Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/framework-google_stackdriver_profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The Google Stackdriver Profiler Framework causes an application to be automatica
</table>
Tags are printed to standard output by the buildpack detect script

## Version
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). 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.

Expand Down
42 changes: 42 additions & 0 deletions src/java/frameworks/manifest_uris_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
}