concourse / semver-resource

automated semantic version bumping
Apache License 2.0
97 stars 105 forks source link

Fix unhandled errors in git source and json encoding #114

Closed novas0x2a closed 1 year ago

novas0x2a commented 4 years ago

This fixes some error-handling bugs, including one in Git:Bump which likely resulted in versions being used more than once.

novas0x2a commented 4 years ago

Respectfully, if it were just a matter of adding a test, I'd probably do it, but this really needs a proper test suite (and code changes to enable mocking, since it uses exec.Command) which isn't really something I have time for currently. Again, respectfully, it might have been better to insist on a test before landing this change which made this unchecked error matter (note the := instead of =), resulting in Bump returning newVersion (on retry exhaustion) as though it had committed it, further resulting in the next Bump returning a duplicate version.

It's possible I'll come back to this at some point if I have some time, though if anyone else wants to pick this up, feel free!