fix(e2e): add daemon_status to serve capabilities baseline; run E2E on PRs (#5211)

* fix(e2e): add daemon_status to serve capabilities baseline; run E2E on PRs

The `qwen serve — capabilities envelope` integration test hard-codes the
expected advertised-feature list. PR #5174 added the `daemon_status`
capability to SERVE_CAPABILITY_REGISTRY (and the server.test.ts unit
baseline) but did not update this integration test, so the list drifted
by one entry and the E2E job began failing on main.

Root cause it slipped through: E2E only triggered on push to main /
merge_group, never on PRs, so this stale assertion was never exercised
before merge. Add a pull_request trigger (targeting main) so capability/
contract regressions surface at PR time, and key concurrency on the PR
number so superseded PR runs cancel.

* fix(e2e): guard fork PRs from secretless runs; dedupe push/PR triggers

Addresses review feedback on #5211:

- Skip the e2e matrix on fork PRs. Forks have no access to repository
  secrets (OPENAI_*, DOCKERHUB_*), so without a guard every fork PR
  produces 3 guaranteed red jobs and wastes CI minutes. A head-repo
  guard runs the jobs for same-repo PRs (and push / merge_group) but
  skips them for forks.

- Key concurrency on the head ref (github.head_ref || github.ref_name)
  so a push to a feat/e2e/** branch and a pull_request from that same
  branch share one group and cancel each other, instead of running the
  full matrix twice for the same change. Keeps the feat/e2e/** push
  trigger (the no-PR e2e iteration escape hatch) intact.

- Stop cancelling in-progress main runs so every main commit produces a
  complete e2e result (matching ci.yml's policy and the very signal that
  surfaced this bug); still cancel superseded PR / feature-branch runs.

---------

Co-authored-by: jinye <djy1989418@126.com>
This commit is contained in:
Shaojin Wen 2026-06-17 11:44:02 +08:00 committed by GitHub
parent e5655b4bd7
commit ccf1e5672f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View file

@ -5,18 +5,32 @@ on:
branches:
- 'main'
- 'feat/e2e/**'
pull_request:
branches:
- 'main'
merge_group:
concurrency:
# Key on the head ref so a `push` to a `feat/e2e/**` branch and a
# `pull_request` from that same branch share one group and cancel each
# other instead of running the matrix twice for the same change.
group: |-
${{ github.workflow }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'main' || github.run_id }}
${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
# Cancel superseded PR / feature-branch runs, but let every `main`
# commit finish (complete per-commit e2e signal, matching ci.yml) and
# never cancel merge-queue runs.
cancel-in-progress: |-
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main') }}
jobs:
e2e-test-linux:
name: 'E2E Test (Linux) - ${{ matrix.sandbox }}'
runs-on: 'ubuntu-latest'
# Skip on fork PRs: forks have no access to repository secrets
# (OPENAI_*, DOCKERHUB_*), so the matrix would fail unconditionally
# and show misleading red status. Same-repo PRs run normally.
if: |-
${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
matrix:
sandbox:
@ -86,6 +100,9 @@ jobs:
e2e-test-macos:
name: 'E2E Test - macOS'
runs-on: 'macos-latest'
# Skip on fork PRs (no secrets) — see e2e-test-linux above.
if: |-
${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: 'Checkout'
uses: 'actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd' # v6.0.2

View file

@ -217,6 +217,7 @@ describe('qwen serve — capabilities envelope', () => {
// always wires `persistSetting` and the workspace service).
expect(caps.features).toEqual([
'health',
'daemon_status',
'capabilities',
'session_create',
'session_scope_override',