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

Pr 18290#18306

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

Closed
Closed

Pr 18290#18306

Show file tree
Hide file tree
Changes fromall commits
Commits
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
25 changes: 16 additions & 9 deletionscoderd/wsbuilder/wsbuilder.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1042,24 +1042,31 @@ func (b *Builder) checkRunningBuild() error {
}

func (b *Builder) usingDynamicParameters() bool {
vals, err := b.getTemplateTerraformValues()
// Check if dynamic parameters are explicitly enabled/disabled first
if b.dynamicParametersEnabled != nil {
return *b.dynamicParametersEnabled
}

// Check template setting next - if classic flow is enabled, we're not using dynamic parameters
tpl, err := b.getTemplate()
if err != nil {
return false // Let another part of the code get this error
}
if tpl.UseClassicParameterFlow {
return false
}

if !ProvisionerVersionSupportsDynamicParameters(vals.ProvisionerdVersion) {
// Only check terraform values if we might use dynamic parameters
vals, err := b.getTemplateTerraformValues()
if err != nil {
return false
}

ifb.dynamicParametersEnabled != nil {
return*b.dynamicParametersEnabled
if!ProvisionerVersionSupportsDynamicParameters(vals.ProvisionerdVersion) {
returnfalse
}

tpl, err := b.getTemplate()
if err != nil {
return false // Let another part of the code get this error
}
return !tpl.UseClassicParameterFlow
return true
}

func ProvisionerVersionSupportsDynamicParameters(version string) bool {
Expand Down
15 changes: 1 addition & 14 deletionscoderd/wsbuilder/wsbuilder_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -114,7 +113,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -161,7 +159,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -200,7 +197,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -239,7 +235,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(nil),
withLastBuildNotFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand DownExpand Up@@ -343,7 +338,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, templateVersionVariables),
Expand DownExpand Up@@ -439,7 +433,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -487,7 +480,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -541,7 +533,7 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
//withTerraformValuesErrNoRows, // Not needed when UseClassicParameterFlow is true
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -574,7 +566,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand DownExpand Up@@ -627,7 +618,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand DownExpand Up@@ -691,7 +681,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand DownExpand Up@@ -753,7 +742,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand DownExpand Up@@ -801,7 +789,6 @@
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(nil),
// building workspaces using presets with different combinations of parameters
// is tested at the API layer, in TestWorkspace. Here, it is sufficient to
Expand DownExpand Up@@ -916,7 +903,7 @@
}, nil)
}

func withTerraformValuesErrNoRows(mTx *dbmock.MockStore) {

Check failure on line 906 in coderd/wsbuilder/wsbuilder_test.go

View workflow job for this annotation

GitHub Actions/ lint

func `withTerraformValuesErrNoRows` is unused (unused)
mTx.EXPECT().GetTemplateVersionTerraformValues(gomock.Any(), gomock.Any()).
Times(1).
Return(database.TemplateVersionTerraformValue{}, sql.ErrNoRows)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp