[Windows] Fix MongoDB installer after release-notes URL and anchor ch… - #14561
Open
v-davit-ioramashvili wants to merge 1 commit into
Open
[Windows] Fix MongoDB installer after release-notes URL and anchor ch…#14561v-davit-ioramashvili wants to merge 1 commit into
v-davit-ioramashvili wants to merge 1 commit into
Conversation
…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.
Contributor
There was a problem hiding this comment.
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 Redirectfailures in Windows PowerShell 5.1. - Parse
7.0.xpatch versions from#std-label-<version>-changeloganchors 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.
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bug fixing.
MongoDB changed its release-notes page, which breaks
Install-MongoDB.ps1onwindows-2025,windows-2025-vs2026andwindows-2022— all three pin MongoDB7.0and share this script:308 Permanent Redirect, whichInvoke-WebRequeston Windows PowerShell 5.1 does not follow, so the request throws.#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 builtmongodb-windows-x86_64--signed.msiand failed later with an unrelated-looking error.Validated on hosted runners for each affected toolset — parser resolved
7.0.40, the MSI passed the existingTest-FileSignatureassertion,msiexecreturned 0, andmongod --versionreportedv7.0.40:There is no hosted
windows-2025-vs2026label, so the vs2026 toolset was run on thewindows-2025runner — the same OS and toolset that build feeds to this script.Related issue:
https://github.com/github/hosted-runners-images/issues/911
Check list