fix(release): repair the release-smoke embedded-extension leg - #927
Open
jbachorik wants to merge 1 commit into
Open
fix(release): repair the release-smoke embedded-extension leg#927jbachorik wants to merge 1 commit into
jbachorik wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release-smoke embedded-extension leg has never passed. It fails at probe-compile time:
NonPrivilegedExtensionProbeinjectsorg.example.btrace.hadoop.api.HadoopApi, but the clientcompiles probes against
$BTRACE_HOME/extensions/*/*-api.jar(
Client.getExtensionApiClasspath), andcopyExtensionsmirrors 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-smokejob is gated ondry_run != trueand 3.0.0 hasnot shipped. That is also why it matters: the job
needs: wait-for-maven, so it runs afterthe operator has manually published to Central, and
finalize-tagneeds it. A failure thereleaves 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
io.btrace.utils.PrinterService(btrace-utils), which isallow-listed, ships its API jar in the distribution, and declares no permissions — so the
allowPrivileged=falseleg still tests what it is named for.BTraceUtils.println, so it would have passed even if the service never resolved. Merelyswapping the field type would have preserved that hole.
extension is also exploded into
$DIST/extensions/, so after the retarget the filesystemcopy could satisfy the injection and leave the fat agent untested. The leg now asserts the
agent logged
BTRACE_HOME not set; using embedded extensions onlyandScanning repository: embedded:META-INF/btrace-extensions/.NO_BTRACE_HOME=1opt-in tostart_patient, applied to the twoembedded-*legsonly. It is deliberately not global: the
preparedleg runs-javaagent:$DIST/libs/btrace.jar,from which
Main.getBTraceHomederives home via thelibs/parent regardless of theenvironment, so an "embedded only" assertion there would fail.
allowExtensions=btrace-hadoop-example. It is inert —ExtensionBridgeImplconsultsisExplicitlyAllowedonly on the privileged branch — and after the retarget it was a danglingid.
allowPrivileged=falseis the constraint that actually means something here.The privileged leg is untouched: it uses
btrace-metrics, which is allow-listed and declaresTHREADS.Verification
Red/green against the same built distribution: the leg fails on
developwith the compile errorabove, and passes with this change, including both new provenance assertions.
🤖 Generated with Claude Code
This change is