sasa1977 / site_encrypt

Integrated certification via Let's encrypt for Elixir-powered sites
MIT License
462 stars 33 forks source link

Upgrade telemetry to 1.0 #39

Closed dzfranklin closed 2 years ago

dzfranklin commented 2 years ago

With phoenix 1.6.0 I'm getting a dependency resolution error

Failed to use "telemetry" (version 1.0.0) because
  phoenix (version 1.6.0) requires ~> 0.4 or ~> 1.0
  phoenix_live_view (version 0.16.4) requires ~> 0.4.2 or ~> 1.0
  swoosh (version 1.5.0) requires ~> 0.4.2 or ~> 1.0
  telemetry_metrics (version 0.6.1) requires ~> 0.4 or ~> 1.0
  telemetry_poller (versions 0.5.0 and 0.5.1) requires ~> 0.4

I think this can be fixed by just upgrading the version of telemetry in site_encrypt's mix.exs

There are no changes in the 1.0.0 release - it marks the stability of the API. https://hexdocs.pm/telemetry/changelog.html#1-0-0

(In the meantime I've resolved this by adding {:telemetry, "~> 1.0", override: true} to my deps list.)

sasa1977 commented 2 years ago

I'm a bit confused, since site_encrypt doesn't directly depend on telemetry. Are you certain that site_encrypt causes this?

dzfranklin commented 2 years ago

You're right, it's an indirect dependency through parent

sasa1977 commented 2 years ago

Oh, this reminds me I got a PR fixing this in parent a few months ago. So it looks like the solution would be to publish new parent to hex.

sasa1977 commented 2 years ago

I just published parent 0.12.1 to hex. Could you please update your parent dep, drop the telemetry override, and let me know if it works?

dzfranklin commented 2 years ago

I depend on parent through site_encrypt. Are you asking me to replace the telemetry override with a parent override?

sasa1977 commented 2 years ago

No, I was thinking something like:

  1. mix deps.unlock parent (which should remove the parent entry from mix.lock)
  2. drop telemetry override from mix.exs
  3. mix.deps.get
dzfranklin commented 2 years ago

Thanks. I'd misunderstood how dependencies work in elixir. That worked great, my issue is resolved.