fix(validator): run buf lint/breaking from module root with --path#6
Merged
Conversation
buf v2 rejects a path contained by a module as a positional build input, so release finalize's re-validation failed for every proto-module canonical repo. Resolve the buf workspace/module root and select the target schema dir via --path instead. Adds bufRootAndPath + TestBufRootAndPath.
buf v2 rejects --path when the path is itself a module root (it must be the positional input) and rejects a positional input contained by a module (must use --path). Decide based on the module paths declared in buf.yaml/buf.work.yaml so both 'apx lint proto' (module root) and finalize's per-API subdir validation work. Fixes the TestScript lint_proto/breaking_proto regressions.
This was referenced Jun 10, 2026
Closed
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.
What
apx release finalizere-validates the schema withbuf lint/buf breaking, invoking buf withthe API subdirectory as a positional build input:
For any canonical repo whose protos live under a buf v2 module (
module_roots: [proto]), bufrejects this:
This makes
finalizefail at re-validation for everyproto-module repo, so a versioned releasetag can never be cut. (
apx lintwith no args is unaffected because it lints the whole module.)Fix
ProtoValidator.Lint/Breakingnow resolve the buf workspace/module root (nearest ancestor withbuf.work.yaml/buf.yaml), run buf from that root, and select the target via--path:This is the buf-blessed invocation (verified: the equivalent command exits 0 on a real canonical
repo where the old form fails). When the schema dir is itself the module root,
--pathis omitted.A
bufRootAndPathhelper does the root detection; addedTestBufRootAndPath(pure filesystem,no buf needed).
go build ./...andgo test ./internal/validator/...pass.Context
This is finding #1 of #5. That issue also tracks three related release-pipeline
gaps (finalize unwired in canonical CI; tag
…/v1/vXvs go-module…/<name>mismatch;apx auth loginnot persisting a usable token) which are out of scope for this PR.Closes #5 partially (finding #1).