renovate icon indicating copy to clipboard operation
renovate copied to clipboard

fix: Elevate Git/GitHub error debug logging to error logging

Open andersfischernielsen opened this issue 2 years ago • 2 comments

Changes

This will elevate error messages logged using logger.debug in GitHub/Git logic (specifically lib/util/http/github.ts and lib/util/git/index.ts) to instead log these errors via logger.error to accurately reflect that the errors are in fact unexpected errors.

Context

These changes will make it easier to stay updated on Git/GitHub issues occurring when using Renovate.

Git/GitHub error messages reflect actual errors happening when Renovate attempts to update/process repositories and will be labelled as such in this PR.

Labeling these errors accurately makes it possible to accurately label/alert on these errors in log processors (such as DataDog) to let teams be alerted when Renovate has issues processing repositories within an organisation.

Currently, these errors drown in the debug output Renovate logs in normal operation which makes it hard to determine when action needs to be taken (e.g. when self-hosting Renovate which we are in Pleo).

Documentation (please check one with an [x])

  • [ ] I have updated the documentation, or
  • [X] No documentation update is required (please let me know if this is not the case!)

How I've tested my work (please tick one)

I have verified these changes via:

  • [ ] Code inspection only, or
  • [ ] Newly added/modified unit tests, or
  • [ ] No unit tests but ran on a real repository, or
  • [X] Both unit tests + ran on a real repository

andersfischernielsen avatar Sep 19 '22 08:09 andersfischernielsen

Please create an issue to discuss first. Your proposed changes can have a very wide effect on others.

Some of these could be errors. Some could be warn. Some should remain as debug or info. Each needs to be evaluated individually before this PR can be approved.

Errors should be reserved for:

  • Renovate code has a bug which needs to be fixed, or
  • The operator of the bot needs to make a config or environmental change

rarkins avatar Sep 19 '22 08:09 rarkins

Please create an issue to discuss first.

My bad, I expected the discussion to backlink here, but it turns out it didn't. See: https://github.com/renovatebot/renovate/discussions/17857


Some of these could be errors.

I'm very open to discussing which of these should be warn, debug, info or error 😄 Either here or in the discussion.


Errors should be reserved for: [...]

  • The operator of the bot needs to make a config or environmental change

Wouldn't this constitute "an environmental change", though? Given that these errors occur due to security settings not being set up as expected in the integration (in this case GitHub), some change needs to be made to the state of the repository to allow Renovate to proceed as expected 🤔 Or maybe I'm misunderstanding.


Also, thanks for the lightning-quick response! ⚡

andersfischernielsen avatar Sep 19 '22 08:09 andersfischernielsen

Closing due to discussion.

andersfischernielsen avatar Sep 28 '22 09:09 andersfischernielsen