Repository navigation
Basis for java agent rule skill - #12816
colin-higgins wants to merge 12 commits into
Conversation
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d27fba9cb6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| Use this file after the [SpotBugs skill](../SKILL.md) classification step finds no matching detector. Do not start here. | ||
|
|
||
| Pick the **narrowest** vehicle that can fail CI with low false positives. One rule per change, same as SpotBugs. |
There was a problem hiding this comment.
Account for non-blocking Forbidden APIs modules
For repository-wide banned-call rules, Forbidden APIs is not currently a blocking gate in every production module: dd-java-agent/agent-otel/otel-bootstrap/build.gradle overrides forbiddenApis.ignoreFailures to true. A violation confined to that module therefore does not fail CI, contrary to the selection criterion here; either document the coverage exception, remove the override as part of enabling the rule, or choose a vehicle that can enforce it there.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
suggestion: This is true, and this is intentional, on some specific modules only, currently only 3 modules disable it.
It might be worth mentioning it though.
|
|
||
| Use when the rule is “never call this method/class” with **no location qualifier** (not “only in `@Advice`”, not “only in premain”). | ||
|
|
||
| 1. Append **one** signature (and optional `@defaultMessage`) to `main.txt`. |
There was a problem hiding this comment.
Reset the inherited Forbidden APIs message
When a signature is appended without its own message, it inherits the last @defaultMessage in the file; the parser retains that value for every subsequent signature until another directive replaces or clears it (implementation). Because main.txt currently ends with the OkHostnameVerifier message, following this instruction literally gives the new rule that unrelated CVE message; require an inline message or an explicit @defaultMessage reset before appending.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
suggestion: Maybe adding an example there would be useful, to teach the agent how this file format works.
In particular if the rule is not added to an existing one, then require an explicit message for each new rule, either inline or through its own @defaultMessage?
See my message on https://github.com/DataDog/dd-trace-java/pull/12816/changes#r4295777114 that addresses the two points.
There was a problem hiding this comment.
The skill can retain a newly enabled visitor after checking only the main source set, although blocking CI also analyzes Java 11 production sources.
🤖 Bits Code Review · Commit d27fba9
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. |
bric3
left a comment
There was a problem hiding this comment.
Two documentation suggestions on shared conventions and justified exceptions. The existing discussions cover the source-set commands and detector selection.
| Config: [`gradle/forbiddenApiFilters/main.txt`](../../../../gradle/forbiddenApiFilters/main.txt), | ||
| [`gradle/forbiddenapis.gradle`](../../../../gradle/forbiddenapis.gradle). | ||
|
|
||
| Use when the rule is “never call this method/class” with **no location qualifier** (not “only in `@Advice`”, not “only in premain”). |
There was a problem hiding this comment.
suggestion: We may want to we mention the extra signature lists for specific module types?
main.txtholds the common rules,- while the instrumentation convention also adds
instrumentation.txt.
This helps the skill choose the right file for a new ban while keeping tool enablement in the module configuration.
bric3
left a comment
There was a problem hiding this comment.
Answered some messages from codex.
|
|
||
| Use this file after the [SpotBugs skill](../SKILL.md) classification step finds no matching detector. Do not start here. | ||
|
|
||
| Pick the **narrowest** vehicle that can fail CI with low false positives. One rule per change, same as SpotBugs. |
There was a problem hiding this comment.
suggestion: This is true, and this is intentional, on some specific modules only, currently only 3 modules disable it.
It might be worth mentioning it though.
|
|
||
| Use when the rule is “never call this method/class” with **no location qualifier** (not “only in `@Advice`”, not “only in premain”). | ||
|
|
||
| 1. Append **one** signature (and optional `@defaultMessage`) to `main.txt`. |
There was a problem hiding this comment.
suggestion: Maybe adding an example there would be useful, to teach the agent how this file format works.
In particular if the rule is not added to an existing one, then require an explicit message for each new rule, either inline or through its own @defaultMessage?
See my message on https://github.com/DataDog/dd-trace-java/pull/12816/changes#r4295777114 that addresses the two points.
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
What Does This Do
Add a skill for guiding agentic static analysis rule suggestions
Motivation
See above
Additional Notes
None
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]