Skip to content

github/mergify: set an explicit "update" account #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Jul 4, 2024

Fixes #1793

See our issue, upstreams issue, and this discussion I had with upstream.

The core problem is also summarised nicely in this comment on another affected project:

Quick summary here:

  • GitHub API doesn't allow a bot to do certain things including rebasing. So, it has to impersonate real people to work because rebasing is pretty usual:
    • we use rebase to update a PR branch when master went ahead (see Mergify config);
    • we use Mergify queues, and those require rebases in general: the bot tries to create a "merge train" rebasing several PRs one on top of each other (Ibid.).
  • Before February 2023 Mergify would impersonate random "authorized users" (users with elevated permissions on the repo), which was annoying but working.
  • Since February 2023 they impersonate the PR author by default. The issue is, not every PR author have enough permissions for the whole thing to work. As a result we see errors like the ones reported upstream, which I referenced at the start ("Unable to update: user X is unknown").
  • Their description of the change seem to suggest that setting update_bot_account to a user that is logged into Mergify Dashboard (like Mikolaj or myself) should solve the issue.

Who to set

I've marked @GaetanLepage as the "update account", so pushing rebased changes will use his account.
I'm also happy to put my name there, but I think @GaetanLepage made more sense as he is the most "senior" and most active maintainer.

This should be fairly invisible though, because when rebasing, mergify sets committer and author matching the original commit's.
This also only affects the push to the PR branch, Mergify[bot] is still used to actually merge the PR into the base branch.

The future

update_bot_account is a "template" type (the default is {{author}}). I've suggested that Mergify add a "known to mergify" filter, which would allow us to filter a list of users (e.g. approved-reviews-by.prepend(author).append(GaetanLepage)) and then filter that list for users that have logged into Mergify's dashboard, (then finally filtering for the first matching user). See the discussion mentioned above.

@MattSturgeon MattSturgeon requested a review from a team July 4, 2024 20:21
@GaetanLepage
Copy link
Member

All good for me !
Thanks @MattSturgeon for having investigated this :)

@MattSturgeon
Copy link
Member Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Jul 5, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 4730563

@MattSturgeon MattSturgeon force-pushed the mergify_update_account branch from aef9874 to 4730563 Compare July 5, 2024 11:55
@mergify mergify bot merged commit 4730563 into nix-community:main Jul 5, 2024
61 checks passed
@mergify mergify bot temporarily deployed to github-pages July 5, 2024 11:59 Inactive
@MattSturgeon MattSturgeon deleted the mergify_update_account branch July 5, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] mergify can't rebase "random" user's PRs
3 participants