Skip to content

ci(artemis): fast PR lane, full suite on main and nightly (CHE-3276) [squash] - #256

Draft
congvc-bot-x99[bot] wants to merge 9 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-3276-1803019636b9
Draft

congvc-bot-x99[bot] wants to merge 9 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-3276-1803019636b9

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Status
Draft. Refs CHE-3276 (slice S4 of CHE-3264). Cheese merges; the agent-merge exception does not apply to workflow changes. Head 741235696f4bbafef7e62e06fd7cc3a8670c6d0d. The review of head bc249899 asked for changes; this head answers it (see Review changes). The after-change latency has two samples on this PR (see Evidence).

Conditions

  • No spend: only the cheese-x99 pool; no paid or larger runners.
  • Test-first: red and green output below.
  • ci-policy is not enrolled in artemis yet (S3d). The branch ruleset for main listed required_status_checks: [] and the branch-protection API returned 403 for this token, so "required checks" below means the jobs that run on pull_request. NOT-VERIFIED: no rule requires any check by name today. An admin must add B2 ADB allowlist and tunnel fuzz (and Python 3.12) to the ruleset for B2 to be enforced; this PR cannot set that.

Change

  • host-agent.yml: push now runs only on main (path filter kept). It no longer duplicates the pull_request run on a branch push.
  • ci.yml: the PR check Python 3.12 (job python-quality) is now a fast lane: ruff format and lint, quality ratchet, pyright, the unit tests outside tests/unit/admin_console, and the B2 ADB and tunnel gate. No coverage, no reverse pass.
  • ci.yml: the full suite (python-tests: deterministic with the coverage floor 60, and reverse order) runs on main pushes, a nightly schedule (20:17 UTC, 03:17 ICT) and workflow_dispatch. It is skipped on a PR.
  • ci.yml: the PR lane also runs the tests/unit/admin_console tests that match the changed paths (eng review D15 = A). scripts/ci_mapped_tests.py maps a changed test file to itself, a changed apps/admin_console module to tests named after it and to every test that imports it, a changed conftest.py or __init__.py under the test directory to the whole directory, and an unmatched module to test_access_control.py and test_route_tiers.py. The step runs with set -euo pipefail: a git or selector error fails the job, and only an empty selection passes without tests. A change to access_control.py maps to 28 of the 85 test files.
  • ci.yml concurrency: cancel-in-progress is true for PR events only, so a main run is not cancelled by the next push.
  • max-parallel: 1 stays on the full matrix, with its reason in a comment.

Why max-parallel: 1 exists
PR #244 (CHE-2461, merged 2 Nov 2026) split the one Python job into two serial legs. Its test test_python_passes_have_independent_budgets_without_extra_runner_contention names the intent: each leg gets its own timeout budget and a run holds one X99 runner, so it adds no contention on the shared 3-CPU host. The comment on the matrix says the deterministic suite grew from about 21 to 42 min on 28 to 29 Oct and swings up to 2.6x under load. Owner: x99-codex-sol authored it; x99-claude-sonnet owned the follow-up. The reason is runner contention, not a test dependency.

Decision: move, do not shard
Rule: shard only if a PR then uses at most 2 concurrent X99 runners and no more total runner-minutes than today. Measured:

  • Per-test time summed over the suite: 1,382 s (23 min) with 12 xdist workers on a 56-CPU host. CI measured 34 to 45 min for the deterministic leg and 19 to 29 min for the reverse leg on 3 CPUs.
  • Two runners cannot bring about 55 to 75 runner-minutes of tests under 15 min, and every extra shard repeats the 2 to 4 min setup (apt, uv sync). Sharding fails both conditions, so the full suite moves to main and nightly.
  • tests/unit/admin_console is 1,018 s of 1,382 s (74%) and 2,049 of 6,376 tests. The fast lane leaves it out: 4,330 tests, 6 min 3 s on this host without coverage, plus 8 s for format, lint, ratchet and pyright.
  • Trade-off: a PR no longer runs tests/unit/admin_console, the coverage floor or the reverse-order pass. A break there is caught on main within one run (about 70 min) and in the nightly run. This is the accepted cost of the 15 min target (Cheese D4 = B).

Review changes (head bc249899, CHANGES REQUESTED)

  • B2 was a step of Python 3.12, so no check could require it by name: now the separate job b2-gate.
  • The map missed test_security_boundary.py for access_control.py, and a selector error was swallowed: now import-matching and a fail-closed step.
  • Red for these fixes: 5 failed, 21 passed in tests/unit/test_workflow_runner_policy.py and tests/unit/test_ci_mapped_tests.py (KeyError: 'b2-gate', test_security_boundary.py missing from the mapped list, [] instead of ['tests/unit/admin_console'] for conftest.py, no set -euo pipefail). Green: 26 passed. Ruff format and check pass; python .github/tests/test_runner_routing.py: OK.

Evidence
Red (before the change), uv run pytest tests/unit/test_workflow_runner_policy.py: 6 failed, 10 passed. The failing tests include test_pull_request_required_job_set_is_the_fast_lane (python-tests was in the PR job set), test_main_runs_queue_instead_of_cancelling_each_other (assert True == "${{ github.event_name == 'pull_request' }}"), test_python_pull_request_lane_runs_checks_and_the_fast_subset ('needs' present) and test_host_agent_does_not_run_on_branch_pushes_beside_pull_requests (KeyError: 'branches').
Green (after): 16 passed. python .github/tests/test_runner_routing.py: OK. Ruff format, ruff check and the quality ratchet pass.
Red for the path-to-test map (stub script returning no tests): 3 failed, 2 passed in tests/unit/test_ci_mapped_tests.py (for example assert [] == ['tests/unit/...est_drain.py']), plus 1 failed for test_python_pull_request_lane_runs_tests_mapped_from_the_changed_paths (StopIteration). Green: 22 passed for both test files.
The workflow test test_pull_request_required_job_set_is_the_fast_lane asserts the PR job set contains B2 ADB allowlist and tunnel fuzz; test_b2_gate_is_its_own_pull_request_check_that_can_be_required asserts the job runs both gate test files with no || true.

Baseline PR feedback latency, before (earliest pull_request check-suite created_at to the last completed check run for the head SHA, first attempts only; every check run on the PR counted because no required list exists):

Head SHA Minutes
ccd867be (pre-#244, one Python job) 65.0
b636f71e (PR #246) 113.5
e9d56924 (PR #254) 126.6
d8c4a4d6 (PR #244) 139.2
bdc5d242 (PR #255) 146.8
Median 126.6 min. None is within 15 min.

After, this PR. Head 741235696f4bbafef7e62e06fd7cc3a8670c6d0d: all 8 checks pass; the whole PR took 41.8 min from the first pull_request run (07:01:49 UTC) to the last check (07:43:39 UTC). Most of that was runner queue time, not test time.

  • Queue: the CI run was created at 07:01:49 UTC. The first job started at 07:22:24 UTC, so no X99 runner was free for about 20 min. No other artemis run was active; the cause is the shared X99 pool (design target 5), not this change.
  • Python 3.12: job time 12.6 min (started 07:27:03, finished 07:39:37 UTC). It ran beside B2 ADB allowlist and tunnel fuzz (2.8 min) and Build and smoke-test Python packages (3.2 min) on the 3-CPU pool, which is slower than the 8.7 min measured on head bc249899 (see below).
  • Frontend tests and production build: job time 3.9 min, but it started at 07:39:43 UTC, 38 min after the run was created, because it waited for a cheese-x99-browser runner.
  • Earlier head bc249899 (before the review changes): 32.6 min for the whole PR, Python 3.12 job 8.7 min, frontend waited 28 min for a browser runner.
  • Run time of the required jobs is within 15 min (largest: 12.6 min). The 15 min p90 PR feedback target is NOT met end to end while the runner queue is 20 to 38 min; the fix is the runner-pool work, outside S4.
  • The earlier head 24b2e402 failed in Run fast Python tests (exit 1). Its job log is missing on GitHub, so the cause is unknown. The step passes locally (4334 passed on 3 CPUs), and the same lane passed on bc249899. The failure may have been a flaky test or runner state; it is not explained.
  • One PR is one sample. The 5-PR after measure, with the D16 metric, can only finish after merge, on the next 5 PRs. NOT-RUN until then.

Closes nothing. Refs CHE-3276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants