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

Cannot import 2 proto files with the same name in different directories #44

Closed
agoodsell5 opened this issue Sep 2, 2021 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@agoodsell5
Copy link

Describe the bug
We have versioned proto files, so we have a folder named v1 and a folder named v2. Inside these ideally we would have proto files with the same name, e.g. customer_service.proto. However, when we do this, Kreya is unable to import both services. If we name the files something different they import perfectly. I think this feels like a bug to me.

To Reproduce
Steps to reproduce the behavior:

  1. Create folder with service called serviceA.proto
  2. Create another folder with service called serviceA.proto
  3. Try importing both of these at the same time using the folders parent folder has the import path
  4. Only one service will be imported

Expected behavior
Both files should be imported, the name of the file should not determine if we can import it.

Environment (if possible, copy the information from the error dialog or the About menu):

  • {
    "kreyaVersion": "1.5.0",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16) AppleWebKit/605.1.15 (KHTML, like Gecko)"
    }
@agoodsell5 agoodsell5 added the bug Something isn't working label Sep 2, 2021
@CommonGuy
Copy link
Contributor

Yes, this is a bug in the current Kreya version. It will be fixed in the upcoming v1.6 release.

As an aside, the bug exists because we can only add proto files as relatives path (relative to the import path(s)). Given the following directory structure:

/root
  /v1
    serviceA.proto
  /v2
    serviceA.proto

The current Kreya version will first add /root, /root/v1 and /root/v2 as import paths, then the serviceA.proto file (only once, since duplicates are ignored). The upcoming Kreya version will only add /root as an import path and the files correctly as v1/serviceA.proto and v2/serviceA.proto.

Note that if you would add /root/v1 and /root/v2 manually as separate import paths, it will still not work in future versions, since the relative paths would still be the same. The import path has to be the parent /root folder.

@CommonGuy CommonGuy added the status:waiting-for-release Implemented, waiting for next stable release label Sep 2, 2021
@CommonGuy
Copy link
Contributor

If you want, you can already try it out in the 1.6.0-beta.1 version by switching the release channel in the About window and checking for updates. Note that the beta version may contain bugs.

@CommonGuy
Copy link
Contributor

V1.6 has been released

@CommonGuy CommonGuy removed the status:waiting-for-release Implemented, waiting for next stable release label Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants