This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
[#202] Trigger builds on push via GitHub webhooks #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scope
This add support for triggering builds when branches are pushed.
This tries to fix #202
Change
For now, the secret / payload authentication is not enabled as I don't have write access to the private repo. The variables for supporting authentication are defined.
For now only the supported builds are auto-triggered for non-trunk branches.
txbuildbot/scheduler.py was removed as it was only used for fileIsImportant and this can be configured with a simple callable.
TwistedGitHubEventHandler was created only to prevent accidental hooks on PR.
If we want to enable building on PR, we should create a new issue in brain and test this scenario.
The production builders uses a secret token and it always asks for signed payloads.
For Vagrant VM the sample private files come without requiring a token
As a drive by, I have updated the
updatefast()method to reduce code duplication.How to test
Testing in Vagrant VM
Create or get some payload from https://github.com/twisted/twisted/settings/hooks/8337490
Check the readme for help in delivering the hooks.
Deliver a payload for trunk and non-trunk and observer how the changes are triggred.
You can observe them by looking at a builder http://172.16.255.140:8080/builders/check-manifest
You should observer that multiple builds are delayed for 5 seconds and then only the last build is triggered.
Once a build is triggred, look at the build property and observer the
schedulerfield. It should betrunkfor trunk commits andbranch-supportedfor non-trunk builds.Also trunk commits will trigger all builders, including the ones which are not supported.
Testing in production
This branch can be applied to production.
For an existing PR or an existing or new branch push a commit. Observer that the supported builds are triggered and that the status is updated.