Skip to content

fix(fleet-sync): fail the run when no App token was minted, and mint with client-id - #346

Merged
Gerrrt merged 1 commit into
mainfrom
fix/fleet-sync-fails-without-app-token
Nov 23, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
fix/fleet-sync-fails-without-app-token

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

What and why

fleet-sync.yml's mint is continue-on-error, and the PR step falls back to GITHUB_TOKEN. So if the App can't reach this repo, or the org never shared FLEET_APP_PRIVATE_KEY with it, the metrics job stays green while its refresh PR sits BLOCKED with no CI. dotgibson/dotfiles-nvim#16 went unnoticed exactly that way.

  • A last step in the metrics job fails the run when no token was minted. The error says whether the secret or variable isn't shared with this repo, or the App isn't installed on it.
    • It runs after the PR step, so the PR still opens.
    • It runs after the swept marker is saved, so the hourly poll won't re-run a red sweep on a fleet state it has already seen.
    • It's limited to github.repository_owner == 'dotgibson', so a fork doesn't go red. This workflow has no job-level owner guard.
  • The mint moves from the retired FLEET_APP_ID / app-id to FLEET_APP_CLIENT_ID / client-id, matching every other consumer since dotfiles-core#831. FLEET_APP_CLIENT_ID is already visible to this repo. Without this, deleting FLEET_APP_ID would break the bot in the same silent way.

The same step went into dotfiles-core's freshness.yml (dotgibson/dotfiles-core#1290), dotfiles-nvim's (dotgibson/dotfiles-nvim#18), and dotfiles-Windows' three sync bots (dotgibson/dotfiles-Windows#301).

Checks

  • The workflow parses, and the metrics job ends with: record swept → save marker → the new step.
  • Not run locally: actionlint, and the site build. CI covers both. The failure path only fires when the key or install is missing, which it currently isn't here.

…with client-id

The mint is continue-on-error and the PR step falls back to
GITHUB_TOKEN, so a repo the App cannot reach, or one the org never
shared FLEET_APP_PRIVATE_KEY with, left the metrics job green while its
refresh PR sat BLOCKED with no CI. dotgibson/dotfiles-nvim#16 went
unnoticed that way.

The job now ends with a step that fails when no token was minted, after
the PR step so the PR still opens, and after the swept marker is saved
so the hourly poll does not re-run a red sweep on a fleet state it has
already seen. It is limited to the canonical repo, and says whether
the secret/variable or the App install is missing.

The mint also moves from the retired FLEET_APP_ID / app-id to
FLEET_APP_CLIENT_ID / client-id, as every other consumer did in
dotfiles-core#831: deleting FLEET_APP_ID would otherwise have broken
this bot in exactly the silent way the new step now reports.
Copilot AI balanced review requested due to automatic review settings November 23, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the workflow authentication and missing-token reporting changes.

No open issues 🎉

What changed in this PR

This PR makes missing App authentication visible in the fleet metrics refresh workflow while preserving the fallback PR and saved sweep marker.

Changes:

  • Migrates token minting from FLEET_APP_ID / app-id to FLEET_APP_CLIENT_ID / client-id.
  • Adds a final failure step for dotgibson-owned repositories when no App token was minted, with configuration diagnostics.
  • Keeps the failure after PR creation and marker saving, while exempting forks.
File Description
.github/​workflows/​fleet-sync.yml Updates App authentication and reports missing tokens after the refresh sweep completes.

Review effort: Balanced

@Gerrrt
Gerrrt merged commit 094b19f into main Nov 23, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the fix/fleet-sync-fails-without-app-token branch November 23, 2026 20:46
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