fix(ci): fetch the bot branch before pushing with a lease - #33
Merged
Conversation
The regenerate run did everything correctly -- pulled manifests, regenerated
the operator objects, stood up the cluster, installed every operator, fetched
the swagger, regenerated the client, committed 142k lines -- and then failed on
the last line:
! [rejected] feat/regenerate-ops-client (stale info)
--force-with-lease compares against a local ref for the remote branch, and
actions/checkout does not fetch that branch. With nothing to compare, git
refuses rather than assuming. So the first run succeeds (no remote branch yet)
and every run after it fails, having already spent ten minutes doing the work.
Fetching the branch first makes the lease meaningful rather than removing it:
the push still refuses if someone else moved the branch, which is worth keeping
for a branch a human may have pushed a fix to.
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.
The regenerate run did everything right and failed on the last line:
--force-with-leasecompares against a local ref for the remote branch, andactions/checkoutdoesn't fetch that branch. With nothing to compare against, git refuses rather than assuming — so the first run succeeds (no remote branch exists yet) and every run after it fails, having already spent ten minutes doing the work.Fetching the branch first makes the lease meaningful rather than removing it. The push still refuses if someone else moved that branch, which is worth keeping since a human may have pushed a fix onto it.
The run itself was a success
Worth recording, since this was the workflow's first execution in its rewritten form. Every new step worked:
pull:allandcodegen— 7 operators, nginx gone, traefik and tekton presentcilium installat runtimeOnly the push was wrong.