Skip to content

Skip unnecessary Muzzle checking - #12800

Open
sarahchen6 wants to merge 1 commit into
masterfrom
sarahchen6/skip-unnecessary-planning
Open

sarahchen6 wants to merge 1 commit into
masterfrom
sarahchen6/skip-unnecessary-planning

Conversation

@sarahchen6

Copy link
Copy Markdown
Contributor

What Does This Do

Avoid the work of Muzzle dependency version checks when they're unneeded, e.g. compile-only requests or modules outside the CI slot. The changes in this PR keep explicitly requested module checks, i.e. running Muzzle checks on a module specifically, and includes child modules when running a project's runMuzzle task.

Motivation

Additional Notes

I had Codex compare these changes to master. It ran an experiment with a 30-module fixture selecting one CI module and registered checks and version configs fell from 120 to 4 while still preserving the module's 20-task graph. The median config + graph time fell from 117 to 68ms (42% improvement) for that request and 126 to 106ms (16% improvement) for compileMuzzle (which registered 0 instead of 4 checks).

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@sarahchen6 sarahchen6 added type: feature Enhancements and improvements comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Oct 8, 2026
@datadog-prod-us1-5

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.73 s 14.71 s [-0.5%; +0.9%] (no difference)
startup:insecure-bank:tracing:Agent 13.61 s 13.60 s [-0.8%; +1.0%] (no difference)
startup:petclinic:appsec:Agent 17.66 s 17.48 s [+0.1%; +2.0%] (maybe worse)
startup:petclinic:iast:Agent 17.43 s 17.51 s [-1.3%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 17.44 s 17.28 s [-0.3%; +2.1%] (no difference)
startup:petclinic:sca:Agent 17.62 s 17.03 s [-1.0%; +7.8%] (no difference)
startup:petclinic:tracing:Agent 16.60 s 16.70 s [-1.7%; +0.4%] (no difference)

Commit: 8a0fe5e8 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@sarahchen6
sarahchen6 requested a review from bric3 October 8, 2026 19:31
@sarahchen6
sarahchen6 marked this pull request as ready for review October 8, 2026 19:31
@sarahchen6
sarahchen6 requested a review from a team as a code owner October 8, 2026 19:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T19:36:01.605017Z 8a0fe5e Draft marked ready
🔒 Security Review ✅ Completed 2026-10-08T19:34:59.863658Z 8a0fe5e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sarahchen6
sarahchen6 added this pull request to stack #12805 October 8, 2026 19:37

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Explicit module checks bypass aggregate exclusions, while compile-only requests skip dependency-version planning. These behaviors were assessed through static inspection; tests were not executed.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 8a0fe5e · @DataDog review to ask questions

@bric3 bric3 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm pre-approving, but there's still coupling here with runMuzzle which is a task created in ci-jobs.

Before merging this one, I suggest mergin into yours

val isRelevantForProject = taskProjectPath.isEmpty() || taskProjectPath == project.path
val isAggregate = taskNameOnly.equals("runMuzzle", ignoreCase = true)
val isRelevantForProject = taskProjectPath.isEmpty() || taskProjectPath == project.path ||
(isAggregate && project.path.startsWith("$taskProjectPath:"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Cover both absolute and relative paths in the nested-aggregate test; dd-java-agent:runMuzzle currently reports success without running the descendant checks.

In MuzzlePluginFunctionalTest, parameterize the existing test:

@ParameterizedTest
@ValueSource(strings = [":dd-java-agent:runMuzzle", "dd-java-agent:runMuzzle"])
fun `nested aggregate plans descendant instrumentation checks`(taskName: String) {

Use run(taskName) and retain the generated check's SUCCESS assertion. Here, the relative taskProjectPath cannot match the absolute project.path. This limitation predates the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI, this block turns out to be useless and removed in #12831, so you can dismiss it.

val session = MuzzleMavenRepoUtils.newRepositorySystemSession(system)
val taskPlanner = MuzzleTaskPlanner.from(system, session)
project.afterEvaluate {
if (relevantTasks.all { it.substringAfterLast(":").equals("runMuzzle", ignoreCase = true) } &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: Hmm this still couples muzzle plugin to ci-jobs ("runMuzzle" is registered in ci-jobs).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I stumbled by chance to a feature of Gradle that allows to register and connect task very late, when Gradle assembled the task execution graph, which happens after project evaluation but before execution.

This looks like the exact thing needed. And as a byproduct (that I actually wanted for a while) it removes afterEvaluate. This even allows to get rid of the hasRelevantTasks / relevantTasks.

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

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants