Skip to content
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

Merges cannot be attributed, encode invoker into the merge commit #100

Open
Atemu opened this issue Jun 26, 2024 · 1 comment
Open

Merges cannot be attributed, encode invoker into the merge commit #100

Atemu opened this issue Jun 26, 2024 · 1 comment

Comments

@Atemu
Copy link
Member

Atemu commented Jun 26, 2024

Currently, a merge bot merge cannot be directly attributed to any real person.
You could go into the PR and look for the last comment before the merge that invoked the bot but GH PR conversations can easily be disappear'd and users can turn into ghosts at any time. We've seen this happen many times before in Nixpkgs. When either of that occurs, it is no longer possible to trace a merge bot merge back to an actual human.

In the commit metadata, the author is set to the merge bot and committer is the generic GH user:

Author:     nixpkgs-merge-bot[bot] <148217876+nixpkgs-merge-bot[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 18 05:23:59 2024 +0000
Commit:     GitHub <[email protected]>
CommitDate: Tue Jun 18 05:23:59 2024 +0000

The actual person who invoked the bot should be embedded in this commit ensure clear ownership and thereby responsibility. Since they effectively author the merge, I propose the Author: field to be set to the invoker's details. The Commit:er should then be set to the merge bot info as it performs the actual commit.

If it is not possible to set the Commit:er field to the bot or the Author: field to anything but the bot, the bot would have to remain as the Author: and the invoker should instead be added as Co-authored-by: (GH and other forges interpret this field and links the users' profiles on commits).
We could also invent a new Invoked-By: metadata field here as there is no real standard for this but that likely won't receive support by forges.

What needs investigation is how the invoker's details would be fetched. In case the GH API does not offer that (might very well be the case) we could always use the maintainers list for this though as it contains a GH user <-> email mapping.

@Atemu Atemu changed the title Merges cannot be traced, encode invoker into the merge commit Merges cannot be attributed, encode invoker into the merge commit Jun 26, 2024
@Mic92
Copy link
Member

Mic92 commented Jun 26, 2024

I believe github also provides some pseudo email addresses that could be used in that field.

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

No branches or pull requests

2 participants