Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Mark PRs merged by bors as merged not closed #1217

Open

Description

@eric-wieser

Right now (at least with use_squash_merge = true), PRs merged by bors end up with [Merged by Bors] in the title, but are still considered "closed" instead of "merged" by github. This has a number of downsides:

  • Repository statistics about merged vs closed aren't useful
  • The "revert PR" button doesn't appear
  • I don't think "Closes #NNN" works in PR descriptions, since github considers the PR abandoned not resolved

I suspect there are technical limitations on the github side (this thread? that make this impossible, but it would be great if this limitation could be documented. The bors website shows everything working normally, so I guess this only comes up in certain configurations.

Activity

  1. cart commented on May 26, 2021

    @cart

    Yup this is causing issues for us in Bevy. We want clean squashed history without bors merge commits, so we enable use_squash_merge, but this comes at the cost of the problems mentioned above (broken stats are a huge loss for us). We also want to distinguish between merged state and closed state in our project boards, but right now that is impossible.

  2. DJMcNab commented on Jul 21, 2021

    @DJMcNab

    I think this is related to #899.

    A few of us (@bjorn3, @mockersf ) in the bevy discord have been theorising a potential way to workaround this.

    In this scheme bors would act as it currently does, until it reaches the point where the PR would currently be closed. At that point, it would change the base branch of the PR to its own version of the target branch (say a branch with name bors/main). It would update that branch to the head commit of main (either before or after the relevant PR is merged, as #899 (comment) suggests either would work). It would then use the GitHub API to merge the PR into that branch, which marks the PR as merged.

  3. yesthesoup commented on Aug 11, 2021

    @yesthesoup

    Have run into this issue as well for our configuration. Just enabled use_squash_merge in the repo's bors.toml, but it's now closing all the merged PRs instead of merging them as before.

  4. jbasila-orca commented on Oct 14, 2021

    @jbasila-orca

    I would like to provide the following suggestion:

    We are currently integrating bors in our CI system and we do need to have the PRs squashed and marked as merged.
    Since this is currently a limitation, you either get a closed PR that is squashed or a merged PR but with all the history on the main branch, we decided to try and add some features to help us overcome this:

    This is currently getting fixed in-house and I would like to know if there is interest so we will contribute this solution.

    The idea is to introduce two new flags to bors.toml:

    • enforce_squashed_only_pr - This will cause bors to block a merge if the PR is not squashed (contains only 1 commit)
    • enable_squash_feature - This will enable a new command bors squash that will squash a PR automatically.

    This way we will provide the users with the ability to squash the PR by a simple request to bors and then they will be able to ask to merge the PR.
    The only downside of this implementation is that you lose the history of the PR itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions