-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workspace directory #2495
Merged
Merged
Workspace directory #2495
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0e0743d
commit
bufdev b4f96cb
test
oliversun9 8e25540
git test
oliversun9 9605538
use module's workspace dir
oliversun9 8856c33
fix
oliversun9 22bf087
Merge branch 'main' into workspace-directory
bufdev 694eb4c
commit
bufdev 26b6b7e
update comment
oliversun9 8ffefbc
fix typo in comment
oliversun9 6be45b4
Update CHANGELOG.md
bufdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/breaking/a/proto/a/v1/a.proto
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/breaking/a/proto/buf.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/breaking/buf.work.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/dir/a/proto/a/v1/a.proto
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir/a/proto/buf.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir/buf.work.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/a/v1/a.proto
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/buf.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/buf.work
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,8 @@ func TestWorkspaceDir(t *testing.T) { | |
t, | ||
nil, | ||
0, | ||
filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto | ||
filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/a/proto/a/v1/a.proto | ||
testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto | ||
testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto`), | ||
"ls-files", | ||
filepath.Join("testdata", "workspace", "success", baseDirPath), | ||
|
@@ -144,7 +145,8 @@ func TestWorkspaceDir(t *testing.T) { | |
t, | ||
nil, | ||
0, | ||
filepath.FromSlash(`testdata/workspace/success/breaking/other/proto/request.proto | ||
filepath.FromSlash(`testdata/workspace/success/breaking/a/proto/a/v1/a.proto | ||
testdata/workspace/success/breaking/other/proto/request.proto | ||
testdata/workspace/success/breaking/proto/rpc.proto`), | ||
"ls-files", | ||
filepath.Join("testdata", "workspace", "success", "breaking"), | ||
|
@@ -302,48 +304,6 @@ func TestWorkspaceNestedArchive(t *testing.T) { | |
) | ||
} | ||
|
||
func TestWorkspaceGit(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is re-enabled, but moved to workspace_unix_test.go because there seems to be a problem with git clone on the Windows CI, see workflow run. This might fix it. This change doesn't reduce the number of tests because it's already skipped on main. |
||
t.Skip("skip until the move to private/buf is merged") | ||
// Directory paths specified as a git reference within a workspace. | ||
t.Parallel() | ||
testRunStdout( | ||
t, | ||
nil, | ||
0, | ||
``, | ||
"build", | ||
"../../../../.git#ref=HEAD,subdir=private/buf/cmd/buf/testdata/workspace/success/dir/proto", | ||
) | ||
testRunStdout( | ||
t, | ||
nil, | ||
0, | ||
filepath.FromSlash(`private/buf/cmd/buf/testdata/workspace/success/dir/proto/rpc.proto`), | ||
"ls-files", | ||
"../../../../.git#ref=HEAD,subdir=private/buf/cmd/buf/testdata/workspace/success/dir/proto", | ||
) | ||
testRunStdout( | ||
t, | ||
nil, | ||
bufcli.ExitCodeFileAnnotation, | ||
filepath.FromSlash(`private/buf/cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Files with package "example" must be within a directory "example" relative to root but were in directory ".". | ||
private/buf/cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Package name "example" should be suffixed with a correctly formed version, such as "example.v1".`), | ||
"lint", | ||
"../../../../.git#ref=HEAD,subdir=private/buf/cmd/buf/testdata/workspace/success/dir/proto", | ||
) | ||
testRunStdout( | ||
t, | ||
nil, | ||
bufcli.ExitCodeFileAnnotation, | ||
filepath.FromSlash(`private/buf/cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Files with package "example" must be within a directory "example" relative to root but were in directory ".". | ||
private/buf/cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Package name "example" should be suffixed with a correctly formed version, such as "example.v1".`), | ||
"lint", | ||
"../../../../.git#ref=HEAD,subdir=private/buf/cmd/buf/testdata/workspace/success/dir/proto", | ||
"--path", | ||
filepath.Join("internal", "buf", "cmd", "buf", "testdata", "workspace", "success", "dir", "proto", "rpc.proto"), | ||
) | ||
} | ||
|
||
func TestWorkspaceDetached(t *testing.T) { | ||
// The workspace doesn't include the 'proto' directory, so | ||
// its contents aren't included in the workspace. | ||
|
@@ -900,7 +860,7 @@ func TestWorkspaceBreakingFail(t *testing.T) { | |
nil, | ||
1, | ||
``, | ||
`Failure: input contained 1 images, whereas against contained 2 images`, | ||
`Failure: input contained 1 images, whereas against contained 3 images`, | ||
"breaking", | ||
filepath.Join("testdata", "workspace", "fail", "breaking"), | ||
"--against", | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a third module to test for the behavior when there are two potential dependency modules, which is what the bug is about. I verified that this fails on main and passes on this branch.