Skip to content
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

Buf.yaml: Multiple modules to have the same path causes extension to stop working #347

Closed
KinNeko-De opened this issue Dec 2, 2024 · 3 comments · Fixed by #348
Closed

Comments

@KinNeko-De
Copy link

Hey..
I am currently writing an article about the integration of buf in visual studio code.
I tried to managed a gitrepository which contains the apis for multiple applications.

I finally found a version where buf lint --config buf.yaml does not report errors because of a wrong package name.
I found the solution with the documentaion: https://buf.build/docs/configuration/v2/buf-yaml/ and the following lines:
Just as side context: The documentation is not correct: bufbuild/buf#3501 (comment)

# Multiple modules are allowed to have the same path, as long as they don't share '.proto' files.
  - path: proto/common
    name: buf.build/acme/weather
    includes:
      - proto/common/weather
  - path: proto/common
    name: buf.build/acme/location
    includes:
      - proto/common/location`

This is a relativ new feature from version v1.39.0 of buf.build

Visual Studio Code:
Version: 1.95.3 (user setup)
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Buf version : 1.47.2
Buf vs extension: v0.6.2

The visual code extension stop working with my buf.yaml configuration.

If I start Visual Studio Code no error in proto files are highlighted.
If I remove the lines and save the proto again the error are highlighted.
If I then added the lines my error in protobuf still appear and do not change even if i fix them
bufExntesion

I have no error in the log of Extension Host but I have an error in the developer tools of visual studio code. It happens every time I add the lines and save the proto.
I will attach the log snippet:
vscode-app-1733163057834.log

If you need further information let me know please.

@doriable
Copy link
Member

doriable commented Dec 4, 2024

Hello! So we dug into the issue, and there are actually a couple of things happening. So the first thing, as you've noticed, is that errors are not well-surfaced through the console, and so a change is currently made to address that: #348

The second, is that once we were able to get to the errors, we were able to find a bug in buf which is being addressed currently (bufbuild/buf#3512).

Once we have merged the change in VSCode and buf these fixes will be available with their respective releases. Thanks!

@KinNeko-De
Copy link
Author

Hey..
I wrote you while you wrote me :)
I looked at your pull request and was a little bit confused about the error that there are no proto files. Because there is one.
I have the feeling that your analysis is correct. I understand go code but I have to dig into your second pull request to fully unterstand the fix.

Thanks for your effort.
I will move my article where I create a api for multiple products in a monorepository to january.
Instead I plan to write an december article for buf integration in vs code instead. This will include a appreciation for your fast help. I do not need the fixes for this article.

......
I created another example in another branch. Maybe that helps:
I removed only the lines with 'another' from my buf.yaml and then the extension works again.
I then add a 1:1 copy of ecommece in another feature branch. And then the extension stop working:
https://github.com/KinNeko-De/poc-sample-apicontract-oneapi/tree/feature/define-more/proto/samplecompany

@doriable
Copy link
Member

doriable commented Dec 5, 2024

Thank you for being understanding! We've merged both fixes and we'll be making releases for the VSCode extension and buf CLI soon, so hopefully this resolves the issues :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants