ci: fail e2e ref lookup unless the branch is missing - #254
Merged
Merged
Conversation
git ls-remote --exit-code status 2 is a missing ref. Other statuses are transport failures and must not soft-fall back to main. migration-wallet-setup re-resolves that candidate immediately before checkout so a failed-job rerun does not reuse a deleted companion. Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
The wallet-setup workflow is called from the app repos, so the pre-checkout resolver must be synonymdev/bitkit-e2e-tests/...@main, matching the other callers. Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
This was referenced Sep 22, 2026
pwltr
approved these changes
Sep 22, 2026
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.
Fixes the two correctness gaps Phil flagged on the app PRs that call
resolve-e2e-ref@main:Please include ben-kaufman and pwltr as reviewers (same as the twin app PRs).
Missing ref vs transport failure
git ls-remote --exit-codereturns 2 when no ref matches. DNS, auth, and other lookup failures return a different status (128 for the fatal cases checked here). The action treated every nonzero status as “branch missing”, so a transient lookup could soft-fall back tomainand let CI pass against a different harness.resolve-e2e-refnow captures the status and stderr:mainon the default companion path, hard-fail for an explicit custome2e_branch::errorand thels-remotestderr. No fallback.The same split is in
determine-e2e-branch.yml. That job is the first lookup. If it still treated a transport error as “missing”, it would emitmain, andresolve-e2e-refwould then skip the re-check because the selected ref is already the fallback.Migration wallet setup re-resolves before checkout
iOS passes a ref from a separate successful
resolve-e2e-refjob intomigration-wallet-setup.yml. “Re-run failed jobs” does not re-run that job, so a companion deleted after resolve stayed stale and checkout failed again.The reusable workflow now runs
resolve-e2e-refimmediately before checkout, pinned to this repo the same way the app workflows call it:The workflow is called from bitkit-ios and bitkit-android, so the action reference has to name this repository. A workspace-relative
./.github/actions/...would look in the caller checkout instead.Input contract (backward compatible)
e2e_branchneeds.resolve-e2e-ref.outputs.ref).e2e_branch_inputmain|default-feature-branch| custom branch name. Empty inherits the callerworkflow_dispatchinpute2e_branch, thendefault-feature-branch. A custom name hard-fails when the ref is missing; the default companion path soft-falls back tomain.No app-repo change is required for the current iOS caller: a deleted companion soft-falls back on re-run, and a dispatch that named a custom branch still hard-fails because that name is on
github.event.inputs.e2e_branch. Callers can passe2e_branch_inputexplicitly to override that.Verification
git ls-remote --exit-code: existingmain→ 0, absent ref → 2, unresolvable host → 128 (fatal: unable to access … Could not resolve host).main; status 2 + custom name → hard-fail; status 1 and 128 → fail with stderr, norefoutput; empty or already-fallback selected skipsls-remote.determine-e2e-branchunderbash --noprofile --norc -eo pipefail(the GitHub Actionsshell: bashinvocation):ref_statusreturning 2 fromif ref_statusstill soft-falls back tomainand the step continues. A found ref is kept. Transport status 128 fails with no fallback. A missing custom branch still hard-fails.