Skip to content

chore(ci, mongodb-runner): cache mongodb download on windows COMPASS-10932 - #856

Open
Anemy wants to merge 3 commits into
mainfrom
COMPASS-10932-cache-windows-mongodb-download
Open

chore(ci, mongodb-runner): cache mongodb download on windows COMPASS-10932#856
Anemy wants to merge 3 commits into
mainfrom
COMPASS-10932-cache-windows-mongodb-download

Conversation

@Anemy

@Anemy Anemy commented Aug 14, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI lite review requested due to automatic review settings August 14, 2026 18:02
options.binDir = await this.downloadMongoDb(
options.downloadDir ?? options.tmpDir,
options.downloadDir ??
process.env.MONGODB_RUNNER_DOWNLOAD_DIR ??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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)

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 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: prefer MONGODB_RUNNER_DOWNLOAD_DIR (when set) as the download directory before falling back to tmpDir.
  • CI: add a Windows-only cache for MongoDB binaries with weekly rotation and set MONGODB_RUNNER_DOWNLOAD_DIR accordingly.

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.

Comment thread .github/workflows/check-test.yaml Outdated
Comment thread .github/workflows/check-test.yaml Outdated
Anemy and others added 2 commits August 14, 2026 14:16
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants