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

fix: version test for equal pre-release versions #521

Closed
wants to merge 1 commit into from

Conversation

vaind
Copy link
Contributor

@vaind vaind commented Feb 28, 2024

I've hit this when testing the compiled craft locally - it comes with version 1.11.0-dev.0 and even though you specify that as minVersion in .craft.yml, the check fails without the changes I've made here.

@asottile-sentry
Copy link
Member

I'm pretty sure we don't want to support minVersion: {a dev version} since that'll never be a valid value when checked in -- is this still needed?

@vaind
Copy link
Contributor Author

vaind commented Feb 28, 2024

I'm pretty sure we don't want to support minVersion: {a dev version} since that'll never be a valid value when checked in -- is this still needed?

the code in the repo before this change is wrong, as illustrated by the added test cases. Whether you call the pre-release a "dev" release or if it's a beta, you should be able to set a minVersion in a .craft.yml to match that version.

Without the changes in this PR, this code fails, which is obviously wrong, just from the name of the function:

expect(versionGreaterOrEqualThan(parseVersion('1.2.3-beta'), parseVersion('1.2.3-beta'))).toBe(true);

@asottile-sentry
Copy link
Member

I'm pretty sure we don't want to support minVersion: {a dev version} since that'll never be a valid value when checked in -- is this still needed?

the code in the repo before this change is wrong, as illustrated by the added test cases. Whether you call the pre-release a "dev" release or if it's a beta, you should be able to set a minVersion in a .craft.yml to match that version.

Without the changes in this PR, this code fails, which is obviously wrong, just from the name of the function:

expect(versionGreaterOrEqualThan(parseVersion('1.2.3-beta'), parseVersion('1.2.3-beta'))).toBe(true);

we haven't, and don't plan to, release craft prereleases so there's no reason to make the change

@vaind
Copy link
Contributor Author

vaind commented Feb 28, 2024

I just don't get why you insist on keeping the code broken, versionGreaterOrEqualThan saying false for identical arguments is just that...

but whatever

@vaind vaind closed this Feb 28, 2024
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.

2 participants