ericcornelissen/codecov-config-validator-action

Improve output for non-200 response

ericcornelissen opened this issue · 0 comments

Summary

In v1.0.0 of this Action a non-200/OK response from the Codecov API always results in (appr.) the same output, namely:

Codecov configuration is invalid (got XYZ)

However, not all non-200 response codes can be considered the same way. Most notably, a >=500 response (I have personally observed 504 on occasion) doesn't mean the configuration is invalid.

As such, the Action should be updated to output a more accurate/relevant message given the received status code.

Proposal

  • ==200: Codecov configuration is valid (unchanged)
  • >=400: Codecov configuration is invalid (got ${STATUS})\n\nUpdate your Codecov configuration file (at ${FILE}) to make it valid.
  • >=500: Codecov configuration could not be validated (got ${STATUS}).\n\nYou can try to rerun this job after a short delay and it should work then. If the exact response code ${STATUS} persists, verify Codecov does not have an outage.
  • else: Codecov configuration status unknown, unexpected status ${STATUS}.\n\nIf this persists open an issue at:\nhttps://github.com/ericcornelissen/codecov-config-validator-action/issues/new

These texts aim to 1) provide clearer explanations of the outcome, and 2) provide help where relevant.