gitlab-org--gitlab-foss/spec
Rémy Coutable 46eb0ebfd2 Merge branch '23584-triggering-builds-from-webhooks' into 'master'
Add ref parameter for triggering builds with gitlab webhook from other project.

Currently GitLab can trigger builds from external tools like curl.
But there is no way to trigger builds with webhook from another GitLab project.
Executing webhook like `/projects/:id/trigger/builds?token=TOKEN&ref=master` results in such message from server:
```
400 No builds created
```

Problem is the ref from request body takes precedence of the ref from query string.
System tries to trigger build for nonexistent branch instead of `master`.
This is the feature of the Grape framework used to build GitLab api.

This MR adds optional `ref` parameter into the api url:
```
/projects/:id/ref/:ref/trigger/builds?token=TOKEN
```

This will lead that the ref in the url will have precedence of the ref inside request body.

This solution provides compatibility with current API urls.

Closes #23584

See merge request !7022
2016-11-15 20:37:04 +00:00
..
bin DRY up the specs for bin/changelog 2016-11-03 17:35:06 +00:00
config Updated mail_room and added sentinel support to Reply by Email 2016-10-26 05:02:47 +02:00
controllers Merge branch '21076-deleted-merged-branches' into 'master' 2016-11-15 12:08:22 +00:00
factories Merge branch 'fix-unathorized-cloning' into 'security' 2016-11-09 12:27:17 +01:00
features Merge branch 'stanhu/gitlab-ce-fix-error-500-with-mr-images' into 'master' 2016-11-15 10:22:36 +00:00
finders Fix lightweight tags not processed correctly by GitTagPushService 2016-10-28 13:53:18 -03:00
fixtures Use separate email-friendly token for incoming email and let incoming 2016-11-07 15:55:42 +00:00
helpers Merge branch 'remove-heading-space-from-diff-content' into 'master' 2016-11-09 15:32:02 +00:00
initializers
javascripts Merge branch 'improve-build-scroll-controls-responsive-behaviour' into 'master' 2016-11-08 21:41:48 +00:00
lib Merge branch 'stanhu/gitlab-ce-fix-error-500-with-mr-images' into 'master' 2016-11-15 10:22:36 +00:00
mailers Move spec/mailers/shared/notify.rb to spec/support 2016-10-22 17:51:50 -05:00
models Merge branch 'fix/error-when-invalid-branch-for-new-pipeline-used' into 'master' 2016-11-10 14:00:55 +00:00
policies Added tests for IssuePolicy 2016-11-07 12:49:24 +01:00
requests Merge branch '23584-triggering-builds-from-webhooks' into 'master' 2016-11-15 20:37:04 +00:00
routing Fix routing spec for group controller 2016-11-08 15:54:17 +02:00
serializers Simplify implementation of entity serializers 2016-11-04 15:00:39 +01:00
services Merge branch '21076-deleted-merged-branches' into 'master' 2016-11-15 12:08:22 +00:00
support Fix Error 500 when creating a merge request that contains an image that was deleted and added 2016-11-14 15:57:01 +01:00
tasks/gitlab Introduce better credential and error checking to `rake gitlab:ldap:check` 2016-11-08 15:46:10 -06:00
uploaders
views add tests for build row templates 2016-11-10 16:38:00 -06:00
workers Merge branch '21076-deleted-merged-branches' into 'master' 2016-11-15 12:08:22 +00:00
factories_spec.rb
rails_helper.rb
rake_helper.rb Add Rake task to create/repair GitLab Shell hooks symlinks 2016-11-01 14:52:59 -05:00
simplecov_env.rb
spec_helper.rb Fix broken commits search 2016-11-08 12:03:23 +02:00
teaspoon_env.rb