Skip to content

Comments

fix(repository): immediately re-clone on pull failure#844

Closed
arnaud-dezandee wants to merge 1 commit intopadok-team:mainfrom
arnaud-dezandee:fix/force-push
Closed

fix(repository): immediately re-clone on pull failure#844
arnaud-dezandee wants to merge 1 commit intopadok-team:mainfrom
arnaud-dezandee:fix/force-push

Conversation

@arnaud-dezandee
Copy link
Contributor

Fix the git bundle flow to immediately re-clone and retry when a pull fails (e.g. after a force-push), instead of returning an error and deferring recovery to the next reconciliation cycle.

  • Extract Bundle logic into bundleWithRetry(ref, isRetry) to support a single retry
  • On pull failure, delete the local repo and recursively call bundleWithRetry with isRetry=true
  • If the retry also fails, return a clear error instead of silently deferring

@github-project-automation github-project-automation bot moved this to 📋 Backlog in burrito Feb 24, 2026
@arnaud-dezandee
Copy link
Contributor Author

I did some more testing and this does not fix all issues I see on my deployment. Here is a log extract

time="2026-02-24T22:47:56Z" level=info msg="repository my-namespace/my-repository is out of sync with remote for ref feat/my-branch. Syncing..."
time="2026-02-24T22:47:56Z" level=info msg="cloning repository git@github.com:my-org/my-repo.git to /var/run/burrito/repositories/038dd31c2fcbf28f4e97b189008763d7f8803903f5854aa658c6f66844e43194/repository"
time="2026-02-24T22:48:01Z" level=info msg="creating local branch refs/heads/feat/my-branch from remote refs/remotes/origin/feat/my-branch"
time="2026-02-24T22:48:01Z" level=info msg="checking out branch refs/heads/feat/my-branch"
time="2026-02-24T22:48:02Z" level=info msg="pulling latest changes for repo git@github.com:my-org/my-repo.git on branch refs/heads/feat/my-branch"
time="2026-02-24T22:48:04Z" level=warning msg="failed to pull latest changes for ref refs/heads/feat/my-branch: non-fast-forward update, deleting local repository and re-cloning"
time="2026-02-24T22:48:04Z" level=info msg="cloning repository git@github.com:my-org/my-repo.git to /var/run/burrito/repositories/038dd31c2fcbf28f4e97b189008763d7f8803903f5854aa658c6f66844e43194/repository"
time="2026-02-24T22:48:10Z" level=info msg="creating local branch refs/heads/feat/my-branch from remote refs/remotes/origin/feat/my-branch"
time="2026-02-24T22:48:10Z" level=info msg="checking out branch refs/heads/feat/my-branch"
time="2026-02-24T22:48:10Z" level=info msg="pulling latest changes for repo git@github.com:my-org/my-repo.git on branch refs/heads/feat/my-branch"
time="2026-02-24T22:48:12Z" level=error msg="failed to get revision bundle for ref feat/my-branch: failed to pull latest changes for ref refs/heads/feat/my-branch after re-clone: non-fast-forward update"
time="2026-02-24T22:48:12Z" level=debug msg="Failed to get revision bundle for ref feat/my-branch: failed to pull latest changes for ref refs/heads/feat/my-branch after re-clone: non-fast-forward update" logger=events
object="{\"kind\":\"TerraformRepository\",\"namespace\":\"my-namespace\",\"name\":\"my-repository\",\"uid\":\"00000000-0000-0000-0000-000000000000\",\"apiVersion\":\"config.terraform.padok.cloud/v1alpha1\",\"resourceVersion\":\"1234567\"}"
reason=Reconciliation type=Warning
time="2026-02-24T22:48:12Z" level=info msg="finished reconciliation cycle for repository my-namespace/my-repository"

Will try #783 and see if that solves it

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in burrito Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant