Repository navigation
ci(owner-surface): run the integration slice an owner or install change can reach on every PR - #4627
Merged
Merged
Conversation
…ge can reach on every PR (#4625) Owner Surface Check (owner-surface.yml) triggers on owner surfaces and runs only the hermetic integration slice the change can reach, selected by scripts/owner_surface.py: owner-rule mutation cases and test_architecture_* files naming a changed file or an affected owner, guard or rule, plus test_install_* for install-path changes. It runs in 3 duration-balanced shards. One always() aggregate reports a stable check: it passes on a skipped slice and on merge_group. The check is advisory; making it required is a maintainer gate. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 13:25
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The test-selection logic omits changed install tests, affected rule cases, and removed-guard coverage, allowing checks to miss relevant regressions.
3 open issues
What changed in this PR
Adds an advisory PR-time integration check to catch owner and install-path regressions earlier, complementing the full merge-time suite and addressing the coverage gaps behind #4067 and #4007.
Changes:
- Adds an always-reporting
Owner Surface Checkwith three conditional test shards. - Introduces selection based on changed paths, owner registries, guards and rules.
- Adds selection and workflow tests, documents the check, and updates deployed instruction hashes.
| File | Description |
|---|---|
tests/unit/scripts/test_owner_surface.py |
Tests triggers, selection, deselection and aggregate results. |
scripts/owner_surface.py |
Plans the integration slice and filters pytest items. |
docs/src/content/docs/contributing/integration-testing.md |
Documents the advisory check and local usage. |
apm.lock.yaml |
Updates hashes for deployed CI instructions. |
.github/workflows/owner-surface.yml |
Adds planning, three test shards and the aggregate check. |
.github/instructions/cicd.instructions.md |
Updates deployed workflow guidance. |
.apm/instructions/cicd.instructions.md |
Updates canonical workflow guidance. |
Review effort: Balanced
…annot crash xdist (#4625) scripts.ci_sharding refuses empty shards, and on xdist workers that UsageError crashed the run. owner_surface now splits the slice into as many nonempty group-preserving shards as it allows (at most 3); surplus shards run nothing and pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ace-check # Conflicts: # apm.lock.yaml
…es and body-named rules (#4625) Review fixes: guards come from both registry revisions, so a removed or replaced guard still selects the tests naming it; a changed test_architecture_* or test_install_* file is always collected; a parametrized rule test is kept when its params, its body or a module string constant it references (e.g. _VR_RULE) names a key. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Nov 21, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds
Owner Surface Check, a cheap PR check that runs only the slice of the merge-time integration suite an owner or install-path change can reach. Today both main reds (the lockfile-read owner test after #4067, the codex bundle e2e after #4007) lived in integration shards that run only on merge_group or dispatch, so the PRs that caused them never ran those tests..github/workflows/owner-surface.ymlruns onpull_requestandmerge_groupwith nopaths:filter, so it always reports:selectplans the slice;sliceruns in 3 shards, only when the select job setsrun=true;Owner Surface Checkis analways()aggregate. It passes when the slice is skipped or green, and fails when the select job fails or the slice is red, cancelled or missing.scripts/owner_surface.py:planis stdlib only: it writes the changed paths and decidesrun;runbuilds the selection keys and runs pytest with the module as a deselection plugin. The plugin also splits the slice into 3 shards withscripts.ci_sharding.partition; a slice too small to split runs whole on shard 1, and empty shards pass.Trigger (owner surfaces):
src/apm_cli/install/*andsrc/apm_cli/deps/lockfile*;.apm/architecture/*andscripts/architecture_linter/*;tests/integration/test_architecture_*.pyandtests/integration/test_install_*.py;.apm/architecture/owners/*.json);Selection keys:
.pypaths and theirapm_cli.*module names;Slice:
test_architecture_owner_rule_mutations.py) whose parameters name a key;test_architecture_*.pyfiles whose text names a key;test_install_*.pyfile for install-path changes;Only the hermetic marker expression runs, with no secrets. The full integration suite stays once per train head (merge_group, or merge-train refs after #4582).
The check is advisory: it is not in
EXPECTED_CHECKSand not in the ruleset. Making it required is a maintainer gate, prepared but not executed. Percicd.instructions.md, the in-repo route is amerge-gate.ymlEXPECTED_CHECKS edit; a ruleset 9294522 diff is prepared as the alternative.Replay evidence (CI durations seed
.github/ci-durations/linux-x86_64.json)-n 4)test_architecture_pack_lockfile_read.py(ownerread-only-lockfile-path)test_install_local_bundle_e2e.pyShards are disjoint, and their union equals the slice (verified with
--collect-onlyper shard; #4007: 1209/1155/987 s). This PR's own slice is 3 tests on shard 1. With setup, wall clock is about 7 min.Issue and approved scope
Issue: Fixes #4625 (Refs #4117, the broader coverage-map slice, which stays open)
Human scope-approval comment: requested through Intake (record_req #4625); pending.
Does this PR complete the issue, or what remains? It completes #4625. Making the check required is a separate maintainer gate.
Type of change
Testing
Commands (local, shared host guard):
pytest tests/unit/scripts/test_owner_surface.py: 33 passed.pytest tests/unit/test_workflow_actor_contract.py tests/integration/test_triage_advisory.py tests/unit/scripts/test_owner_surface.py: 73 passed.pytest tests/quality/test_ci_topology.py tests/unit/test_shared_apm_workflow_contract.py tests/unit/test_guardrailing_hero_topology.py tests/unit/test_devcontainer_feature_retired.py tests/unit/test_push_ci_gates.py tests/unit/scripts/test_architecture_runner.py: 520 passed. 2 failed and 6 errored, all in collection tests that subprocess the shared local venv (it imports another worktree'sapm_cli); they do not involve this change.ruff check/ruff format --check(0.15.12),check_complexity_ratchet.py --base-ref main,python -m tests.quality.taxonomy --changed: clean.python -m scripts.owner_surface run --base <M>^1 --changed <file> -- --collect-onlyat the merge commits of [0.38] fix(policy): required-package checks read explicit proxy-URL lock rows (#4037) #4067 and [0.38] feat(install): render bundle agents to Codex TOML at install (#3714) #4007 (table above).Changelog
## [Unreleased]inCHANGELOG.md:user-visible effect first, 25 words or fewer, ending with
(#PR);breaking changes only under upgrade notes; no Highlights; see
.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
N/A: no
req-XXXbehaviour changes.