You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor merge-ref retries per review; add merge_ref_retry_attempts
- Add try_fetch_merge_ref helper and loop over MERGE_REF_RETRY_ATTEMPTS
- Default 3 attempts; validate numeric config and document in README/plugin.yml
- Keep 2s then 5s backoff between attempts; non-merge-ref errors still fail fast
Made-with: Cursor
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,10 @@ Use this option for pipeline upload jobs that don't need to preserve local chang
42
42
43
43
Enable verbose logging with bash execution tracing (`set -x`). This shows each command being executed and can help debug issues with ssh-keyscan, git operations, or other checkout problems. When enabled, you'll see detailed output including command arguments and any error messages from underlying tools.
44
44
45
+
#### `merge_ref_retry_attempts` (integer)
46
+
47
+
How many times to try fetching the GitHub pull-request merge ref (`refs/pull/<n>/merge`) when using merge-ref checkout (see `BUILDKITE_PULL_REQUEST_USING_MERGE_REFSPEC` below). Defaults to `3`. Between attempts the hook waits 2 seconds after the first failure and 5 seconds after later failures. Set to `0` to skip merge-ref fetch attempts and fall back immediately.
48
+
45
49
#### `post_checkout` (object)
46
50
47
51
Options that run after the sparse checkout completes, in the `post-checkout` hook.
@@ -54,13 +58,11 @@ Convert the shallow clone into a full-depth clone by running `git fetch --unshal
54
58
55
59
### BUILDKITE_PULL_REQUEST_USING_MERGE_REFSPEC
56
60
When `BUILDKITE_PULL_REQUEST_USING_MERGE_REFSPEC=true`, the plugin will retry the
57
-
GitHub merge ref checkout if it sees the known "missing merge ref" failure:
58
-
59
-
- retry after 2 seconds
60
-
- retry after 5 seconds
61
-
- if the merge ref is still unavailable, fall back to the normal non-merge-ref
62
-
target (`BUILDKITE_BRANCH` when `BUILDKITE_COMMIT=HEAD`, otherwise
63
-
`BUILDKITE_COMMIT`)
61
+
GitHub merge ref checkout if it sees the known "missing merge ref" failure, up to
62
+
`merge_ref_retry_attempts` times (default `3`). Between attempts it waits 2 seconds
63
+
after the first failure and 5 seconds after subsequent failures. If the merge ref
64
+
is still unavailable, it falls back to the normal non-merge-ref target
65
+
(`BUILDKITE_BRANCH` when `BUILDKITE_COMMIT=HEAD`, otherwise `BUILDKITE_COMMIT`).
64
66
65
67
This retry logic only applies to the specific merge-ref-not-ready error. Other
0 commit comments