Skip to content

feat: add template setting to require active template version - #10277

Merged
sreya merged 32 commits into
mainfrom
jon/templateversion
Oct 18, 2023
Merged

sreya merged 32 commits into
mainfrom
jon/templateversion

Conversation

@sreya

@sreya sreya commented Oct 15, 2023 •

Copy link
Copy Markdown
Collaborator

This PR adds the backend plumbing to support enforcing workspaces use the active template version when buildling.

This setting does not apply to template admins

fixes #7466

@sreya
sreya force-pushed the jon/templateversion branch from 7b0bf6d to 508a84d Compare October 15, 2023 23:22
@sreya
sreya requested a review from spikecurtis October 16, 2023 00:30
Comment thread coderd/database/dbauthz/dbauthz.go Resolved
Comment thread coderd/wsbuilder/wsbuilder.go Resolved
Comment thread coderd/templates.go Resolved
Comment thread coderd/autobuild/lifecycle_executor.go Resolved
Comment thread coderd/database/dbauthz/dbauthz.go Resolved
@sreya
sreya requested a review from spikecurtis October 18, 2023 06:05

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Couple nits in the comments, but I don't need to review again; LGTM

Comment thread coderd/coderdtest/coderdtest.go Outdated
req := codersdk.CreateWorkspaceBuildRequest{
// TODO (JonA): I get this is for convenience but we should probably
// change this. Tripped me up why my test was passing when it shouldn't
// have.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't really understand this comment --- change how?

@sreya sreya Oct 18, 2023 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Currently the behavior when calling MustTransitionWorkspace is to submit a workspace build with the template's active version as opposed to the the workspace's template version. That's kinda at odds with how it behaves in production.

Comment thread coderd/database/dbfake/dbfake.go Resolved
Comment thread coderd/templates.go Resolved
@sreya
sreya merged commit 997493d into main Oct 18, 2023
@sreya
sreya deleted the jon/templateversion branch October 18, 2023 22:07
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 18, 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.

template setting allowing/disabling version selection

2 participants