m icon indicating copy to clipboard operation
m copied to clipboard

Fix: m stable returns latest production version, not just X.0 series

Open Copilot opened this issue 3 months ago • 0 comments

m --stable was returning 8.0.15 when 8.2.1 was available. The implementation incorrectly limited "stable" to X.0 LTS series, ignoring MongoDB's rapid release versions (8.1.x, 8.2.x) which are also production-ready.

Changes

Version detection logic (display_latest_stable_version, display_latest_version):

  • Changed stable to mean "latest without RC/alpha/beta suffix" instead of "latest X.0.z"
  • Extract versions from JSON "version": field only (prevents false matches from URLs)
  • Support MongoDB 10+ with multi-digit major version regex patterns
  • Replace non-portable \d with [0-9] for POSIX compliance

Code cleanup:

  • Remove redundant uniq after sort -u

Results

# Before
$ m --stable
8.0.15

# After  
$ m --stable
8.2.1

$ m --latest
8.2.2-rc0

Series-specific queries unchanged:

$ m --stable 8.0
8.0.15  # Correctly excludes 8.0.16-rc1

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.mongodb.com
    • Triggering command: curl -sSLf REDACTED -o /tmp/m-test-1761868523457/m/mongosh-2.5.6.tgz (dns block)
    • Triggering command: curl -sSLf REDACTED -o /tmp/m-test-1761868957375/m/mongosh-2.5.9.tgz (dns block)
    • Triggering command: curl -sSLf REDACTED -o /tmp/m-test-1761868957375/m/mongosh-2.5.6.tgz (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Incorrect versions identified for m latest and m stable</issue_title> <issue_description>> By the way, m latest didn't say MongoDB 8.2.2 doesn't exist for Linux x64, and m stable installed MongoDB version 8.0.15, even though version 8.2.1 is available. I would assume that it will install the latest available version, in this case 8.2.1

Originally posted by @sfn101 in #160</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes aheckmann/m#166

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Oct 30 '25 23:10 Copilot