You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since travis-ci doesn't allow to trigger the notifications webhooks on specific branch, some roles are imported just because a user forked a repo to do a PR.
The original user could indeed configuring .travis.yml to only trigger the build on master, but it will disable the build on the branch created to made the PR on the forked repo too and will not allow the user who forked the project to check the travis build is OK before creating the PR without :
to be aware he need to changed .travis.yml with his own branch
rollback .travis.yml when his PR seems ok
Proposed Solution
Since the payload sent by travis-ci contain the branch who trigger the build, adding a parameter to the notifications api endpoint to only import the role if the branch built is contained in the parameter (on all branch if not set) could be maybe implemented ?
When we get the travis notification webhook, currently regardless of the travis branch we import or re-import the default branch. We will make a change so: we will not import if the travis branch does not match the import branch (for existing repos) or the default branch (for new repos). So forking and pushing my_feature_branch should not trigger an import.
When using the cli ansible-galaxy import and passing the --branch parameter, we will make sure that branch is what gets imported and also that branch is the only one that triggers the travis notification webhook
We will remove the ansible-galaxy initmeta/main.yml comment for the github_branch field since that field is not currently being used.
After this we will look into whether specifying the branch during the web UI import is something we want to add
awcrosby
changed the title
[FeatureRequest] Allow notifications on specific branch
Make notifications dependent on imported branch
Jan 22, 2019
An additional change was made to address original feature request:
If you give the webhook a branch query parameter, it will only trigger an import with pushes to that particular branch. For example a forked repo with a PR my_feature branch will not trigger an import with this: webhooks: https://galaxy.ansible.com/api/v1/notifications/?branch=master. Note that tag pushes will continue to trigger imports.
Feature Request
Use Case
Since travis-ci doesn't allow to trigger the notifications webhooks on specific branch, some roles are imported just because a user forked a repo to do a PR.
The original user could indeed configuring .travis.yml to only trigger the build on master, but it will disable the build on the branch created to made the PR on the forked repo too and will not allow the user who forked the project to check the travis build is OK before creating the PR without :
Proposed Solution
Since the payload sent by travis-ci contain the branch who trigger the build, adding a parameter to the
notifications
api endpoint to only import the role if the branch built is contained in the parameter (on all branch if not set) could be maybe implemented ?Implementation
Maybe something similar to this :
https://galaxy.ansible.com/api/v1/notifications/
https://galaxy.ansible.com/api/v1/notifications/?branch=master
master
https://galaxy.ansible.com/api/v1/notifications/?branch=master:dev
master
ordev
Best regards,
The text was updated successfully, but these errors were encountered: