Make Featured plugin Project-Isolation-safe; remove scanAllLocalFlags root task#286
Merged
Merged
Conversation
… root task Remove wireToRootAggregator and the scanAllLocalFlags root convenience task from FeaturedPlugin: the only rootProject access in the plugin and a Project Isolation violation. Cross-module flag resolution is covered by the built-in name-matched ./gradlew resolveFeatureFlags invocation. Add ProjectIsolationIntegrationTest asserting the configuration phase succeeds with org.gradle.unsafe.isolated-projects enabled. Closes #186 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
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.
Closes #186.
What changed
Removes the only
rootProjectaccess in the Featured Gradle plugin, making it compatible with Gradle Project Isolation.wireToRootAggregator(...)fromFeaturedPlugin(a project-scopedPlugin<Project>applied to every feature module) — it reached intotarget.rootProjectto register/mutate a convenience taskscanAllLocalFlagson the root project at configuration time, the canonical Project Isolation violation.scanAllLocalFlagsroot task and theSCAN_ALL_TASK_NAMEconstant.featured-gradle-plugin/src/mainnow contains zerorootProjectaccess.The real cross-module registry aggregation (
generateFeaturedRegistry→GeneratedFeaturedRegistry.all) was already PI-safe via the declarativefeaturedAggregationconfiguration + variant resolution — untouched.Why
scanAllLocalFlagswas a convenience task that duplicated built-in Gradle behavior:./gradlew resolveFeatureFlags(name-matched task invocation, no project path) already runs the per-moduleresolveFeatureFlagstask across every module that applies the plugin. Under Project Isolation a project-scoped plugin fundamentally cannot auto-register a task on root — so the task is removed rather than reworked, eliminating the violation with no new API surface.How to test
./gradlew :featured-gradle-plugin:test— 317 tests incl. the newProjectIsolationIntegrationTest../gradlew resolveFeatureFlags— resolves flags across all feature modules (the replacement forscanAllLocalFlags).New
ProjectIsolationIntegrationTest(TestKit) builds a multi-module fixture withorg.gradle.unsafe.isolated-projects=trueand asserts the configuration phase succeeds — empirical proof the plugin is PI-safe. It guards against a vacuous pass by asserting isolated-projects actually engaged (Configuration cache entry stored) and no cross-project violation (cannot access project).Verification
spotlessCheckgreen.ProjectIsolationIntegrationTestPASS — isolated-projects engaged,resolveFeatureFlagsTaskOutcome.SUCCESS, no PI violation../gradlew resolveFeatureFlagsresolves flags across all 3 sample feature modules (feature-ui 2, feature-promotions 1, feature-checkout 2)./finalizePASS (1 round),/acceptanceVERIFIED (all 5 ACs).Release Notes
CHANGELOG.md(Removed):scanAllLocalFlagsroot aggregation task. The plugin no longer accessesrootProjectand is now compatible with Gradle Project Isolation. Use./gradlew resolveFeatureFlagsto resolve flags across all modules.🤖 Generated with Claude Code