-
Notifications
You must be signed in to change notification settings - Fork 929
feat: allow users to pause prebuilt workspace reconciliation #18700
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
Changes from all commits
4751936
0b4d669
caa9224
140d820
cdd55fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -2304,6 +2304,10 @@ func (q *querier) GetPrebuildMetrics(ctx context.Context) ([]database.GetPrebuil | |||
return q.db.GetPrebuildMetrics(ctx) | ||||
} | ||||
|
||||
func (q *querier) GetPrebuildsSettings(ctx context.Context) (string, error) { | ||||
return q.db.GetPrebuildsSettings(ctx) | ||||
} | ||||
|
||||
func (q *querier) GetPresetByID(ctx context.Context, presetID uuid.UUID) (database.GetPresetByIDRow, error) { | ||||
empty := database.GetPresetByIDRow{} | ||||
|
||||
|
@@ -5101,6 +5105,13 @@ func (q *querier) UpsertOAuthSigningKey(ctx context.Context, value string) error | |||
return q.db.UpsertOAuthSigningKey(ctx, value) | ||||
} | ||||
|
||||
func (q *querier) UpsertPrebuildsSettings(ctx context.Context, value string) error { | ||||
if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceDeploymentConfig); err != nil { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify here on the rbac side, this means that only a user with this permission can update the setting. From https://github.com/coder/coder/blob/main/coderd/rbac/roles.go currently, only the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auditor only has read though? Line 327 in 8a69f6a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good catch! 👀 So it means that only the owner of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there exists any other suitable role that should have permission to edit site-wide deployment config? Our choices are site-wide template admin or site-wide user admin, neither of which feel right to me. Site-wide auditor should only have read permissions, and all of the org-scoped admins are out of site-wide scope. This might be something to explore in a separate PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this could definitely be addressed in a separate PR. You might be right that adding the permission to admin roles isn’t the best approach. My main concern was that currently only users with the On second thought, limiting this permission to the |
||||
return err | ||||
} | ||||
return q.db.UpsertPrebuildsSettings(ctx, value) | ||||
} | ||||
|
||||
func (q *querier) UpsertProvisionerDaemon(ctx context.Context, arg database.UpsertProvisionerDaemonParams) (database.ProvisionerDaemon, error) { | ||||
res := rbac.ResourceProvisionerDaemon.InOrg(arg.OrganizationID) | ||||
if arg.Tags[provisionersdk.TagScope] == provisionersdk.ScopeUser { | ||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.