Skip to content

Conversation

@addaleax
Copy link
Collaborator

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@addaleax addaleax requested a review from a team as a code owner November 25, 2025 11:06
@addaleax addaleax requested review from Copilot and lerouxb November 25, 2025 11:06
@addaleax addaleax changed the title chore(data-service): remove dependency on compass-logging chore(data-service): remove dependency on compass-logging COMPASS-10116 Nov 25, 2025
Copy link
Contributor

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

This PR removes the @mongodb-js/compass-logging dependency from the data-service package and replaces it with direct usage of mongodb-log-writer and the debug package. This simplifies the dependency chain by using lower-level logging utilities directly.

Key Changes:

  • Replaced @mongodb-js/compass-logging imports with mongodb-log-writer and debug
  • Updated logger type definitions to use MongoLogWriter instead of Logger['log']['unbound']
  • Moved mongodb-log-writer from devDependencies to dependencies

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
packages/data-service/src/logger.ts Updated imports and type definitions to use mongodb-log-writer and debug directly
packages/data-service/src/connection-attempt.ts Changed to import mongoLogId from local logger module instead of creating a new logger
packages/data-service/src/connection-attempt.spec.ts Updated test file to import mongoLogId from local logger module
packages/data-service/package.json Removed @mongodb-js/compass-logging dependency and moved mongodb-log-writer to dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import _debug from 'debug';

export const debug = _debug.extend('data-service');
export const debug = _debug('data-service');
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The debug function usage has changed from .extend('data-service') to calling _debug('data-service') directly. However, the debug package's default export is already a function that creates namespaced debuggers. This change removes the ability to extend an existing debug namespace, which may break existing debug functionality if other parts of the codebase were using debug.extend(). Verify that all usages of the exported debug are compatible with this change.

Suggested change
export const debug = _debug('data-service');
export const debug = _debug.extend('data-service');

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think Copilot is just wrong here

@addaleax addaleax merged commit f950a03 into main Nov 27, 2025
107 of 109 checks passed
@addaleax addaleax deleted the 10116-dev branch November 27, 2025 14:26
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