Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

dlombard
Copy link
Contributor

@dlombard dlombard commented Jul 7, 2025

Added a flag (skipStartupWarning) to skip the server's startup warnings

@Copilot Copilot AI review requested due to automatic review settings July 7, 2025 17:29
@dlombard dlombard requested a review from a team as a code owner July 7, 2025 17:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new skipStartupWarnings flag to let users suppress server startup warnings on demand.

  • Extends CLI and TypeScript option interfaces with skipStartupWarnings
  • Updates banner logic to omit startupWarnings when the flag is set
  • Registers the flag in the argument parser and adds a unit test for the new behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/cli-repl/src/mongosh-repl.ts Added skipStartupWarnings option and updated banner logic to use it
packages/cli-repl/src/mongosh-repl.spec.ts Added a test case to verify warnings are skipped when the flag is true
packages/cli-repl/src/arg-parser.ts Registered skipStartupWarnings in the parser’s boolean options
packages/arg-parser/src/cli-options.ts Extended the CliOptions interface with skipStartupWarnings
Comments suppressed due to low confidence (2)

packages/cli-repl/src/mongosh-repl.spec.ts:1349

  • Mock the 'automationNotices' and 'nonGenuineMongoDBCheck' commands in this test to prevent unexpected calls and ensure the test reliably covers only the suppression of 'startupWarnings'.
        it('startup warnings are absent when skipStartupWarnings flag is present', async function () {

packages/cli-repl/src/arg-parser.ts:74

  • [nitpick] Add a help description entry for the --skipStartupWarnings flag so users see a clear explanation in the CLI's usage output.
    'skipStartupWarnings',

Copy link
Collaborator

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @dlombard! ✨

packages/cli-repl/src/mongosh-repl.spec.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@addaleax addaleax changed the title feat: Add skipStartupWarnings flag to skip warnings on demand feat: add skipStartupWarnings flag to skip warnings on demand MONGOSH-2371 Jul 7, 2025
dlombard and others added 2 commits July 7, 2025 13:54
Co-authored-by: Anna Henningsen <github@addaleax.net>
@addaleax addaleax merged commit 7a7c872 into mongodb-js:main Jul 8, 2025
129 of 134 checks passed
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.