-
Notifications
You must be signed in to change notification settings - Fork 901
feat: implement deprecated flag for templates to prevent new workspaces #10745
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
You should be able to remove deprecation even without a license, but not add it back. You should always be able to return your deployment to the pre-license state without a license. |
I can add the ability to remove deprecation then. It's just a little more difficult in the UI to have it not disabled, but then be disabled when you delete the message. I thought it was clunky in the UI 🤔 |
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 PR is approaching the upper limit of what I'm comfortable reviewing at once.
It would be a lot simpler to review the following separately:
- Database + API changes
- UI changes
- CLI changes
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.
Left a few comments.
@@ -614,6 +614,21 @@ func CreateAnotherUserMutators(t testing.TB, client *codersdk.Client, organizati | |||
return createAnotherUserRetry(t, client, organizationID, 5, roles, mutators...) | |||
} | |||
|
|||
// AuthzUserSubject does not include the user's groups. | |||
func AuthzUserSubject(user codersdk.User) rbac.Subject { |
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.
That's handy!
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.
Yup, got tired of using AsSystemContext
in all my unit tests. Figured this would be a bit better.
Closes #6355
What this does
Adds a new template meta data field "deprecated" that if set blocks new workspaces from being created on that template.
Existing workspaces still function as before.
UX could be improved, but I implemented an MVP to make the deprecation noticeable on all relevant pages.
UI
Deprecate a template
Missing enterprise license
Deprecated templates remain deprecated if you lose your license. But you can no longer edit the field. I think this is better than making the template active again.
Creating a workspace
This could probably be prevented with better ux?
Templates table page
Templates page
We should show the deprecation message here. I just don't know where to put it 🤔
Workspace page