Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
ethanndickson merged 2 commits intomainfromethan/allow-push-inactive
Jan 21, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJan 21, 2025
edited
Loading

Per some customer feedback, this PR relaxes some of the constraints when creating template versions via thecoderd_template resource. Previously, each update of the resource required that at least one of the versions in theversions list had theactive attribute set to true.

This constraint is now only required when:

  1. Creating the resource, as every template must have an active version.
  2. It's not clear what template version should be set as active.
    • This occurs when the currently active version is marked as inactive, but no changes are made to the contents of the version (and no version would be created).

Examples of these cases can be seen in the tests.

With this, a workflow that involves:

  • Marking an active version in the list as inactive
  • Pushing it a few times via the provider
  • And then finally marking it as active

is now possible with just a single item in the list.

@ethanndicksonethanndickson changed the titlechore: allow only pushing inactivecoderd_template versionschore: allow pushing only inactivecoderd_template versionsJan 21, 2025
@ethanndicksonGraphite App
Copy link
MemberAuthor

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ethanndicksonethanndickson self-assigned thisJan 21, 2025
}
if versionDeactivated(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.")
Copy link
MemberAuthor

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 reacted with thumbs up emoji
@ethanndicksonethanndickson marked this pull request as ready for reviewJanuary 21, 2025 07:27
Copy link
Member

@deansheatherdeansheather left a 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.

@ethanndicksonethanndickson merged commite036857 intomainJan 21, 2025
14 checks passed
@ethanndicksonethanndickson deleted the ethan/allow-push-inactive branchJanuary 21, 2025 09:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ethanndickson@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp