-
-
Notifications
You must be signed in to change notification settings - Fork 521
Store workflow/step dependencies in database and update API #6130
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
base: main
Are you sure you want to change the base?
Changes from all commits
c8c51ed
dfd1b8e
c52f4da
6728b0e
3306c46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,14 +180,15 @@ func setPipelineStepsOnPipeline(pipeline *model.Pipeline, pipelineItems []*stepb | |
| for _, step := range stage.Steps { | ||
| pidSequence++ | ||
| step := &model.Step{ | ||
| Name: step.Name, | ||
| UUID: step.UUID, | ||
| PipelineID: pipeline.ID, | ||
| PID: pidSequence, | ||
| PPID: item.Workflow.PID, | ||
| State: model.StatusPending, | ||
| Failure: step.Failure, | ||
| Type: model.StepType(step.Type), | ||
| Name: step.Name, | ||
| UUID: step.UUID, | ||
| PipelineID: pipeline.ID, | ||
| PID: pidSequence, | ||
| PPID: item.Workflow.PID, | ||
| State: model.StatusPending, | ||
| Failure: step.Failure, | ||
| Type: model.StepType(step.Type), | ||
| DependsOnNames: step.DependsOn, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not name it DependsOn like the rest of the codebase?!?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you need to resolve string DependsOn (step names) to IDs but they are only known when all records are inserted, model has both DopendsOnNames -> string array and DependsOn -> int64 array that will be populated after saving all workflows and steps to database from DependsOnNames and then we can update depends_on column with depends_on step ID's
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we not do it DependsOn -> string array and DependsOnIDs -> int64 array to be consistent with the rest? |
||
| } | ||
| if item.Workflow.State == model.StatusSkipped { | ||
| step.State = model.StatusSkipped | ||
|
|
@@ -202,6 +203,7 @@ func setPipelineStepsOnPipeline(pipeline *model.Pipeline, pipelineItems []*stepb | |
| item.Workflow.State = model.StatusBlocked | ||
| } | ||
| item.Workflow.PipelineID = pipeline.ID | ||
| item.Workflow.DependsOnNames = item.DependsOn | ||
| pipeline.Workflows = append(pipeline.Workflows, item.Workflow) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need it in backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it goes through compiler to backend types and then from backend types it's assigned to model type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what?!