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

feat!: extract provisioner tags from coder_workspace_tags data source#15578

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 20 commits intomainfromcj/15087-extract-workspace-tags-plumbing
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
944eb3a
feat: extract provisioner tags from coder_workspace_tags data source …
johnstcnNov 18, 2024
7bc2fc8
Merge remote-tracking branch 'origin/main' into cj/15087-extract-work…
johnstcnNov 20, 2024
4653638
add initial framework for API tests
johnstcnNov 20, 2024
fc8ff56
Merge remote-tracking branch 'origin/main' into cj/15087-extract-work…
johnstcnNov 20, 2024
85c2c8f
update tests
johnstcnNov 20, 2024
2e9526b
drop warn log
johnstcnNov 20, 2024
01c8e99
var naming
johnstcnNov 20, 2024
5a53d86
adjust control flow in error case
johnstcnNov 20, 2024
c1e321d
show warning in templates push
johnstcnNov 20, 2024
ed534bd
bump test timeout
johnstcnNov 20, 2024
42f39a7
improve test coverage
johnstcnNov 21, 2024
c6f33f7
fix tests
johnstcnNov 21, 2024
b22e890
move to client-side checking for warnings
johnstcnNov 21, 2024
a8a620f
make gen
johnstcnNov 21, 2024
8ec672c
address indentation
johnstcnNov 22, 2024
7b7aa40
use CacheDir for tfparse instead
johnstcnNov 22, 2024
80dc6c2
feat: add codersdk.MatchedProvisioners
johnstcnNov 22, 2024
5631577
update cli template push
johnstcnNov 22, 2024
58fae97
cleanup and error handling
johnstcnNov 22, 2024
90991bd
Apply suggestions from code review
johnstcnNov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix tests
  • Loading branch information
@johnstcn
johnstcn committedNov 21, 2024
commitc6f33f7520cf60a87fd4d66abc64d4856afa7a19
4 changes: 1 addition & 3 deletionscoderd/templateversions.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1343,9 +1343,6 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
}
}

// Ensures the "owner" is properly applied.
// tags := provisionersdk.MutateTags(apiKey.UserID, req.ProvisionerTags)

if req.ExampleID != "" && req.FileID != uuid.Nil {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "You cannot specify both an example_id and a file_id.",
Expand DownExpand Up@@ -1480,6 +1477,7 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
return
}

// Ensure the "owner" tag is properly applied in addition to request tags and coder_workspace_tags.
// Tag order precedence:
// 1) User-specified tags in the request
// 2) Tags parsed from coder_workspace_tags data source in template file
Expand Down
5 changes: 2 additions & 3 deletionscoderd/templateversions_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -231,7 +231,6 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) {
// TODO(Cian): I'd also like to assert that the correct raw tag values are stored in the database,
// but in order to do this, we need to actually run the job! This isn't straightforward right now.

ctx := testutil.Context(t, testutil.WaitLong)
store, ps := dbtestutil.NewDB(t)
client := coderdtest.New(t, &coderdtest.Options{
Database: store,
Expand DownExpand Up@@ -434,6 +433,8 @@ data "coder_workspace_tags" "tags" {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

// Create an archive from the files provided in the test case.
tarFile := testutil.CreateTar(t, tt.files)

Expand All@@ -453,15 +454,13 @@ data "coder_workspace_tags" "tags" {

if tt.expectError == "" {
require.NoError(t, err)

// Assert the expected provisioner job is created from the template version import
pj, err := store.GetProvisionerJobByID(ctx, tv.Job.ID)
require.NoError(t, err)
require.EqualValues(t, tt.wantTags, pj.Tags)
} else {
require.ErrorContains(t, err, tt.expectError)
}

})
}
})
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp