Skip to content

Add mutation to accept merge requests

Alex Kalderimis requested to merge ajk-graphql-accept-mr into master

What does this MR do?

This adds a GraphQL mutation to accept merge requests.

See:

Example queries

mutation {
  mergeRequestAccept(input: { projectPath: "gitlab-org/gitlab", iid: "54758", strategy: "MERGE_TRAIN", sha: "deadbeef" }) {
    errors
    mergeRequest { status }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

This exposes a feature via HTTP APIs that is currently only available via controller actions. That makes it more available for abuse. This is only available to logged in users with maintainer permissions, so this risk is minimal.

Security

This adds a new policy rule, which replicates the logic found in the controller and API resources. This is not a change in authorization.

  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
Edited by Alex Kalderimis

Merge request reports

Loading