-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to use database as DNS ground truth, remove DNS worker code #464
Conversation
There might be more code we can remove that I'm missing. Let me know if you see or think of anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see have simpler things got and that we should care about the record status anymore!
app/components/dns-records-table.tsx
Outdated
@@ -121,7 +80,6 @@ export default function DnsRecordsTable(props: DnsRecordsTableProps) { | |||
<Table variant="striped" colorScheme="gray"> | |||
<Thead> | |||
<Tr> | |||
<Th /> | |||
<Th>Subdomain</Th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change this column name to DNS Record
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I'll do that.
Updated to not use |
@Eakam1007 because this is so big, I'll get you to do your review too before I merge (and anyone else that wants to--let me know). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we are changing a record, I think we should call setReconciliationNeeded(true)
from the systemState
model
I think this could be integrated into the DNS model
Ah, indeed. Changing now... |
Updated to indicate that reconciler is needed after CRUD operations. |
@@ -48,7 +49,11 @@ export async function createDnsRecord( | |||
// Set expiration date 6 months from now | |||
const expiresAt = dayjs().add(6, 'month').toDate(); | |||
|
|||
return prisma.dnsRecord.create({ data: { ...data, expiresAt } }); | |||
return prisma.dnsRecord.create({ data: { ...data, expiresAt } }).then((result) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we extract it in a separate function?
(result) => {
// Flag the reconciler that an update will be needed
setIsReconciliationNeeded(true);
return result;
})
Like flagReconciliationNeeded
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I started to write it, and it's literally the same code. I'm not sure adding a new function does much for us here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like setIsReconciliationNeeded()
does the job of setting that flag.
Do we need it for |
No, that is only for our own system, telling when to delete the record Us deleting the record from db, will trigger the reconciler to delete it from Route53 |
Rebased and squashed. |
Fixes #440
This switches over to use the database as our source of truth for all DNS Record info. The reconciler is now responsible for making this happen in Route53, and we don't use DNS workers or direct calls anymore.
I've also fixed the bug where we didn't update the optional parts of a DNS Record in the db while editing.
I have to fix something with e2e tests, but I wanted to get this in fast, since it's blocking testing on Staging.