fix: detect MongoDB version and signing key from the published repo - #41
Merged
Conversation
20260813_stasadev_fix_mongo_9 ## The Issue Installing the MongoDB CLI tools failed with `gpg: no valid OpenPGP data found`. The signing key name does not track the release version: every 8.x release is signed with `server-8.0`, but 9.x uses `server-9`. The key was derived as `<major>.0`, so once 9.0 was published as the latest release the build requested `server-9.0.asc`, which does not exist, and `wget -qO-` piped the 404 page into `gpg`. The version was also taken as the newest suite in the bucket without checking it was usable, and 9.0 shipped `mongodb-database-tools` before `mongodb-mongosh` was available for it. ## How This PR Solves The Issue - Look the key name up in the `pgp.mongodb.com` bucket listing instead of deriving it from the version. - Select the newest release whose `Packages` index actually lists every package for `TARGETARCH`, so an incomplete or arch-specific suite is skipped before the repository is configured. - Fetch with `curl -f` so an HTTP error fails at the download rather than feeding an error page to `gpg`. - Fall back to a known-good version/key pair when either bucket listing is unreachable or returns nothing usable, so the build still installs. ## Manual Testing Instructions ```bash ddev add-on get ddev/ddev-mongo --pr replace_me ddev restart ddev exec mongosh --version ddev exec mongodump --version ``` ## Automated Testing Overview Covered by the existing bats tests, which assert `mongosh` and `mongodump` are available in the web container. ## Release/Deployment Notes Only affects the web container build. Selection is dynamic, so no change is needed here when MongoDB publishes a new release. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
The Issue
https://github.com/ddev/ddev-mongo/actions/runs/31685388982
Installing the MongoDB CLI tools failed with
gpg: no valid OpenPGP data found. The signing key name does not track the release version: every 8.x release is signed withserver-8.0, but 9.x usesserver-9. The key was derived as<major>.0, so once 9.0 was published as the latest release the build requestedserver-9.0.asc, which does not exist, andwget -qO-piped the 404 page intogpg.The version was also taken as the newest suite in the bucket without checking it was usable, and 9.0 shipped
mongodb-database-toolsbeforemongodb-mongoshwas available for it.How This PR Solves The Issue
pgp.mongodb.combucket listing instead of deriving it from the version.Packagesindex actually lists every package forTARGETARCH, so an incomplete or arch-specific suite is skipped before the repository is configured.curl -fso an HTTP error fails at the download rather than feeding an error page togpg.Manual Testing Instructions
Automated Testing Overview
Covered by the existing bats tests, which assert
mongoshandmongodumpare available in the web container.