Skip to content

Conversation

blva
Copy link
Collaborator

@blva blva commented Aug 29, 2025

Proposed changes

  • fixes the Atlas test command
  • Adds IP to access list of any created project test
  • Checks that apiClient has credentials and updates a mock for validation

Checklist

@blva blva changed the title fix: add ipAccessList after creating project ci: add ipAccessList after creating project Aug 29, 2025
@blva blva marked this pull request as ready for review August 29, 2025 17:12
@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 17:12
@blva blva requested a review from a team as a code owner August 29, 2025 17:12
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

This PR fixes Atlas test configuration and adds IP access list management to created test projects. The changes ensure proper authentication validation and enable tool access by automatically adding the current IP address to project access lists.

  • Adds API base URL configuration with fallback to dev environment
  • Implements credential validation and IP access list creation for test projects
  • Fixes mock condition logic for access token validation
  • Updates CI workflow to run only Atlas integration tests

Reviewed Changes

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

File Description
tests/integration/tools/atlas/atlasHelpers.ts Adds API base URL config, credential validation, and IP access list creation
tests/integration/helpers.ts Fixes mock condition to properly handle missing credentials
.github/workflows/code_health.yaml Updates test command to run only Atlas integration tests

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

Comment on lines +123 to +137
const { currentIpv4Address } = await apiClient.getIpInfo();
await apiClient.createProjectIpAccessList({
params: {
path: {
groupId: group.id,
},
},
body: [
{
ipAddress: currentIpv4Address,
groupId: group.id,
comment: "Added by MongoDB MCP Server to enable tool access",
},
],
});
Copy link
Preview

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

The IP access list creation should be wrapped in a try-catch block to handle potential failures gracefully. If this operation fails, it could leave the project in an unusable state for tests, but the project creation itself succeeded.

Copilot uses AI. Check for mistakes.

@blva blva merged commit d1e0ee3 into main Aug 29, 2025
28 checks passed
@blva blva deleted the atlas-tests branch August 29, 2025 17:17
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