Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add description field to variables #3813

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions pkg/microservice/aslan/core/build/service/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func generateBuildModuleFromOpenAPIRequest(req *OpenAPIBuildCreationReq, log *za
Value: kv.DefaultValue,
Type: commonmodels.ParameterSettingType(kv.Type),
ChoiceOption: kv.ChoiceOption,
Description: kv.Description,
IsCredential: kv.IsCredential,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ type KeyVal struct {
CallFunction string `bson:"call_function,omitempty" json:"call_function,omitempty" yaml:"call_function,omitempty"`
FunctionReference []string `bson:"function_reference,omitempty" json:"function_reference,omitempty" yaml:"function_reference,omitempty"`
IsCredential bool `bson:"is_credential" json:"is_credential" yaml:"is_credential"`
Description string `bson:"description" json:"description" yaml:"description"`
}

type Item struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ func (j *JobProperties) DeepCopyEnvs() []*KeyVal {
RegistryID: env.RegistryID,
ChoiceOption: choiceOption,
IsCredential: env.IsCredential,
Description: env.Description,
})
}
return envs
Expand Down
1 change: 1 addition & 0 deletions pkg/microservice/aslan/core/common/service/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func MergeBuildEnvs(templateEnvs []*commonmodels.KeyVal, customEnvs []*commonmod
for _, v := range templateEnvs {
if cv, ok := customEnvMap[v.Key]; ok {
cv.ChoiceOption = v.ChoiceOption
cv.Description = v.Description
cv.Script = v.Script
cv.FunctionReference = v.FunctionReference
cv.CallFunction = v.CallFunction
Expand Down
22 changes: 0 additions & 22 deletions pkg/microservice/aslan/core/workflow/service/workflow/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,28 +439,6 @@ func JobSkiped(job *commonmodels.Job) bool {
return job.Skipped
}

func RenderKeyVals(input, origin []*commonmodels.KeyVal) []*commonmodels.KeyVal {
resp := make([]*commonmodels.KeyVal, 0)

for _, originKV := range origin {
item := &commonmodels.KeyVal{
Key: originKV.Key,
Value: originKV.Value,
Type: originKV.Type,
IsCredential: originKV.IsCredential,
ChoiceOption: originKV.ChoiceOption,
}
for _, inputKV := range input {
if originKV.Key == inputKV.Key {
// always use origin credential config.
item.Value = inputKV.Value
}
}
resp = append(resp, item)
}
return resp
}

// use service name and service module hash to generate job name
func jobNameFormat(jobName string) string {
if len(jobName) <= 63 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ func renderKeyVals(input, origin []*commonmodels.KeyVal) []*commonmodels.KeyVal
Type: originKV.Type,
IsCredential: originKV.IsCredential,
ChoiceOption: originKV.ChoiceOption,
Description: originKV.Description,
FunctionReference: originKV.FunctionReference,
CallFunction: originKV.CallFunction,
Script: originKV.Script,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ func PresetWorkflowArgs(namespace, workflowName string, log *zap.SugaredLogger)
Value: moduleEnv.Value,
IsCredential: moduleEnv.IsCredential,
ChoiceOption: moduleEnv.ChoiceOption,
Description: moduleEnv.Description,
Type: moduleEnv.Type,
})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/types/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type ParameterSetting struct {
// ExternalSetting It is the configuration of the external system to obtain the variable
ExternalSetting *ExternalSetting `json:"external_setting"`
IsCredential bool `json:"is_credential"`
Description string `json:"description"`
}

type ExternalSetting struct {
Expand Down
Loading