-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Currently the update system has some fragile version handling patterns that could be improved.
Priority: Low - System works correctly, but could be more maintainable and robust.
Current Issues
-
Asset Name Brittleness: We manually construct expected asset names but GoReleaser generates versioned names like
wt_0.4.0_Darwin_all.tar.gz. Our matching logic uses string manipulation workarounds. -
Binary Name Inconsistency: We support both
wt-bin(development name) andworktree-utils(release name) which creates confusion and maintenance overhead. -
Platform Detection: Manual OS/arch mapping that could leverage existing Go tooling.
-
Version Comparison: Basic string comparison instead of semantic versioning.
Suggested Improvements
1. Standardize Asset Naming
- Use GoReleaser naming patterns consistently
- Or configure GoReleaser to match our expected patterns
- Consider using GitHub API dynamic asset discovery
2. Unify Binary Names
- Choose one canonical name (probably
wt-binfor consistency) - Update GoReleaser config to use consistent binary name
- Remove dual binary name support after transition
3. Use Semantic Versioning Library
- Replace manual version comparison with proper semver
- Handle pre-release versions, build metadata correctly
- Examples:
github.com/Masterminds/semver/v3orgolang.org/x/mod/semver
4. Learn from Established Tools
- Study how
gh,docker,kubectlhandle updates - Consider using update frameworks like
go-githubfor releases
Current Workarounds
The update system currently works with these workarounds:
strings.HasSuffix(a.Name, "_"+assetName[3:]+".tar.gz")for versioned assetsbase == "wt-bin" || base == "worktree-utils"for binary names
Benefits of Fixing
- More maintainable update code
- Reduced fragility when changing release processes
- Better error messages for users
- Preparation for more complex update scenarios (checksums, signatures, etc.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request