From 0778107d29451944e5e7867932273d09a43738f1 Mon Sep 17 00:00:00 2001 From: Peter Paul Bakker Date: Fri, 13 Nov 2026 22:32:24 +0000 Subject: [PATCH 1/2] fix(manifest): pin google-stackdriver-profiler to its versioned artifact --- docs/framework-google_stackdriver_profiler.md | 3 ++ manifest.yml | 4 +- src/java/frameworks/manifest_uris_test.go | 42 +++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/java/frameworks/manifest_uris_test.go diff --git a/docs/framework-google_stackdriver_profiler.md b/docs/framework-google_stackdriver_profiler.md index e10b98ca80..4fb9693cf9 100644 --- a/docs/framework-google_stackdriver_profiler.md +++ b/docs/framework-google_stackdriver_profiler.md @@ -16,6 +16,9 @@ The Google Stackdriver Profiler Framework causes an application to be automatica Tags are printed to standard output by the buildpack detect script +## Version +Google publishes the agent as `cloud-profiler-java-agent__RC.tar.gz`, a date based version that Cloud Foundry's semantic version resolver cannot handle. The manifest therefore maps `_RC` to `0..`, for example `20261026_RC00` is `0.20261026.0`. The `uri` points to the versioned artifact, never to the floating `latest` copy, so the pinned `sha256` stays valid. + ## User-Provided Service (Optional) Users may optionally provide their own Google Stackdriver Profiler service. A user-provided Google Stackdriver Profiler service must have a name or tag with `google-stackdriver-profiler` in it so that the Google Stackdriver Profiler Agent Framework will automatically configure the application to work with the service. diff --git a/manifest.yml b/manifest.yml index 1bc7f6b6f2..7fb8c2ff0c 100644 --- a/manifest.yml +++ b/manifest.yml @@ -338,8 +338,8 @@ dependencies: source: https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/1.14.0/elastic-otel-javaagent-1.14.0.jar source_sha256: '' - name: google-stackdriver-profiler - version: 0.4.0 - uri: https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz + version: 0.20261026.0 + uri: https://storage.googleapis.com/cloud-profiler/java/cloud-profiler-java-agent_20261026_RC00.tar.gz sha256: bd44383322b51b4ddd45233306d318a4f89afa69d5461c412f06ccbb6e11f835 cf_stacks: - cflinuxfs4 diff --git a/src/java/frameworks/manifest_uris_test.go b/src/java/frameworks/manifest_uris_test.go new file mode 100644 index 0000000000..5d7ba5418a --- /dev/null +++ b/src/java/frameworks/manifest_uris_test.go @@ -0,0 +1,42 @@ +package frameworks_test + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "go.yaml.in/yaml/v3" +) + +// A dependency URI must point to one fixed artifact. A floating URI such as +// .../latest/... changes content without changing the URI, so the pinned sha256 +// breaks whenever the vendor republishes, and the packager keeps reusing a stale +// download that is cached under the URI. +func TestManifestDependencyURIsAreNotFloating(t *testing.T) { + data, err := os.ReadFile(filepath.Join("..", "..", "..", "manifest.yml")) + if err != nil { + t.Fatalf("read manifest.yml: %v", err) + } + + var manifest struct { + Dependencies []struct { + Name string `yaml:"name"` + Version string `yaml:"version"` + URI string `yaml:"uri"` + } `yaml:"dependencies"` + } + if err := yaml.Unmarshal(data, &manifest); err != nil { + t.Fatalf("parse manifest.yml: %v", err) + } + if len(manifest.Dependencies) == 0 { + t.Fatal("no dependencies found in manifest.yml") + } + + for _, dependency := range manifest.Dependencies { + if strings.Contains(dependency.URI, "/latest/") { + t.Errorf("%s %s has a floating uri, use the versioned artifact instead: %s", + dependency.Name, dependency.Version, dependency.URI) + } + } +} From 327c9ffa540b7a3507c32376d19b40806e17ef3d Mon Sep 17 00:00:00 2001 From: Peter Paul Bakker Date: Fri, 20 Nov 2026 12:24:32 +0000 Subject: [PATCH 2/2] fix(manifest): use the Stackdriver profiler release from GitHub Google publishes the agent as release v0.5.0 of GoogleCloudPlatform/cloud-profiler-java, with the same file as the Cloud Storage release 20261026_RC00 (same sha256). Use the real version 0.5.0 and the versioned release URL instead of the date mapped label 0.20261026.0. --- docs/framework-google_stackdriver_profiler.md | 2 +- manifest.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/framework-google_stackdriver_profiler.md b/docs/framework-google_stackdriver_profiler.md index 4fb9693cf9..a6490a2c28 100644 --- a/docs/framework-google_stackdriver_profiler.md +++ b/docs/framework-google_stackdriver_profiler.md @@ -17,7 +17,7 @@ The Google Stackdriver Profiler Framework causes an application to be automatica Tags are printed to standard output by the buildpack detect script ## Version -Google publishes the agent as `cloud-profiler-java-agent__RC.tar.gz`, a date based version that Cloud Foundry's semantic version resolver cannot handle. The manifest therefore maps `_RC` to `0..`, for example `20261026_RC00` is `0.20261026.0`. The `uri` points to the versioned artifact, never to the floating `latest` copy, so the pinned `sha256` stays valid. +The agent version is the version of the Google release, `vX.Y.Z` of [GoogleCloudPlatform/cloud-profiler-java](https://github.com/GoogleCloudPlatform/cloud-profiler-java/releases), and the manifest points at the asset `profiler_java_agent.tar.gz` of that release. The default version pin `0.x` resolves to it. ## User-Provided Service (Optional) Users may optionally provide their own Google Stackdriver Profiler service. A user-provided Google Stackdriver Profiler service must have a name or tag with `google-stackdriver-profiler` in it so that the Google Stackdriver Profiler Agent Framework will automatically configure the application to work with the service. diff --git a/manifest.yml b/manifest.yml index 7fb8c2ff0c..c60ee925e8 100644 --- a/manifest.yml +++ b/manifest.yml @@ -338,8 +338,8 @@ dependencies: source: https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/1.14.0/elastic-otel-javaagent-1.14.0.jar source_sha256: '' - name: google-stackdriver-profiler - version: 0.20261026.0 - uri: https://storage.googleapis.com/cloud-profiler/java/cloud-profiler-java-agent_20261026_RC00.tar.gz + version: 0.5.0 + uri: https://github.com/GoogleCloudPlatform/cloud-profiler-java/releases/download/v0.5.0/profiler_java_agent.tar.gz sha256: bd44383322b51b4ddd45233306d318a4f89afa69d5461c412f06ccbb6e11f835 cf_stacks: - cflinuxfs4