fix(bootstrap): compare release versions semantically against the installed one #36
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ochenstarik/server-monitor-manager#36
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/version-comparison"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The update guard compared the archive version with
PROGRAM_VERSIONusing shell string ordering. Both halves were wrong.PROGRAM_VERSIONis a constant describing the bootstrap source tree (0.2.0-dev), never the deployed component. The cross-role compatibility check compared it with a manifest field such asv0.1.0-alpha.9; those can never be equal, soupdate-controlon a host that also runs the agent always failed. The downgrade guard compared the same mismatched pair and passed only by accident, becausevsorts above0in ASCII.String ordering is also wrong for the version scheme in use:
so the next release after the ninth would have been rejected as a downgrade.
Change
PROGRAM_VERSION;sort -Vafter stripping the leadingv;Verification
bash -nandBOOTSTRAP_CONTRACT=PASSlocally.Each defect was deliberately reintroduced to confirm the guard catches it:
PROGRAM_VERSIONsortwithout-Vrecord_installed_version agentOrdering cases checked:
alpha.9 < alpha.10,alpha.10 !< alpha.9, equal versions not less,v-prefix insensitivity,alpha.9 < 0.2.0,0.2.0 !< alpha.9.🤖 Generated with Claude Code