Skip to content

Move CI-script and verification procedures into skills (PROF-16542) - #961

Open
rkennke wants to merge 5 commits into
mainfrom
rkennke/PROF-16542-ci-verify-skills
Open

rkennke wants to merge 5 commits into
mainfrom
rkennke/PROF-16542-ci-verify-skills

Conversation

@rkennke

@rkennke rkennke commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?:

Moves two procedures from AGENTS.md into agent skills:

  • .agents/skills/ci-script-change/: before changing CI configuration or a script that CI, Gradle or a hook runs, and before deleting a tracked file or removing a default entry:
    • find every caller;
    • list the script's behavior branches from its history;
    • prove a removal with a repo-wide grep;
    • check each caller and extend the script's tests.
  • .agents/skills/verify-profiler-change/: which builds and tests each kind of change needs before it is called done, and how to report flaky and blocked checks. Commands stay in doc/building/TestingGuide.md.

AGENTS.md keeps "never claim success until all affected tests pass" and a one-line pointer to each skill. It shrinks from 544 to 534 lines.

Stacked on #959, which adds the check-skills.py gate that these skills pass.

Motivation:

Both procedures apply at a known moment: editing CI, or claiming a change is done. AGENTS.md loaded them into every session. Step 2 of PROF-16466; design on PROF-16542 (decision D3 narrows verify-profiler-change to which tests to run).

Additional Notes:

  • New content, beyond the moved text:
    • verify-profiler-change adds rows for JVM-specific, libc-sensitive, build-logic, script and doc changes;
    • it adds gtestTsan for signal-handler and atomic changes;
    • it says neither the containers nor CI run Zing, so a Zing check without a local Zing is blocked with no CI coverage. Codex and Bits found that the first version asked for a covering CI job that does not exist. A later attempt to search the CI matrix gave false matches, so the skill states the fact and cites doc/architecture/JvmSupportLayer.md. When Zing returns to CI, both need updating together;
    • the JVM row also covers shared code that branches on VM::isHotspot(), VM::isOpenJ9() or VM::isZing().
  • Wider trigger: the old rule covered deleting "a script or file". The new trigger names any tracked file, and callers are searched repo-wide, including Gradle files and hooks.
  • Pre-PR review: /code-review (medium) on the first commit found 10 issues: narrowed triggers, an incomplete test-suite list, a missing TSan run, the Zing gap, a wrong Node.js version and one duplicated rule. The second commit fixes all 10. /code-review (low) on the fix found nothing. No Sphinx run, because the PR changes only Markdown.

How to test the change?:

Check State
python3 utils/check-skills.py passed, 5 skills
bash utils/tests/test_quality_check_scripts.sh passed, 231 groups
Claude Code 2.1.319 and Pi 1.2.0, headless, no MCP servers, prompts that do not name a skill, on e441e87 passed: "simplify prepare_reports.sh" loads ci-script-change; "what must pass after changing a signal-handler flag load" loads verify-profiler-change
Same prompts on main vs. this branch passed: with the skill, both harnesses read the script's git log, search its callers and run bash -n; on main, neither read the history. Both verify answers name ASan, TSan, the aarch64 container, the Gradle wrapper and blocked; on main, Pi named neither TSan nor blocked, and Claude Code named all five

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-16542

🤖 Generated with Claude Code

rkennke and others added 2 commits November 9, 2026 19:21
Both procedures apply at a known moment: before editing CI configuration
or a script CI runs, and before calling a change done. AGENTS.md loaded
them into every session.

- ci-script-change: find every caller, enumerate the script's behavior
  branches from its history, prove a removal with a repo-wide grep, and
  check each calling job. Moved from "CI / Automation Script Changes",
  plus a pointer to the hermetic script test suites.
- verify-profiler-change: which builds and tests each kind of change
  needs, by area. Moved from the first Development Guidelines bullet and
  extended with rows for JVM-specific, libc-sensitive, build-logic,
  script and doc changes, plus rules for flaky and blocked checks.
  Commands stay in doc/building/TestingGuide.md.

AGENTS.md keeps "never claim success until all affected tests pass" and
one-line pointers to both skills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ci-script-change and its AGENTS.md trigger cover deleting any tracked
  file, as the moved rule did, not only scripts. Callers are searched
  repo-wide, including Gradle files and hooks, and test suites are found
  with git ls-files instead of a partial list.
- verify-profiler-change adds gtestTsan for signal-handler and atomic
  changes, says the containers have no Zing JDK (report blocked), covers
  .github and .gitlab scripts, states that the Pi cases need Node.js
  22.6, and that running the check scripts directly is not
  qualityChecks. It drops the bug-fix test bullet that AGENTS.md
  already states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dd-octo-sts

dd-octo-sts Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervmwuk1x
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 21.1.8 (6ubuntu1)
Date:Tue Nov 10 14:54:39 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs2
Logic error
Dereference of null pointer1
Unused code
Dead initialization1

Filter Results by File

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Unused codeDead initializationreferenceChains.cppapplyOomRamp4971
Logic errorDereference of null pointerperfEvents_linux.cppunregisterThread72026

@dd-octo-sts

dd-octo-sts Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 34545bb5

@rkennke
rkennke marked this pull request as ready for review November 9, 2026 20:44
@rkennke
rkennke requested a review from a team as a code owner November 9, 2026 20:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T20:46:37.716552Z e441e87 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e441e87204

ℹ️ 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".

| --- | --- |
| C++ under `ddprof-lib/src/main/cpp/` | `:ddprof-lib:gtestDebug`; add `:ddprof-test:testDebug` when Java-visible behavior can change |
| Signal-handler paths, atomics, crash protection, thread lifecycle | The C++ row, plus `gtestAsan`, `gtestTsan` and `testAsan` where the sanitizers are available (Linux glibc), plus the aarch64 container (`./utils/run-containers-tests.sh --arch=aarch64 ...`) when there is no arm64 host: memory-ordering bugs show only there |
| JVM-implementation code (`hotspot/`, `j9/`, `zing/`) | `testDebug` against that JVM: `JAVA_TEST_HOME` set to it, or the container with the matching `--jdk` (for example `17-j9`). The containers have no Zing JDK: without a local Zing, report Zing as `blocked` and name the CI job that covers it |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not require a nonexistent Zing CI job

When a change touches zing/ and the developer has no local Zing installation, this instruction cannot be followed: both active matrices in .github/workflows/test_workflow.yml omit all -zing entries (lines 54-56 and 439-443), and doc/architecture/JvmSupportLayer.md:253-254 explicitly says Zing CI is disabled. Requiring a named CI job therefore encourages fabricated coverage and leaves the required JVM check without a valid disposition; state that no CI coverage exists or name a real job after restoring it.

AGENTS.md reference: AGENTS.md:L366-L370

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 33374cfd5 and 34545bb5b: the JVM row says that neither the containers nor CI run Zing (citing doc/architecture/JvmSupportLayer.md), so without a local Zing the check is blocked with no CI coverage. The general blocked-check rule allows "no CI job covers it". The row also covers shared code that branches on VM::isZing() and the other VM predicates.

The skill told an agent without a local Zing to report the check as
blocked and name the CI job that covers it. No such job exists: every
Zing entry in CI is commented out because the Zing downloads are gone
(.github/workflows/cache_java.yml). The skill now says so, and the
general blocked-check rule allows "no CI job covers it".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The verify-profiler-change SKILL.md instructs contributors to name a CI job covering Zing-specific changes, but Zing is excluded from all active matrices in test_workflow.yml and its downloads are disabled in cache_java.yml, so no such job exists and the procedure cannot be followed. Both the JVM row and the blocked-check rule need to be updated to explicitly allow reporting that no CI coverage is available for Zing.

Open Bits AI session

🤖 Bits Code Review · Commit e441e87

Comment on lines +17 to +28
| JVM-implementation code (`hotspot/`, `j9/`, `zing/`) | `testDebug` against that JVM: `JAVA_TEST_HOME` set to it, or the container with the matching `--jdk` (for example `17-j9`). The containers have no Zing JDK: without a local Zing, report Zing as `blocked` and name the CI job that covers it |
| libc-sensitive code (allocation hooks, `dlopen`, symbol lookup, TLS) | The matching row, plus the musl container (`--libc=musl`) |
| Java code or the Java API | `:ddprof-test:testDebug`, or the narrowest `-Ptests=` filter that covers the change, then the full suite before review |
| `build-logic/` or Gradle files | `assembleAll`, and the tasks the change affects |
| Scripts and hooks (`utils/`, `.github/scripts/`, `.gitlab/**`, `.claude/`, `.pi/`, `.githooks/`) | The test suites in the `tests/` directories next to them (`git ls-files '*/tests/*'`). The Pi adapter cases need Node.js 22.6 or newer (`--experimental-strip-types`); older versions skip them, which is not a pass. Scripts that CI, Gradle or hooks run also follow the `ci-script-change` skill. |
| Docs, skills, `AGENTS.md` | `:ddprof-lib:qualityChecks`. Running its `utils/check-*.py` scripts directly skips the signal-reachability check, which needs the debug build. |

- **Flaky failures:** re-run once. If the retry passes, record the first failure and the
retry. If it fails again, treat it as a real failure until shown otherwise.
- **When a check cannot run here** (no sanitizer runtime, no container runtime, no arm64
host, no Zing), report it as `blocked` with the reason, and name the CI job that covers
it. Never report it as passed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Account for unavailable Zing coverage in CI

For a Zing-specific change without a local Zing JDK, the new instructions require naming a covering CI job. However, both architecture matrices in .github/workflows/test_workflow.yml exclude Zing, and its downloads are disabled in .github/workflows/cache_java.yml. No configured job supplies that verification, so the procedure cannot be followed as written. Both the JVM row and the final blocked-check rule should explicitly acknowledge unavailable CI coverage.

Suggested change
| JVM-implementation code (`hotspot/`, `j9/`, `zing/`) | `testDebug` against that JVM: `JAVA_TEST_HOME` set to it, or the container with the matching `--jdk` (for example `17-j9`). The containers have no Zing JDK: without a local Zing, report Zing as `blocked` and name the CI job that covers it |
| libc-sensitive code (allocation hooks, `dlopen`, symbol lookup, TLS) | The matching row, plus the musl container (`--libc=musl`) |
| Java code or the Java API | `:ddprof-test:testDebug`, or the narrowest `-Ptests=` filter that covers the change, then the full suite before review |
| `build-logic/` or Gradle files | `assembleAll`, and the tasks the change affects |
| Scripts and hooks (`utils/`, `.github/scripts/`, `.gitlab/**`, `.claude/`, `.pi/`, `.githooks/`) | The test suites in the `tests/` directories next to them (`git ls-files '*/tests/*'`). The Pi adapter cases need Node.js 22.6 or newer (`--experimental-strip-types`); older versions skip them, which is not a pass. Scripts that CI, Gradle or hooks run also follow the `ci-script-change` skill. |
| Docs, skills, `AGENTS.md` | `:ddprof-lib:qualityChecks`. Running its `utils/check-*.py` scripts directly skips the signal-reachability check, which needs the debug build. |
- **Flaky failures:** re-run once. If the retry passes, record the first failure and the
retry. If it fails again, treat it as a real failure until shown otherwise.
- **When a check cannot run here** (no sanitizer runtime, no container runtime, no arm64
host, no Zing), report it as `blocked` with the reason, and name the CI job that covers
it. Never report it as passed.
| JVM-implementation code (`hotspot/`, `j9/`, `zing/`) | `testDebug` against that JVM: `JAVA_TEST_HOME` set to it, or the container with the matching `--jdk` (for example `17-j9`). The containers have no Zing JDK: without a local Zing, report Zing as `blocked`. Zing is also disabled in the CI matrices, so explicitly report that CI coverage is unavailable |
| libc-sensitive code (allocation hooks, `dlopen`, symbol lookup, TLS) | The matching row, plus the musl container (`--libc=musl`) |
| Java code or the Java API | `:ddprof-test:testDebug`, or the narrowest `-Ptests=` filter that covers the change, then the full suite before review |
| `build-logic/` or Gradle files | `assembleAll`, and the tasks the change affects |
| Scripts and hooks (`utils/`, `.github/scripts/`, `.gitlab/**`, `.claude/`, `.pi/`, `.githooks/`) | The test suites in the `tests/` directories next to them (`git ls-files '*/tests/*'`). The Pi adapter cases need Node.js 22.6 or newer (`--experimental-strip-types`); older versions skip them, which is not a pass. Scripts that CI, Gradle or hooks run also follow the `ci-script-change` skill. |
| Docs, skills, `AGENTS.md` | `:ddprof-lib:qualityChecks`. Running its `utils/check-*.py` scripts directly skips the signal-reachability check, which needs the debug build. |
- **Flaky failures:** re-run once. If the retry passes, record the first failure and the
retry. If it fails again, treat it as a real failure until shown otherwise.
- **When a check cannot run here** (no sanitizer runtime, no container runtime, no arm64
host, no Zing), report it as `blocked` with the reason. Name a covering CI job if one
exists; otherwise, explicitly report that CI coverage is unavailable. Never report it
as passed.

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 33374cfd5 and 34545bb5b: the JVM row says that neither the containers nor CI run Zing (citing doc/architecture/JvmSupportLayer.md), so without a local Zing the check is blocked with no CI coverage. The general blocked-check rule allows "no CI job covers it". The row also covers shared code that branches on VM::isZing() and the other VM predicates.

rkennke and others added 2 commits November 9, 2026 21:44
…16542)

Review follow-ups to the Zing fix:

- The JVM row also covers shared code that branches on VM::isHotspot(),
  VM::isOpenJ9() or VM::isZing(), where most Zing behavior lives.
- Instead of stating today's CI state, the row tells the agent to check
  the JDK matrix in .github/workflows/test_workflow.yml for a -zing entry
  before claiming coverage. The statement cannot go stale when Zing is
  re-enabled.
- The blocked-check rule says where to look for a covering CI job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit told agents to search test_workflow.yml for a -zing
entry. The file still contains -zing in commented-out matrices and in
conditionals, so the search reports coverage that does not exist. The
row now states the fact and cites doc/architecture/JvmSupportLayer.md,
which records that Zing is disabled in the CI JDK matrix. The search for
a covering job includes the .gitlab/ files that .gitlab-ci.yml includes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dd-octo-sts

dd-octo-sts Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #42838093658 | Commit: f1abcdc | Duration: 20m 56s (longest job)

✅ All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - ✅ - -
8-ibm - ✅ - -
8-j9 ✅ ✅ - -
8-librca - - ✅ ✅
8-orcl - ✅ - -
11 - ✅ - -
11-j9 ✅ ✅ - -
11-librca - - ✅ ✅
17 ✅ ✅ - -
17-graal ✅ ✅ - -
17-j9 ✅ ✅ - -
17-librca - - ✅ ✅
21 ✅ ✅ - -
21-graal ✅ ✅ - -
21-librca - - ✅ ✅
25 ✅ ✅ - -
25-graal ✅ ✅ - -
25-librca - - ✅ ✅

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-11-10 15:14:35 UTC

Base automatically changed from rkennke/PROF-16542-writing-skills to main November 10, 2026 15:14

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

Copy link
Copy Markdown

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

The extracted procedures preserve caller tracing and behavior-preservation safeguards. The verification guidance explicitly marks unavailable Zing checks as blocked with no CI coverage, avoiding an unsupported claim of validation.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 34545bb

@datadog-prod-us1-3

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

DDCI - DataDog/java-profiler | renaissance-benchmarks: [akka-uct, 21] — 🔄 Retry may pass, looks flaky

View more details · View in DDCI

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 34545bb | Docs | View more details | Give us feedback!

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant