Skip to content

Sort stellar_cli_versions by version after every mutation#13

Closed
fnando wants to merge 1 commit into
mainfrom
sort-by-version
Closed

Sort stellar_cli_versions by version after every mutation#13
fnando wants to merge 1 commit into
mainfrom
sort-by-version

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented May 29, 2026

What

Updates scripts/release-prepare.sh so both add_cli_entry and extend_cli_entry sort stellar_cli_versions by semantic version (numeric MAJOR.MINOR.PATCH) after writing to builds.json, rather than relying on insertion order.

Why

Without an explicit sort, entries land in the order they're added, which can produce a non-monotonic stellar_cli_versions array — e.g. backfilling an older CLI release after a newer one leaves the file out of order. Sorting on every mutation keeps builds.json deterministic and easy to scan regardless of the order releases are prepared.

Notes

  • Sort key is .version | split(".") | map(tonumber), so versions compare numerically (10.0.0 > 9.0.0) instead of lexicographically.
  • Applied inside the same jq pipeline that performs the mutation, so the file is written once.

Copilot AI review requested due to automatic review settings May 29, 2026 02:27
@fnando fnando self-assigned this May 29, 2026
@fnando fnando added this to DevX May 29, 2026
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 29, 2026
@fnando fnando requested a review from leighmcculloch May 29, 2026 02:27
@fnando fnando enabled auto-merge (squash) May 29, 2026 02:27
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX May 29, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates scripts/release-prepare.sh to keep builds.json deterministic by sorting the stellar_cli_versions array by semantic version after every mutation, so backfilled/refresh releases don’t leave the array in a non-monotonic order.

Changes:

  • In add_cli_entry, append the new entry and immediately sort_by(.version | split(".") | map(tonumber)).
  • In extend_cli_entry, update the matched entry and then re-sort stellar_cli_versions by numeric semver.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fnando fnando disabled auto-merge May 29, 2026 05:23
@fnando fnando closed this May 29, 2026
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX May 29, 2026
@fnando fnando deleted the sort-by-version branch May 29, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants