Repository navigation
fix(fleet-sync): fail the run when no App token was minted, and mint with client-id - #346
Merged
Merged
Conversation
…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.
There was a problem hiding this comment.
🟢 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-idtoFLEET_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
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.
What and why
fleet-sync.yml's mint iscontinue-on-error, and the PR step falls back toGITHUB_TOKEN. So if the App can't reach this repo, or the org never sharedFLEET_APP_PRIVATE_KEYwith it, the metrics job stays green while its refresh PR sitsBLOCKEDwith no CI. dotgibson/dotfiles-nvim#16 went unnoticed exactly that way.github.repository_owner == 'dotgibson', so a fork doesn't go red. This workflow has no job-level owner guard.FLEET_APP_ID/app-idtoFLEET_APP_CLIENT_ID/client-id, matching every other consumer since dotfiles-core#831.FLEET_APP_CLIENT_IDis already visible to this repo. Without this, deletingFLEET_APP_IDwould 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