ci: fail closed when e2e ref lookup is not a missing branch - #253
Draft
piotr-iohk wants to merge 1 commit into
Draft
piotr-iohk wants to merge 1 commit into
piotr-iohk wants to merge 1 commit into
Conversation
git ls-remote --exit-code returns 2 only when the ref is absent. DNS, auth, and other transport errors were taking the missing-branch path, so a blip could silently run CI against main. Re-resolve inside migration-wallet-setup immediately before checkout so a failed-job rerun does not reuse a stale companion ref. Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
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 two correctness gaps Phil (pwltr) found on the app twins that consume
resolve-e2e-ref@main:mainPlease include ben-kaufman and pwltr as reviewers (same as the twin app PRs).
Transport errors are not a missing ref
git ls-remote --exit-code(git 2.43, checked locally):fatal: ...reasonresolve-e2e-refused to send every nonzero status down the missing-branch path (>/dev/null 2>&1). A DNS or auth blip could therefore warn and check outmain.The action now:
mainfordefault-feature-branch/main, hard-fail for an explicit custome2e_branch_input::errorand fail the step. stderr is kept in the log (not redirected away) and norefoutput is writtenThe same distinction is in
determine-e2e-branch.yml. That job runs first, andresolve-e2e-reftreatsselected == mainas already settled, so a transport error swallowed at determine time would still check outmainfor the rest of the run.Migration wallet setup re-resolves before checkout
iOS
prepare-walletscallsmigration-wallet-setup.yml. On master it passesneeds.e2e-branch.outputs.branch. ios#767 passesneeds.resolve-e2e-ref.outputs.reffrom a separate job. "Re-run failed jobs" does not re-run that successful resolve job, so a companion deleted after resolve is checked out again and fails again.The reusable workflow now runs
resolve-e2e-refimmediately beforeactions/checkout. Android migration already resolves in-job and does not call this workflow.The action is referenced as
synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@main. A relativeusesinside a reusable workflow resolves against the caller (bitkit-ios), not this repo.Input contract (backward compatible)
e2e_branch(required, same name): candidate to re-validate. Callers can keep passing determine's output or a previously resolved ref.e2e_branch_input(optional, defaultdefault-feature-branch): same policy as the action. A missing companion warns and usesmain. An explicit custom name hard-fails.Callers that only pass
e2e_branch(iOS master, and ios#767 as written) therefore soft-fall back when that candidate is gone. That fixes the stale-companion rerun without an app change. After this merges, iOS migration wallet setup on master will clonemainwith a warning instead of failing checkout when the determined companion has been deleted.ios#767 should also pass the dispatch input so an explicit custom branch still hard-fails inside this job, and can pass determine's output directly (the separate resolve job is no longer what keeps the wallet checkout current):
Verification
Ran the bash from both YAML files with
bash -eo pipefail(GitHub's default shell flags):default-feature-branch→mainplus the existing warningInvalid e2e_branch, norefoutputmain→ nols-remotegit ls-remoteagainst this repo for a missing ref (soft-fallback and custom hard-fail)git ls-remoteagainst a 404 repo → exit 128,Repository not foundin the log, no fallback