Skip to content

Attribute the measurement commit to the App, not to nobody (T-1502) - #743

Merged
MongLong0214 merged 2 commits into
mainfrom
t1502-app-committer-id
Aug 18, 2026
Merged

Attribute the measurement commit to the App, not to nobody (T-1502)#743
MongLong0214 merged 2 commits into
mainfrom
t1502-app-committer-id

Conversation

@MongLong0214

Copy link
Copy Markdown
Owner

The run after #741 got further and printed:

--- branch pushed; commit committer on the server: unknown
pull request create failed: GraphQL: Resource not accessible by integration (createPullRequest)

Two separate things, and this PR fixes the first.

Attribution. The committer address used 4622872 — the App id. The number in a noreply address is the bot user id, which for this App is 317873099:

$ gh api 'users/commitlore-canonical-build[bot]'
login=commitlore-canonical-build[bot] id=317873099 type=Bot

GitHub could not match the address to an account, so the commit was attributed to nobody. The read-back added in dbcd73b did its job — it reported a defect in the line above it. Left alone it would have spoiled a successful measurement: ADR-0036 assumes the App opens the pull request, and a commit attributed to nobody makes the answer ambiguous exactly when the rest of the run finally goes green.

Access, which this PR does not fix. gh pr create was refused with Resource not accessible by integration (createPullRequest). The installation has contents: write — the push proves it — but not Pull requests: write. No workflow change can grant that; it is a change to the App's declared permissions, made by the App owner, followed by accepting the updated permissions on the installation.

That is worth stating plainly, because it lands on ADR-0036: the decision that a bot merge opens a pull request rests on the App being able to open one, and today it cannot. The original question — whether on: pull_request fires for an App-opened pull request — is still unmeasured, and the next run answers it once the permission is added.

The run that got past the credential fix reported:

    --- branch pushed; commit committer on the server: unknown

The push itself worked, so `persist-credentials: false` did what it was for. What did not work was attribution: the committer address used `4622872`, which is the App id. The number in a noreply address is the bot *user* id, and for this App that is `317873099` (`gh api 'users/commitlore-canonical-build[bot]'`). GitHub could not match the address to an account, so it attributed the commit to nobody and the read-back printed `unknown`.

That read-back was added one commit earlier to tell two failures apart, and it worked -- it just reported a defect in the line above it rather than in the token. Left alone it would have spoiled a successful measurement: ADR-0036 assumes the App opens the pull request, and a commit attributed to nobody makes the answer ambiguous exactly when the rest of the run finally goes green.

Limit: this fixes attribution, not access -- the same run was refused at `gh pr create` with `Resource not accessible by integration (createPullRequest)`, which is a missing `Pull requests: write` on the App installation and is not something a workflow can change
Blast: local
Undo: easy
Certainty: firm
Record-Id: r-committerid1502
Provenance: authored
Verified: `gh api 'users/commitlore-canonical-build[bot]'` returns `id=317873099 type=Bot`, and the App id in the failing line is 4622872; the two numbers are different things and the log's `unknown` is what using the wrong one looks like
CommitLore-Version: 2.0.0
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

CommitLore — record lint

Trailers: clean — 2 commits in origin/main..562b3a036de80d4fa6cef55957c4214577e39eea
Active constraints: not read — commitlore: the index is incomplete: the build stopped after its time budget with 711 commit(s) or note(s) unread — records in them are missing from this answer. fix: commitlore init (or commitlore index) to finish the index (1 changed path)

Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR.

The cleanup step was gated on `steps.open.outputs.number`, which is only set after `gh pr create` returns. Both runs that failed at create failed *after* pushing the branch, so `number` was empty, the step was skipped, and the branch outlived the run that made it.

That is the wrong key. The push is what creates something to clean up, so the branch name is what the cleanup should be keyed on -- it is written to the step output before anything else happens, and it exists on every path that reaches the push.

The delete is followed by a reference read rather than trusted. `git push --delete` on a ref that is already gone is a failure, and `|| true` would then hide a delete that genuinely did not happen. Reading the ref back separates "already absent" from "still there", which is the same shape as the readback #735 put in the installer.

Limit: this cleans up after a failed measurement; it does not stop one from failing, and a run killed between the push and this step still leaves the branch
Blast: local
Undo: easy
Certainty: firm
Record-Id: r-measurecleanup1502
Provenance: authored
Verified: the two failed runs (32081602096 and its predecessor) both reached the push and stopped at `gh pr create`, which is the window where `number` is empty and `branch` is not; the successful run 32082467906 shows the close step working when a number exists, and that path is unchanged
CommitLore-Version: 2.0.0
@MongLong0214
MongLong0214 merged commit 20ed0df into main Aug 18, 2026
12 checks passed
@MongLong0214
MongLong0214 deleted the t1502-app-committer-id branch August 18, 2026 00:31
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.

1 participant