Skip to content

Conversation

addaleax
Copy link
Collaborator

@addaleax addaleax commented Oct 7, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 15:09
@addaleax addaleax requested a review from a team as a code owner October 7, 2025 15:09
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

Enable the new autocompleter by default (unless explicitly disabled via USE_NEW_AUTOCOMPLETE='0') and adjust test expectations accordingly. Some tests were globally skipped, and timing instrumentation was effectively disabled.

  • Default condition for enabling new autocompleter changed to env var !== '0'
  • Several test suites/contexts were skipped and test logic updated for new enablement semantics
  • Startup timing markTime implementation replaced with a no-op (previous logic commented out)

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/cli-repl/src/startup-timing.ts Replaced timing capture with no-op, leaving prior implementation commented
packages/cli-repl/src/mongosh-repl.ts Switched feature flag condition to enable new autocompleter unless set to '0'
packages/cli-repl/src/mongosh-repl.spec.ts Updated test conditions to reflect new default enablement logic
packages/cli-repl/src/cli-repl.spec.ts Adjusted autocomplete test logic and skipped a CTRL-C context
packages/cli-repl/src/async-repl.spec.ts Entire AsyncRepl test suite skipped
packages/browser-runtime-core/src/autocompleter/shell-api-autocompleter.ts Updated condition to initialize new autocompleter by default

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return {
markTime: (category, label) =>
jsTimingEntries.push([category, label, process.hrtime.bigint()]),
markTime: (category, label) => 0, //jsTimingEntries.push([category, label, process.hrtime.bigint()]),
Copy link
Preview

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

The markTime function has been replaced with a no-op, so jsTimingEntries is never populated and getTimingData will return empty or stale data; either restore the push logic or remove/adjust getTimingData to reflect the intentional disabling of timing collection.

Suggested change
markTime: (category, label) => 0, //jsTimingEntries.push([category, label, process.hrtime.bigint()]),
markTime: (category, label) => { jsTimingEntries.push([category, label, process.hrtime.bigint()]); return 0; },

Copilot uses AI. Check for mistakes.

let oldMongoshCompleter: (line: string) => Promise<CompletionResults>;

if (process.env.USE_NEW_AUTOCOMPLETE) {
if (process.env.USE_NEW_AUTOCOMPLETE !== '0') {
Copy link
Preview

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The magic string comparison !== '0' is repeated across multiple files; consider introducing a helper (e.g., function isNewAutocompleteEnabled(env = process.env) { return env.USE_NEW_AUTOCOMPLETE !== '0'; }) to centralize the flag semantics and avoid divergence.

Copilot uses AI. Check for mistakes.

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.

1 participant