Closed Bug 1433506 Opened 8 years ago Closed 8 years ago

Add ability to exclude branches from github-taskcluster integration

Categories

(Taskcluster :: Services, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kats, Assigned: bstack)

Details

According to [1] it's possible to provide a "whitelist" of branches on which the CI jobs run. However it would be nice to also provide a "blacklist" of branches on which to exclude CI jobs from running. Travis-CI supports this [2]. It would be quite useful for any repos managed by bors (the servo PR-merging bot) because right now any merged PR has CI jobs run three times on the exact same code, and this blacklist would allow reducing that to two times. (The other fix will need to go in bors). [1] https://docs.taskcluster.net/reference/integrations/taskcluster-github/docs/usage#branch-filtering [2] https://docs.travis-ci.com/user/customizing-the-build/#Safelisting-or-blocklisting-branches
Also for reference, the process of merging a PR is like so: - PR branch is merged to the current master branch and pushed to the "auto" branch. This triggers one CI run. - Upon successful completion, the auto branch is pushed as the new master. This triggers the second CI run. - The new master is then pushed back to auto (which really should be identical already). This triggers the third CI run. If we can exclude CI from running on the master branch that would remove the second of the three CI runs listed above.
Hi Kartikaya, I want to work on this bug. I think the fix could be to - 1) Update the docs for an 'exclude' field. 2) Modify the src/intree.js (https://github.com/taskcluster/taskcluster-github/blob/master/src/intree.js#L127) to exclude the branches under 'exclude'
Flags: needinfo?(bugmail)
I'm not familiar with the code, redirecting needinfo to bstack who may be able to provide some guidance. Thanks!
Flags: needinfo?(bugmail) → needinfo?(bstack)
Your general idea seems correct, yd! This seems like a fine plan.
Assignee: nobody → didwaniayashvardhan
Status: NEW → ASSIGNED
Flags: needinfo?(bstack)
The PR has merged, do you know if it has been deployed already, or when it will be deployed? I'm not sure of what the tc-gh release process looks like and when this bug will be marked resolved.
Flags: needinfo?(bstack)
kats: I beleive this is running in production now. Generally once something is in master in tc, it goes to production within a couple hours at most. Sorry we never closed this.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(bstack)
Resolution: --- → FIXED
Thanks for the update!
So I started using this on the webrender repo, but it looks like it disabled running taskcluster CI on PR branches as well. See for example: https://github.com/servo/webrender/pull/2536/commits - this is before I added 'master' to excludeBranches https://github.com/servo/webrender/pull/2537/commits - this is after I added 'master' to excludeBranches On the first PR (#2536) you can see by clicking on the green checkmark that taskcluster CI ran on the PR commit. On the second PR (#2537) it doesn't run. It still seems to be running on the "auto" branch, where the bot merges the PR head with the current master. So something isn't quite right.
Flags: needinfo?(didwaniayashvardhan)
^
Flags: needinfo?(bstack)
Status: RESOLVED → REOPENED
Flags: needinfo?(bstack)
Resolution: FIXED → ---
Assignee: didwaniayashvardhan → bstack
Sorry, at a work-week now and am in weird time zones. I think I can have a fix for this tomorrow Berlin time!
We can land https://github.com/taskcluster/taskcluster-github/pull/234 soon and this should work after that! Thanks for the bug report.
Seems to be working now, thanks!
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Flags: needinfo?(didwaniayashvardhan)
Resolution: --- → FIXED
Component: Github → Services
You need to log in before you can comment on or make changes to this bug.