codecov / codecov-ruby

Ruby uploader for Codecov
https://codecov.io
MIT License
73 stars 82 forks source link

Missing CI variables result in "no implicit conversion to String" #17

Closed ben-axnick closed 4 years ago

ben-axnick commented 8 years ago

Hi there,

I recently had some issues getting Buildkite setup due to an initially mysterious issue that turned out to be pretty straightforward once I looked at the code - the codecov formatter expected an environment variable I had forgotten to forward.

In my case, it was BUILDKITE_JOB_ID I forgot to forward to the Rails container, meaning nil got concatenated with a string and resulting in:

/usr/local/bundle/gems/codecov-0.1.5/lib/codecov.rb:67:in `+': no implicit conversion of nil into String (TypeError)
    from /usr/local/bundle/gems/codecov-0.1.5/lib/codecov.rb:67:in `format'
        ...

should there be some sort of pre-validation that the expected environment variables are present, along with a more helpful error message, or are you happy with the current situation which, while not obvious at first, is easy enough to debug once you look at the code?

I'd be happy to look into making this a bit more obvious, but would like to know that the effort is likely to be well received first.

thomasrockhu commented 4 years ago

Closing this out due to age. If this is still and issue, please re-ping and I'll take a look