Skip to content

feat(ci): add changed-file scoped test selection with full-suite fallback (#243)#274

Merged
utksh1 merged 12 commits into
utksh1:mainfrom
divyansha12:feat/ci-test-selection
Jun 1, 2026
Merged

feat(ci): add changed-file scoped test selection with full-suite fallback (#243)#274
utksh1 merged 12 commits into
utksh1:mainfrom
divyansha12:feat/ci-test-selection

Conversation

@divyansha12
Copy link
Copy Markdown
Contributor

@divyansha12 divyansha12 commented May 23, 2026

Hey @utksh1 .

Description

This PR resolves #243 by introducing a production-grade CI optimization pipeline. It adds a deterministic file classification script select_tests.py that maps changed files to frontend/backend/plugin test subsets, allowing GHA to run fast checks first and skip slow builds/tests where possible, while maintaining a safe fallback to the full suite for shared or configuration edits.

Related Issues

Closes #243

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  1. Added 14 unit test cases under testing/backend/unit/test_select_tests.py to cover success, mixed, fallback, and empty file list paths.
  2. Ran the unit tests locally with pytest testing/backend/unit/test_select_tests.py -v (100% passed).
  3. Ran local dry-runs simulating representative file changes.
  4. Ran the entire python test suite ./testing/test_python.sh (all 349 tests passed).

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

🟢 GSSoC note – I’m a GSSoC contributor. All checks are passing; please add the gssoc:approved label when merging.

@divyansha12 divyansha12 force-pushed the feat/ci-test-selection branch from d412620 to 95715bc Compare May 25, 2026 04:49
@utksh1 utksh1 added area:ci CI, tooling, or automation work type:devops DevOps or infrastructure work category bonus label type:testing Testing work category bonus label level:advanced 55 pts difficulty label for advanced contributor PRs labels May 26, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The selective CI idea is useful, but this needs to be rebased after the benchmark CI changes and documented so required checks do not get accidentally skipped or hidden. Please also cover PR, push, docs-only, and shared-config cases clearly.

@divyansha12
Copy link
Copy Markdown
Contributor Author

Hey @utksh1 Rebased onto latest main.
Added docs: docs/ci-test-selection.md.
Ran unit tests: testing/backend/unit/test_select_tests.py — all passed.
No unrelated files, formatting, or refactor commits were introduced.
Please re-review.

@divyansha12 divyansha12 requested a review from utksh1 May 27, 2026 18:10
@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 28, 2026

Thanks for following up. Clarifying the change request so it is actionable:

Why this is blocked:
Requesting changes. The selective CI idea is useful, but this needs to be rebased after the benchmark CI changes and documented so required checks do not get accidentally skipped or hidden. Please also cover PR, push, docs-only, and shared-config cases clearly.

What to do next:

  • Fix the specific issues called out above.
  • Push the updated branch and make sure the relevant CI checks pass.
  • Reply here when ready for re-review.

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed latest state. The selective CI logic is still risky for required checks because jobs can be skipped based on changed files. Please document the branch protection behavior clearly and ensure docs-only, workflow/config, PR, push, and shared-file changes cannot hide required backend/frontend checks unexpectedly.

@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 30, 2026

Re-reviewed after the latest push. Still blocked: changed-file selective CI must not hide required backend/frontend checks. Please document branch protection behavior clearly and prove docs-only, workflow/config, PR, push, and shared-file changes still produce the expected required checks.

@divyansha12
Copy link
Copy Markdown
Contributor Author

Hey @utksh1
Thanks for the detailed review. I see now how the initial approach could have been risky with our branch protection rules.
I went back and re-worked the logic in scripts/select_tests.py. The issue was that it treated all events the same. I've now made it event-aware, so for any pull_request event, it completely bypasses the selective logic and defaults to running the full suite. This guarantees our required checks can't get skipped on a PR.

The selective skipping is now only active on push events to main, where it's safe to optimize.

To be absolutely sure, I added a ci_proof.txt artifact that logs the script's exact output for every scenario you mentioned. All checks are passing now.

Let me know if this looks better.

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the CI test-selection update. This still needs cleanup before merge. The PR includes ci_proof.txt, which looks like a proof/debug artifact and should not be committed. More importantly, the workflow now conditionally skips backend/frontend jobs, so branch protection can be weakened unless required checks are replaced by stable no-op/success jobs or the existing required job names always report. Please remove the proof artifact and document/test the required-check behavior for docs-only/backend-only/frontend-only PRs so protected branches do not get stuck or bypassed.

@divyansha12 divyansha12 requested a review from utksh1 June 1, 2026 18:38
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after the latest updates and maintainer cleanup. The generated proof artifacts are removed, PR events force the full backend/frontend suite so required checks are not skipped, push events keep selective behavior, selector tests pass, and the refreshed CI suite is green. Good to merge.

@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 1, 2026
@utksh1 utksh1 merged commit a72cca5 into utksh1:main Jun 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, tooling, or automation work gssoc:approved Admin validation: approved for GSSoC scoring level:advanced 55 pts difficulty label for advanced contributor PRs type:devops DevOps or infrastructure work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Add changed-file scoped test selection with full-suite fallback

3 participants