Repository navigation
Conversation
Rewrite mongodl.py's _latest_build_url() to resolve a presigned S3 URL against the origin-mongodb-server-latest bucket instead of building an HTTP URL against downloads.10gen.com, chaining through drivers-test-secrets-role to the role/bucket/prefix named in the drivers/devprod-release-infrastructure secret. Add boto3 as a dependency, add an ec2.assume_role step to bootstrap mongo-orchestration, and include a standalone spike script proving out the credential chain.
latest_spike.py was a throwaway local proof-of-concept for the credential chain; the same logic now lives in mongodl.py itself.
GitHub Actions runners don't have S3 access to the private "latest" nightly builds, so under GITHUB_ACTION, default to (and alias "latest" to) the newest published release instead. Evergreen's default of "latest" is unchanged.
mongodb-atlas-local's Docker image only publishes a "latest" tag, not "latest-stable", so aliasing broke `docker run` for local_atlas consumers on GitHub Actions.
crypt_shared's separate mongodl invocation shares opts.version with the mongodb-atlas-local Docker tag and isn't gated by local_atlas, so exempting local_atlas from the alias (previous commit) left crypt_shared still requesting the private S3 "latest" build with no AWS credentials in GitHub Actions, crashing with NoCredentialsError. Alias only the value passed to mongodl (archive + crypt_shared), leaving opts.version itself untouched for the Docker tag and the mongodb_runner version-compat check.
Add a note under "Using In Evergreen" explaining that "latest"/ "latest-build" now downloads from a private S3 bucket and requires assuming drivers_test_secrets_role. Update the GitHub Actions "version" input description to document the default/alias to "latest-stable".
…from env Both were hardcoded string constants; read them from the environment instead, since they're now provisioned via a secrets vault rather than being safe to bake into source.
mongodl.py now reads this from the environment unconditionally (not just on the local, non-ambient-creds path), so Evergreen tasks need it too, not just AWS_ACCESS_KEY_ID/etc.
…m a vault These are sourced from the drivers/devprod-release-infrastructure AWS Secrets Vault via setup-secrets.sh, not an Evergreen project variable. Since setup-secrets.sh requires bash but bootstrap mongo-orchestration's main step uses sh, add a separate bash step that fetches them and promotes them to Evergreen expansions via expansions.update, so the existing sh step can pick them up like AWS_ACCESS_KEY_ID already does. Only fetches when downloading latest/latest-build, to avoid an unnecessary SecretsManager call for pinned-version tasks.
Revert the separate fetch-server-artifacts-secrets.sh script and its Evergreen wiring. mongodl.py now reads the drivers/devprod-release- infrastructure vault directly, using whatever AWS identity is already active: - The vault itself is readable with the ambient identity directly, no assume-role hop needed (confirmed empirically). - Assuming the S3 artifacts role does need drivers-test-secrets-role's own identity specifically, not an SSO permission set's distinct auto-generated role, so locally we assume it using the ARN the vault itself provides (DRIVERS_TEST_SECRETS_ROLE_ARN) -- no hardcoded ARN, no pre-exported env vars, no separate script. - In Evergreen, ec2.assume_role already makes the ambient identity drivers-test-secrets-role, so that extra hop is skipped entirely. Verified locally end-to-end for both the AWS_PROFILE (local) and ambient-env-vars (simulated Evergreen) paths, with nothing pre-exported beyond the credentials Evergreen's ec2.assume_role or a local aws sso login already provide.
mongodb-runner is used for local dev and GitHub Actions, neither of which should require S3 credentials just to spin up a default server. Extend the existing GITHUB_ACTION alias condition to also trigger for --mongodb-runner, regardless of environment.
Evergreen consumers won't all assume drivers-test-secrets-role, so explicit "latest" is a breaking change regardless. Keep it consistent: change only the default, never rewrite an explicit "latest".
Try the ambient identity first, then the artifacts role assumed directly, then the artifacts role reached through drivers-test-secrets-role.
The Docker tag stays "latest", but crypt_shared is a separate download that "latest" now routes to private S3.
GitHub Actions runners have no AWS credentials for the private "latest" nightly, so the action downloads the newest stable release instead. mongodl keeps "latest" meaning the nightly build.
There was a problem hiding this comment.
🟡 Changes recommended
Presigned credentials may leak in logs, and the AWS access, caching, and GitHub fallback issues must be addressed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Migrates nightly MongoDB binary downloads to authenticated private S3 presigned URLs.
Changes:
- Adds AWS credential resolution and S3 URL generation.
- Updates version mapping, caching, dependencies, documentation, and Evergreen configuration.
File summaries
| File | Review |
|---|---|
README.md |
Documents private downloads; needs clarification for local Atlas and unpublished versions (nits). |
action.yml |
Documents version mapping; needs the local-Atlas exception clarified (nit). |
.evergreen/uv.lock |
Locks new AWS dependencies. |
.evergreen/server_artifacts.py |
Adds credential resolution and presigned URLs. |
.evergreen/run-mongodb.sh |
Updates the documented default version. |
.evergreen/pyproject.toml |
Adds boto3 and packages the resolver. |
.evergreen/orchestration/uv.lock |
Updates orchestration dependencies. |
.evergreen/orchestration/drivers_orchestration.py |
Adds version mapping; unpublished versions can bypass the GitHub fallback and require unavailable credentials (moderate). |
.evergreen/mongodl.py |
Routes nightly artifacts through S3, but presigned URLs break stable caching (moderate) and expose credentials in logs (critical). |
.evergreen/config.yml |
Adds role assumption too broadly, potentially breaking non-nightly tasks without AWS access (moderate). |
Review details
Suppressed comments (1)
README.md:59
- This statement excludes pinned versions, but
drivers_orchestration.pycurrently rewrites every entry inUNPUBLISHED_VERSIONS(currently9.0) tolatest-build, so those pinned inputs also require private-S3 credentials. Document that unpublished-version exception so users do not expect such versions to work without AWS access.
[Secrets Handling](.evergreen/secrets_handling/README.md)). Any version other
than `latest`/`latest-build` (e.g. `latest-stable`, or a pinned version like
`8.0`) is unaffected and needs no AWS access.
- Files reviewed: 8/10 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assume drivers_test_secrets_role in the CLI, mongodb-runner, and docker tests, forward AWS credentials into the docker container, and pin the azure OIDC server to latest-stable.
There was a problem hiding this comment.
🔵 Needs a closer look
Private IAM role chaining, presigned artifact paths, and credential forwarding require final validation against the production AWS configuration.
Review details
- Files reviewed: 20/22 changed files
- Comments generated: 0 new
- Review effort level: Balanced
…3622-s3-latest-spike # Conflicts: # .evergreen/orchestration/drivers_orchestration.py
The test-otel Evergreen task downloads MongoDB 'latest' builds through a presigned private S3 URL and needs the drivers-test-secrets role. Its subprocess didn't forward the assumed-role AWS credentials, so mongodl fell back to the unprivileged instance role, which cannot read the drivers/devprod-release-infrastructure vault. Add the same include_expansions_in_env forwarding used by the other 'latest' tests.
Restores the version-mismatch warning, splits the vault-read error handling into client-side and server-side branches, and documents the release-infrastructure vault and latest-build usage.
|
CI is failing with |
PavelSafronov
left a comment
There was a problem hiding this comment.
Changes look good, approving.
|
After a fix to fallback handling in e8edbc8, I was able to confirm that it works as intended in Evergreen: I'm working on verifying the "latest" behavior in the GitHub Action now |
|
Confirmed here: Versus on a recent run without this change: |
DRIVERS-3628
Summary
DEVPROD-42370 moves MongoDB "latest"/nightly server binaries from public HTTP hosts to a private S3 bucket. This migrates
mongodlto resolvelatestandlatest-buildthrough presigned S3 URLs, and defaults the non-nightly entry points tolatest-stableso they keep working without AWS credentials.Changes in this PR
latestandlatest-buildwith presigned S3 URls created byserver_artifacts.py.run-mongodb.sh,run-orchestration.sh, the Docker wrapper,serverless/download-crypt.sh, and the cloud-VM scripts) tolatest-stablelatesttolatest-stable.Migration Guide
latestandlatest-buildnow download unpublished nightly builds from a private S3 bucket instead of the publicdownloads.10gen.comanddownloads.mongodb.comhosts, so they require an AWS identity.latest-stableand pinned released versions are unchanged and need no credentials.drivers_test_secrets_role(for example viaec2.assume_role) before the download. Pass the AWS credentials to the driver orchestration step.AWS_PROFILEwith drivers test secrets credentials.latestis remapped tolatest-stable, so no credentials are needed there.run-mongodb.sh,run-orchestration.sh, the Docker wrapper, andserverless/download-crypt.shnow default tolatest-stable. Under--local-atlasthe Docker image tag stayslatest.MONGODL_PRIVATE_ARTIFACTS=1so the host's AWS identity is forwarded into the container.Test Plan
make lintclean.mongodl --version latestand--version latest-buildresolve to presigned S3 URLs locally usingAWS_PROFILE=drivers-test; a run with no AWS identity fails with a clear message.test-dockerexercises thelatestdownload with assumed credentials.test-latest-*,test-docker, and thelatest-stablepartial CLI/mongodb-runner tests.Checklist
Checklist for Author
Checklist for Reviewer