-
Notifications
You must be signed in to change notification settings - Fork 169
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
fix(3181): Virtual builds not completed when triggered by webhook #3261
Conversation
75611e8
to
645634d
Compare
2bab9a0
to
798b4fd
Compare
Is this a duplicate of #3260 |
798b4fd
to
5448a07
Compare
for (const build of virtualJobBuilds) { | ||
await updateBuildAndTriggerDownstreamJobs( | ||
{ | ||
status: Status.SUCCESS, | ||
statusMessage: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessage, | ||
statusMessageType: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessageType | ||
}, | ||
build, | ||
server, | ||
username, | ||
scmContext | ||
); | ||
} |
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.
for (const build of virtualJobBuilds) { | |
await updateBuildAndTriggerDownstreamJobs( | |
{ | |
status: Status.SUCCESS, | |
statusMessage: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessage, | |
statusMessageType: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessageType | |
}, | |
build, | |
server, | |
username, | |
scmContext | |
); | |
} | |
await Promise.all( | |
virtualJobBuilds.map(build => | |
updateBuildAndTriggerDownstreamJobs( | |
{ | |
status: Status.SUCCESS, | |
statusMessage: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessage, | |
statusMessageType: BUILD_STATUS_MESSAGES.SKIP_VIRTUAL_JOB.statusMessageType | |
}, | |
build, | |
server, | |
username, | |
scmContext | |
) | |
) | |
); |
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.
Besides marking the status of virtual build to "SUCCESS", we also process its downstream jobs. While triggering the downstream jobs in the workflow, we have been following depth-first approach. Sticking to the same here as well.
So we need process all the virtual builds sequentially.
Context
Changes made in the PR #3252 introduced a regression. Virtual job builds at the beginning of the event workflow never got marked as completed (remain in
CREATED
state) when the event is created by SCM webhook.Objective
Mark virtual job builds at the beginning of the event workflow for all the scenarios.
References
#3181
License
I confirm that this contribution is made under a BSD license and that I have the authority necessary to make this contribution on behalf of its copyright owner.