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

fix(coderd): change the order of precedence between coder_workspace_tags and request tags#16119

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
johnstcn merged 2 commits intomainfromcj/templateversion-precedence
Jan 14, 2025

Conversation

johnstcn
Copy link
Member

This PR switches the order of precedence of workspace tags when posting a template version.
Previously, user-specified tags in the request could not override those detected from our parsing of the template file. Now, they can do.

This addresses a customer issue where were attempting to set a workspace tag via variable.

Note: there is a possible follow-up item here where we could pass in the workspace tag values from the request intotfparse and let it take those user-specified values into account. This is covered in a separate test.

@johnstcnjohnstcn self-assigned thisJan 13, 2025
@johnstcnjohnstcn changed the titlefix(coderd): swap order of precedence of coder_workspace_tags and tags from requestfix(coderd): change the order of precedence between coder_workspace_tags and request tagsJan 13, 2025
@@ -355,10 +355,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
wantTags: map[string]string{"owner": "", "scope": "organization", "foo": "bar", "a": "1", "b": "2"},
},
{
name: "main.tf withworkspace tagsand request tags",
name: "main.tf withrequest tagsnot clobbering workspace tags",
Copy link
Member

@mafredrimafredriJan 14, 2025
edited
Loading

Choose a reason for hiding this comment

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

Is clobbering actually involved here? Since there's no two entries of the same tag the result is just a union.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There's a test below that shows the actual clobbering behaviour. I guess "not clobbering" and "union" are similar enough in result but different enough in semantics to be confusing. But the tags are not a union, there is an order of precedence here that I'm trying to codify and demonstrate.

Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

Tricky edge case 👍

@johnstcnjohnstcn merged commit12991ff intomainJan 14, 2025
31 checks passed
@johnstcnjohnstcn deleted the cj/templateversion-precedence branchJanuary 14, 2025 16:43
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 14, 2025
@matifali
Copy link
Member

/cherry-pick release/2.18

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@EmyrkEmyrkEmyrk approved these changes

@mtojekmtojekmtojek approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@johnstcn@matifali@mafredri@Emyrk@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp