Skip to content

chore: moving common classes into src/common #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2025
Merged

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Jul 11, 2025

Proposed changes

moves config.ts, errors.ts, logger.ts & session.ts into src/common
moves src/helpers/packageInfo.ts into src/common
moves src/common/container.ts and src/common/atlas/generatePassword.ts into src/helpers

now src/common should be about classes and common functionality and src/helpers should be about pure/utility functions

NOTE: no code changes except for import paths

Checklist

@fmenezes fmenezes marked this pull request as ready for review July 11, 2025 10:52
@Copilot Copilot AI review requested due to automatic review settings July 11, 2025 10:52
@fmenezes fmenezes requested a review from a team as a code owner July 11, 2025 10:52
Copy link
Contributor

@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

Moves shared utility modules into a centralized src/common directory and updates all import paths accordingly.

  • Relocated config.ts, errors.ts, logger.ts, and session.ts under src/common.
  • Adjusted import statements across tests and source files to reference the new common path.
  • Fixed relative paths within moved modules (e.g., updated helper imports in src/common/session.ts).

Reviewed Changes

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

Show a summary per file
File Description
tests/unit/telemetry.test.ts Updated imports to src/common for session, config, and logger
tests/unit/session.test.ts Updated imports to src/common for session and config
tests/integration/tools/mongodb/mongodbHelpers.ts Updated UserConfig import to src/common/config.ts
tests/integration/tools/mongodb/connect/connect.test.ts Updated config import to src/common/config.ts
tests/integration/tools/atlas/clusters.test.ts Updated Session import to src/common/session.ts
tests/integration/telemetry.test.ts Updated Session and config imports to src/common
tests/integration/helpers.ts Updated UserConfig, Session, and config imports to src/common
src/tools/tool.ts Updated imports for Session, logger, and UserConfig to src/common
src/tools/mongodb/mongodbTool.ts Updated ErrorCodes, MongoDBError, and logger imports to src/common
src/tools/mongodb/connect/connect.ts Updated UserConfig and Session imports to src/common
src/tools/atlas/connect/connectCluster.ts Updated logger import to src/common
src/tools/atlas/atlasTool.ts Updated logger import to src/common
src/telemetry/telemetry.ts Updated Session, UserConfig, and logger imports to src/common
src/server.ts Updated Session, logger, and UserConfig imports to src/common
src/index.ts Updated logger, config, and Session imports to src/common
src/helpers/indexCheck.ts Updated errors import to src/common/errors.ts
src/common/session.ts Corrected internal helper import paths and atlas client import
src/common/atlas/cluster.ts Corrected logger import to src/common
src/common/atlas/apiClient.ts Corrected logger import to src/common
Comments suppressed due to low confidence (1)

src/common/session.ts:1

  • [nitpick] Consider adding a barrel file (e.g., src/common/index.ts) or configuring path aliases to re-export common modules—this will simplify deep relative imports across the codebase.
import { NodeDriverServiceProvider } from "@mongosh/service-provider-node-driver";

…sword.ts into src/helpers and src/helpers/packageInfo.ts into src/common
@coveralls
Copy link
Collaborator

coveralls commented Jul 11, 2025

Pull Request Test Coverage Report for Build 16218434167

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 75.33%

Files with Coverage Reduction New Missed Lines %
src/common/atlas/apiClient.ts 2 65.6%
Totals Coverage Status
Change from base Build 16217682500: 0.0%
Covered Lines: 887
Relevant Lines: 1087

💛 - Coveralls

@fmenezes fmenezes enabled auto-merge (squash) July 11, 2025 11:38
@fmenezes
Copy link
Collaborator Author

  • Failures are happening on main (unrelated)

Copy link
Collaborator

@blva blva left a comment

Choose a reason for hiding this comment

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

LGTM

@fmenezes fmenezes merged commit c023314 into main Jul 11, 2025
24 of 26 checks passed
@fmenezes fmenezes deleted the chore_move_common branch July 11, 2025 11:55
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