Skip to main content

Definition: Resolving Pull Request

Arnaud Lachaume avatar
Written by Arnaud Lachaume
Updated today

A resolving pull request is a pull request that:

  • Contains an auto-closing keyword to an issue

  • Has a state equal to DRAFT, OPEN or MERGED (not CLOSED)

  • Has a head ref that has not been used as a base ref by a previous resolving pull request associated with the issue

This last condition ensures that release PRs (e.g., PR from master to staging then staging to production) do not get considered as resolving if they follow a proper implementation PR (e.g., from my-feature-branch to master), even though they contain references to issues through commits.

Example: Series of PRs related to an issue via an auto-closing keyword, and whether they are considered "resolving" by Keypup.

PR

From (head)

To (base)

State

Resolving?

PR 1

main

hotfix

MERGED

βœ…

PR 2

feat1

main

MERGED

βœ… The main branch was used as a "from" but not as a "to" yet, so it is fine.

PR 3

feat2

main

MERGED

βœ…

PR 4

feat3

staging1

CLOSED

🚫 The PR is closed

PR 5

staging1

staging2

DRAFT

βœ… The staging1 branch was used as a "to" by PR 4, but PR 4 is closed, so it is ignored.

PR 6

main

prod

OPEN

🚫 The main branch has been used as a "to" by PR 3.

This condition replaces the rule from GitHub, GitLab, and Bitbucket that resolving pull requests must target the main branch. This condition is not practical for Keypup since the main branch can change over time. Using this definition would mean that any resolving PR preceding a change of main branch would no longer be considered as resolving, which would impact historical reporting.

The Keypup definition also brings some flexibility in case of emergency releases. If you push an emergency fix referencing an issue to the main branch and then release this fix through release PRs, then the first release PR will be considered as a resolving PR (GitHub/GitLab/Bitbucket would simply ignore it). This information can then be used for incident reporting in Keypup.

Did this answer your question?