Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Version Tagging #23

Open
mdsalmeida92 opened this issue Jul 1, 2024 · 0 comments
Open

Incorrect Version Tagging #23

mdsalmeida92 opened this issue Jul 1, 2024 · 0 comments

Comments

@mdsalmeida92
Copy link
Collaborator

mdsalmeida92 commented Jul 1, 2024

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

  1. Checkout a specific tag in the repository:

    git checkout csi-horatio-0.243.0
  2. Create a new branch from the detached HEAD state:

    git checkout -b test-vergo
  3. Use the Vergo tool to get the current version:

    vergo get current-version -t "csi-horatio" --disable-strict-host-check

    Output:

    0.243.0%
  4. Make a change and commit it:

    echo "test" >> README.md
    git add README.md
    git commit -m "vergo test"
  5. Use the Vergo tool to get the current version again:

    vergo get current-version -t "csi-horatio" --disable-strict-host-check

    Output:

    0.247.0-SNAPSHOT%
  6. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant