Author format commits as the App's own bot user - #318
Open
anandhu-eng wants to merge 2 commits into
Open
anandhu-eng wants to merge 2 commits into
anandhu-eng wants to merge 2 commits into
Conversation
format.yml pushes with the mlc-automations GitHub App token but stamped a
user account as the commit author:
3246381+mlc-automations@users.noreply.github.com
GitHub resolves those addresses by the numeric id and ignores the name, so
the credit never reached the App (id 272923709) -- it went to account
3246381, a separate user account. That account is now named bumper97birch
and its profile 404s, so cla-bot resolves the format commits to an unsigned
contributor and fails the check on any PR the bot has committed to. Three open
PRs are blocked this way today (#285, #274, #265).
The bot user's id is now looked up from the App's own slug at run time
instead of written down, following the pattern in the create-github-app-token
README, so the identity cannot drift out of sync again.
The CLA allowlist named mlc-automations, which is why this passed until the
rename; it now names mlc-automations[bot], the login the commits will
actually carry. Dropping the stale entry matters on its own -- the
mlc-automations username is currently unclaimed on GitHub, so anyone who
registered it would have been allowlisted on this repo.
The skip guard tested `github.actor != 'mlc-automations'`, but a push made
with an App token sets the actor to mlc-automations[bot], so the workflow has
been re-triggering on its own format commits. Harmless, as autopep8 is
idempotent, but it burned a run each time.
The 18 commits already on main are left as they are. cla-bot only inspects
pullRequest.commits, so base history is never re-checked and no history
rewrite is needed; the three branches above just need a rebase once this lands.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
🤖 AI PR Review SummaryThis PR updates GitHub Actions workflows to correctly handle bot usernames with '[bot]' suffixes in allowlists and conditional checks, and dynamically resolves the bot's GitHub user ID and email for git commits. The main risk is ensuring the dynamic resolution of bot identity works reliably and that the syntax for referencing outputs in git config commands is correct. The change improves maintainability by avoiding hardcoded IDs but requires validation of the new dynamic approach. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
format.ymlpushes with themlc-automationsGitHub App token, but hardcoded a user account as the commit author:GitHub resolves
<id>+<name>@users.noreply.github.comby the numeric id and ignores the name entirely. Id3246381is not the App — the App's bot user is id272923709:So every
[Automated Commit] Format Codebasecommit has been credited to account3246381, a separate user account. That account is now namedbumper97birch, andgithub.com/bumper97birch,GET /users/bumper97birchand the GraphQL node lookup all return 404 /NOT_FOUND.cla-botresolves those commits to an unsigned contributor and fails the check on any PR the format bot has committed to. The display name still readsmlc-automationsbecause that string is baked into the commit, which is what made this confusing to diagnose.Effect today
Three open PRs are blocked: #285, #274, #265.
This passed until recently because the CLA allowlist named
mlc-automationsand account 3246381 carried that login. The same defect and the same fix apply tomlcommons/mlperf-automations(mlcommons/mlperf-automations#1104), where the rename was first noticed.Changes
format.yml— resolve the App's bot user id at run time fromsteps.app-token.outputs.app-slug, per thecreate-github-app-tokenREADME, rather than hardcoding a number that can silently go stale.cla.yml— allowlistmlc-automations[bot]instead ofmlc-automations. Notebot*is a prefix glob and does not cover...[bot], so the explicit entry is required. Dropping the stale entry matters independently:mlc-automationsis currently an unclaimed GitHub username, so anyone who registered it would have been auto-allowlisted on this repo.format.ymlskip guard —github.actor != 'mlc-automations'never matched, because an App-token push sets the actor tomlc-automations[bot]. The workflow has been re-triggering on its own format commits (visible ona8e187953, actormlc-automations[bot]). Harmless, as autopep8 is idempotent, but it burned a run each time.No history rewrite needed
The 18 commits already on
mainare untouched.cla-bot/src/graphql.tsqueriespullRequest.commits, i.e. only commits reachable from the head branch and not the base — so merged history is never re-inspected. Confirmed empirically inmlperf-automations, where every PR merged since the rename passed CLA cleanly.Rewriting
mainwould also invalidate every fork, clone, open PR base and recorded release-provenance hash, for no benefit.Once this lands, the three branches above need a rebase; the bot will recreate the format commits with the correct identity.
Open question
Whether account
3246381was ever under the MLCommons organization, and what it was originally intended to be, is not answerable from outside — the account is not resolvable through any public endpoint. The org audit log or GitHub Support can confirm. It does not block this fix.🧾 PR Checklist
272923709+mlc-automations[bot]@users.noreply.github.com🤖 Generated with Claude Code