Skip to content

ci: run only the integration suites a pull request can affect - #775

Open
Sarath1018 wants to merge 1 commit into
mainfrom
ci/scope-integration-tests-to-changes
Open

Sarath1018 wants to merge 1 commit into
mainfrom
ci/scope-integration-tests-to-changes

Conversation

@Sarath1018

@Sarath1018 Sarath1018 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This adds a scope job to coverage.yml that decides which suites a PR needs from the files it changes (scripts/integration-scope.mjs, 127 lines, no dependencies). The rule is name-based: suites are the folders under tests/integration/shared/, and a domain's sources live under the same name in src/services/ and src/models/.

Changed path Runs
src/services/<name>/**, src/models/<name>/**, tests/integration/shared/<name>/** (suite folder exists) tests/integration/shared/<name>
docs/**, samples/**, packages/**, tests/unit/**, tests/utils/mocks/**, Markdown, lint/build config nothing
anything else — src/core, src/utils, src/services/base.ts, src/models/common, the test harness, config, workflows, a domain with no suite folder everything

smoke, http and auth-errors run whenever any suite runs. The integration job is skipped only when the resolver explicitly reports nothing affected (run_integration=false); a missing output, a failed diff or an unrecognised path all run the full suite. sonar and summary handle the skipped case; test-and-build passes because a skipped job does not fail the called workflow.

Deliberately not modelled (kept simple on request): cross-domain source imports. Maestro's cases wrap the Action Center TaskService, so an action-center-only change runs action-center but not maestro; weekly-coverage.yml still runs everything against main. Adding a mapping later is a one-line table.

Escape hatch: the ci:full-integration label forces a full run (labels are read from the event that started the run, so push a commit after labelling). Scheduled/manual runs (weekly-coverage.yml) are always full.

Dry run against recent PRs

#720 (coded-action-app docs/types) → nothing · #709 (sample) → nothing · #745 (maestro tests) → maestro only · #736, #747, #734, #663 (config / core / workflow changes) → everything.

Notes

  • SonarCloud PR analysis sees integration coverage only from the suites that ran; coverage on the changed files is unaffected, other files may show less. Sonar is not a required check.
  • Unit tests: tests/unit/scripts/integration-scope.test.ts (behavioural cases + the suite-folder discovery).

Test plan

  • npm run test:unit, npm run lint
  • node scripts/integration-scope.mjs --base origin/main on this branch → full run (workflow + script changed)
  • coverage / scope on this PR resolves scope=all; the integration legs run the full suite

🤖 Generated with Claude Code

@Sarath1018
Sarath1018 requested a review from a team September 24, 2026 07:10
Comment thread scripts/integration-scope.mjs Outdated
@Sarath1018
Sarath1018 force-pushed the ci/scope-integration-tests-to-changes branch from 1df05a8 to 2630b5f Compare September 24, 2026 10:13
@claude

claude Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

PR coverage runs used to execute every integration suite for every change,
so a docs- or packages-only PR spent ~17 minutes per leg creating Data
Fabric entities and Maestro instances it could not influence, and every
platform hiccup in ~3,000 requests failed the PR.

A new `scope` job classifies the files changed against the base branch
(scripts/integration-scope.mjs). Suites are the folders under
tests/integration/shared; a change under src/services/<name>,
src/models/<name> or tests/integration/shared/<name> runs that suite, docs,
samples, packages and unit tests run nothing, and anything else (core,
utils, the harness, config, workflows, a domain with no suite folder) runs
everything. The cross-cutting smoke, http and auth-errors suites run
whenever any suite runs. The `integration` job receives the resulting
vitest path filters and is skipped only when the resolver explicitly says
nothing is affected; a missing output still runs. The `ci:full-integration`
label forces a full run; weekly-coverage.yml keeps running everything.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Sarath1018
Sarath1018 force-pushed the ci/scope-integration-tests-to-changes branch from 2630b5f to 4189c2b Compare September 24, 2026 10:29
@claude

claude Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

This branch has not been deployed

No deployments
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.

1 participant