Skip to content

[Windows] Fix MongoDB installer after release-notes URL and anchor ch… - #14561

Open
v-davit-ioramashvili wants to merge 1 commit into
actions:mainfrom
v-davit-ioramashvili:fix/mongodb-release-notes-url
Open

[Windows] Fix MongoDB installer after release-notes URL and anchor ch…#14561
v-davit-ioramashvili wants to merge 1 commit into
actions:mainfrom
v-davit-ioramashvili:fix/mongodb-release-notes-url

Conversation

@v-davit-ioramashvili

Copy link
Copy Markdown
Contributor

Description

Bug fixing.

MongoDB changed its release-notes page, which breaks Install-MongoDB.ps1 on windows-2025, windows-2025-vs2026 and windows-2022 — all three pin MongoDB 7.0 and share this script:

  • The URL with a trailing slash now answers 308 Permanent Redirect, which Invoke-WebRequest on Windows PowerShell 5.1 does not follow, so the request throws.
  • The release anchors lost their dots (#7040---aug-11-2026), so the old #7.0*---* filter matched nothing.

The fix uses the canonical URL without the trailing slash and reads versions from the changelog anchors (#std-label-7.0.40-changelog), which still carry the dotted version. It also picks the highest version instead of the first on the page, and fails with a clear message when nothing parses — previously an empty result silently built mongodb-windows-x86_64--signed.msi and failed later with an unrelated-looking error.

Validated on hosted runners for each affected toolset — parser resolved 7.0.40, the MSI passed the existing Test-FileSignature assertion, msiexec returned 0, and mongod --version reported v7.0.40:

Runner Toolset Resolved Signature msiexec mongod
windows-2025 toolset-2025.json 7.0.40 pass 0 v7.0.40
windows-2025 toolset-2025-vs2026.json 7.0.40 pass 0 v7.0.40
windows-2022 toolset-2022.json 7.0.40 pass 0 v7.0.40

There is no hosted windows-2025-vs2026 label, so the vs2026 toolset was run on the windows-2025 runner — the same OS and toolset that build feeds to this script.

Related issue:

https://github.com/github/hosted-runners-images/issues/911

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

…ange

The release-notes URL with a trailing slash now answers 308 Permanent
Redirect, which Invoke-WebRequest on Windows PowerShell 5.1 does not
follow, so the install fails on windows-2025, windows-2025-vs2026 and
windows-2022. The release anchors on that page also lost their dots
(actions#7040---aug-11-2026), so the old parser matched nothing.

Use the canonical URL without the trailing slash and read versions from
the changelog anchors (#std-label-7.0.40-changelog), which keep the
dotted version. Also pick the highest version rather than the first on
the page, and fail with a clear message when nothing parses.
Copilot AI lite review requested due to automatic review settings August 14, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes MongoDB version resolution on Windows runner images by updating how Install-MongoDB.ps1 discovers the latest 7.0.x patch release from MongoDB’s release notes page, avoiding Windows PowerShell 5.1 redirect limitations and anchor-format changes.

Changes:

  • Switch release-notes fetching to the canonical (no trailing slash) URL to avoid 308 Permanent Redirect failures in Windows PowerShell 5.1.
  • Parse 7.0.x patch versions from #std-label-<version>-changelog anchors and select the highest version (instead of the first match).
  • Add an explicit failure with a clear error message when no versions can be parsed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@taha-au

taha-au commented Aug 14, 2026

Copy link
Copy Markdown

we hit the same issue while building last night/this morning. i'd recommend using the json release feed instead of re-scraping the docs page which is brittle

something like

$mongoReleases = Invoke-RestMethod -Uri "https://downloads.mongodb.org/current.json"
$latestVersion = $mongoReleases.versions.version |
    Where-Object { $_ -like "$toolsetVersion.*" } |
    Sort-Object { [version]$_ } -Descending |
    Select-Object -First 1
if (-not $latestVersion) {
    throw "Unable to resolve latest MongoDB $toolsetVersion release from downloads.mongodb.org/current.json"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants