fix: repin fleet with normal push and propagate failures#220
Merged
Conversation
The fleet-e2e repin job force-pushed to each example repo's protected main, which the ruleset rejects, and then swallowed the rejection so the job reported green while pushing nothing. Suites then validated a stale pin under a fresh-rc label. Replace the force push with a normal fast-forward push plus a bounded fetch/reset/re-apply/retry loop, mirroring the state-writer's commitWithApplicationRetry. Capture the push exit status explicitly, record per-repo failures, and exit non-zero if any repo's regen or push fails. Add a post-push assertion that reads each repo's main cli_version back and fails the job if it is not the rc, so a silent no-op can never report green. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The fleet-e2e
repinjob had two bugs found by an end-to-end run:git push --force-with-lease origin HEAD:mainto each example repo, which the protected-main ruleset rejects (push declined due to repository rule violations). Write access exists - the suites' own state-writes to the same main succeed via a normal push - the force is what is blocked.echoafter the push ran regardless, the subshell exited 0, and the job reported green while pushing nothing. Suites then validated a stale pin under a fresh-rc label.Fix
git push origin HEAD:main). The repin clones fresh main, so the first push is a fast-forward and needs no force.git fetch origin main && git reset --hard origin/main, re-apply the cli_version sed +generate-workflow --force, re-commit, push, up to 5 attempts. This mirrors the state-writer's commitWithApplicationRetry.cli_versionback via the contents API and fail the job if it is not the rc, so a silent no-op can never report green.Verification
[ -n "$failed" ] && exit 1reds the job, and thus the fleet gate, so no promote on a stale fleet.If a normal push is also rejected, the job now fails loudly with the exact rejection captured, signalling a genuine ruleset/write block that needs a maintainer protection bypass.