Description
The Vergo tool is currently using the latest tag when determining the version, instead of starting from the current commit and moving up the commit tree until it encounters the first tag with a matching prefix.
Steps to Reproduce
-
Checkout a specific tag in the repository:
git checkout csi-horatio-0.243.0
-
Create a new branch from the detached HEAD state:
git checkout -b test-vergo
-
Use the Vergo tool to get the current version:
vergo get current-version -t "csi-horatio" --disable-strict-host-check
Output:
-
Make a change and commit it:
echo "test" >> README.md
git add README.md
git commit -m "vergo test"
-
Use the Vergo tool to get the current version again:
vergo get current-version -t "csi-horatio" --disable-strict-host-check
Output:
-
Bump the patch version using Vergo:
vergo bump patch -t csi-horatio --versioned-branch-names test-vergo
Output:
INFO[0000] Set tag csi-horatio-0.246.1
0.246.1%
Note: The latest tag was 0.246.0
Expected Behavior
The Vergo tool should traverse the commit history from the current commit, find the first tag with a matching prefix, and then use this tag to determine the current version.
Actual Behavior
The tool is using the latest tag in the repository, leading to incorrect version increments. For instance, after checking out csi-horatio-0.243.0 and creating a new branch, Vergo should have determined the current version based on 0.243.0 instead of jumping to 0.247.0-SNAPSHOT.
Impact
This behavior results in incorrect version tags being set, which can cause confusion and issues in version management and deployment processes.
Suggested Fix
Modify the Vergo tool's version determination logic to start from the current commit and move up the commit tree until it encounters the first tag with the specified prefix.
Description
The Vergo tool is currently using the latest tag when determining the version, instead of starting from the current commit and moving up the commit tree until it encounters the first tag with a matching prefix.
Steps to Reproduce
Checkout a specific tag in the repository:
Create a new branch from the detached HEAD state:
Use the Vergo tool to get the current version:
vergo get current-version -t "csi-horatio" --disable-strict-host-checkOutput:
Make a change and commit it:
Use the Vergo tool to get the current version again:
vergo get current-version -t "csi-horatio" --disable-strict-host-checkOutput:
Bump the patch version using Vergo:
Output:
Note: The latest tag was 0.246.0
Expected Behavior
The Vergo tool should traverse the commit history from the current commit, find the first tag with a matching prefix, and then use this tag to determine the current version.
Actual Behavior
The tool is using the latest tag in the repository, leading to incorrect version increments. For instance, after checking out
csi-horatio-0.243.0and creating a new branch, Vergo should have determined the current version based on0.243.0instead of jumping to0.247.0-SNAPSHOT.Impact
This behavior results in incorrect version tags being set, which can cause confusion and issues in version management and deployment processes.
Suggested Fix
Modify the Vergo tool's version determination logic to start from the current commit and move up the commit tree until it encounters the first tag with the specified prefix.