Skip to content

fix: Don't fail when there are no releases #602

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BYK
Copy link
Member

@BYK BYK commented May 2, 2025

Fixes #342.

@asottile-sentry
Copy link
Member

I was pretty sure the conclusion from #342 was that this wasn't really fixable for two reasons:

  • the bump script has two required positional arguments (old version, new version) and passing nonsense is a breaking change
  • the changelog generation requires a previous version

@BYK
Copy link
Member Author

BYK commented May 2, 2025

It is fixable (at least to me), here's my reasoning:

the bump script has two required positional arguments (old version, new version) and passing nonsense is a breaking change

Not necessarily as this only applies to the very first release. At that point one can tweak the script. In any case, I use 0.0.0 as the default version instead of an empty string just in case. That said the "breaking" part doesn't really apply as this would not affect any existing project (otherwise you are right, it is a marked departure from the original behavior, which is crashing).

the changelog generation requires a previous version

The workaround for this is just getting all the commits up to HEAD which just works?

@asottile-sentry
Copy link
Member

I'd rather we fix this properly and deprecate the 2-arg release bump script and make a bump-version-v2.sh or whatever

The workaround for this is just getting all the commits up to HEAD which just works?

I assume you mean to the beginning of the history? HEAD is the current revision

@BYK
Copy link
Member Author

BYK commented May 2, 2025

I assume you mean to the beginning of the history? HEAD is the current revision

Up to HEAD from beginning. The entire commit history in short.

@BYK
Copy link
Member Author

BYK commented May 2, 2025

I'd rather we fix this properly and deprecate the 2-arg release bump script and make a bump-version-v2.sh or whatever

Why though? Having the old version available is definitely useful and making the script be called with 1 arg for the initial release and 2 args for the rest seems like adding unnecessary complexity.

What's your main concern here? I am lax as this only applies to new projects and shouldn't have any impact on existing ones.

@asottile-sentry
Copy link
Member

I don't think the old version is useful. and I don't think sending a bogus value for the first release makes sense either

@BYK
Copy link
Member Author

BYK commented May 2, 2025

@asottile-sentry I cannot justify the change you are asking for from a cost benefit standpoint. Making a deprecation for all existing projects, forcing an analysis and migration with a way to manage a breaking change for a fix that only affects the first release of new projects doesn't seem cost effective to me.

What am I missing from your perspective?

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

Successfully merging this pull request may close these issues.

Prepare dies if there are no tags yet - fatal: No names found, cannot describe anything
2 participants