Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- This issue affects my Ory Network project.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Bug Description
Generated Elixir module names such as Ory.Connection
clash. Elixir dependencies cannot override each other's Modules, but the generated code does contain the same module name in different dependencies:
Examples:
This is a follwup to this comment #194 (comment)
Reproducing the bug
Create any library importing e.g. at least 2 packages:
Example snippet from mix.exs
:
defp deps do
[
...
{:ory_client, github: "ory/sdk", sparse: "clients/client/elixir/"},
{:ory_hydra, github: "ory/sdk", sparse: "clients/hydra/elixir/"}
]
end
Relevant log output
when building/running lots of warnings such as this one is logged:
warning: redefining module Ory.Connection (current version loaded from /workspace/cantex_umbrella/_build/dev/lib/ory_client/ebin/Elixir.Ory.Connection.beam)
lib/ory/connection.ex:5
Relevant configuration
Here is the Variable setting, to which I propose to add this line:
export ELIXIR_INVOKER_MODULE="Ory.${PROJECT^}"
Line 85 in 2324e5c
And here the line 3 should be changed to
invokerPackage: ${ELIXIR_INVOKER_MODULE}
Lines 1 to 3 in 2324e5c
This results in package names such as Ory.Hydra.Connection
Version
latest stable versions
Additional Context
@aeneasr I'm putting here the questions I have for understanding & documentation, These are mostly issues to get the PR right.
- How shall a PR be formulated? I'm thinking about a multi commit PR, one commit comprising the config changes, another one with each package.?
- Does the build pipeline build all clients, all the time?
- Are the old spec vertions built too?
- How does the spec version map to package versions generally [if there's a rule/docs]?
- Is there such a thing as an [aglorithmic] sdk version ?
I'll come back with a PR on this, I've already forked the sdk. The bug is easy to solve, but perhaps a followup documentation issue would benefit from those questions.
It's a rather long post, so feel free to only discuss in context of the upcoming PR.