chore(ci, mongodb-runner): cache mongodb download on windows COMPASS-10932 - #856
chore(ci, mongodb-runner): cache mongodb download on windows COMPASS-10932#856Anemy wants to merge 3 commits into
Conversation
…r a week to speed up CI COMPASS-10932
| options.binDir = await this.downloadMongoDb( | ||
| options.downloadDir ?? options.tmpDir, | ||
| options.downloadDir ?? | ||
| process.env.MONGODB_RUNNER_DOWNLOAD_DIR ?? |
There was a problem hiding this comment.
Maybe we want to avoid using env here and instead pass the downloadDir everywhere? It will add a bit more code and could lead to folks not passing it though.
There was a problem hiding this comment.
I feel like env is fine but since this is in the CLI could we add it to the help menu along side the --downloadDir flag and call this PR a feat -> (feat to add env var control for the download location)
There was a problem hiding this comment.
Pull request overview
This PR aims to speed up Windows CI runs by caching downloaded MongoDB server binaries between workflow executions, wiring the cache location into mongodb-runner via a new environment-variable default.
Changes:
mongodb-runner: preferMONGODB_RUNNER_DOWNLOAD_DIR(when set) as the download directory before falling back totmpDir.- CI: add a Windows-only cache for MongoDB binaries with weekly rotation and set
MONGODB_RUNNER_DOWNLOAD_DIRaccordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/mongodb-runner/src/mongocluster.ts | Uses MONGODB_RUNNER_DOWNLOAD_DIR as a default download location for MongoDB binaries. |
| .github/workflows/check-test.yaml | Adds Windows-only cache + weekly rotation key and exports download dir env var for tests. |
Suppressed comments (1)
.github/workflows/check-test.yaml:129
- $GITHUB_ENV should be quoted to avoid failures if the runner path contains spaces or special characters.
run: echo "MONGODB_RUNNER_DOWNLOAD_DIR=${RUNNER_TEMP}/mongodb-binaries" >> $GITHUB_ENV
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Only uses them for a week so we avoid getting stale ones. Github automatically cleans up unused cache items. This does mean once a week CI will be that slower run.