gitlab-org--gitlab-foss/lib/api
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
..
helpers New AccessRequests API endpoints for Group & Project 2016-08-10 19:07:05 +02:00
access_requests.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
api.rb Merge branch 'api-order-mounts' into 'master' 2016-10-13 16:03:22 +00:00
api_guard.rb Remove some dead code from the Grape API 2016-09-19 12:27:36 +01:00
award_emoji.rb GrapeDSL for Award Emoji endpoints 2016-10-03 10:32:09 +02:00
boards.rb Add support to group labels on issues board API 2016-10-19 14:58:26 -02:00
branches.rb Add button to delete all merged branches 2016-11-09 21:04:03 +01:00
broadcast_messages.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
builds.rb Grapify builds API 2016-10-24 13:06:17 +02:00
commit_statuses.rb Don't use Hash#slice since it's not supported in Ruby 2.1 2016-10-20 19:08:46 +02:00
commits.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
deploy_keys.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
deployments.rb Add deployment endpoints 2016-08-18 21:10:52 +02:00
entities.rb Issue #4270: Recursive option for files through API 2016-11-12 10:00:39 +01:00
environments.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
files.rb Add optional 'author' param when making commits 2016-09-19 10:00:26 -07:00
groups.rb Grapify the group API 2016-11-15 14:36:42 +01:00
helpers.rb Use #to_h to convert params to a hash 2016-11-14 11:17:51 +01:00
internal.rb Refactor storage path extraction from full repo path 2016-10-28 15:55:55 +03:00
issues.rb Fix API issues sorting 2016-09-09 16:10:01 +01:00
keys.rb GrapeDSL for Keys endpoint 2016-10-01 11:11:41 +02:00
labels.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
lint.rb Improve curl commend, remove blank lines 2016-09-07 12:54:02 +02:00
members.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
merge_request_diffs.rb Add single merge request diff API endpoint 2016-08-12 14:44:49 +03:00
merge_requests.rb Grapify the merge request API 2016-11-15 10:31:18 +01:00
milestones.rb Use #to_h to convert params to a hash 2016-11-14 11:17:51 +01:00
namespaces.rb GrapeDSL for Namespace endpoint 2016-10-04 07:47:29 +02:00
notes.rb Grapify the notes API 2016-11-15 16:28:11 +01:00
notification_settings.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
pipelines.rb Use PipelinesFinder in Pipelines API 2016-09-07 15:38:03 +02:00
project_hooks.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
project_snippets.rb
projects.rb Add setting to only allow merge requests to be merged when all discussions are resolved 2016-11-04 14:58:40 +01:00
repositories.rb Issue #4270: Recursive option for files through API 2016-11-12 10:00:39 +01:00
runners.rb Use #to_h to convert params to a hash 2016-11-14 11:17:51 +01:00
services.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
session.rb Grapify the session API 2016-11-09 17:36:35 +01:00
settings.rb Allow multiple repository storage shards to be enabled, and automatically round-robin between them 2016-11-04 04:01:08 +00:00
sidekiq_metrics.rb Fixed Rubocop error 2016-06-17 11:16:25 -05:00
subscriptions.rb Grapify subscription API 2016-11-14 11:05:06 +01:00
system_hooks.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
tags.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
templates.rb Create a new /templates API namespace 2016-10-12 11:09:41 +02:00
todos.rb Grapify todos API 2016-10-14 09:22:50 +02:00
triggers.rb Add ref parameter for triggerring builds with gitlab webhook from other project. 2016-11-15 17:19:33 +03:00
users.rb Use declared_params helper in API 2016-11-14 15:22:06 +01:00
variables.rb GrapeDSL for variables 2016-10-13 09:55:50 +02:00
version.rb API: Version information 2016-10-12 16:47:35 +02:00