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: Version variable is inconsistent, and sometimes equal to the old version #1111

Open
BatmanAoD opened this issue Jul 24, 2024 · 4 comments

Comments

@BatmanAoD
Copy link
Collaborator

It appears that this is a bug introduced in either 0.16.1 or 0.16.2.

Here, I have several Command steps, some of which use the Version variable. I've used ... to elide some output. Note that with 0.16.0, the release-cli command uses v1.17.0, but with 0.16.2, the command uses v1.16.0.

$> knope --version
knope 0.16.0

$> knope release --verbose --dry-run
...
Using MINOR rule to bump from 1.16.0 to 1.17.0
...
Would run git commit -m "chore: prepare release 1.17.0"
Would create Git tag v1.17.0
Would create Git tag golang/v1.17.0
Would run git push --push-option ci.skip
Would run git push --tags --push-option ci.skip
Looking for Git tags matching package name.
Skipping relevant tags that are not on the current branch: v1.2.0, v1.17.0, v1.0.0-rc.1, v1.1.1
Finding version for ...
Found 1.17.0 from ...
... <the above is repeated for each versioned file>
Would run release-cli create --name "Release 1.17.0" --tag-name "v1.17.0" --ref "v1.17.0"

$> cargo binstall knope
 ...

$> knope --version
knope 0.16.2

$> knope release --verbose --dry-run
...
Using MINOR rule to bump from 1.16.0 to 1.17.0
...
Would run git commit -m "chore: prepare release 1.17.0"
Would create Git tag v1.17.0
Would create Git tag golang/v1.17.0
Would run git push --push-option ci.skip
Would run git push --tags --push-option ci.skip
Looking for Git tags matching package name.
Would run release-cli create --name "Release 1.16.0" --tag-name "v1.16.0" --ref "v1.16.0"

Also of interest, despite the --verbose flag, the second version-resolution doesn't actually print any output with 0.16.2, even though it does with 0.16.0.

@dbanty
Copy link
Member

dbanty commented Jul 28, 2024

I've been doing a ton of refactoring of the version handling code to pull out a bunch of stuff into a standalone crate (so the bot can use it). I'm sure I broke something in all that.

Curious—does it pick the right version when actually running PrepareRelease? It might just be the --dry-run handling that got broken.

@BatmanAoD
Copy link
Collaborator Author

I'm not sure -- if I have some time I'll try to put together a standalone reproduction case.

@BatmanAoD
Copy link
Collaborator Author

Oh, but I think I did actually discover this when a release ran, rather than by doing a prerelease.

@dbanty
Copy link
Member

dbanty commented Aug 4, 2024

@BatmanAoD 0.17 finally finishes all the refactor work I was doing in the 0.16 series. Did I happen to fix the version variable bug as part of that?

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

2 participants