gitlab-org--gitlab-foss/lib/api/helpers
Luke Duncalfe aa352a95df Support merge request create with push options
To create a new merge request:

  git push -u origin -o merge_request.create

To create a new merge request setting target branch:

  git push -u origin -o merge_request.create \
    -o merge_request.target=123

To update an existing merge request with a new target branch:

  git push -u origin -o merge_request.target=123

A new Gitlab::PushOptions class handles parsing and validating the push
options array. This can be the start of the standard of GitLab accepting
push options that follow namespacing rules. Rules are discussed in issue
https://gitlab.com/gitlab-org/gitlab-ce/issues/43263.

E.g. these push options:

  -o merge_request.create -o merge_request.target=123

Become parsed as:

  {
    merge_request: {
      create: true,
      target: '123',
    }
  }

And are fetched with the class via:

  push_options.get(:merge_request)
  push_options.get(:merge_request, :create)
  push_options.get(:merge_request, :target)

A new MergeRequests::PushOptionsHandlerService takes the `merge_request`
namespaced push options and handles creating and updating
merge requests.

Any errors encountered are passed to the existing `output` Hash in
Api::Internal's `post_receive` endpoint, and passed to gitlab-shell
where they're output to the user.

Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/43263
2019-04-09 09:36:42 +12:00
..
badges_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
common_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
custom_attributes.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
custom_validators.rb Provide EE backports for filtering by approver feature 2019-03-07 23:55:45 +00:00
discussions_helpers.rb Refactor API noteable types constants 2019-03-04 17:44:56 +01:00
graphql_helpers.rb Add metadata about the GitLab server to GraphQL 2019-03-05 15:00:32 +00:00
headers_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
internal_helpers.rb Support merge request create with push options 2019-04-09 09:36:42 +12:00
issues_helpers.rb Backport API::Issues parameters from EE 2019-03-26 14:18:29 +01:00
label_helpers.rb Simplify label helper and correct version 2019-01-31 13:49:52 +01:00
members_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
notes_helpers.rb Merge branch 'resolve-lib-differences' into 'master' 2019-03-12 17:03:50 +00:00
pagination.rb Adds the Rubocop ReturnNil cop 2019-03-06 17:51:56 +02:00
presentable.rb Do not expose trigger token when user should not see it 2019-01-31 16:51:17 +01:00
project_snapshots_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
projects_helpers.rb Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'" 2019-04-05 13:02:56 +00:00
related_resources_helpers.rb Enable frozen string in lib/api and lib/backup 2018-09-29 21:04:50 -07:00
resource_label_events_helpers.rb Move eventable types constant to a helper 2019-03-04 17:44:56 +01:00
runner.rb Properly handle multiple X-Forwarded-For addresses in runner IP 2019-02-24 14:50:55 -08:00
search_helpers.rb add users search to search api 2019-03-14 18:21:01 +01:00
services_helpers.rb Move API::Services constants to a helper 2019-03-04 17:44:57 +01:00
version.rb Improve readablity of CI_API_V4_URL related code 2019-01-04 15:32:40 +01:00