Bump Go module path to github.com/grafana/pyroscope/v2#5073
Merged
simonswine merged 9 commits intografana:mainfrom Apr 17, 2026
Merged
Bump Go module path to github.com/grafana/pyroscope/v2#5073simonswine merged 9 commits intografana:mainfrom
simonswine merged 9 commits intografana:mainfrom
Conversation
Go requires a /v2 suffix in the module path for major version >= 2. Updates the root module declaration, all internal import paths, the Makefile VPREFIX, and pkg/buf.gen.yaml go_package_prefix. The api and lidia submodules are kept at their current v1 paths.
After bumping pkg/buf.gen.yaml go_package_prefix to .../v2/pkg/, the embedded raw file descriptors in the generated .pb.go files needed regenerating to encode the correct go_package option string.
find_go.go: fix comment that was incorrectly updated to include /v2 by the bulk import path rewrite. find_test.go: remove incorrect /v2 from expected GitHub web URLs that were incorrectly updated by the bulk import path rewrite (these are HTML URLs, not Go import paths).
compacted.golden: update byte offsets/sizes — the block data encodes function names which are 3 bytes longer with the v2 path, shifting all table-of-contents offsets. compaction_test.go: revert FunctionName strings to v1 paths — the testdata/segments were profiled from a v1 binary so recording rule function name matching must use the old module path.
aleks-p
approved these changes
Apr 17, 2026
| buf: make([]parquet.Row, 1), | ||
| GenericWriter: parquet.NewGenericWriter[*schemav1.Profile](w, | ||
| parquet.CreatedBy("github.com/grafana/pyroscope/", build.Version, build.Revision), | ||
| parquet.CreatedBy("github.com/grafana/pyroscope/v2/", build.Version, build.Revision), |
Contributor
There was a problem hiding this comment.
do we want/need the change here?
Comment on lines
+258
to
+259
| FunctionName: "github.com/grafana/pyroscope/v2/pkg/compactionworker.(*Worker).runCompaction", | ||
| Path: "/Users/christian/git/github.com/grafana/pyroscope/v2/pkg/compactionworker/worker.go", |
Contributor
There was a problem hiding this comment.
probably doesn't matter since it is a test, but this path seems wrong
| FunctionName: "github.com/grafana/pyroscope/pkg/foo.Bar", | ||
| Path: "/Users/christian/git/github.com/grafana/pyroscope/pkg/foo/bar.go", | ||
| FunctionName: "github.com/grafana/pyroscope/v2/pkg/foo.Bar", | ||
| Path: "/Users/christian/git/github.com/grafana/pyroscope/v2/pkg/foo/bar.go", |
Contributor
There was a problem hiding this comment.
probably doesn't matter since it is a test, but this path seems wrong
| @@ -69,7 +69,7 @@ type profileStore struct { | |||
|
|
|||
| func newParquetProfileWriter(writer io.Writer, options ...parquet.WriterOption) *parquet.GenericWriter[*schemav1.Profile] { | |||
| options = append(options, parquet.PageBufferSize(parquetWriteBufferSize)) | |||
| options = append(options, parquet.CreatedBy("github.com/grafana/pyroscope/", build.Version, build.Revision)) | |||
| options = append(options, parquet.CreatedBy("github.com/grafana/pyroscope/v2/", build.Version, build.Revision)) | |||
Contributor
There was a problem hiding this comment.
same here, do we want/need this change?
parquet.CreatedBy is metadata stored in parquet file headers - it's a human-readable identifier, not a Go import path. The bulk module path rewrite incorrectly changed "github.com/grafana/pyroscope/" to "github.com/grafana/pyroscope/v2/" in all five places. Also revert the two local filesystem paths in find_test.go that got /v2 added by the bulk rewrite. Go module major version suffixes apply to import paths, not to filesystem paths where repos are checked out. The function names (which are import paths) correctly retain /v2.
This reverts commit 88f3cf3.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 932ccb3. Configure here.
1 task
4 tasks
4 tasks
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
github.com/grafana/pyroscopetogithub.com/grafana/pyroscope/v2to comply with Go's major version suffix requirement for v2+ releasespkg/buf.gen.yamlgo_package_prefixandMakefileVPREFIXto matchThe
apiandlidiasubmodules are intentionally kept at their v1 module paths.Test plan
go build ./...passesgo mod tidyproduces no changesmake lintpassesgrep -r '"github.com/grafana/pyroscope/' --include='*.go' . | grep -v '/v2/' | grep -v 'pyroscope-go' | grep -v 'pyroscope/api/' | grep -v 'pyroscope/lidia'Note
Medium Risk
Moderate risk because it changes the Go module path and rewrites a large number of internal imports, which can break downstream builds and generated-code references if anything is missed. No functional logic changes are intended, but build/test tooling and dependency resolution are affected repo-wide.
Overview
Updates the root Go module path to
github.com/grafana/pyroscope/v2and rewrites internal imports throughout the repo to use the new.../v2/...prefix.Aligns build and codegen configuration with the new module path (e.g.,
MakefileVPREFIXandpkg/buf.gen.yamlgo_package_prefix), and updates generated Go protobuf/connect outputs accordingly.Reviewed by Cursor Bugbot for commit fefa8dd. Bugbot is set up for automated code reviews on this repo. Configure here.