-
Notifications
You must be signed in to change notification settings - Fork 109
ci: add ipAccessList after creating project #496
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
Conversation
There was a problem hiding this 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.
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", | ||
}, | ||
], | ||
}); |
There was a problem hiding this comment.
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.
Proposed changes
Checklist