Consider how to track latest stable tag in git_tag
The Issue
While this plugin is a step in the right direction, it still only guarantees latest stable in git repos that release only on a single branch, however this is not the typical policy of most repos.
There are two likely alternative cases which will cause problems:
- Upstream develops and releases only on master
- Upstream has a stable branch, which changes with major/minor releases
In order to solve repos of type 1 I think only manual review can help us, as there is nothing to stop upstream tagging an unstable release candidate on master, which the plugin will track to.
Type 2 offers more of a challenge, as we will want to automatically track the latest tag in two branches: the release branch and master, in case of a new major release and new stable branch. This currently still requires a downstream to check for new releases manually every so often, which makes tracking the tags far less of a bonus than first appeared.
Proposed Solution
In order to reduce type 2 repos to the same level of issue as type 1 I propose the following change to the plugin:
- Allow config to track two branches
- Automatically track to the latest tag overall of both branches
- A human now reviews whether the proposed tag is indeed stable
- If stable, we merge the change and carry on
- If not stable, simply refuse the change
This will require some tweaking in CI to prevent it opening a load of MRs for each element after closing them, but should reduce the issue to a simpler case.
I have implemented this functionality on this branch.
Further Improvement
As a future consideration we may be able to reduce this further by heuristically determining if a given tag looks stable, but I doubt this will be very reliable.