mailgun / gubernator

High Performance Rate Limiting MicroService and Library
Apache License 2.0
964 stars 99 forks source link

Add version consistency check. #158

Closed Baliedge closed 2 years ago

Baliedge commented 2 years ago

Simplify the version update workflow.

Original Workflow

Manual Method

Previously, I have been manually updating the version by:

Automated Method

However, there exists conflicting functionality in Github Actions to make automated updates to these files from the version tag. This means that the workflow is assumed to be instead:

The apparent outcome is that the files are updated with the appropriate version, however the tag still points to the original commit. When users pull the latest version, the versioning will not match.

In reality, the Github Action is failing when attempting to commit the changes. Complains of missing branch master.

This error doesn't occur in Manual Method because no automated changes were needed because the correct versions were already updated, therefore nothing to commit.

Change in Workflow

The workflow is documented in RELEASE.md.

Instead of automated file changes, the workflow should take the role of checking version state and allow the developer to make changes if anything fails.

This check happens in new script ./check-version.sh. It obtains the latest git tag and compares it against the versions inside files.

The script ./check-version.sh is added to both on-pull-request and on-release actions to ensure consistency during PR development and at release time.

Workflow:

The Docker and Helm resources are published only if on-release passes.