Skip to content

feat: integrate user's ip address into debugger tool COMPASS-11046 - #8397

Open
dudaschar wants to merge 5 commits into
mainfrom
COMPASS-11046
Open

feat: integrate user's ip address into debugger tool COMPASS-11046#8397
dudaschar wants to merge 5 commits into
mainfrom
COMPASS-11046

Conversation

@dudaschar

Copy link
Copy Markdown
Collaborator

Description

This PR is using the system status endpoint integration made in #8396.
Replacing hard coded ipAddress with retrieved value from atlas admin endpoint.

image

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)

@dudaschar
dudaschar requested a review from a team as a code owner August 24, 2026 15:34
@dudaschar
dudaschar requested review from mabaasit and a lite review from Copilot August 24, 2026 15:34
@github-actions github-actions Bot added the feat label Aug 24, 2026
@codeowners-service-app

Copy link
Copy Markdown

Assigned kmruiz for team compass-developers because mabaasit is out of office.

@dudaschar dudaschar added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Aug 24, 2026
@dudaschar
dudaschar requested review from esvm and paula-stacho August 24, 2026 15:35

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.

Pull request overview

Integrates the user’s IP address from Atlas system status into the connection debugger.

Changes:

  • Adds validated system-status API support and authentication allowlisting.
  • Uses the retrieved IP with graceful fallback behavior.
  • Adds API, authentication, and debugger tests.

Reviewed changes

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

Show a summary per file
File Description
packages/compass-generative-ai/src/tools/debug-connection.ts Uses the resolved IP for access checks.
packages/compass-generative-ai/src/tools/debug-connection.spec.ts Tests IP resolution and fallback behavior.
packages/atlas-service/src/main.spec.ts Tests system-status authentication.
packages/atlas-service/src/atlas-admin-api-auth-endpoints.ts Allowlists the system-status endpoint.
packages/atlas-admin-api/src/system-status-types.ts Defines and validates system-status responses.
packages/atlas-admin-api/src/index.ts Exports the new response type.
packages/atlas-admin-api/src/atlas-admin-api-service.ts Implements system-status retrieval.
packages/atlas-admin-api/src/atlas-admin-api-service.spec.ts Tests system-status API behavior.
Suppressed comments (1)

packages/atlas-admin-api/src/index.ts:14

  • AtlasAdminApiService is exposed and consumed through the @mongodb-js/atlas-admin-api/provider entrypoint, whose type exports in provider.tsx mirror this barrel for the existing response types. Exporting AtlasSystemStatus only from src/index.ts leaves the return type of the new getSystemStatus API unavailable from the entrypoint consumers already use; please re-export it from provider.tsx as well.
export { type AtlasSystemStatus } from './system-status-types';

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

`Bearer ${accessToken}`
);
});

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.

I don't think we need to test every endpoint that is on the list, but it won't hurt I suppose

Comment thread packages/compass-generative-ai/src/tools/debug-connection.ts Outdated
Comment thread packages/atlas-admin-api/src/system-status-types.ts
ipAccessStatus:
ipAccessList && userIp && isUserIpIncluded(ipAccessList, userIp)
? 'Client IP Allowed'
: 'Could not confirm',

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.

Surprisingly, many customers have problems with ip whitelisting. To give more information, I would separate:

  • Atlas is unavailable and we can't confirm
  • Atlas is available and my ip is not in the range.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@paula-stacho paula-stacho Aug 25, 2026

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.

We left the "can't confirm" intentionally vague for now as we realised we can't always tell (for example we don't know how to check awsSecurityGroup), but distinguishing that the request failed would make sense if we allow partial results. For now the plan is to not go with partial results though, if some of the requests fail we just let the user to retry the tool.

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.

We might want to add a clear 'not match' for when we can tell for sure though, will probably be a follow up improvement

Comment thread packages/atlas-admin-api/src/system-status-types.ts
@dudaschar
dudaschar requested review from esvm and paula-stacho August 25, 2026 09:32

@paula-stacho paula-stacho 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.

Left minor comment, otherwise looks good 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants