beam-telemetry/telemetry_poller

Hex does not include the telemetry dependency

CaiqueMitsuoka opened this issue · 17 comments

In the telemetry_poller hex 0.4.0 release its does include the telemetry dependency.

The version 0.3.0 includes.

The problem is when we add the telemetry_poller and has an older version of telemetry, like 0.3.0, it will not have a dependency issue, it will run and them crash, since the telemetry:execute/3 change its api.

It seems we do list telemetry as a dependency in rebar.config though. @arkgil, do you have any idea what may have happened?

Yeah, that's strange. Rebar3 correctly lists telemetry as a dependency, even in docs profile we use to publish the package. I'll investigate.

@CaiqueMitsuoka can you provide a mix.exs/rebar.config file which causes this problem? I was able to reproduce, however I'm not sure if I hit exactly the same problem as you did.

@josevalim funny thing is that for Poller we pin Telemetry version using ~> syntax:
https://github.com/beam-telemetry/telemetry_poller/blob/master/rebar.config#L3

However, I'm not really sure if it's a valid rebar3 dep specification.

@arkgil that is right.

But somehow it was published without the dep https://hex.pm/packages/telemetry_poller/0.4.0

@arkgil afaik its is valid syntax the ~>, I think hackney uses just fine.

I've create an example app, here is the mix.lock if you just run the iex -S mix you will get the error of poller calling telemetry:execute/3 with bad args.

This will cause it to get 0.3.0, right? https://github.com/CaiqueMitsuoka/telemetry_dep_example/blob/master/mix.exs#L24

But telemetry_pollerdoes need to be published again so it picks up the dependency on telemetry 0.4.0.

I remember that we had to publish the docs again (the audit log confirms that), so I wonder if something goofy happened. Seems like republishing should correct it.

When publishing rebar3 will output the dependencies before it asks you Y/n if you want to continue. Be sure to see if it does that, in case it does include it there but still doesn't include it in the actual published packages. And of course if it isn't listed in that output something is also wrong.

So hackney is using the ~> syntax but I noticed that it doesn't have a space like Elixir uses. Could that be the cause? I would have thought the behavior would be the same in both langs now.

https://github.com/benoitc/hackney/blob/master/rebar.config#L19

I don't have a commit bit.

Yes @tsloughter, basically the situation is when some dependency lock a version other than 0.4 and poller crash only on runtime.

Let's just ship a new patch version and see if this time the proper deps will be pushed to Hex?

So I checked what would happen if I published it and indeed it shows no deps for me?

$ ~/.mix/rebar3 hex publish
===> Verifying dependencies...
===> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins.
Publishing telemetry_poller 0.4.1
  Description: Periodically collect measurements and dispatch them as Telemetry events.
  Dependencies:

  Included files:
    /Users/jose/OSS/telemetry_poller/LICENSE
    /Users/jose/OSS/telemetry_poller/NOTICE
    /Users/jose/OSS/telemetry_poller/README.md
    /Users/jose/OSS/telemetry_poller/rebar.config
    /Users/jose/OSS/telemetry_poller/rebar.lock
    /Users/jose/OSS/telemetry_poller/src/telemetry_poller.app.src
    /Users/jose/OSS/telemetry_poller/src/telemetry_poller.erl
    /Users/jose/OSS/telemetry_poller/src/telemetry_poller_app.erl
    /Users/jose/OSS/telemetry_poller/src/telemetry_poller_builtin.erl
    /Users/jose/OSS/telemetry_poller/src/telemetry_poller_sup.erl
  Maintainers:

  Licenses: Apache 2.0
  Links:
    Github: https://github.com/beam-telemetry/telemetry_poller
  Build tools: rebar3
Before publishing, please read Hex CoC: https://hex.pm/docs/codeofconduct
Proceed? ("Y")>
$ rebar3 version
rebar 3.12.0 on Erlang/OTP 22 Erts 10.4
$ rebar3 plugins upgrade rebar3_hex
===> No upgrade needed for rebar3_hex

It seems my rebar3_hex version was out of date, but even after an upgrade the issue persists:

$ ~/.mix/rebar3 plugins upgrade rebar3_hex
===> No upgrade needed for rebar3_hex
===> No upgrade needed for hex_core
===> No upgrade needed for verl

Running on v6.5.0 now.

@arkgil I have pushed the tag and master, can you please ship a new release? I am unsure how to fix my rebar. :(

@josevalim done! @CaiqueMitsuoka can you check if it works for you now?

Its working perfectly, thanks all of you ❤️