open-component-model / ocm

Open Component Model (Software Bill of Delivery) Toolset
https://ocm.software
Apache License 2.0
34 stars 23 forks source link

Regression in integration tests by modified credential handling errors #629

Closed jensh007 closed 8 months ago

jensh007 commented 9 months ago

What happened: Integration Tests are failing after commit: 0362e29d97c5dfc5c21fbc3a06cd876535150988 Likely caused by: https://github.com/open-component-model/ocm/pull/611

Before this commit error message if credentials are missing from ocm was: '401 Unauthorized` After this commit it was changed to: 'unable to add blob (OCI repository images/pause): failed to push: authorization failed: no basic auth credentials\n'

What you expected to happen: I prefer the old message as it reflects the http status code and is much better scriptable.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know: I added a PR to to ocm-integrationtest. Depending on whether you want to fix this in the CLI or in the integration-test either merghe or close this PR

Environment:

morri-son commented 9 months ago

Hi @jensh007 , thanks for the analysis. A 401 is the HTTP error, whereas the other part is explaining this more. From my perspective the error message should always contain at least the basic HTTP error as first part of the error message. Additional explanation that helps the end user to resolve the issue, should come afterwards. So, what about changing the error back to the old error at the beginning and then adding the details in another sentence after that? @mandelsoft , can you please also comment?

jensh007 commented 8 months ago

As this problem was introduced by an update of a used library (ocm CLI does not control the error message) it was fixed in the test.