Closed igor-tsiglyar closed 1 week ago
Hi, do you mind providing an example of how you've structured and configured your workspace vs. BSR modules? It is not clear to me what the contents of your workspace are and how they differ from how your BSR modules are structured.
@doriable Sure, with workspaces I have the following config in module A
:
buf.work.yaml
version: v1
directories:
- proto
- _third_party/B
Respective config for dependent module B
:
buf.work.yaml
version: v1
directories:
- proto
- _third_party/C
With BSR, I have buf.work.yaml
replaced with a deps
entry in the buf.yaml
file, like:
buf.yaml
version: v1
deps:
- <bsr>/B:<version>
When running buf generate
with debug logging, I have noticed that with workspace the files from module B
are treated as local:
{
"all_with_imports": {
"local": {
"B.proto": [
"C.proto"
],
"A.proto": [
"B.proto"
],
}
},
}
While when using BSR scheme, they are placed under respective dependency modules:
"all_with_imports": {
"local": {
"A.proto": [
"B.proto"
],
},
"C": {
"C.proto"
},
"B": {
"B.proto": [
"C.proto"
]
}
},
This is probably why I cannot apply the --path
filter to them. So the general question is: can I somehow control which BSR dependency files are passed into buf generate
other than using --include-imports
which would pass the whole dependency tree?
@igor-tsiglyar, you're going to have to provide us a reproducible example that demonstrates the issue you'd like us to see - check out the bug template for more information on providing a reproducible example https://github.com/bufbuild/buf/issues/new?assignees=&labels=Bug&projects=&template=1-bug-report.yml
Once that is provided, we're happy to take a look!
We weren't able to get a reproduction here, so we're going to close this issue for now. @igor-tsiglyar, if you're able to provide one, please comment with a link to the reproduction and we are more than happy to re-open!
@bufdev @doriable Sure, thanks! For now we decided to implement filtering at the plugin level, so we are fine with using --include-imports
. Will reopen, once that changes.
What's up?
Hi,
I am having the proto file
A
importing another proto fileB
from a dependency. The dependent proto fileB
, in turn, imports other proto fileC
.When using workspaces to make
A
->B
->C
dependency, I am able to pass onlyA
andB
togenerate
using--path
parameter.When using BSR modules, I am only able to use
--include-imports
option, which passes all 3 filesA
,B
, andC
to the plugin in gen config, which is undesirable.Any way I can either limit import depth, or explicitly specify the files from modules to be passed into
generate
?Thanks!