-
Notifications
You must be signed in to change notification settings - Fork 3
Add a mechanism to skip triggering builds. #18
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: master
Are you sure you want to change the base?
Conversation
|
Unfortunately, * Maybe not never; I think if the PR was converted to non-draft, those branches would get moved, then built, then cleaned up? No, that's incorrect. The branches aren't reused; a unique name is created every time. |
ab98c0f to
05aefef
Compare
Skip when: - The PR has a 'skip-build' label Note that this label only controls behavior when the PR is a top-level PR.
05aefef to
b2891cb
Compare
|
I've updated the code in accordance with the discussion on the related issue. I've also moved the check earlier in the process to avoid creating commits. For simplicity:
|
| /** | ||
| * Checks skip triggers and starts all builds needed for `prId` (which should be in the form 'User/Repo/123') as needed. | ||
| */ | ||
| function buildPullRequestIfNeeded(prId) { |
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.
buildPullRequest returns a ReplaySubject; buildPullRequestIfNeeded returns a Promise; can those be used interchangeably?
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.
It looked like the places I changed to call buildPullRequestIfNeeded weren't using the return value, so I think that shouldn't matter.
| */ | ||
| function buildPullRequestIfNeeded(prId) { | ||
| const [owner, repo, prNumber] = prId.split('/'); | ||
| return github.repos(owner, repo).pulls(prNumber).fetch() |
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.
Should this Promise be returned? I can't see anything using it. (Or should something "listen" to it?)
| } else { | ||
| buildPullRequest(prId); | ||
| } | ||
| }); |
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.
| }); | |
| }) | |
| .then(x => null, err => { ... log.error ... }); |
Should we add a catch-all error handler here to log any errors? Just concerned that failure might be silently dropped on the floor.
This PR addresses #17
Draft because: needs testing.
Skip when:
Always build when: