Skip to content

feat/v2.0-remove-legacy-knobs: Phase 3 — delete the v1 DSL surface for v2.0.0#34

Merged
vedanthvdev merged 1 commit intomasterfrom
feat/v2.0-remove-legacy-knobs
Apr 22, 2026
Merged

feat/v2.0-remove-legacy-knobs: Phase 3 — delete the v1 DSL surface for v2.0.0#34
vedanthvdev merged 1 commit intomasterfrom
feat/v2.0-remove-legacy-knobs

Conversation

@vedanthvdev
Copy link
Copy Markdown
Owner

Why

This is the breaking release. Phase 3 of docs/DESIGN-v2.md called for removing the three deprecation-warned v1 knobs (runAllIfNoMatches, runAllOnNonJavaChange, excludePaths) once the v1.9.x minor line had burned enough runway to give consumers time to migrate. That runway is burned; keeping the old surface around any longer just lets new code grow against it and makes the mode-default story permanently fuzzy.

After this PR the resolver is strictly two-tier: explicit onXxx > mode default. No legacy boolean tier, no pre-v2 hardcoded-default tier, no deprecationWarnings() list.

What changes

Removed from the public surface:

  • AffectedTestsExtension.getRunAllIfNoMatches(), getRunAllOnNonJavaChange(), getExcludePaths()
  • AffectedTestTask equivalents
  • AffectedTestsConfig.runAllIfNoMatches(), runAllOnNonJavaChange(), excludePaths(), deprecationWarnings()
  • AffectedTestsConfig.Builder.runAllIfNoMatches(...), runAllOnNonJavaChange(...), excludePaths(...)
  • ActionSource.LEGACY_BOOLEAN, ActionSource.HARDCODED_DEFAULT
  • The legacy resolution tier from AffectedTestsConfig#resolveInto

Lock-in: AffectedTestsPluginTest#legacyDslKnobsNoLongerExistInV2 reflectively asserts absence across all four surfaces (extension, task, config, builder). A well-intentioned "restore the getter for back-compat" revert fails at build time instead of silently reopening the v1 API and the deprecation nags it carried.

Migration

The README and CHANGELOG both carry the new migration table. The one subtle case worth calling out here too:

v1 config v2 migration
runAllIfNoMatches = false (explicit) Set mode = \"local\", or pin onEmptyDiff = \"skipped\" + onDiscoveryEmpty = \"skipped\" explicitly. Do not just delete the line — in v2 the zero-config mode = \"auto\" resolves to ci in a CI runner, and ci escalates DISCOVERY_EMPTY to FULL_SUITE. A v1 pipeline that set runAllIfNoMatches = false specifically to prevent that branch from flipping to full suite will regress silently otherwise.

The other two knobs are straightforward deletes-with-a-rename (runAllOnNonJavaChangeonUnmappedFile, excludePathsignorePaths).

Docs refresh

  • README.md: --explain sample output rewritten to what v2 actually produces (Mode: AUTO (effective: LOCAL), includes the DISCOVERY_INCOMPLETE row, no "pre-v2 defaults" string). Mode-profile table now has a DISCOVERY_INCOMPLETE column. "Migrating from v1" rewritten to emphasize that the old knobs are removed, not deprecated.
  • CHANGELOG.md: new v2.0 section with the removal list, migration table, and regression-coverage note.
  • docs/architecture.mmd + regenerated docs/architecture.svg: priority ladder trimmed to the two-tier resolver so the picture matches the code.
  • docs/DESIGN-v2.md: Phase 3 marked done.

Test coverage

Every legacy-tier test was rewritten against the two-tier resolver or deleted where it no longer had anything to say. Engine, explain-format, and log-format tests renamed away from v1 vocabulary (runAllIfNoMatches*onEmptyDiffFullSuite* / onDiscoveryEmptyFullSuite*, etc.) so a future grep for the old names returns nothing.

./gradlew check is green locally.

Post-merge

  • Tag v2.0.0.
  • Open a follow-up bump PR in security-service that (a) pins 2.0.0 and (b) removes any residual v1 config the service was still carrying.

…r v2.0.0

This is the breaking release. The three deprecation-warned v1 knobs
(`runAllIfNoMatches`, `runAllOnNonJavaChange`, `excludePaths`) are gone
from every public surface — extension, task, core config, and builder —
along with the two `ActionSource` tiers (`LEGACY_BOOLEAN`,
`HARDCODED_DEFAULT`) and the `deprecationWarnings()` list that existed
only to carry v1 nags. After this commit the resolver is strictly
two-tier (explicit `onXxx` > mode default), which is what the v2 design
doc has always pointed at.

Why now: we promised Phase 3 in DESIGN-v2.md and burned a full v1.9.x
minor cycle warning about the removal so consumers had runway. Keeping
the old surface around any longer just invites new code to grow against
it and makes the mode-default story permanently fuzzy.

Why this shape, not a softer one:
- Reflective regression test (`legacyDslKnobsNoLongerExistInV2`) pins
  the absence of the accessors on every surface — extension, task,
  config, and builder — so a well-intentioned "restore the getter for
  back-compat" revert fails at build time instead of silently
  re-opening the v1 API.
- Migration table in README/CHANGELOG explicitly calls out that
  `runAllIfNoMatches = false` is *not* a safe no-op delete in CI — the
  new zero-config `mode = "auto"` resolves to `ci`, and `ci` escalates
  `DISCOVERY_EMPTY` to `FULL_SUITE`. A v1 pipeline that set the flag
  specifically to suppress that branch would regress silently. Users
  must either pin `mode = "local"` or set both
  `onEmptyDiff = "skipped"` and `onDiscoveryEmpty = "skipped"`.
- `--explain` sample output refreshed to match v2 reality (AUTO mode,
  `DISCOVERY_INCOMPLETE` row, no "pre-v2 defaults" string) so the
  README doesn't ship with a trace operators can no longer reproduce.
- Architecture diagram (`docs/architecture.mmd` + regenerated SVG)
  trimmed to the two-tier ladder so the picture matches the code.

The engine test `unmappedFileEscalationCanBeDisabled` now pins
`mode(Mode.LOCAL)`. The migration it proves — opting out of the
unmapped-file escalation via `onUnmappedFile = SELECTED` — causes a
yaml-only diff to fall through to `DISCOVERY_EMPTY`, and under the
new zero-config `mode = "auto"` that escalates to `FULL_SUITE` on any
`CI=true` runner (GitHub Actions, GitLab, etc.). The test would have
passed locally and failed on CI forever — the v2 behaviour change is
correct, the test assertion is correct, but the test needs the same
`mode = "local"` pin we tell v1 users to apply. This is the exact
migration path the README now documents for `runAllOnNonJavaChange =
false` users, so the test doubles as executable documentation.

Test coverage follows the deletion: legacy-tier tests removed, priority
tests rewritten against the two-tier resolver, engine/explain/log-format
tests renamed away from the v1 vocabulary, and every test method that
used to reach for the old knobs now uses `ignorePaths`, `onEmptyDiff`,
`onDiscoveryEmpty`, or `onUnmappedFile` instead.

Closes Phase 3 of DESIGN-v2.md.
@vedanthvdev vedanthvdev force-pushed the feat/v2.0-remove-legacy-knobs branch from c44b745 to 04c5818 Compare April 22, 2026 22:48
@vedanthvdev vedanthvdev merged commit a50abf6 into master Apr 22, 2026
1 check passed
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