The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci: E2E suites run only on release builds
Tekniumffcd3621a9c4
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yamlindex 7f53b6db96d..10966917d8c 100644--- a/.github/workflows/ci.yaml+++ b/.github/workflows/ci.yaml@@ -93,19 +93,27 @@ jobs:uses: ./.github/actions/detect-changeswith:github-token: ${{ github.token }}- - name: Force all lanes on release- # Overwrite the classifier outputs with 'true' when inputs.release.+ - name: Force all lanes on release; E2E only on release or dispatch+ # Overwrite the classifier outputs with 'true' when inputs.release. The E2E+ # lanes are forced off unless this is a release run or a manual dispatch+ # (whose empty diff already turns every lane on): never on a pull request+ # or a push to main, whatever the diff or labels say.id: gate-lanesenv:RELEASE: ${{ inputs.release }}+ EVENT_NAME: ${{ github.event_name }}CLASSIFIED: ${{ toJSON(steps.classify.outputs) }}run: |python3 - <<'PY'import json, osvalues = json.loads(os.environ['CLASSIFIED'])+ release = os.environ['RELEASE'] == 'true'+ e2e_allowed = release or os.environ['EVENT_NAME'] == 'workflow_dispatch'with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as output:for lane, value in values.items():- if os.environ['RELEASE'] == 'true' and value in ('true', 'false'):+ if lane.startswith('e2e') and not e2e_allowed:+ value = 'false'+ elif release and value in ('true', 'false'):value = 'true'if '\n' in value or '\r' in value:continue@@ -117,12 +125,9 @@ jobs:# Skipped workflows (if condition is false) don't spin up runners.## The E2E suites (e2e, e2e-upgrade, both Desktop suites, and the two- # Windows journeys in tests-os) take most of the larger-runner minutes.- # On a pull request each runs only when the diff touches that suite or the- # code it guards, or the PR carries the `run-e2e` label- # (scripts/ci/classify_changes.py::_E2E_LANES). Every push to main runs- # all of them, so a regression the path lists miss turns main red after- # the merge.+ # Windows journeys in tests-os) run ONLY on a release run (inputs.release)+ # or a manual dispatch; the detect gate forces their lanes off for pull+ # requests and pushes to main.# ─────────────────────────────────────────────────────────────────────tests:name: Python testsdiff --git a/.github/workflows/install-e2e.yml b/.github/workflows/install-e2e.ymlindex bbabb6124f4..5320608f995 100644--- a/.github/workflows/install-e2e.yml+++ b/.github/workflows/install-e2e.yml@@ -32,18 +32,10 @@ name: Install & Update E2E# between. A hardcoded list would stop covering the newest release the day# after it ships, and would pin an "oldest" that nobody still runs.#-# Triggers:-# * every 12 hours, so upstream drift (a new uv, a Node bump, a PyPI change)-# surfaces on a schedule rather than in someone's review cycle;-# * manually, where you can pick the route (a preset or specific legs) and how many-# releases to sample;-# * pull_request, path-filtered to the install/update surface, runs ONLY the-# `pr` route (generate-e2e-matrix.mjs PR_SUBSET): installer-script ->-# hermes-update on linux (newest release -> PR, and PR -> NEXT), windows-# (PR -> NEXT) and macos (newest release -> PR), sampling just the newest tag.-# Four legs in parallel keep a PR's wall clock near one leg (~15 min);-# the full matrix multiplies that, so it stays on the clock and releases.-# A red scheduled run is reported by install-e2e-red.yml.+# Triggers: release builds only. The stable-release gate calls it+# (workflow_call, route=all), and a maintainer can dispatch it by hand to pick+# the route (a preset or specific legs) and how many releases to sample. It+# never runs on pull requests, pushes to main, or a schedule.on:workflow_dispatch:@@ -116,52 +108,13 @@ on:required: falsetype: stringdefault: ''- schedule:- # Every 12 hours, off the hour to avoid the top-of-hour runner crunch.- - cron: '20 7,19 * * *'- pull_request:- # The install/update surface: derived from 60 days of commits whose subject- # names update/install/pm/bootstrap/relaunch. Keep it to code a real- # install or `hermes update` executes; hermes_cli/main.py and friends are- # deliberately absent (they change daily and are covered by e2e-upgrade).- paths:- - 'scripts/install*'- - 'scripts/desktop-update/**'- - 'setup-hermes.*'- - 'hermes_bootstrap.py'- - 'pm/**'- - '!pm/**/*.md'- - 'hermes_cli/update*'- - 'hermes_cli/*update*'- - 'hermes_cli/pm*'- - 'hermes_cli/*install*'- - 'hermes_cli/_early_recovery*.py'- - 'hermes_cli/_launchers.py'- - 'hermes_cli/managed_uv.py'- - 'hermes_cli/venv_sync.py'- - 'hermes_cli/relaunch.py'- - 'hermes_cli/gateway.py'- - 'gateway/status.py'- - 'apps/bootstrap-installer/**'- - 'apps/desktop/electron/*update*'- - 'apps/desktop/electron/updater/**'- - 'pyproject.toml'- - 'uv.lock'- - 'package.json'- - 'package-lock.json'- - 'tests/install/**'- - 'scripts/sandbox/generate-e2e-matrix.mjs'- - 'scripts/sandbox/pick-release-tags.sh'- - 'scripts/ci/setup_toolchain.py'- - '.github/actions/setup-pm/**'- - '.github/workflows/install-e2e*.yml'permissions:contents: read# A workflow_call run (stable release) is never cancelled: its group uses# github.run_id so a parent rerun cannot kill this child mid-flight. The-# scheduled/manual runs keep ref-scoped collapse.+# manual runs keep ref-scoped collapse.concurrency:group: install-e2e-${{ inputs.release == true && github.run_id || github.ref }}cancel-in-progress: ${{ inputs.release != true }}@@ -198,7 +151,7 @@ jobs:# stable release the candidate tag itself is the newest release# tag, and sampling it as an OLD version would produce a no-change# update leg — the candidate must never update from itself.- TAG_COUNT: ${{ github.event_name == 'pull_request' && '1' || inputs.tag-count || 2 }}+ TAG_COUNT: ${{ inputs.tag-count || 2 }}INSTALL_REF: ${{ inputs.install-ref }}EXCLUDE_REF: ${{ inputs.exclude-ref }}RELEASE_MODE: ${{ inputs.release }}@@ -250,8 +203,7 @@ jobs:- id: genenv:# Free text on dispatch, so it reaches the script as data, never as script.- # Scheduled runs have no inputs: the default route. PRs run the pr subset.- ROUTE: ${{ github.event_name == 'pull_request' && 'pr' || inputs.route || 'all' }}+ ROUTE: ${{ inputs.route || 'all' }}run: |set -euo pipefailmatrices="$(node scripts/sandbox/generate-e2e-matrix.mjs \@@ -269,8 +221,7 @@ jobs:bundle-inputs:name: Validate pinned bundle transitions- # Bundled legs need dispatch-only manifests; a PR never runs them.- if: github.event_name != 'pull_request'+ # Bundled legs need dispatch-only manifests.runs-on: ubuntu-latesttimeout-minutes: 5outputs:diff --git a/.github/workflows/label-rerun.yml b/.github/workflows/label-rerun.ymlindex 756193180b7..65c9100c4b1 100644--- a/.github/workflows/label-rerun.yml+++ b/.github/workflows/label-rerun.yml@@ -2,8 +2,9 @@ name: Label rerun# When the ``run-e2e`` label is added, rerun the head commit's CI, Docker and# Nix runs in full. Their ``detect`` job reads the PR's labels through the API-# (a rerun replays the original event payload), so the rerun turns every slow-# lane on (scripts/ci/classify_changes.py).+# (a rerun replays the original event payload), so the rerun turns the Docker+# and Nix slow lanes on (scripts/ci/classify_changes.py). The E2E suites stay+# off on pull requests either way: they run only on release builds.## The review comment updates without help. The poller in# ci-review-comment.yml watches the CI run through the API. It gets thediff --git a/.github/workflows/live-providers.yml b/.github/workflows/live-providers.ymlindex 4fc491886d6..bc4c476f5f0 100644--- a/.github/workflows/live-providers.yml+++ b/.github/workflows/live-providers.yml@@ -12,8 +12,6 @@ name: Live provider canaries# LIVE_OPENAI_API_KEY, LIVE_GEMINI_API_KEY, LIVE_XAI_API_KEYon:- schedule:- - cron: "17 7 * * *" # nightly, 07:17 UTCpush:tags:- "v*" # release gatediff --git a/scripts/ci/classify_changes.py b/scripts/ci/classify_changes.pyindex e629e1f7c33..4799e778fa9 100644--- a/scripts/ci/classify_changes.py+++ b/scripts/ci/classify_changes.py@@ -17,9 +17,10 @@ Lanes:* ``nix`` — ``nix flake check``: the flake files and the dependencymanifests.* ``e2e``, ``e2e_upgrade``, ``e2e_desktop_core``, ``e2e_desktop_update`` —- the end-to-end suites. Each runs on a pull request only when the PR edits- that suite or the code the suite exists to guard (``_E2E_LANES``), or- carries the ``run-e2e`` label.+ the end-to-end suites. The classifier still says which suites a diff+ touches (``_E2E_LANES``, the ``run-e2e`` label), but ci.yaml's ``detect``+ gate forces these lanes off on pull requests and pushes to main: the E2E+ suites run only on a release run or a manual dispatch.* ``frontend`` — TS typecheck matrix + desktop build.* ``site`` — Docusaurus + generated skill docs.* ``scan`` — supply-chain scan (Python files, .pth, setup hooks).diff --git a/tests/ci/test_update_ci_routing.py b/tests/ci/test_update_ci_routing.pyindex f43c28e4ef0..0ef0ad6e26b 100644--- a/tests/ci/test_update_ci_routing.py+++ b/tests/ci/test_update_ci_routing.py@@ -95,8 +95,12 @@ def _on(workflow: dict) -> dict:return workflow.get("on", workflow.get(True)) or {}-def _detect_outputs(lanes: dict[str, bool]) -> dict[str, Any]:- """The classifier's lines -> the composite action's outputs -> ci.yaml ``detect`` outputs."""+def _detect_outputs(lanes: dict[str, bool], event_name: str = "workflow_dispatch") -> dict[str, Any]:+ """The classifier's lines -> the composite action's outputs -> ci.yaml ``detect`` outputs.++ Replays a manual dispatch by default: E2E lanes reach their consumers only on a dispatch or a+ release run (pull requests and main pushes force them off), and the routing tests below check+ that a set lane reaches its suites."""raw = {k: gha.to_string(v) for k, v in lanes.items()}action = _yaml(".github/actions/detect-changes/action.yml")action_out = {k: gha.render(v["value"], {"steps": {"classify": {"outputs": raw}}})@@ -106,7 +110,7 @@ def _detect_outputs(lanes: dict[str, bool]) -> dict[str, Any]:classify = next(s for s in detect["steps"] if s.get("id") == "classify")assert classify["uses"] == "./.github/actions/detect-changes"steps = {"classify": {"outputs": action_out}}- ctx = {"steps": steps, "github": {"event_name": "pull_request"}, "inputs": {}}+ ctx = {"steps": steps, "github": {"event_name": event_name}, "inputs": {}}steps["gate-lanes"] = {"outputs": workflow_steps.outputs(gate, ctx)}return {k: gha.render(v, ctx) for k, v in detect["outputs"].items()}@@ -815,10 +819,15 @@ def test_strict_acceptance_dispatch_reaches_every_e2e_suite(value):assert _strict_env(run, path, rel, job, step) == value, "/".join(path)-def test_pull_requests_never_run_strict():- run = _ci_run(cc.classify([]))- for path, rel, job, step in _STRICT_STEPS:- assert _strict_env(run, path, rel, job, step) == "", "/".join(path)[email protected]("event_name", ["pull_request", "push"])+def test_pull_requests_and_main_pushes_never_run_e2e(event_name):+ """E2E suites run only on a release run or a manual dispatch, whatever the diff or labels select."""+ lanes = cc.classify([], run_e2e=True) # every lane on, as a label or an update-path diff would+ run = _run_workflow(".github/workflows/ci.yaml", inputs={}, detect=_detect_outputs(lanes, event_name))+ for lane in ("e2e", "e2e_upgrade", "e2e_desktop_update"):+ assert not any(_consumers_reached(run, lane).values()), f"{event_name}: {lane} ran"+ assert "e2e-desktop-core" not in run+ assert "tests" in run and "tests-os" in run # the unit lanes still rundef test_windows_install_update_dispatch_alone_sets_strict():diff --git a/tests/install/README.md b/tests/install/README.mdindex d0d261ff2ad..19ca16e6a34 100644--- a/tests/install/README.md+++ b/tests/install/README.md@@ -160,12 +160,9 @@ The result chart on the run summary shows each leg as passed, failed, or skipped## Triggers and cost-The full matrix does not run on pull requests. One leg installs real toolchains and takes more than 10 minutes. The triggers are:+The matrix runs on release builds only. It never runs on pull requests, pushes to main, or a schedule: one leg installs real toolchains and takes more than 10 minutes. The triggers are:-- A pull request that touches the install/update surface (the `paths:` list in `install-e2e.yml`). It runs only the `pr` route: `installer-script -> hermes-update` on Linux (newest release -> PR, and PR -> NEXT), Windows (PR -> NEXT) and macOS (newest release -> PR). The four legs run in parallel, so the wall clock is about one leg.-- A schedule, every 12 hours. This finds upstream drift. When a scheduled run goes red, `install-e2e-red.yml` opens one issue labelled `install-e2e-red`, rewrites its body in place on every later red run, and closes it on the first green one.-- A matching release tag push.-- A reusable workflow call from the stable release gate.+- A reusable workflow call from the stable release gate (`route=all`).- Manual dispatch. You can select the route and the tag count:```