-
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
Workspace directory #2495
Conversation
@@ -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 comment
The 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.
@@ -1,4 +1,5 @@ | |||
version: v1 | |||
directories: | |||
- a/proto |
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.
Verified that running |
Fixes #2480
This fixes the problem where in some occasions dependencies from workspace are not loaded correctly when
--path
is passed. For example,buf build workspacedir/a --path workspacedir/a/foo.proto
whenworkspacedir/b
andworkspacedir/c
also exist. Inmodule_file_set_builder.go
module b and module c would be hashed based on theirTargetFileInfos
, which are both empty slices due to the--path
filter. Same hash means only one of them gets added to the list of potential dependencies.In this PR, workspace modules are distinguished by their directories relative to the workspace directory. This is accomplished by adding
WorkspaceDirectory
to interfacebufmodule.Module
.