ci: fall back if e2e clone branch is gone - #767
piotr-iohk wants to merge 9 commits into
Conversation
Resolve the determined bitkit-e2e-tests ref immediately before checkout so companion cleanup and re-runs do not fail Clone E2E tests. Fall back to main with a warning unless an explicit custom e2e_branch is missing. Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
Replace duplicated inline resolve-e2e-ref bash in local, staging, and migration workflows with the composite action from bitkit-e2e-tests#252. Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Please add a TEMPORARY file name: resolve-e2e-ref smoke
on:
workflow_dispatch:
inputs:
e2e_branch:
description: "E2E branch input (main | default-feature-branch | custom)"
required: false
default: "default-feature-branch"
type: string
pre_resolve_sleep_seconds:
description: "Sleep before resolve job (race simulation)"
required: false
default: "0"
type: string
jobs:
determine:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.ref_name }}
e2e_branch_input: ${{ inputs.e2e_branch }}
resolve:
needs: determine
runs-on: macos-latest
steps:
- name: Optional pre-resolve sleep
if: inputs.pre_resolve_sleep_seconds != '0'
run: |
echo "Sleeping ${{ inputs.pre_resolve_sleep_seconds }}s before resolve..."
sleep "${{ inputs.pre_resolve_sleep_seconds }}"
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine.outputs.branch }}
e2e_branch_input: ${{ inputs.e2e_branch }}
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "selected=${{ needs.determine.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git branch -r || true
git log -1 --oneline
echo "PASS"Commit message: |
|
Temporary smoke workflow is on PR #767 (
No new PR. Dispatch |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Update the TEMPORARY Problem: Replace the file with this exact content (macos-latest for resolve): name: resolve-e2e-ref smoke
on:
workflow_dispatch:
inputs:
e2e_branch:
description: "E2E branch input"
required: false
default: "default-feature-branch"
type: string
pre_resolve_sleep_seconds:
description: "Sleep before resolve"
required: false
default: "0"
type: string
push:
branches:
- 'cursor/e2e-clone-branch-fallback-2163'
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
pull_request:
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
jobs:
determine:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.head_ref || github.ref_name }}
e2e_branch_input: ${{ inputs.e2e_branch || 'default-feature-branch' }}
resolve:
needs: determine
runs-on: macos-latest
steps:
- name: Optional pre-resolve sleep
if: ${{ (inputs.pre_resolve_sleep_seconds || '0') != '0' }}
run: |
echo "Sleeping ${{ inputs.pre_resolve_sleep_seconds }}s before resolve..."
sleep "${{ inputs.pre_resolve_sleep_seconds }}"
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine.outputs.branch }}
e2e_branch_input: ${{ inputs.e2e_branch || 'default-feature-branch' }}
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "selected=${{ needs.determine.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git branch -r || true
git log -1 --oneline
echo "PASS"Commit message: |
|
Updated the temporary smoke workflow on PR #767 so it can run from this branch.
Resolve stays on |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Replace name: resolve-e2e-ref smoke
on:
push:
branches:
- 'cursor/e2e-clone-branch-fallback-2163'
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
pull_request:
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
workflow_dispatch:
jobs:
determine-A:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.head_ref || github.ref_name }}
e2e_branch_input: main
resolve-A:
needs: determine-A
runs-on: macos-latest
steps:
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine-A.outputs.branch }}
e2e_branch_input: main
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "case=A"
echo "selected=${{ needs.determine-A.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git log -1 --oneline
echo "PASS"
determine-B:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.head_ref || github.ref_name }}
e2e_branch_input: default-feature-branch
resolve-B:
needs: determine-B
runs-on: macos-latest
steps:
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine-B.outputs.branch }}
e2e_branch_input: default-feature-branch
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "case=B"
echo "selected=${{ needs.determine-B.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git log -1 --oneline
echo "PASS"
determine-C:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.head_ref || github.ref_name }}
e2e_branch_input: default-feature-branch
resolve-C:
needs: determine-C
runs-on: macos-latest
steps:
- name: Pre-resolve sleep for race simulation
run: |
echo "Sleeping 90s before resolve (case C race)..."
sleep 90
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine-C.outputs.branch }}
e2e_branch_input: default-feature-branch
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "case=C"
echo "selected=${{ needs.determine-C.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git log -1 --oneline
echo "PASS"Commit: |
|
Updated the temporary smoke workflow on PR #767. One push now runs cases A, B, and C on
Commit: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Replace name: resolve-e2e-ref smoke
on:
push:
branches:
- 'cursor/e2e-clone-branch-fallback-2163'
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
pull_request:
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
workflow_dispatch:
jobs:
determine-C:
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.head_ref || github.ref_name }}
e2e_branch_input: default-feature-branch
resolve-C:
needs: determine-C
runs-on: macos-latest
steps:
- name: Pre-resolve sleep for race simulation
run: |
echo "Sleeping 120s before resolve (case C race)..."
sleep 120
- name: Resolve e2e ref
id: e2e-ref
uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@ci/resolve-e2e-ref
with:
selected: ${{ needs.determine-C.outputs.branch }}
e2e_branch_input: default-feature-branch
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ steps.e2e-ref.outputs.ref }}
fetch-depth: 1
path: e2e-tests
- name: Confirm checkout
working-directory: e2e-tests
run: |
echo "case=C"
echo "selected=${{ needs.determine-C.outputs.branch }}"
echo "effective=${{ steps.e2e-ref.outputs.ref }}"
echo "HEAD=$(git rev-parse HEAD)"
git log -1 --oneline
echo "PASS"Commit: |
|
Smoke workflow on PR #767 is now Case C only.
Pushed immediately. No new PR. This push should start the smoke run. |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor On this same PR branch, make a tiny no-op edit to |
|
Pushed a no-op retry on PR #767. Added |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Delete the TEMPORARY file |
|
Removed Commit: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
resolve-e2e-ref smoke — iOS PASS (3/3)Wiring to
Runs:
Temporary smoke workflow removed ( |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
pwltr
left a comment
There was a problem hiding this comment.
Requesting changes for two correctness gaps: Git transport failures currently trigger a silent fallback, and the migration wallet setup still reuses a stale ref when failed jobs are retried.
| run: echo $E2E_BRANCH | ||
| - name: Resolve E2E tests ref | ||
| id: e2e-ref | ||
| uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@main |
There was a problem hiding this comment.
[P2] Distinguish a missing ref from transport failures. The referenced action runs git ls-remote --exit-code in an elif and sends every nonzero result through the missing-branch path. Exit status 2 means no matching ref, while DNS, authentication, and other transport failures return different statuses. A transient lookup failure can therefore fall back to main and let this workflow pass against a different test harness. Please capture the status, fall back only when it is 2, and fail for other errors. The same issue applies to the other new resolver invocations.
| - { name: migration_4-with-sweep, setup_type: sweep } | ||
| with: | ||
| e2e_branch: ${{ needs.e2e-branch.outputs.branch }} | ||
| e2e_branch: ${{ needs.resolve-e2e-ref.outputs.ref }} |
There was a problem hiding this comment.
[P2] Resolve the ref inside the migration wallet setup workflow. This value comes from a separate successful resolve-e2e-ref job, but a failed-jobs-only rerun does not rerun that successful prerequisite. If the companion branch disappears after resolution and the checkout inside migration-wallet-setup.yml fails, retrying failed jobs reuses this same stale value and fails again. The called workflow checks out inputs.e2e_branch directly, so the resolver needs to run there immediately before checkout (or otherwise be forced to rerun with the failed setup job).


Twin: bitkit-android#1318
This PR stops Clone E2E tests from hard-failing when
determine-e2e-branchresolved a same-named companion branch that is gone by the timeactions/checkoutruns.Android already hit this race: after companion cleanup, or on "Re-run failed jobs" that reuse a stale determine output, checkout of
synonymdev/bitkit-e2e-testsfails on fetch. Example: https://github.com/synonymdev/bitkit-android/actions/runs/35594055695/job/106339565695. iOS uses the same determine-then-clone pattern in the local, staging, and migration workflows.Resolve logic now lives in the shared composite action from synonymdev/bitkit-e2e-tests#252, which is merged. Workflows pin
resolve-e2e-refto@main.Description
synonymdev/bitkit-e2e-tests, so a deleted companion branch falls back tomainwith a::warninginstead of failing clone.::errorwhen a distinguishable explicite2e_branchinput (notmainordefault-feature-branch) is missing, so a requested custom harness branch is not silently replaced.resolve-e2e-refcomposite action from synonymdev/bitkit-e2e-tests#252 in each clone, shard (including macos), and Slack job instead of duplicating the resolve script inline.resolve-e2e-refjob in the migration workflow somigration-wallet-setupstill receives a job-level ref.@mainnow that e2e#252 is merged.Out of Scope
synonymdev/bitkit-e2e-testsreusable workflows:determine-e2e-branch.ymlandmigration-wallet-setup.ymlare unchanged; iOS only resolves the ref it passes in.Design
N/A — no UI changes.
Preview
N/A
QA Notes
Manual Tests
N/A
Automated Checks
e2e-tests.yml,e2e-staging.yml, ande2e_migration.ymlwith the shared composite action from synonymdev/bitkit-e2e-tests#252; parsed all three files after the swap.mainwith a warning; dispatch with a missing custome2e_branchshould still fail.