fix: bug: init branch-protection setup gives up after 3 short retries — forgejo needs more time to index freshly-created branches (#588)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful

Extract branch-wait retry logic into _bp_wait_for_branch helper with
exponential backoff (10 attempts, 2s base, capped at 10s per wait,
~70s worst-case). Replaces the 3-attempt/2s-fixed loops in all three
setup functions. Upgrade caller warnings in bin/disinto to ERROR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-10 15:41:55 +00:00
parent 506a00151b
commit 73fded12c8
2 changed files with 57 additions and 74 deletions

View file

@ -708,7 +708,7 @@ p.write_text(text)
if setup_vault_branch_protection "$branch"; then
echo "Branch protection: vault protection configured on ${ops_slug}"
else
echo "Warning: failed to set up vault branch protection" >&2
echo "ERROR: failed to set up vault branch protection — security rules not applied" >&2
fi
unset FORGE_OPS_REPO
@ -769,7 +769,7 @@ p.write_text(text)
if setup_project_branch_protection "$forge_repo" "$branch"; then
echo "Branch protection: project protection configured on ${forge_repo}"
else
echo "Warning: failed to set up project branch protection" >&2
echo "ERROR: failed to set up project branch protection — security rules not applied" >&2
fi
# Generate VISION.md template