Skip to content

Incorrect Version Tagging #23

@mdsalmeida92

Description

@mdsalmeida92

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions