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 options to all workflow choice fields #3443

Merged
merged 69 commits into from
Apr 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
61e82c9
Add options to all workflow choice fields
jamsman94 Mar 20, 2024
ac00b94
deploy job done
jamsman94 Mar 26, 2024
2132881
deploy job update & helm chart deploy & k8s patch job update
jamsman94 Mar 26, 2024
c33b5cc
swagger update
jamsman94 Mar 27, 2024
f71697f
custom deploy done
jamsman94 Mar 27, 2024
2f928a5
update docs
jamsman94 Mar 27, 2024
f54f036
update docs
jamsman94 Apr 1, 2024
251e221
fundamentally change how workflow is organized
jamsman94 Apr 1, 2024
f65be3c
bugfix
jamsman94 Apr 1, 2024
803a7d6
fix bugs
jamsman94 Apr 1, 2024
ff5f93a
debug
jamsman94 Apr 1, 2024
c4128f3
done up to scanning job
jamsman94 Apr 2, 2024
a211a19
multiple changes in jobs
jamsman94 Apr 3, 2024
707ff59
final change to the jobs basic logic
jamsman94 Apr 3, 2024
1dc5fc4
change clone logics
jamsman94 Apr 3, 2024
360f850
fix vm options
jamsman94 Apr 7, 2024
b4bb976
debug
jamsman94 Apr 7, 2024
06270ac
debug
jamsman94 Apr 7, 2024
ab84d12
fixed user & group search problems
jamsman94 Apr 7, 2024
dc7b4f9
debug
jamsman94 Apr 8, 2024
e490a22
debug
jamsman94 Apr 8, 2024
2b966b2
debug
jamsman94 Apr 10, 2024
f538c48
debug
jamsman94 Apr 10, 2024
a158b1f
spilt set preset with clear option to make code more flexible
jamsman94 Apr 10, 2024
fe79245
debug
jamsman94 Apr 10, 2024
a5e1dde
debug
jamsman94 Apr 10, 2024
436f585
debug
jamsman94 Apr 10, 2024
25cd8a5
merge main
jamsman94 Apr 10, 2024
c10e83c
debug logs
jamsman94 Apr 11, 2024
6724778
even more debug logs
jamsman94 Apr 11, 2024
5024b99
bugfix
jamsman94 Apr 11, 2024
1dcde29
fix
jamsman94 Apr 11, 2024
b7ebb8d
debug
jamsman94 Apr 11, 2024
84c5266
fix
jamsman94 Apr 11, 2024
d59179d
debug logs
jamsman94 Apr 11, 2024
14431c4
debug
jamsman94 Apr 11, 2024
1a0910b
debug
jamsman94 Apr 11, 2024
0f9d93c
debug
jamsman94 Apr 11, 2024
6a60ee3
debug
jamsman94 Apr 11, 2024
95b841b
debug
jamsman94 Apr 11, 2024
08f2618
add hooks support
jamsman94 Apr 11, 2024
4cd1377
apollo change
jamsman94 Apr 11, 2024
1b01945
debug logs
jamsman94 Apr 11, 2024
e2dcb37
debug
jamsman94 Apr 11, 2024
e4ef2ff
debug logs
jamsman94 Apr 11, 2024
d8606c0
debug logs
jamsman94 Apr 11, 2024
d1271d7
debug
jamsman94 Apr 11, 2024
77ee7de
debug
jamsman94 Apr 11, 2024
67d31cd
debug logs
jamsman94 Apr 11, 2024
94e363d
bugfix
jamsman94 Apr 11, 2024
580578c
debug
jamsman94 Apr 11, 2024
b043b0b
debug logs
jamsman94 Apr 11, 2024
5904a09
debug
jamsman94 Apr 11, 2024
73e19c2
FUCK
jamsman94 Apr 11, 2024
09a2a59
debug
jamsman94 Apr 11, 2024
8cb1c9e
debug
jamsman94 Apr 11, 2024
46b9184
debug
jamsman94 Apr 15, 2024
5feec3b
possible fix
jamsman94 Apr 15, 2024
745e92b
debug
jamsman94 Apr 15, 2024
440e548
debug
jamsman94 Apr 15, 2024
831e405
debug
jamsman94 Apr 15, 2024
d9c23e8
debug
jamsman94 Apr 15, 2024
8ff9dc3
debug
jamsman94 Apr 15, 2024
92425e1
debug
jamsman94 Apr 15, 2024
6a1d57f
debug
jamsman94 Apr 15, 2024
a515970
debug logs
jamsman94 Apr 15, 2024
05f57ca
debug
jamsman94 Apr 15, 2024
775879d
debug
jamsman94 Apr 15, 2024
2112c56
bugfix
jamsman94 Apr 15, 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
Prev Previous commit
Next Next commit
debug
Signed-off-by: Min Min <jamsman94@gmail.com>
jamsman94 committed Apr 7, 2024
commit b4bb976f69e4b2d468f469f442a920125fe6fe70
Original file line number Diff line number Diff line change
@@ -450,8 +450,7 @@ type TestModule struct {
}

type ZadigScanningJobSpec struct {
Scannings []*ScanningModule `bson:"scannings" yaml:"scannings" json:"scannings"`
ScanningOptions []*ScanningModule `bson:"-" yaml:"scanning_options" json:"scanning_options"`
Scannings []*ScanningModule `bson:"scannings" yaml:"scannings" json:"scannings"`
}

type ScanningModule struct {
Original file line number Diff line number Diff line change
@@ -234,6 +234,11 @@ func (j *DeployJob) SetOptions() error {
}

for _, env := range products {
// skip the sleeping envs
if env.IsSleeping() {
continue
}

serviceDeployOption, err := generateEnvDeployServiceInfo(env.EnvName, j.workflow.Project, j.spec.Production, j.spec)
if err != nil {
log.Errorf("failed to generate service deployment info for env: %s, error: %s", env.EnvName, err)
Original file line number Diff line number Diff line change
@@ -55,59 +55,11 @@ func (j *ScanningJob) SetPreset() error {
return err
}

j.spec.Scannings = make([]*commonmodels.ScanningModule, 0)
j.job.Spec = j.spec
return nil
}

func (j *ScanningJob) SetOptions() error {
j.spec = &commonmodels.ZadigScanningJobSpec{}
if err := commonmodels.IToi(j.job.Spec, j.spec); err != nil {
return err
}

originalWorkflow, err := commonrepo.NewWorkflowV4Coll().Find(j.workflow.Name)
if err != nil {
log.Errorf("Failed to find original workflow to set options, error: %s", err)
}

originalSpec := new(commonmodels.ZadigScanningJobSpec)
found := false
for _, stage := range originalWorkflow.Stages {
if !found {
for _, job := range stage.Jobs {
if job.Name == j.job.Name && job.JobType == j.job.JobType {
if err := commonmodels.IToi(job.Spec, originalSpec); err != nil {
return err
}
found = true
break
}
}
} else {
break
}
}

if !found {
return fmt.Errorf("failed to find the original workflow: %s", j.workflow.Name)
}

for _, scanning := range originalSpec.Scannings {
scanningInfo, err := commonrepo.NewScanningColl().Find(j.workflow.Project, scanning.Name)
if err != nil {
log.Errorf("find scanning: %s error: %v", scanning.Name, err)
continue
}
if err := fillScanningDetail(scanningInfo); err != nil {
log.Errorf("fill scanning: %s detail error: %v", scanningInfo.Name, err)
continue
}
scanning.Repos = mergeRepos(scanningInfo.Repos, scanning.Repos)
scanning.KeyVals = renderKeyVals(scanning.KeyVals, scanningInfo.Envs)
}

j.spec.ScanningOptions = originalSpec.Scannings
return nil
}