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

No commits found to generate a pre-release #415

Open
m1racoli opened this issue Sep 3, 2021 · 8 comments
Open

No commits found to generate a pre-release #415

m1racoli opened this issue Sep 3, 2021 · 8 comments

Comments

@m1racoli
Copy link

m1racoli commented Sep 3, 2021

Description

cz bump --prerelease rc should handle missing "bumpable" commits the same way as cz bump.

Steps to reproduce

  1. create a non-bumpable commit (i.e. ci or build)
  2. run cz bump --prerelease rc --dry-run

Current behavior

The command terminates with an error:

$ cz bump --prerelease rc --dry-run
[NO_COMMITS_FOUND]
No commits found to generate a pre-release.
To avoid this error, manually specify the type of increment with `--increment`

Desired behavior

It should behave like running cz bump without --prerelease flag.

$ cz bump --dry-run                
bump: version 1.2.1 → 1.2.1 [skip ci]
tag to create: v1.2.1
increment detected: None

Environment

  • commitizen version: 2.18.0
  • python version: 3.9.4
  • operating system: Darwin
@Lee-W
Copy link
Member

Lee-W commented Sep 6, 2021

Thanks for reporting! This seems to be designed this way. See if this comment helps. #307 (comment)

@m1racoli
Copy link
Author

m1racoli commented Sep 6, 2021

Ok, I see the issue at hand.

Our intention is to generate pre-releases automatically from the master branch in CI. If there are no corresponding changes it should just not do anything. Since we rely on commitizen to determine the kind of bump, it would be problematic to explicitly configure the increment.

hmmmm

@Lee-W
Copy link
Member

Lee-W commented Sep 7, 2021

@woile I kinda don't get the idea of the original design. Would there be any issue if we check the pre-release commits as usual?

#307 (comment)

@woile
Copy link
Member

woile commented Sep 7, 2021

Luckily I added the issue to the comments, seems to be related to this issue:
#281

@Lee-W
Copy link
Member

Lee-W commented Sep 11, 2021

Yep, got your idea. @m1racoli Do you think this one better explains the design? Or is there a better solution for this one

@m1racoli
Copy link
Author

m1racoli commented Sep 16, 2021

Hmm ... I am not sure yet.

If any release (alpha, beta, rc, prod) would bump the version if and only if there is a version increasing commit then we would not have a problem, no?

I kinda expect the following behaviour when there is no version increasing commit:

alpha -> alpha: do nothing
alpha -> beta: only create beta tag
alpha -> rc: only create rc tag
alpha -> release: only create relase tag

beta -> alpha: do nothing
beta -> beta: do nothing
beta -> rc: only create rc tag
beta -> release: only create release tag

rc -> alpha: do nothing
rc -> beta: do nothing
rc -> rc: do nothing
rc -> release: only create release tag

release -> alpha: do nothing
release -> beta: do nothing
release -> rc: do nothing
release -> release: do nothing

Basically we need to consider the different types of releases in a hierarchical order and only create a tag when we increase the level of release. And we'll never increase the version if there is not version increasing commit.

I think it's quite common to first release something as RC and later release the same code as release. 🤔

Does this make sense?

@Lee-W
Copy link
Member

Lee-W commented Sep 19, 2021

This makes sense to me. @woile what do you think?

@nbrugger-tgm
Copy link

Hi,
i basically run into the same issue (not being able to release a RC as PROD).
Is there a recommended workflow/workaround to go from RC to PROD without commits in between?

Thanks

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

No branches or pull requests

4 participants