mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 11:07:42 +00:00
ci: run the layout-owner switch-on specs as an advisory PR check (dark, layout-owner build only) (#30582)
* ci: run the layout-owner switch-on specs as an advisory PR job Build the e2e app with ORCA_LAYOUT_OWNER=main through the existing e2e.yml (new layout_owner input, read only by the app and orcad builds), run the layout oracle, its positive control and the layout-owner acceptance specs with the save-divergence log on, and upload a summary by kind and spec. Not in the PR aggregate's needs. * ci: summarize divergence logs without a test report, and drop file-path ids from kinds * ci: switch-on job adds the stream-loss spec and the managed-SSH Docker lane, drops diff-word-wrap (fails switch off), and names each looped test in the summary * test(e2e): editor-model-host-isolation opens both files through the store's open action, so a layout-owner build's main holds the tabs * ci: the divergence summary skips a cut-short test report instead of failing * ci: re-run PR checks on a merge ref that includes the main typecheck repair (#30680)
This commit is contained in:
+105
-4
@@ -33,6 +33,12 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
# Why only the app builds read it: the orcad template build refuses a dark switch.
|
||||
layout_owner:
|
||||
description: Set to main to build with ORCA_LAYOUT_OWNER=main and record save-divergence reports
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
@@ -107,7 +113,12 @@ jobs:
|
||||
env:
|
||||
VITE_EXPOSE_STORE: 'true'
|
||||
ORCA_CI_MAIN_SOURCEMAPS: '0'
|
||||
run: pnpm run build:electron-vite:parallel --mode e2e
|
||||
LAYOUT_OWNER: ${{ inputs.layout_owner }}
|
||||
run: |
|
||||
if [ -n "$LAYOUT_OWNER" ]; then
|
||||
export ORCA_LAYOUT_OWNER="$LAYOUT_OWNER"
|
||||
fi
|
||||
pnpm run build:electron-vite:parallel --mode e2e
|
||||
|
||||
# The CLI emits into out/main too; start only after Electron finishes clearing that tree.
|
||||
- name: Build shared E2E CLI
|
||||
@@ -125,6 +136,11 @@ jobs:
|
||||
|
||||
- wait: e2e-cli
|
||||
|
||||
# The switch-on specs skip, rather than fail, when the build left no marker.
|
||||
- name: Check layout-owner build marker
|
||||
if: inputs.layout_owner == 'main'
|
||||
run: test -f out/main/ORCA_LAYOUT_OWNER_MAIN
|
||||
|
||||
- name: Check shared native runtime action
|
||||
id: native-runtime-action
|
||||
run: |
|
||||
@@ -325,6 +341,7 @@ jobs:
|
||||
- name: Run changed E2E specs
|
||||
env:
|
||||
TEST_FILES_JSON: ${{ inputs.test_files }}
|
||||
LAYOUT_OWNER: ${{ inputs.layout_owner }}
|
||||
run: |
|
||||
if [ -f config/scripts/ci-e2e-job-selection.mjs ]; then
|
||||
printf '%s\n' "$TEST_FILES_JSON" | node config/scripts/ci-e2e-job-selection.mjs > "$RUNNER_TEMP/general-e2e-specs"
|
||||
@@ -347,12 +364,43 @@ jobs:
|
||||
fi
|
||||
E2E_ENV=(SKIP_BUILD=1 ORCA_E2E_FORWARD_APP_LOGS=1 ORCA_E2E_WEB_CLIENT=1)
|
||||
E2E_PROJECT_ARGS=()
|
||||
if [ -n "$LAYOUT_OWNER" ]; then
|
||||
test -f out/main/ORCA_LAYOUT_OWNER_MAIN
|
||||
mkdir -p layout-divergence
|
||||
E2E_ENV+=(ORCA_LAYOUT_SAVE_DIVERGENCE_LOG="$PWD/layout-divergence/window-specs.jsonl")
|
||||
E2E_ENV+=(PLAYWRIGHT_JSON_OUTPUT_FILE="$PWD/layout-divergence/window-specs-results.json")
|
||||
E2E_PROJECT_ARGS+=('--reporter=list,json')
|
||||
fi
|
||||
if grep -l '@headful' "${TEST_FILES[@]}" >/dev/null; then
|
||||
E2E_PROJECT_ARGS+=(--project=electron-headful)
|
||||
fi
|
||||
xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env "${E2E_ENV[@]}" \
|
||||
pnpm run test:e2e "${TEST_FILES[@]}" --workers=1 "${E2E_PROJECT_ARGS[@]}"
|
||||
|
||||
- name: Summarize layout save divergence
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
run: &summarize_layout_divergence |
|
||||
# Either file names a run: a log with no report is unattributed, a report with no log is zero.
|
||||
shopt -s nullglob
|
||||
runs=(layout-divergence/*.jsonl layout-divergence/*-results.json)
|
||||
for run in $(printf '%s\n' "${runs[@]%.jsonl}" | sed 's/-results\.json$//' | sort -u); do
|
||||
node config/scripts/layout-save-divergence-summary.mjs "$run.jsonl" "$run-summary.json" "$run-results.json"
|
||||
if [ -f "$run-results.json" ]; then
|
||||
node config/scripts/ci-e2e-failure-summary.mjs "$run-results.json"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Upload layout save divergence report
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: layout-divergence-changed${{ inputs.artifact_suffix }}-attempt-${{ github.run_attempt }}
|
||||
path: layout-divergence/
|
||||
retention-days: 14
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload Playwright traces
|
||||
if: failure() || cancelled()
|
||||
uses: actions/upload-artifact@v7
|
||||
@@ -410,11 +458,18 @@ jobs:
|
||||
# The packaged orcad slot the T6-11 launcher runs: its own node-pty under the pinned Node.
|
||||
# The template is what `orca serve`'s default selection materializes that slot from.
|
||||
- name: Build this runner's orcad slot and template
|
||||
env:
|
||||
LAYOUT_OWNER: ${{ inputs.layout_owner }}
|
||||
run: |
|
||||
slot="$(node config/scripts/build-orcad-prebuilds.mjs --print-slot)"
|
||||
pnpm build:orcad-prebuilds
|
||||
pnpm build:orcad-prebuilds --require-slots "$slot"
|
||||
pnpm build:orcad
|
||||
# The headless oracle's orcad host must hold the same layout owner as the Electron host.
|
||||
if [ -n "$LAYOUT_OWNER" ]; then
|
||||
ORCA_LAYOUT_OWNER="$LAYOUT_OWNER" pnpm build:orcad
|
||||
else
|
||||
pnpm build:orcad
|
||||
fi
|
||||
node config/scripts/build-orcad-template.mjs --targets "$slot"
|
||||
- name: Switch serve hosts on one profile
|
||||
if: inputs.test_files == '' || contains(inputs.test_files, 'tests/e2e/orcad-serve-mode-switch.spec.ts')
|
||||
@@ -431,7 +486,30 @@ jobs:
|
||||
env:
|
||||
SKIP_BUILD: '1'
|
||||
ORCA_E2E_FORWARD_APP_LOGS: '1'
|
||||
run: xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/workspace-layout-oracle-headless.spec.ts --project=electron-headless --workers=1
|
||||
LAYOUT_OWNER: ${{ inputs.layout_owner }}
|
||||
run: |
|
||||
REPORT_ARGS=()
|
||||
if [ -n "$LAYOUT_OWNER" ]; then
|
||||
test -f out/main/ORCA_LAYOUT_OWNER_MAIN
|
||||
mkdir -p layout-divergence
|
||||
export ORCA_LAYOUT_SAVE_DIVERGENCE_LOG="$PWD/layout-divergence/headless-oracle.jsonl"
|
||||
export PLAYWRIGHT_JSON_OUTPUT_FILE="$PWD/layout-divergence/headless-oracle-results.json"
|
||||
REPORT_ARGS=('--reporter=list,json')
|
||||
fi
|
||||
xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/workspace-layout-oracle-headless.spec.ts --project=electron-headless --workers=1 "${REPORT_ARGS[@]}"
|
||||
- name: Summarize layout save divergence
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
run: *summarize_layout_divergence
|
||||
- name: Upload layout save divergence report
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: layout-divergence-headless${{ inputs.artifact_suffix }}-attempt-${{ github.run_attempt }}
|
||||
path: layout-divergence/
|
||||
retention-days: 14
|
||||
if-no-files-found: warn
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: failure()
|
||||
with:
|
||||
@@ -486,9 +564,32 @@ jobs:
|
||||
ORCA_E2E_ORCAD_CONVERT_HOST: docker
|
||||
ORCA_E2E_FORWARD_APP_LOGS: '1'
|
||||
SHARD: ${{ matrix.shard }}
|
||||
LAYOUT_OWNER: ${{ inputs.layout_owner }}
|
||||
SHARD_INDEX: ${{ strategy.job-index }}
|
||||
run: |
|
||||
export ORCA_E2E_ORCAD_CONVERT_TEMPLATE="$RUNNER_TEMP/orcad-convert-template"
|
||||
xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-orcad- --project=electron-headless --workers=1 --shard="$SHARD"
|
||||
REPORT_ARGS=()
|
||||
if [ -n "$LAYOUT_OWNER" ]; then
|
||||
test -f out/main/ORCA_LAYOUT_OWNER_MAIN
|
||||
mkdir -p layout-divergence
|
||||
export ORCA_LAYOUT_SAVE_DIVERGENCE_LOG="$PWD/layout-divergence/managed-ssh-$SHARD_INDEX.jsonl"
|
||||
export PLAYWRIGHT_JSON_OUTPUT_FILE="$PWD/layout-divergence/managed-ssh-$SHARD_INDEX-results.json"
|
||||
REPORT_ARGS=('--reporter=list,json')
|
||||
fi
|
||||
xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-orcad- --project=electron-headless --workers=1 --shard="$SHARD" "${REPORT_ARGS[@]}"
|
||||
- name: Summarize layout save divergence
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
run: *summarize_layout_divergence
|
||||
- name: Upload layout save divergence report
|
||||
if: always() && inputs.layout_owner == 'main'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: layout-divergence-managed-ssh-${{ strategy.job-index }}${{ inputs.artifact_suffix }}-attempt-${{ github.run_attempt }}
|
||||
path: layout-divergence/
|
||||
retention-days: 14
|
||||
if-no-files-found: warn
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: failure()
|
||||
with:
|
||||
|
||||
@@ -60,6 +60,7 @@ jobs:
|
||||
e2e_needs_build: ${{ steps.e2e_filter.outputs.e2e_needs_build }}
|
||||
native_ime_source_changed: ${{ steps.e2e_filter.outputs.native_ime_source_changed }}
|
||||
wsl_source_changed: ${{ steps.e2e_filter.outputs.wsl_source_changed }}
|
||||
layout_owner_switch_on: ${{ steps.e2e_filter.outputs.layout_owner_switch_on }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -84,6 +85,7 @@ jobs:
|
||||
/config/scripts/pr-code-change-scope.mjs
|
||||
/config/scripts/pr-package-test-paths.mjs
|
||||
/config/scripts/pr-layout-oracle-route.mjs
|
||||
/config/scripts/pr-layout-owner-switch-on-route.mjs
|
||||
/config/scripts/pr-e2e-source-routing.mjs
|
||||
/config/scripts/ci-e2e-job-selection.mjs
|
||||
/config/scripts/pr-ready-check-reuse.mjs
|
||||
@@ -164,6 +166,8 @@ jobs:
|
||||
WSL_CHANGED="$(git diff --name-only --no-renames --diff-filter=ACDMR "$DIFF_BASE" HEAD)"
|
||||
WSL_SOURCE_CHANGED="$(printf '%s\n' "$WSL_CHANGED" | node config/scripts/pr-e2e-source-routing.mjs --wsl-source)"
|
||||
echo "wsl_source_changed=$WSL_SOURCE_CHANGED" >> "$GITHUB_OUTPUT"
|
||||
LAYOUT_OWNER_SWITCH_ON="$(printf '%s\n' "$WSL_CHANGED" | node config/scripts/pr-layout-owner-switch-on-route.mjs)"
|
||||
echo "layout_owner_switch_on=$LAYOUT_OWNER_SWITCH_ON" >> "$GITHUB_OUTPUT"
|
||||
echo "Native IME source changed: $NATIVE_IME_SOURCE_CHANGED"
|
||||
SHOULD_RUN="$(printf '%s\n' "$CHANGED" | node config/scripts/pr-e2e-source-routing.mjs --reusable-workflow "${E2E_SCOPE_ARGS[@]}")"
|
||||
if [ "$SHOULD_RUN" = true ]; then
|
||||
@@ -1532,6 +1536,28 @@ jobs:
|
||||
needs_build: true
|
||||
artifact_suffix: -layout-oracle
|
||||
|
||||
# Why not in verify's needs: the layout-owner switch is off in shipped builds, and some of these
|
||||
# specs fail with it on until that work lands. It reports a red X without blocking the merge.
|
||||
layout_owner_switch_on:
|
||||
name: layout owner (switch on)
|
||||
needs: [code_paths, preflight]
|
||||
if: >-
|
||||
!cancelled() &&
|
||||
needs.code_paths.result == 'success' &&
|
||||
needs.code_paths.outputs.layout_owner_switch_on == 'true' &&
|
||||
needs.preflight.result == 'success'
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/e2e.yml
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
# LAYOUT_OWNER_SWITCH_ON_E2E_SPECS in config/scripts/pr-layout-owner-switch-on-route.mjs.
|
||||
test_files: '["tests/e2e/workspace-layout-oracle-headless.spec.ts","tests/e2e/workspace-layout-oracle.spec.ts","tests/e2e/cli-file-open-position.spec.ts","tests/e2e/relaunch-first-terminal.spec.ts","tests/e2e/relaunch-sleeping-agents-resume-on-view.spec.ts","tests/e2e/terminal-cold-activation-deferral.spec.ts","tests/e2e/cli-first-worktree-single-terminal.spec.ts","tests/e2e/unopened-workspace-agent-single-resume.spec.ts","tests/e2e/terminal-pane-close-layout-consistency.spec.ts","tests/e2e/golden-file-open-edit-save.spec.ts","tests/e2e/golden-source-control-open-diff.spec.ts","tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts","tests/e2e/floating-workspace-pane-height.spec.ts","tests/e2e/editor-model-host-isolation.spec.ts","tests/e2e/editor-tab-selection-restore.spec.ts","tests/e2e/finished-agent-ghost-resume.spec.ts","tests/e2e/live-background-terminal-mount-authority.spec.ts","tests/e2e/workspace-back-forward-navigation.spec.ts","tests/e2e/worktree-lineage-toggle-shortcut.spec.ts","tests/e2e/local-cli-terminal-retention.spec.ts","tests/e2e/default-tabs-mark-crash-relaunch.spec.ts","tests/e2e/terminal-cli-split-closed-before-mount.spec.ts","tests/e2e/layout-stream-loss-reopen.spec.ts","tests/e2e/ssh-orcad-"]'
|
||||
run_changed_e2e: true
|
||||
needs_build: true
|
||||
artifact_suffix: -layout-owner-switch-on
|
||||
layout_owner: main
|
||||
|
||||
# Why this is not in verify's needs: it is the first PR-gate run of a harness whose reliability
|
||||
# is only known from nightly main runs (20/20 green, 2026-08-09..2026-08-29, p50 3m25s). It
|
||||
# reports a red X on the PR without blocking, exactly like `e2e` above. Deliberately no
|
||||
|
||||
Reference in New Issue
Block a user