Skip to content

fix(release): repair the release-smoke embedded-extension leg - #927

Open
jbachorik wants to merge 1 commit into
developfrom
agent/fix-release-smoke-embedded-extension-leg
Open

fix(release): repair the release-smoke embedded-extension leg#927
jbachorik wants to merge 1 commit into
developfrom
agent/fix-release-smoke-embedded-extension-leg

Conversation

@jbachorik

@jbachorik jbachorik commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The release-smoke embedded-extension leg has never passed. It fails at probe-compile time:

NonPrivilegedExtensionProbe.java:6: error: package org.example.btrace.hadoop.api does not exist
BTrace compilation failed

NonPrivilegedExtensionProbe injects org.example.btrace.hadoop.api.HadoopApi, but the client
compiles probes against $BTRACE_HOME/extensions/*/*-api.jar
(Client.getExtensionApiClasspath), and copyExtensions mirrors only the release allow-list —
which does not include the Hadoop example. The API is therefore never present in a
distribution, no matter what the fat agent embeds.

Nobody has hit this because the release-smoke job is gated on dry_run != true and 3.0.0 has
not shipped. That is also why it matters: the job needs: wait-for-maven, so it runs after
the operator has manually published to Central, and finalize-tag needs it. A failure there
leaves artifacts on Central with no final tag, no GitHub release and no SDKMAN update.

Found while designing #901; independent of it, so it lands separately and first.

Changes

  • Retarget the probe to io.btrace.utils.PrinterService (btrace-utils), which is
    allow-listed, ships its API jar in the distribution, and declares no permissions — so the
    allowPrivileged=false leg still tests what it is named for.
  • Emit the asserted line through the injected service. The old probe printed it via
    BTraceUtils.println, so it would have passed even if the service never resolved. Merely
    swapping the field type would have preserved that hole.
  • Add embedded-provenance assertions. Unlike the Hadoop example, every allow-listed
    extension is also exploded into $DIST/extensions/, so after the retarget the filesystem
    copy could satisfy the injection and leave the fat agent untested. The leg now asserts the
    agent logged BTRACE_HOME not set; using embedded extensions only and
    Scanning repository: embedded:META-INF/btrace-extensions/.
  • Add a NO_BTRACE_HOME=1 opt-in to start_patient, applied to the two embedded-* legs
    only. It is deliberately not global: the prepared leg runs -javaagent:$DIST/libs/btrace.jar,
    from which Main.getBTraceHome derives home via the libs/ parent regardless of the
    environment, so an "embedded only" assertion there would fail.
  • Drop allowExtensions=btrace-hadoop-example. It is inert — ExtensionBridgeImpl consults
    isExplicitlyAllowed only on the privileged branch — and after the retarget it was a dangling
    id. allowPrivileged=false is the constraint that actually means something here.

The privileged leg is untouched: it uses btrace-metrics, which is allow-listed and declares
THREADS.

Verification

Red/green against the same built distribution: the leg fails on develop with the compile error
above, and passes with this change, including both new provenance assertions.

🤖 Generated with Claude Code


This change is Reviewable

The embedded-extension leg has never passed. It fails at probe-compile time:

  NonPrivilegedExtensionProbe.java:6: error:
    package org.example.btrace.hadoop.api does not exist

The probe injects the Hadoop example's API, but the client compiles probes
against $BTRACE_HOME/extensions/*/*-api.jar and copyExtensions mirrors only the
release allow-list, which excludes the examples. The API is therefore never in a
distribution, independent of what the fat agent embeds.

This stayed hidden because the release-smoke job is gated on dry_run != true and
3.0.0 has not shipped. It matters because the job needs wait-for-maven, so it
runs after the operator has published to Central, and finalize-tag needs it -- a
failure there strands artifacts on Central with no tag, release or SDKMAN update.

Retarget the probe to io.btrace.utils.PrinterService, which is allow-listed,
ships its API jar in the distribution, and declares no permissions, so the
allowPrivileged=false leg still tests what it is named for. Emit the asserted
line through the injected service rather than BTraceUtils, so the leg cannot
pass when the service fails to resolve.

Unlike the Hadoop example, every allow-listed extension is also exploded into
the distribution's extensions/ directory, so the retarget alone would let the
filesystem copy satisfy the injection and leave the fat agent untested. Add a
NO_BTRACE_HOME opt-in, applied to the two embedded legs only, and assert the
agent reported embedded-only resolution. The opt-in is deliberately not global:
the prepared leg runs -javaagent against the distribution's own masked jar, from
which BTrace derives its home via the libs/ parent regardless of the
environment.

Drop allowExtensions from the non-privileged leg. The policy consults it only on
the privileged branch, so it asserted nothing, and after the retarget it named a
dangling extension id.

Verified red/green against a built distribution, plus a negative run confirming
the new provenance assertion fails when BTRACE_HOME is allowed to resolve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 12:07

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants