Skip to content

feat(mongodb-runner): include full topology in start --json output - #962

Merged
autarch merged 1 commit into
mainfrom
11-05-mongodb-runner_start-json-full-topology
Nov 10, 2026
Merged

autarch merged 1 commit into
mainfrom
11-05-mongodb-runner_start-json-full-topology

Conversation

@autarch

@autarch autarch commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

start --json now includes the full serialized cluster topology, the same data ls --json reports for that id (topology, servers, shards, ...). This eliminates the need for a separate ls --json invocation after start to learn each server's host, port, and role.

Checklist

@autarch
autarch requested review from a team as code owners November 5, 2026 19:38
@autarch
autarch requested review from nbbeeken and a balanced review from Copilot November 5, 2026 19:38

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.

🟡 Changes recommended

The README’s redaction guarantee needs to clarify that connection strings may still contain passwords and should not be assumed safe to log or share.

1 open issue
What changed in this PR

This PR adds full cluster topology to mongodb-runner start --json, eliminating the separate ls --json call needed to discover server details.

Changes:

  • Reuses the serialized metadata and applies the same redaction as ls --json.
  • Adds tests for standalone and sharded topology, output consistency, and credential redaction.
  • Documents the expanded JSON output.
File Description
packages/​mongodb-runner/​src/​runner-helpers.ts Returns serialized metadata and the connection string from start.
packages/​mongodb-runner/​src/​cli.ts Includes redacted topology data in start JSON output.
packages/​mongodb-runner/​src/​cli.spec.ts Tests topology fields, listing consistency, and redaction.
packages/​mongodb-runner/​README.md Describes the expanded output and updates the example.

Review effort: Balanced

Comment thread packages/mongodb-runner/README.md Resolved
@autarch
autarch force-pushed the 11-05-mongodb-runner_start-json-full-topology branch 3 times, most recently from 86bdb75 to 4ee26d0 Compare November 5, 2026 20:45
@autarch
autarch force-pushed the 11-05-mongodb-runner_start-json-full-topology branch 2 times, most recently from 2e8cda7 to 8faafd6 Compare November 9, 2026 15:58
@codeowners-service-app
codeowners-service-app Bot requested a review from esvm November 9, 2026 16:02
@codeowners-service-app

codeowners-service-app Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Assigned esvm for team mongosh-developers because nbbeeken is out of office.
Assigned LuciaHarcekova for team compass-developers because nbbeeken is out of office.

start --json now spreads in redactSerializedCluster(cluster.serialize()),
the same redacted serialized data that ls --json reports for the id
(topology, servers, shards), so callers no longer need a separate ls
invocation after start to learn each server's host, port, and role.
@autarch
autarch force-pushed the 11-05-mongodb-runner_start-json-full-topology branch from 8faafd6 to 76347bd Compare November 9, 2026 21:39

@esvm esvm left a comment

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.

LGTM!

@autarch
autarch merged commit 1fca5e6 into main Nov 10, 2026
19 checks passed
@autarch
autarch deleted the 11-05-mongodb-runner_start-json-full-topology branch November 10, 2026 16:11
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