-
Notifications
You must be signed in to change notification settings - Fork 887
fix(coderd/database): avoid clobbering workspace build state #9826
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
Conversation
check.Args(database.UpdateWorkspaceBuildDeadlineByIDParams{ | ||
ID: build.ID, | ||
UpdatedAt: build.UpdatedAt, | ||
Deadline: build.Deadline, |
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.
This is a test, but in theory this clobbers max deadline? Should we do some testing about that / prevent it?
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.
In theory, yes - but I want to keep the scope of this limited to provisioner state.
We can think about #9822 separately.
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.
👍 once the linter is happy
Fixes #9823.
UpdateWorkspaceBuildByID
intoUpdateWorkspaceBuildProvisionerStateByID
andUpdateWorkspaceBuildDeadlineByID
.UpdateWorkspaceBuildByID
with the newer queries where applicable.GetActiveWorkspaceBuildsByTemplateID
to not return incomplete workspace builds.