ci: fall back when e2e clone ref is gone - #1318
Conversation
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
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: ubuntu-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: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Update the TEMPORARY Problem: Replace the file with: name: resolve-e2e-ref smoke
on:
pull_request:
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
push:
branches:
- 'cursor/e2e-clone-missing-branch-fallback-d3b1'
paths:
- '.github/workflows/resolve-e2e-ref-smoke.yml'
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
case_filter:
description: "Which matrix cases to run (all|A|B|C)"
required: false
default: "all"
type: string
jobs:
determine:
strategy:
fail-fast: false
matrix:
include:
- case: A
e2e_branch: main
pre_resolve_sleep_seconds: "0"
- case: B
e2e_branch: default-feature-branch
pre_resolve_sleep_seconds: "0"
- case: C
e2e_branch: default-feature-branch
pre_resolve_sleep_seconds: "90"
# Filter via dispatch input when present; on push/PR run all
if: |
github.event_name != 'workflow_dispatch' ||
inputs.case_filter == 'all' ||
inputs.case_filter == matrix.case
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
with:
app_branch: ${{ github.ref_name }}
e2e_branch_input: ${{ github.event_name == 'workflow_dispatch' && inputs.e2e_branch || matrix.e2e_branch }}
resolve:
needs: determine
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- case: A
e2e_branch: main
pre_resolve_sleep_seconds: "0"
- case: B
e2e_branch: default-feature-branch
pre_resolve_sleep_seconds: "0"
- case: C
e2e_branch: default-feature-branch
pre_resolve_sleep_seconds: "90"
if: |
github.event_name != 'workflow_dispatch' ||
inputs.case_filter == 'all' ||
inputs.case_filter == matrix.case
steps:
- name: Optional pre-resolve sleep
if: (github.event_name == 'workflow_dispatch' && inputs.pre_resolve_sleep_seconds != '0') || matrix.pre_resolve_sleep_seconds != '0'
run: |
SECONDS_TO_SLEEP="${{ github.event_name == 'workflow_dispatch' && inputs.pre_resolve_sleep_seconds || matrix.pre_resolve_sleep_seconds }}"
echo "Sleeping ${SECONDS_TO_SLEEP}s before resolve (case ${{ matrix.case }})..."
sleep "$SECONDS_TO_SLEEP"
- 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: ${{ github.event_name == 'workflow_dispatch' && inputs.e2e_branch || matrix.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 "case=${{ matrix.case }}"
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"IMPORTANT: reusable workflow_call jobs cannot use 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-missing-branch-fallback-d3b1'
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: ubuntu-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"Use the SIMPLER approach (second YAML). Commit message: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Replace name: resolve-e2e-ref smoke
on:
push:
branches:
- 'cursor/e2e-clone-missing-branch-fallback-d3b1'
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: ubuntu-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: ubuntu-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: ubuntu-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: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Replace name: resolve-e2e-ref smoke
on:
push:
branches:
- 'cursor/e2e-clone-missing-branch-fallback-d3b1'
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: ubuntu-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: |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@cursor Delete the TEMPORARY file |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
resolve-e2e-ref smoke — Android PASS (3/3)Wiring to
Runs:
Temporary smoke workflow removed ( |
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
|
pwltr
left a comment
There was a problem hiding this comment.
Requesting changes for one correctness issue in the new ref resolver integration. The resolver must distinguish a missing branch from a Git transport failure so CI cannot silently test the fallback branch after an infrastructure error.
jvsena42
left a comment
There was a problem hiding this comment.
Only LOW findings, posted inline, which is why this is a COMMENT and not a block. No verifier pass was run, so read them as observations.
The prior CHANGES_REQUESTED point about telling a missing ref apart from a transport failure is still live at head. The resolver runs from bitkit-e2e-tests@main, and main still sends every nonzero ls-remote status to the soft fallback (action.yml:55, determine-e2e-branch.yml:60). The fix is only in synonymdev/bitkit-e2e-tests#254, which is still open. That PR's LS_STATUS capture is correct under set -euo pipefail and only status 2 falls back. Merge order: #254 must land before or together with this PR. Merged alone, this PR adds another unguarded lookup per shard.
Checked and clean:
- No
github.head_refor other attacker-controlled value is interpolated into arun:that this PR adds. e2e_branch_inputis the same at every call site and matches the determine input.- A missing custom branch still fails hard, and an empty
selectedresolves tomainwithout a network call. - The temporary smoke workflow is removed at head.
Pre-existing and outside this PR: determine-e2e-branch.yml:30 in bitkit-e2e-tests interpolates inputs.app_branch straight into bash, and #254 does not change that line. It should be raised in that repo.
Co-authored-by: piotr-iohk <piotr-iohk@users.noreply.github.com>
|
@jvsena42 thanks — addressed:
Re-requesting Phil once iOS twin has the same soften. |
jvsena42
left a comment
There was a problem hiding this comment.
Delta since ac52b617 (1ff0fd123): no findings. The LOW is fixed. The slack-report resolve step has continue-on-error: true, and checkout falls back to main. synonymdev/bitkit-e2e-tests#254 is merged, so the fail-closed shard lookups are live on @main, and the earlier transport-vs-missing-ref concern no longer depends on merge order.
pwltr
left a comment
There was a problem hiding this comment.
Re-reviewed after synonymdev/bitkit-e2e-tests#254 merged. The shared resolver now distinguishes missing refs from transport failures, and this head keeps Slack reporting available when its non-critical re-resolution fails. The prior blocker is resolved.


Twin: bitkit-ios#767
This PR stops Clone E2E tests from hard-failing when the determined companion branch is gone by the time checkout runs, using the shared
resolve-e2e-refcomposite action from bitkit-e2e-tests#252 (merged; pin is@main).determine-e2e-branchalready falls back tomainwhen the same-named companion is missing at determine time. Clone still used that output asactions/checkoutrefblindly. If the companion is deleted between determine and clone, or a failed-only re-run keeps a stale determine output, checkout fails (fetch exit 1). Example: run 35594055695, Clone E2E tests (E2E_BRANCH: fix/724-lock-on-background).Description
resolve-e2e-refaction immediately before each clone so a missing companion falls back tomainwith a warning, instead of failing checkout.e2e_branchis an explicit missing custom branch, so that case stays actionable.usestosynonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@mainafter e2e#252 merged.Out of Scope
determine-e2e-branchin bitkit-e2e-tests: still only checks the companion at determine time.Design
N/A — no UI changes.
Preview
N/A
QA Notes
Manual Tests
N/A
Automated Checks
.github/workflows/e2e.yml,e2e-staging.yml, ande2e_migration.yml..github/actions/resolve-e2e-ref/action.ymlonmain.@ci/resolve-e2e-refpins remain; allresolve-e2e-refuses are@main.e2e_branch, to confirm fallback vs hard-fail (after merge).