Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9438db8

Browse files
committed
Linting fixes
1 parent fa9b230 commit 9438db8

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

cli/templatecreate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func createValidTemplateVersion(cmd *cobra.Command, args createValidTemplateVers
256256
// If the value is not in the param file, and can be pulled from the last template version,
257257
// then don't mark it as missing.
258258
parameters = append(parameters, codersdk.CreateParameterRequest{
259-
CopyFromParameter: inherit.ID,
259+
CloneID: inherit.ID,
260260
})
261261
pulled = append(pulled, fmt.Sprintf("%q", parameterSchema.Name))
262262
continue

cli/templateupdate_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func TestTemplateUpdate(t *testing.T) {
2929
// 6. Creates a new version with 0 params
3030
// 7. Asset 0 params in new version
3131
t.Run("NewParameter", func(t *testing.T) {
32+
t.Parallel()
3233
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerD: true})
3334
user := coderdtest.CreateFirstUser(t, client)
3435
// Create initial template version to update
@@ -107,6 +108,7 @@ func TestTemplateUpdate(t *testing.T) {
107108
})
108109

109110
t.Run("OK", func(t *testing.T) {
111+
t.Parallel()
110112
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerD: true})
111113
user := coderdtest.CreateFirstUser(t, client)
112114
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)

coderd/database/databasefake/databasefake.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ import (
88
"sync"
99
"time"
1010

11-
"github.com/coder/coder/coderd/util/slice"
12-
1311
"github.com/google/uuid"
1412
"golang.org/x/exp/slices"
1513

1614
"github.com/coder/coder/coderd/database"
15+
"github.com/coder/coder/coderd/util/slice"
1716
)
1817

1918
// New returns an in-memory fake of the database.

coderd/templateversions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
640640
jobID := uuid.New()
641641
inherits := make([]uuid.UUID, 0)
642642
for _, parameterValue := range req.ParameterValues {
643-
if parameterValue.CopyFromParameter != uuid.Nil {
644-
inherits = append(inherits, parameterValue.CopyFromParameter)
643+
if parameterValue.CloneID != uuid.Nil {
644+
inherits = append(inherits, parameterValue.CloneID)
645645
}
646646
}
647647

@@ -681,7 +681,7 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
681681
}
682682

683683
for _, parameterValue := range req.ParameterValues {
684-
if parameterValue.CopyFromParameter != uuid.Nil {
684+
if parameterValue.CloneID != uuid.Nil {
685685
continue
686686
}
687687

codersdk/parameters.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ type ParameterSchema struct {
7878

7979
// CreateParameterRequest is used to create a new parameter value for a scope.
8080
type CreateParameterRequest struct {
81-
// CopyFromParameter allows copying the value of another parameter.
81+
// CloneID allows copying the value of another parameter.
8282
// The other param must be related to the same template_id for this to
8383
// succeed.
8484
// No other fields are required if using this, as all fields will be copied
8585
// from the other parameter.
86-
CopyFromParameter uuid.UUID `json:"copy_from_parameter,omitempty" validate:"uuid4"`
86+
CloneID uuid.UUID `json:"copy_from_parameter,omitempty" validate:"uuid4"`
8787

8888
Name string `json:"name" validate:"required"`
8989
SourceValue string `json:"source_value" validate:"required"`

0 commit comments

Comments
 (0)