Repository navigation
Reuse Maven results across Muzzle modules - #12801
sarahchen6 wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Static review found no reportable defect in deferred planning, repository isolation, Maven caching, or task wiring. Gradle execution and the claimed performance improvement remain unverified.
🤖 Bits Code Review · Commit c4923c9 · @DataDog review to ask questions
dougqh
left a comment
There was a problem hiding this comment.
Looks good -- sharing the session is safe here (it's only used serially during configuration, and the retry path already bypasses cached failures with fresh session data). Two non-blocking comments:
-
Shared state: rather than a raw
MutableMapinrootProject.extensions.extraPropertieswith an unchecked cast, consider a sharedBuildServiceto hold the planners. It's typed, lifecycle-managed by Gradle, and won't get in the way if we ever enable isolated projects. -
projectsEvaluated: is the later timing needed? Sharing via the map would also work from each project'safterEvaluate, since the root project is evaluated first. If it's mainly for the "planning sees directives configured after project evaluation" case, note that test relies on the root'sprojectsEvaluatedcallback being registered before the module's. If the later timing isn't needed, keepingafterEvaluateseems simpler; if it is, a sentence in the description on why would help.
There was a problem hiding this comment.
More details
Static review supports repository isolation when sharing Maven planners and found no concrete regression in deferred planning or aggregate task selection.
🤖 Bits Code Review · Commit c4923c9
c4923c9 to
d82e429
Compare
| } | ||
|
|
||
| private fun sharedTaskPlanner(project: Project): MuzzleTaskPlanner { | ||
| val properties = project.rootProject.extensions.extraProperties |
There was a problem hiding this comment.
issue: I'd avoid the extra properties here. It's not typed, and the access is not coordinated, it happens via hasProperty / setProperty which looks like configuring another project.
Maybe a service could better fit? I'm unsure at this stage.
| properties.set(key, mutableMapOf<List<List<Triple<String, String, String>>>, MuzzleTaskPlanner>()) | ||
| } | ||
| @Suppress("UNCHECKED_CAST") | ||
| val planners = properties.get(key) as MutableMap<List<List<Triple<String, String, String>>>, MuzzleTaskPlanner> |
There was a problem hiding this comment.
note: This is a long type. Maybe using a kotlin type alias or a concrete value class for the key could help. Also that's the issue with extra properties it's not typed.
Also, I think using the map directly here could burn us.
I tend to think that making the whole thing a service offering some method. E.g. a registrar that return a planer. Or even higher level method returning a MuzzleValidationTasks.
What Does This Do
Plan Muzzle checks after all projects finish evaluating so that the Maven resolvers and sessions can be shared between modules with matching repo settings. Modules with custom settings are kept on their own.
Motivation
Muzzle uses the Maven Resolver library to get published dependency versions. For modules with matching repo settings, we can minimize work done by sharing the Maven results.
Additional Notes
I had Codex compare results pre and post-change. It found in a local 30-module fixture that resolver/session creation fell from 30 to 1 and median configuration + task-graph time fell from 164 to 89ms (46% improvement). All the checks and task graph were preserved. Measurements used one warmup followed by four measured warm runs per variant, alternating variant order, with offline Gradle 9.8, four workers, configuration caching disabled, a local Maven repository, and a no-op scanner.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]