Repository navigation
bot-token, merge-key-check, notify-umbrella and gemini-review on marola-pr-bot (MIP-0086 row 2) - #110
Merged
Merged
Conversation
… §5.4) Tested: release.py --self-test red then green; devkit quality gate Co-Authored-By: Claude <[email protected]>
…86 §5.4) Composite action over actions/create-github-app-token: refuses an empty repositories list, always passes owner plus the named repos, and sets git to the bot's noreply identity. bot-token-test.yml proves the refusal and the one-repo, no-pull-request-write scope live. Tested: actionlint; the live bot-token test runs on the PR Co-Authored-By: Claude <[email protected]>
…ssert the probes Refuse a token with no permission-* input (v3 skips empty ones, so it would hold every App permission). Clean the repositories list in bash and pass that to the mint step, refusing blanks and non-bare names. Write the bot identity to a job-scoped GIT_CONFIG_GLOBAL file instead of the runner's global config. The test mints with contents write, adds a positive control, and asserts marola-site is 403 or 404. Tested: actionlint; guard step exercised locally; the live bot-token test runs on the PR Co-Authored-By: Claude <[email protected]>
…party code (MIP-0086 §5.6) Tested: merge_key_check.py --self-test red then green; devkit quality gate Co-Authored-By: Claude <[email protected]>
…, containers and custom shells Tested: merge_key_check.py --self-test red then green; devkit quality gate Co-Authored-By: Claude <[email protected]>
…rit in any workflow once an allowlist exists Tested: merge_key_check.py --self-test red then green; devkit quality gate Co-Authored-By: Claude <[email protected]>
…mes as fallback (MIP-0086) notify-umbrella mints a marola-pr-bot token for the umbrella from pr_bot_key and still reads the old PAT in `token` when it is absent. gemini-review reads PR_BOT_* first, falls back to GEMINI_*, and no longer requires GEMINI_APP_PRIVATE_KEY. Tested: actionlint; devkit quality gate Co-Authored-By: Claude <[email protected]>
…086) Tested: actionlint; devkit quality gate Co-Authored-By: Claude <[email protected]>
…erit message A keyed job may call a local reusable workflow only when that file is itself on the allowlist, so the callee is scanned under the same rules. Tested: merge_key_check.py --self-test (red before, green after), merge_key_check.py ., ruff Co-Authored-By: Claude <[email protected]>
…y and the PR bot bot-token-test jobs get contents: read for checkout. The mint steps pass client-id (app-id is deprecated in create-github-app-token v3); actionlint's bundled v3 metadata predates it, so notify-umbrella.yml ignores those two messages. gemini-review callers pass secrets explicitly, since merge-key-check rejects inherit. The docs name the real secrets and the persist-credentials trap. Tested: merge_key_check.py --self-test and ., actionlint, devkit-quality.sh (quality rc=0) Co-Authored-By: Claude <[email protected]>
…own name; back to app-id
A caller could map `k: ${{ secrets.MERGE_BOT_KEY }}` to a listed local callee that
only reads secrets.k, so the callee never named the key and was never scanned.
The mapping entry must now be called MERGE_BOT_KEY. The mint steps pass app-id
again and the actionlint ignore block is gone; the README no longer claims the
GEMINI_APP_* names work next to a snippet that does not pass them.
Closes #79
Tested: merge_key_check.py --self-test (red without the fix, green with) and ., mkc-review probes a-d, actionlint, devkit-quality.sh (quality rc=0)
Co-Authored-By: Claude <[email protected]>
…run push (MIP-0086 §7) The first live run (38305859769) failed at the marola-site API probe with a code that was never printed. probe now prints the code and GitHub's message, the cross-repo API probe only fails on a 2xx, and a git push --dry-run with the bot token to devkit (must succeed) and marola-site (must be refused) is the scoping test §7 asks for. Tested: actionlint; devkit quality gate; probe() exercised unauthenticated Co-Authored-By: Claude <[email protected]>
…othing
Run 38306845732 printed `422 Invalid request.` for a `{}` POST to git/refs on both
marola-devkit and marola-site, a repo the token cannot reach: that endpoint validates the
body before checking permission, so 422 is not evidence of write access. The dry-run pushes
(devkit ok, marola-site 403) already prove contents scoping; the pulls probe stays, since
it returned 403 before validation.
Tested: actionlint; devkit quality gate (outside Nix); run 38306845732's printed codes
Co-Authored-By: Claude <[email protected]>
Resolve the CHANGELOG and docs/4-reference_tools.md conflicts with #109: keep both v0.9.0 bullets, and main's ruleset-sync row followed by this branch's merge-key-check row. Tested: devkit quality gate (outside Nix) on the merge result Co-Authored-By: Claude <[email protected]>
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.
Summary: The devkit side of MIP-0086's two Apps. A
bot-tokencomposite action mints a scopedmarola-pr-botormarola-merge-bottoken for named repos,merge-key-checkkeeps the merge bot's key out of jobs that run third-party code, andnotify-umbrellaandgemini-reviewmove to the PR bot with the old names as fallback. Closes #79.release.pyandmerge_key_check.pyself-tests red then green; actionlint; devkit quality gate run outside Nix (ruff 0.17.0 from a venv, flake.nix unevaluated). Live:bot-token testpassed against the realPR_BOT_KEYon the final head in run 38465551179.What changed
release.pymovesmarola-dev/marola-devkit/.github/actions/<name>@vX.Y.Zpins, so consumers'bot-tokenpin follows a release..github/actions/bot-token: mints with an explicit repo list underowner: marola-dev. It refuses an empty or malformed list (the token action reads"\r\n"as no list, which would cover every installed repo) and a call with nopermission-*set (which would inherit every permission the App holds). The bot's git identity goes to a gitconfig under$RUNNER_TEMP, exported asGIT_CONFIG_GLOBAL, so it ends with the job even on a self-hosted runner..github/workflows/bot-token-test.yml: the refusals, then a token for marola-devkit withcontents: writeonly. It must list exactly that repo, get 403 onpulls, succeed on agit push --dry-runto marola-devkit and be refused (403) on one to marola-site, and commit as<id>+marola-pr-bot[bot]. A{}POST togit/refsis not used: it returned 422 on marola-site as well, so it shows nothing about permission.scripts/merge_key_check.py, injust quality,tests/self-tests.shand the flake's tools:MERGE_BOT_KEY(matched case-insensitively, as GitHub resolves secret names) may appear only in workflows listed in.github/merge-key-allowlist. A keyed job fails on a third-party action, a reusable call other than a listed local one receiving the key under its own name,container/services, a shell other than bash or sh (step ordefaults), workflow-level env carrying the key, ornix/npm/pip/curland the like inrun:. Once the allowlist exists,secrets: inheritfails in every workflow of the repo.notify-umbrellatakespr_bot_keyand mints an umbrella-only Contents-write token; thetokenPAT is read only whenpr_bot_keyis absent.gemini-reviewreadsPR_BOT_*first,GEMINI_*second;GEMINI_APP_PRIVATE_KEYis no longer required.marola-gemini-botismarola-pr-botin present-tense prose; the action, the check andpr_bot_keyare in the reference pages; gemini-review's caller example passes secrets explicitly; one line in the unreleased v0.9.0 CHANGELOG entry.No consumer breaks at its next pin bump: callers passing only
token, or GEMINI_* secrets, behave as before.What this leaves for later rows:
merge-key-checkblockssecrets: inheritin any repo holding the merge key, so marola-dev/marola#766 (row 4) and #80 (row 8) must switch theirgemini.ymlto explicit secrets before adding an allowlist. The check reads workflows only; a checked-in script that itself runsnixorcurlis outside what it can see.This branch and
mip-0086/3-merge-bypassboth add a line to the v0.9.0 CHANGELOG entry; whichever merges second rebases.