mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-21 07:56:31 +00:00
After filterItemsWithMissingDependencies introduced, the next id can be higher than the length of procs
This commit is contained in:
parent
063b7fcbff
commit
1f83f0f198
1 changed files with 7 additions and 4 deletions
|
@ -248,23 +248,26 @@ func (b *procBuilder) toInternalRepresentation(parsed *yaml.Config, environ map[
|
||||||
}
|
}
|
||||||
|
|
||||||
func setBuildStepsOnBuild(build *model.Build, buildItems []*buildItem) *model.Build {
|
func setBuildStepsOnBuild(build *model.Build, buildItems []*buildItem) *model.Build {
|
||||||
|
var pidSequence int
|
||||||
for _, item := range buildItems {
|
for _, item := range buildItems {
|
||||||
build.Procs = append(build.Procs, item.Proc)
|
build.Procs = append(build.Procs, item.Proc)
|
||||||
|
if pidSequence < item.Proc.PID {
|
||||||
|
pidSequence = item.Proc.PID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pcounter := len(build.Procs)
|
|
||||||
|
|
||||||
for _, item := range buildItems {
|
for _, item := range buildItems {
|
||||||
for _, stage := range item.Config.Stages {
|
for _, stage := range item.Config.Stages {
|
||||||
var gid int
|
var gid int
|
||||||
for _, step := range stage.Steps {
|
for _, step := range stage.Steps {
|
||||||
pcounter++
|
pidSequence++
|
||||||
if gid == 0 {
|
if gid == 0 {
|
||||||
gid = pcounter
|
gid = pidSequence
|
||||||
}
|
}
|
||||||
proc := &model.Proc{
|
proc := &model.Proc{
|
||||||
BuildID: build.ID,
|
BuildID: build.ID,
|
||||||
Name: step.Alias,
|
Name: step.Alias,
|
||||||
PID: pcounter,
|
PID: pidSequence,
|
||||||
PPID: item.Proc.PID,
|
PPID: item.Proc.PID,
|
||||||
PGID: gid,
|
PGID: gid,
|
||||||
State: model.StatusPending,
|
State: model.StatusPending,
|
||||||
|
|
Loading…
Reference in a new issue