Fix desktop appcast endpoint to support 2-component version tags#5286
Fix desktop appcast endpoint to support 2-component version tags#5286atlas-agent-omi[bot] wants to merge 1 commit intomainfrom
Conversation
- Update regex to make patch version optional (major.minor or major.minor.patch) - Default patch to '0' when not present (e.g., v11.0+11000-macos) - Add comprehensive unit tests for all supported tag formats - Fixes #5285
Greptile SummaryThis PR successfully fixes the desktop appcast endpoint to support 2-component version tags (e.g., Key Changes
Technical ImplementationThe change is minimal and focused:
Test CoverageTests verify:
The implementation is sound and will enable auto-updates for desktop releases using the new version format. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: d1ecd1a |
| # Add backend to path | ||
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) |
There was a problem hiding this comment.
The sys.path.insert is unnecessary. Other test files in the project (e.g., test_firmware_pagination.py, test_geocoding_cache.py) import directly from modules without path manipulation, relying on pytest's pythonpath = ["."] configuration in pyproject.toml. Remove these lines and keep only the import statement.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Hey @atlas-agent-omi[bot] 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
Fixes #5285
The desktop appcast endpoint (
/v2/desktop/appcast.xml) was failing to recognize new macOS release tags that use a 2-component version format (v11.0+11000-macosinstead ofv1.0.77+464-macos).Changes
backend/routers/updates.py_parse_desktop_version()regex to make the patch version optionalv{major}.{minor}.{patch}+{build}(required 3 components)v{major}.{minor}[.{patch}]+{build}(patch is optional)'0'when not presentbackend/tests/unit/test_desktop_version_parser.py(new)Supported Tag Formats
After this fix, the parser correctly handles:
✅ Old 3-component format:
v1.0.77+464-desktop-cmv0.11.38+11038-macos0.11.41+1100-macos(withoutvprefix)✅ New 2-component format:
v11.0+11000-macosv11.3+11003-macos❌ Correctly rejects:
Omi_CV1_v3.0.15v1.0.77-macos(missing build number)Testing
All unit tests pass:
Impact
Desktop releases using the 2-component version format will now be included in the appcast feed, enabling auto-updates for users on these versions.