-
Notifications
You must be signed in to change notification settings - Fork 5
Update the Installable Build job status for Jetpack #90
Conversation
org/pr/installable-build.ts
Outdated
if (status.state == "pending" && HOLD_CONTEXTS.includes(status.context)) { | ||
if (status.state == "pending" && HOLD_CONTEXTS.concat(HOLD_CONTEXTS_NO_COMMENT).includes(status.context)) { | ||
await markStatusAsSuccess(status) | ||
await createOrUpdateComment(status, `You can trigger an installable build for these changes by visiting CircleCI [here](${status.target_url}).`) | ||
} else if (status.state == "success" && INSTALLABLE_BUILD_CONTEXTS.filter(s => status.context.match(s)).length > 0) { |
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.
If I'm not mistaken, this is the only place where both HOLD_CONTEXTS
and HOLD_CONTEXTS_NO_COMMENTS
constants are used.
- If that's intended, and the only place where they are used here they are concatenated, not sure what's the point of having them split in the first place?
- Instead I think what you intended to do is to NOT call
createOrUpdateComment
for the case ofHOLD_CONTEXTS_NO_COMMENTS
?
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.
Oh, I didn't notice my last push failed 🤦! I guess this is what you get when you try to write some code while you have to respond to too many pings 😂
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.
Yeah! That version was clearly doing nothing :-)
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.
Aside from stylistic comment, LGTM, but I'll let @jkmassel approve since he's the one knowing what the original intent was here.
After #89 got merged, I've started noticing that the status of the
Installable Build
job for the Jetpack application doesn't get updated frompending (orange)
toready (green)
.The reason is that this commit removed it from the list of the handled states.
My understanding, from the commit title, is that the goal was to avoid that Peril commented on the PR with the prompt to run the installable build for Jetpack.
I think we still want the state of the job to be green, because, otherwise, the PR remains in a pending state and, while it's still possible to merge the changes because the job is not required, this behaviour can create confusion.
My take is that the bug that #89 fixed was actually hiding this problem.
This PR should fix this problem. There are probably better ways to do this, and the test cases are not complete and strong, but since @jkmassel mentioned that with the migration to Buildkite this function will be integrated in the CI and won't be required anymore in Peril, I opted for a quick, minimal and easy solution.