Skip to content
Versora

Manual

Merge requests

Dependencies between merge requests

3 min read

On this page

A change may need another one that is in a different merge request, even in another project: the front end depends on the new API, the migration has to go in before the code that uses it. On GitLab Premium, an MR can declare which others it depends on, and the server only allows its merge after all of them have gone in. The Dependencies card shows and edits that list without leaving the app.

The feature is GitLab Premium or higher. GitHub has no formal dependencies between pull requests, and the card doesn't appear there.

Tip

For a sequence of MRs where each one starts from the previous one, branch stacks usually work better: each MR's target is already the one below it, and Versora rebuilds the stack after each merge.

Where to find it

  • MR review › Actions tab › Dependencies card.
  • Merge card, when there's an open dependency: "Depends on !12, still open: the merge can only happen after it."

What the card shows

PartWhat it is
Warning at the top"Depends on 2 merge requests that are still open: GitLab only allows the merge after them."
Depends onThe MRs this one depends on, with the reference, the title and the state (open, merged, closed, locked). With none: "No dependencies."
"+1 your account can't see"Dependencies in projects you don't have access to.
Depending on this oneThe MRs waiting for this one.
Field and AddTo record a new dependency (only with the MR open).

Click a dependency's reference to open it: from the same project, it opens the review in the app; from another project, it opens the page in the browser.

Step by step: adding a dependency

  1. On the review's Actions tab, go to the Dependencies card.
  2. In the field, type the reference of the MR this one depends on, in one of these formats:
    • !12 (from the same project);
    • group/project!12 (from another project);
    • the MR's full URL.
  3. Click Add or press Enter. The bar shows "Adding the dependency…".
  4. At the end: "Now depends on !12.".

Step by step: removing a dependency

  1. Click the × next to the dependency ("Remove the dependency on !12").
  2. Confirm in the Remove the dependency on !12? dialog ("!42 no longer waits for !12 to merge."), with Remove.
  3. At the end: "No longer depends on !12.".

What Versora does in git

Nothing in the local repository. The dependencies are saved on GitLab through the merge request dependencies API (from GitLab 17.3 on).

How to undo

The dependency lives on the server: Ctrl+Z doesn't undo it. To undo an addition, remove the dependency; to undo a removal, add it again.

Caveats and messages

  • "Merge request dependencies are a GitLab Premium or higher feature.": the card appears disabled with this reason on GitLab Free.
  • "Dependencies through the API need GitLab 17.3 or newer." and "This GitLab doesn't have the merge request dependencies API.": old server.
  • "Use !12, group/project!12 or the merge request URL.": format not recognized.
  • "A merge request can't depend on itself.": the reference is to the MR itself.
  • "That dependency already exists.": nothing to do.
  • "!99 doesn't exist or your account can't see it.": check the reference and your access to the project.
  • "Your account can't change this merge request's dependencies.": permission on the project is missing.
  • "That dependency had already been removed.": someone removed it first; the card is refreshed.
  • "GitLab rejected the dependency: …": the reason comes from the server.
  • On the Merge card, the blocker "The merge depends on another merge request that hasn't been merged yet." disappears when all the dependencies go in.

None in the app. The feature depends on the GitLab plan, which appears in Git servers.

See also