feat: Allow inheriting parameters from previous template_versions when updating a template (#2397)

* WIP: feat: Update templates also updates parameters
* Insert params for template version update
* Working implementation of inherited params
* Add "--always-prompt" flag and logging info
This commit is contained in:
Steven Masley
2022-06-17 12:22:28 -05:00
committed by GitHub
parent 18973a65c1
commit 64b92eea67
16 changed files with 547 additions and 167 deletions
+10 -3
View File
@@ -14,9 +14,9 @@ import (
type ParameterScope string
const (
ParameterTemplate ParameterScope = "template"
ParameterWorkspace ParameterScope = "workspace"
ParameterScopeImportJob ParameterScope = "import_job"
ParameterTemplate ParameterScope = "template"
ParameterWorkspace ParameterScope = "workspace"
ParameterImportJob ParameterScope = "import_job"
)
type ParameterSourceScheme string
@@ -78,6 +78,13 @@ type ParameterSchema struct {
// CreateParameterRequest is used to create a new parameter value for a scope.
type CreateParameterRequest struct {
// CloneID allows copying the value of another parameter.
// The other param must be related to the same template_id for this to
// succeed.
// No other fields are required if using this, as all fields will be copied
// from the other parameter.
CloneID uuid.UUID `json:"copy_from_parameter,omitempty" validate:""`
Name string `json:"name" validate:"required"`
SourceValue string `json:"source_value" validate:"required"`
SourceScheme ParameterSourceScheme `json:"source_scheme" validate:"oneof=data,required"`