- Notifications
You must be signed in to change notification settings - Fork4
chore: allow pushing only inactivecoderd_template versions#167
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coderd_template versionscoderd_template versionsethanndickson commentedJan 21, 2025
f91d9db toafe3400Compare| } | ||
| ifversionDeactivated(prevs,&planVersions[i]) { | ||
| diag.AddError("Client Error","Plan could not determine which version should be active.\n"+ | ||
| "Either specify an active version or modify the contents of the previously active version before marking it as inactive.") |
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.
Instead of returning an error and failing the plan here, we could just push a new, identical, template version and not promote it to active. Given there's no other way to push an unmodified template version, and the whole point of this resource is to avoid pushing spurious diffs, I think it's better to just fail the plan.
deansheather left a comment
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.
Sounds good and the tests seem thorough. It's kinda hard to wrap your head around the one active version thing, but after I thought about it a bit your solution makes the most sense to me.
Uh oh!
There was an error while loading.Please reload this page.
e036857 intomainUh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
Per some customer feedback, this PR relaxes some of the constraints when creating template versions via the
coderd_templateresource. Previously, each update of the resource required that at least one of the versions in theversionslist had theactiveattribute set to true.This constraint is now only required when:
Examples of these cases can be seen in the tests.
With this, a workflow that involves:
is now possible with just a single item in the list.