-
Notifications
You must be signed in to change notification settings - Fork 927
Add reason
field for workspace builds
#2438
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
Add reason
field for workspace builds
#2438
Conversation
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 really like this approach! Nice n' simple 😎
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.
LG. Minor nit
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.
Looks good to me! I Just a couple small issues.
Transition: trans, | ||
JobID: newProvisionerJob.ID, | ||
|
||
err = store.InTx(func(db database.Store) error { |
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 already in one big transaction, see line 80 -- since we're already in a tx, this ends up being a no-op
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.
Oh TIL. I didn't see that @AbhineetJain
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.
Thanks @johnstcn. This was also the reason the tests were failing.
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.
Issue: #2468
778b819
to
4802eaf
Compare
4802eaf
to
c5b9aac
Compare
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.
Nice work!
This PR adds a new
reason
field for workspace builds to indicate the reason for its initiation. The following values are supported:initiator
,autostart
,autostop
.The following combinations can arise:
In case of
Reason.Autostart
andReason.Autostop
, we ignore the initiator field when displaying it in the UI, and use the initiator field for the other case - the member could be admin too (or whoever the user may possibly be sharing workspaces with).Subtasks