Skip to content

Conversation

@DylanDevelops
Copy link
Owner

Enhanced CompareVersions to correctly handle prerelease tags, ensuring prerelease versions are considered less than stable releases and comparing prerelease tags alphabetically. Added comprehensive test cases to verify correct behavior for various prerelease and stable version scenarios.

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Closes #63

Description

This pull request improves the version comparison logic in the update checker by adding proper handling for prerelease versions and extending the test coverage to verify these cases. The new logic ensures that prerelease versions (like 1.0.0-rc.1) are correctly considered less than their corresponding stable releases, and that different prerelease tags are compared appropriately.

Version comparison improvements:

  • Updated CompareVersions in internal/update/checker.go to split out prerelease tags, compare core versions numerically, and handle prerelease vs. stable comparisons according to semantic versioning rules.
  • Added splitPrerelease and compareCoreVersions helper functions to support the new comparison logic.

Test coverage enhancements:

  • Added multiple new test cases to internal/update/checker_test.go to verify correct handling of prerelease vs. stable versions, alphabetical ordering of prerelease tags, and cases with version prefixes.

Enhanced CompareVersions to correctly handle prerelease tags, ensuring prerelease versions are considered less than stable releases and comparing prerelease tags alphabetically. Added comprehensive test cases to verify correct behavior for various prerelease and stable version scenarios.
@DylanDevelops DylanDevelops merged commit f59fdd1 into main Jan 15, 2026
6 checks passed
@DylanDevelops DylanDevelops deleted the ravel/fix-prerelease-update-available branch January 15, 2026 23:30
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.

Prerelease Versions Fail to Prompt for Updates to Stable

2 participants