Skip to content

Add support for semantic versioning in zopen-install #1153

Draft
sachintu47 wants to merge 3 commits intozopencommunity:mainfrom
sachintu47:main
Draft

Add support for semantic versioning in zopen-install #1153
sachintu47 wants to merge 3 commits intozopencommunity:mainfrom
sachintu47:main

Conversation

@sachintu47
Copy link
Copy Markdown
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Content Update

Category

  • zopen build framework
  • zopen package manager
  • Documentation
  • CI/CD
  • Tools

Description

Related Issues

  • Related Issue #
  • Closes #

[optional] Are there any post-deployment tasks or follow-up actions required?

- Support semantic operators (>, >=, <, <=) in addition to '='
- Use jq-based numeric array comparison for accurate semantic versioning
- Implement version-aware sorting to correctly prioritize versions (e.g., 1.10 over 1.9)
- Maintain prefix matching behavior for the '=' operator
- Update port validation to recognize and handle all semantic operators
@sachintu47
Copy link
Copy Markdown
Member Author

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 21, 2026

🤖 Augment PR Summary

Summary: This PR extends bin/zopen-install to support selecting package releases using version constraints.

Changes:

  • Parses package specs with comparison operators (=, >, >=, <, <=) alongside existing %tag syntax.
  • Adds validation for operators and version strings, and rejects ambiguous specs that include both a version constraint and a tag.
  • Updates release selection to use a unified jq comparator over padded numeric version arrays, then sorts to pick the newest matching release.
  • Normalizes/filters repo arguments so operator/tag suffixes don’t interfere with repo-name validation and install-queue building.

Technical Notes: Version comparison pads arrays to a fixed width and uses date/tag as tie-breakers when versions compare equal.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

fi

# Convert requested version string to a JSON array of numbers for jq
req_v_json=$(echo "${versioned#v}" | tr '.' '\n' | jq -R 'tonumber' | jq -s -c .)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The version validation above allows alphanumeric/hyphen suffixes (e.g. 1.2.3-rc1), but req_v_json is built via jq -R 'tonumber' and will error on any non-numeric segment. This makes some “valid” version inputs fail at runtime during release selection, so it may be worth ensuring the accepted version format matches what the jq parsing/comparison can actually handle.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant