Skip to content

fix(statewrite): stamp the bot on orchestrate, release, and rollback state writes - #366

Merged
joshua-temple merged 2 commits into
mainfrom
fix/statewrite-attribution-complete
Jun 26, 2026
Merged

joshua-temple merged 2 commits into
mainfrom
fix/statewrite-attribution-complete

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

#364 made the Contents-API state writer stamp github-actions[bot], but only the promote and hotfix finalize callers used it. The orchestrate state write, release latest_release write, and rollback finalize build the gh api ... PUT themselves and set no author/committer, so GitHub attributed those automated commits to the token owner (the maintainer). Confirmed on a post-#364 run.

Fix

  • internal/generate/state_write.go writeStateCommitPush now emits author[name]/[email] and committer[name]/[email]; callers in generator.go and release.go pass GetGitUserName/GetGitUserEmail (default github-actions[bot], manifest-overridable).
  • internal/rollback extracts a testable buildStatePutArgs that stamps the identity via statewrite.Identity.OrDefault, threaded from manifest config through a new Rollbacker.GitIdentity().
  • Exported statewrite.Identity.OrDefault for reuse. Orchestrate's local-git path already set the bot identity and is unchanged.

Tests

New unit tests assert the bot author/committer on the orchestrate, release, and rollback paths, plus custom-identity honoring. Full go test ./... 1939 pass; vet and golangci-lint clean.

Coupled suite change

cascade-example-3env assert_auto_commit expects the token-user login; it is updated in lockstep (separate suite PR) to expect github-actions[bot].

…e bot

The orchestrate and release finalize steps write trunk state through the Contents REST API by emitting a gh api PUT, and the rollback finalize CLI builds the same PUT by hand. None of these set author or committer, so the API attributed the commit to the token owner instead of the automation bot. Stamp author and committer from the manifest git identity (defaulting to github-actions[bot]) on all three paths, reusing the statewrite.Identity plumbing.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

No workflow drift detected.

@joshua-temple
joshua-temple enabled auto-merge (squash) June 26, 2026 02:41
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 6badcf8 into main Jun 26, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant