Skip to content

Fix version check for alpha3 #13242

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where bibliography entries generated from CSL styles had leading spaces. [#13074](https://github.com/JabRef/jabref/pull/13074)
- We fixed an issue where the preview area in the "Select Style" dialog of the LibreOffice integration was too small to display full content. [#13051](https://github.com/JabRef/jabref/issues/13051)
- We fixed an issue where the tab showing the fulltext search results was not displayed. [#12865](https://github.com/JabRef/jabref/issues/12865)
- We fixed an issue where the Version checker did not correctly recognize the newer alpha versions. [#13242](https://github.com/JabRef/jabref/pull/13242)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion jablib/src/main/java/org/jabref/logic/util/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Version {

private static final Version UNKNOWN_VERSION = new Version();

private final static Pattern VERSION_PATTERN = Pattern.compile("(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?<stage>-alpha|-beta)?(?<num>\\d+)?(?<dev>-?dev)?.*");
private final static Pattern VERSION_PATTERN = Pattern.compile("(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?<stage>-alpha|-beta)?(\\.|)(?<num>\\d+)?(?<dev>-?dev)?.*");
private final static Pattern CI_SUFFIX_PATTERN = Pattern.compile("-ci\\.\\d+");

private static final String JABREF_GITHUB_RELEASES = "https://api.github.com/repos/JabRef/JabRef/releases";
Expand Down
7 changes: 7 additions & 0 deletions jablib/src/test/java/org/jabref/logic/util/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ void stableShouldNotBeUpdatedToBeta() {
assertFalse(stable.shouldBeUpdatedTo(beta));
}

@Test
void alpha3IsNewerThanAlpha2WithoutDot() {
Version alphaNewer = Version.parse("6.0-alpha.3-2025-04-27--c52dc44");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a dot

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From your screenshot:
grafik

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mabye the issue is obsolete because you fixed gitversion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, #13093 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then, this PR is not needed, because there is no dot. See #13093 (comment)

Version alphaNotNewer = Version.parse("6.0-alpha2");
assertTrue(alphaNewer.isNewerThan(alphaNotNewer));
}

@Test
void alphaShouldBeUpdatedToStables() {
Version alpha = Version.parse("2.8-alpha");
Expand Down
Loading