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

[BUG] - pre release SemVer tags are still not handled correctly #362

Open
oknozor opened this issue Feb 14, 2024 · 0 comments
Open

[BUG] - pre release SemVer tags are still not handled correctly #362

oknozor opened this issue Feb 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@oknozor
Copy link
Collaborator

oknozor commented Feb 14, 2024

Describe the bug
Auto bump still ignore pre-release version.

Example: on a repo containing the only tag 1.0.0-alpha, next generated version will be 0.1.0.

To Reproduce

#[sealed_test]
fn should_bump_from_latest_pre_release() -> Result<()> {
    git_init()?;
    git_commit("chore: init")?;
    git_commit("feat: feature 1")?;
    git_tag("1.0.0-alpha.0")?;
    git_commit("feat: feature 2")?;


    Command::cargo_bin("cog")?
        .arg("bump")
        .arg("--auto")
        .assert()
        .success();

    // This fail, the current behavior is to generate `0.1.0`
    assert_tag_exists("1.0.0")?;

    Ok(())
}

Expected behavior
When the latest tag is a pre-release, auto bump should first try to calculate a bump from the latest non pre-release tag.
If the calculated bump is lower than the pre-release, fallback to the pre-release version number (without pre-release data).

Additional context
https://github.com/onagre-launcher/onagre/actions/runs/7902329552/job/21567765875

@oknozor oknozor added the bug Something isn't working label Feb 14, 2024
@oknozor oknozor self-assigned this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant