Skip to content

fix(fleet-app): fail a self-PR bot that cannot mint, and register dotfiles-nvim - #1290

Merged
Gerrrt merged 2 commits into
mainfrom
fix/fleet-app-nvim-self-pr
Nov 23, 2026
Merged

Gerrrt merged 2 commits into
mainfrom
fix/fleet-app-nvim-self-pr

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

What & why

freshness.yml's two PR-opening jobs fall back to GITHUB_TOKEN when the fleet App mint is skipped or fails. GitHub starts no workflow for a PR opened with that token, so the run stayed green while the PR sat BLOCKED waiting on required checks that never came. That happened in dotgibson/dotfiles-Windows#265, and again in dotgibson/dotfiles-nvim#16: that repo's bot has minted tokens since #1123, but the repo was never registered and the org secret was never shared with it.

  • freshness.yml: each PR-opening job (zsh-plugins, fleet-versions) ends with a step that fails the run if no token was minted. It runs after the PR step, so the PR still opens, and the error says which half is missing: the secret or variable not shared with the repo, or the App not installed. A red scheduled run is what notify-failure already files as an issue, and its details now mention this cause.
  • scripts/fleet-app-scope.sh: dotfiles-nvim joins EXTRA_REPOS as the fourth self-PR install. Without this, the weekly reach check would report the newly added nvim install as an EXTRA row. Counts move from thirteen to fourteen.
  • GITHUB-APP-AUTH.md: adds an nvim bullet and a verb-table row (90-policy-gates.sh holds EXTRA_REPOS to that section). It also documents a third registration a self-PR repo needs, which no register can read without org admin: FLEET_APP_PRIVATE_KEY must be shared with the repo. That's why the bot's own red run is the detector.
  • CHANGELOG.md: a Fixed entry.

The nvim side of the same step is dotgibson/dotfiles-nvim#18. The org-side half is done: the key is shared with dotfiles-nvim and the App is installed there. A mode=pr run today logged HAS_APP_KEY: true and opened dotgibson/dotfiles-nvim#17 as dotgibson-fleet-sync.

Linked issue

No-Issue: found and fixed while unblocking dotgibson/dotfiles-nvim#16, never filed

Is it actually Core?

  • Identical on every machine. This is repo-meta (CI workflow, a fleet register script, docs), not vendored Core.
  • Not offensive tooling

Contract & checks

  • No Core file added or removed; core.manifest is unchanged
  • make audit is not green locally. It couldn't complete on this Windows/Git Bash box: audit-changed timed out in fleet coverage, and the behavioral suite fails across the board on symlink and tmux fixtures that need a Unix host. What I did verify:
    • The fleet-app-scope assertions from 90-policy-gates.sh, reproduced by hand: EXTRA_REPOS is a single line; all four entries are named in "Where the App is installed"; htpx is absent; only one repo array exists.
    • bash -n passes on both scripts, and fleet-app-scope.sh --help exits 0.
    • freshness.yml parses, and both PR jobs end with the new step.
    • gitleaks, shellcheck, markdownlint and actionlint were not installed and did not run. CI is the gate for those.
  • Exec bits unchanged
  • No new file needs a symlink

Notes

dotfiles-web's fleet-sync.yml and dotfiles-Windows' three sync bots use the same continue-on-error fallback. The new doc section says the same step belongs in every self-PR bot, but those workflows live in their own repos and are not touched here.

🤖 Generated with Claude Code

…files-nvim

freshness.yml's PR jobs fall back to GITHUB_TOKEN when the App mint is
skipped or fails, and GitHub starts no workflow for a PR that token
opens. So a repo the App cannot reach, or one the org never shared
FLEET_APP_PRIVATE_KEY with, ran green while its PR sat BLOCKED on
required contexts that never arrived: dotfiles-Windows#265, and now
dotgibson/dotfiles-nvim#16, whose bot has minted since #1123 but whose
repo was never registered or shared the key.

Each PR-opening job now ends with a step that reds the run when no
token was minted, after the PR step so the PR still opens, naming
whether the secret/variable or the install is the missing half; the
red scheduled run is what notify-failure files as an issue.

dotfiles-nvim joins EXTRA_REPOS as the fourth self-PR install, with its
bullet and verb row in GITHUB-APP-AUTH.md (the policy suite holds the
two together), and the doc records the third registration a self-PR
repo needs that no register here can read: the org secret shared with
it.

No-Issue: found while unblocking dotgibson/dotfiles-nvim#16, never filed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 20:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation contradicts nvim’s required EXTRA_REPOS registration and overstates missing-secret guard coverage for self-PR bots.

2 open issues
What changed in this PR

This PR makes missing fleet App credentials visible in Core’s self-PR workflows and registers dotfiles-nvim in the expected App installation scope.

Changes:

  • Add post-PR failure guards to both PR-opening freshness jobs and expand failure-notification details.
  • Register dotfiles-nvim, bringing the expected App installation count to fourteen repositories.
  • Document secret-sharing requirements and record the fix in the changelog.
File Description
scripts/​test/​90-policy-gates.sh Update comments and failure text for four installation exceptions.
scripts/​fleet-app-scope.sh Add dotfiles-nvim to the expected App installation scope.
GITHUB-APP-AUTH.md Document nvim access and self-PR credential requirements.
CHANGELOG.md Record the token-failure reporting and registration fixes.
.github/​workflows/​freshness.yml Fail PR-mode jobs when no App token was minted and update notification details.

Review effort: Balanced

Comment thread GITHUB-APP-AUTH.md Resolved
Comment thread scripts/fleet-app-scope.sh Resolved
@Gerrrt
Gerrrt enabled auto-merge (squash) November 23, 2026 20:27
…luding nvim from EXTRA_REPOS

GITHUB-APP-AUTH.md said every self-PR bot now fails when it cannot
mint; only Core's freshness.yml and dotfiles-nvim's do. It now names
the four bots that still fall back silently (dotfiles-web's
fleet-sync.yml, dotfiles-Windows' three sync bots), so an operator is
not told a key un-shared from those repos is being watched.

scripts/os-repos.txt still said dotfiles-nvim belongs in neither this
list nor EXTRA_REPOS, which would have sent a maintainer to undo the
registration this PR adds. It now says nvim stays out of the fan-out
list and in EXTRA_REPOS, for its own self-PR mint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the App-token guards and installation-scope updates.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@Gerrrt
Gerrrt merged commit 3d5a5e5 into main Nov 23, 2026
14 checks passed
@Gerrrt
Gerrrt deleted the fix/fleet-app-nvim-self-pr branch November 23, 2026 20:47
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.

2 participants