diff --git a/.github/actions/gnome-e2e/action.yml b/.github/actions/gnome-e2e/action.yml index 6d2bb35e1..cb8d5052d 100644 --- a/.github/actions/gnome-e2e/action.yml +++ b/.github/actions/gnome-e2e/action.yml @@ -75,11 +75,26 @@ runs: # ── Checkout test content ───────────────────────────────────────────────── # Match the action repository/ref, including local calls on fork branches. + # Resolve them in a run step: inside the checkout step itself + # github.action_repository names actions/checkout, so the checkout fetched + # testsuite's commit from the wrong repository ("not our ref", canary run + # 42919533096). A local ./ call has no action repository; fall back to the + # caller's repository. + - name: Resolve testsuite source + id: testsuite-source + shell: bash + env: + ACTION_REPOSITORY: ${{ github.action_repository }} + ACTION_REF: ${{ github.action_ref }} + run: | + echo "repository=${ACTION_REPOSITORY:-${GITHUB_REPOSITORY}}" >> "$GITHUB_OUTPUT" + echo "ref=${ACTION_REF}" >> "$GITHUB_OUTPUT" + - name: Checkout testsuite uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: - repository: ${{ github.action_repository || github.repository }} - ref: ${{ inputs.testsuite-ref || github.action_ref }} + repository: ${{ steps.testsuite-source.outputs.repository }} + ref: ${{ inputs.testsuite-ref || steps.testsuite-source.outputs.ref }} path: _testsuite sparse-checkout: | tests/${{ inputs.suite }} @@ -143,8 +158,11 @@ runs: BOOTC_INSTALL_LOG="$(pwd)/bootc-install.log" set +e + # --pid=host: bootc install refuses to run without it ("This command + # must be run with the podman --pid=host flag", canary run 42923546804); + # e2e.yml's install step already passes it. sudo podman run \ - --rm --privileged \ + --rm --privileged --pid=host \ --security-opt label=type:unconfined_t \ -v /var/lib/containers:/var/lib/containers \ -v /dev:/dev \ @@ -209,12 +227,34 @@ runs: EFI_PART="${LOOP}p2" sudo mkdir -p /mnt/efi sudo mount "${EFI_PART}" /mnt/efi - BLS_FILE=$(sudo find /mnt/efi/loader/entries -name '*.conf' 2>/dev/null | head -1) + # When bootc's bootloader step failed (bootupd, the expected late + # failure above) there is no loader/entries directory: find exits + # non-zero, which under pipefail ended this step silently before the + # fallback below could run (canary run 42929881520). + BLS_FILE=$(sudo find /mnt/efi/loader/entries -name '*.conf' 2>/dev/null | head -1 || true) if [[ -n "${BLS_FILE}" ]]; then BLS_OPTS=$(sudo grep '^options' "${BLS_FILE}" | sed 's/^options //') else - DEPLOY_HASH="${DEPLOY%.*}" - BLS_OPTS="root=UUID=${ROOT_UUID} rw ostree=/ostree/boot.1/default/${DEPLOY_HASH}/0 systemd.firstboot=no" + # No BLS entry (bootc's bootloader step failed): find the deployment's + # real ostree boot entry, as e2e.yml and startup-qualification.yml do. + # Guessing /ostree/boot.1/default//0 left ostree-prepare-root + # with "Couldn't find specified OSTree root" (canary run 42932368882). + BOOT_ENTRY=$(sudo find /mnt/root/ostree -maxdepth 4 -type l -name '0' | grep -E '/boot\.[0-9]' | grep '/default/' | head -1 || true) + if [[ -z "${BOOT_ENTRY}" ]]; then + BOOT_DIR="/mnt/root/ostree/boot.0/default/${DEPLOY%.*}" + sudo mkdir -p "${BOOT_DIR}" + sudo ln -sfT "../../../deploy/default/deploy/${DEPLOY}" "${BOOT_DIR}/${DEPLOY##*.}" + BOOT_ENTRY="${BOOT_DIR}/${DEPLOY##*.}" + fi + OSTREE_PATH="${BOOT_ENTRY#/mnt/root}" + # ostree-system-generator only parses /ostree/boot.[01]/... (see e2e.yml). + if [[ "${OSTREE_PATH}" =~ /ostree/(boot\.[0-9]+)\.[0-9]+ ]]; then + VERSIONED=$(echo "${OSTREE_PATH}" | grep -oE 'boot\.[0-9]+\.[0-9]+') + [[ -e "/mnt/root/ostree/${BASH_REMATCH[1]}" ]] || sudo ln -s "${VERSIONED}" "/mnt/root/ostree/${BASH_REMATCH[1]}" + OSTREE_PATH="${OSTREE_PATH/${VERSIONED}/${BASH_REMATCH[1]}}" + fi + echo "ostree boot entry: ${OSTREE_PATH}" + BLS_OPTS="root=UUID=${ROOT_UUID} rw ostree=${OSTREE_PATH} systemd.firstboot=no" fi GNOME_E2E_KERNEL_ARGS="${BLS_OPTS} console=ttyS0,115200 quiet" echo "GNOME_E2E_KERNEL_ARGS=${GNOME_E2E_KERNEL_ARGS}" >> "$GITHUB_ENV" diff --git a/.github/workflows/gnomeos-canary.yml b/.github/workflows/gnomeos-canary.yml index 049bba53a..13e79e0fd 100644 --- a/.github/workflows/gnomeos-canary.yml +++ b/.github/workflows/gnomeos-canary.yml @@ -10,7 +10,10 @@ permissions: jobs: canary: - runs-on: ubuntu-latest + # Pinned: on ubuntu-26.04 (ubuntu-latest since 2026-11-09) bootc's + # loopback install stops with "root partition 3 has type "; the + # same image installs on 24.04 (#1123). Lift once it works on 26.04. + runs-on: ubuntu-24.04 timeout-minutes: 60 steps: - name: Checkout diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-desktop-canary.md b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-desktop-canary.md index db7b08372..55779cc0e 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-desktop-canary.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-desktop-canary.md @@ -26,6 +26,13 @@ to register manual dispatch. It also supports `workflow_call` from an existing workflow for fork experiments. It requests only `contents: read`, publishes no image, and uses no registry credentials. It is never scheduled automatically. +It runs on `ubuntu-24.04`, not `ubuntu-latest`: on 26.04 runners bootc's +loopback install fails with "root partition 3 has type " (#1123). The +`gnome-e2e` action resolves its own repository and ref in a run step before +checking out testsuite, because inside the checkout step +`github.action_repository` names `actions/checkout` (canary run 42919533096 +failed with "not our ref" for that reason). + On a Linux host with rootful Podman, Skopeo, curl, Python and KVM: ```bash diff --git a/tests/unit/test_gnome_e2e_action_summary.py b/tests/unit/test_gnome_e2e_action_summary.py index 038716836..7c32b35b8 100644 --- a/tests/unit/test_gnome_e2e_action_summary.py +++ b/tests/unit/test_gnome_e2e_action_summary.py @@ -373,6 +373,21 @@ def test_action_checks_out_the_summary_module(): assert "scripts" in checkout +def test_action_checkout_resolves_its_repository_outside_the_checkout_step(): + """Inside the checkout step github.action_repository names actions/checkout. + + Reading it there made the canary fetch testsuite's commit from + actions/checkout ("not our ref"); the repository and ref must come from + the earlier run step. + """ + checkout = _action_text().partition("- name: Checkout testsuite")[2].partition("- name:")[0] + + assert "github.action_repository" not in checkout + assert "github.action_ref" not in checkout + assert "steps.testsuite-source.outputs.repository" in checkout + assert "steps.testsuite-source.outputs.ref" in checkout + + def _gate_step() -> str: step = _action_text().partition("- name: Gate extension-validation run")[2] assert step, "Gate extension-validation run step not found in the gnome-e2e action"