ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
187 stars 28 forks source link

Hiding errors on release 0.16.1 #194

Closed michelzanini closed 1 year ago

michelzanini commented 1 year ago

Hi,

On release 0.16.1 this change was introduced https://github.com/ajoberstar/reckon/commit/ad133e8dacf4f90843ab62cea82be4460b4a0a8e.

I understand this is trying to workaround initialisation issues. However, it creates larger problems. Because the catch block hides the exceptions, this becomes a real mess when the error is not actually because of initialisation order.

For example, I had multiple times where the failure was "Can't release a repo without being clean" or "Can't re-release the same tag again" etc.... (errors that were my mistake and real errors) where the exception was caught and ignored and instead of my build failing, it went fine with "unspecified" version up to when it was actually finishing the release build (deploying and everything).

I don't think you should catch all exceptions and assume they are because the initialisation isn't correct. Most cases it will be other errors that should not be caught. Even the error message is completely misleading.

"Project version evaluated before reckon was configured. Run with --info to see cause."

The error was something completely different and the message does not make sense at all. If you want to keep this logic, you should understand which error to catch and let the others errors throw correctly.

I am going to keep using 0.16.0 instead until this issue is sorted.

Thanks.

ajoberstar commented 1 year ago

This fix will be released as 0.17.0. In the new behavior, the settings plugin will never soft-fail (bury exceptions). In the "legacy" project plugin, it will only soft-fail on config errors (during Reckoner.Builder.build()) but not during version inference.