Skip to content

feat(coderd): add last_seen_at and version to provisioner_daemons table #11033

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

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Dec 5, 2023

Related to #10676

@johnstcn johnstcn self-assigned this Dec 5, 2023
@johnstcn johnstcn changed the base branch from main to cj/offlinedocs-protoc December 5, 2023 11:47
@johnstcn johnstcn force-pushed the cj/provisionerd-last-seen-at-version branch from a05e8ae to 546e211 Compare December 5, 2023 11:52
@johnstcn johnstcn marked this pull request as ready for review December 5, 2023 12:02
@johnstcn johnstcn requested review from mafredri and mtojek December 5, 2023 12:03
Base automatically changed from cj/offlinedocs-protoc to main December 5, 2023 12:03
@johnstcn johnstcn force-pushed the cj/provisionerd-last-seen-at-version branch from 546e211 to 1c7c901 Compare December 5, 2023 12:04
@@ -40,7 +40,9 @@ type ProvisionerDaemon struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt sql.NullTime `json:"updated_at" format:"date-time"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just spotted, if this is sql.NullTime, then the property should have omitempty.

Copy link
Member

@mafredri mafredri Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note here that omitempty isn't actually relevant. Since sql.NullTime is a struct, it can't be omitted even when the struct is "zero".

https://go.dev/play/p/SGmN64SRt8F

Omitempty can be relevant in e.g. codersdk when we use codersdk.NullTime that implements MarshalJSON. In that case it might help with generation of TypeScript types (unless we handle the type specifically in gen).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that using format here is wrong, too (it'd be OK for codersdk.NullTime).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mafredri sounds like UpdatedAt should be a codersdk.NullTime then in the API struct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah @johnstcn, I think that would be better 👍🏻

Copy link
Member Author

@johnstcn johnstcn Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnstcn johnstcn force-pushed the cj/provisionerd-last-seen-at-version branch from 52dffd9 to df18a13 Compare December 5, 2023 13:23
@johnstcn johnstcn merged commit 5fad611 into main Dec 5, 2023
@johnstcn johnstcn deleted the cj/provisionerd-last-seen-at-version branch December 5, 2023 13:54
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants