chore(atlas-service): add a new atlas config CLOUDP-397307#7984
chore(atlas-service): add a new atlas config CLOUDP-397307#7984
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “atlas-internal” Atlas backend preset/config so Compass can be pointed at an internal Atlas environment, and updates related development tooling/configuration.
Changes:
- Add
atlas-internalto the Compass preferences schema enum foratlasServiceBackendPreset. - Introduce an
atlas-internalentry in the Atlas service backend config map. - Add a new redirect-extension rule intended for “cloud-internal” Compass Web.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/compass-web/scripts/redirect-extension-config.json | Adds a new Header Editor Lite redirect rule entry for “cloud-internal”. |
| packages/compass-preferences-model/src/preferences-schema.tsx | Extends the atlasServiceBackendPreset allowed values to include atlas-internal. |
| packages/atlas-service/src/util.ts | Adds the atlas-internal backend preset configuration. |
| 'atlas-internal': { | ||
| ccsBaseUrl: '', | ||
| // multiplexedWsBaseUrls: ['wss://cloud-internal.mongodb.com/ccs'], | ||
| cloudBaseUrl: '', | ||
| atlasApiBaseUrl: 'https://cloud-internal.mongodb.com/api/private', |
There was a problem hiding this comment.
The preset list in the comment above this config doesn’t mention atlas-internal, even though it’s now a supported option. Update the documentation comment so it stays in sync with the available presets.
| "name": "cloud-internal: compass-web localhost", | ||
| "to": "http://localhost:7777/compass-web.mjs", | ||
| "condition": { | ||
| "regex": "https://downloads\\.mongodb\\.com/compass/compass-web/prod/index.mjs", | ||
| "resourceTypes": ["script"] |
There was a problem hiding this comment.
This adds an enabled redirect rule whose condition regex matches the same .../prod/index.mjs URL as the existing "cloud: compass-web localhost" rule above. Two enabled rules with identical conditions can lead to non-deterministic behavior depending on extension rule ordering; consider removing the duplicate, disabling one by default, or adjusting the regex to match the intended cloud-internal asset URL (if different).
| 'atlas-dev', | ||
| 'atlas-qa', | ||
| 'atlas-staging', | ||
| 'atlas-internal', | ||
| 'atlas', |
There was a problem hiding this comment.
The doc comment describing available atlasServiceBackendPreset values doesn’t include the newly added atlas-internal option. Please update the comment so the documented presets match the enum values.
| clientId: '', | ||
| issuer: '', | ||
| }, | ||
| authPortalUrl: '', | ||
| assistantApiBaseUrl: '', | ||
| userDataBaseUrl: '', |
There was a problem hiding this comment.
The new atlas-internal preset sets required URLs/oidc fields to empty strings. Downstream code builds absolute URLs from authPortalUrl and atlasLogin.issuer (e.g. new URL(this.config.authPortalUrl) / new URL(${issuer}/v1/introspect)), which will throw or generate invalid endpoints if this preset is selected without env overrides. Provide valid defaults for the internal environment, or add validation in getAtlasConfig that fails fast with a clear error when required fields are missing.
| clientId: '', | |
| issuer: '', | |
| }, | |
| authPortalUrl: '', | |
| assistantApiBaseUrl: '', | |
| userDataBaseUrl: '', | |
| clientId: '0oajzdcznmE8GEyio297', | |
| issuer: 'https://auth.mongodb.com/oauth2/default', | |
| }, | |
| authPortalUrl: 'https://account.mongodb.com/account/login', | |
| assistantApiBaseUrl: 'https://knowledge.mongodb.com/api/v1', | |
| userDataBaseUrl: 'https://cloud-internal.mongodb.com/ui/userData', |
| // multiplexedWsBaseUrls: ['wss://cloud-internal.mongodb.com/ccs'], | ||
| cloudBaseUrl: '', | ||
| atlasApiBaseUrl: 'https://cloud-internal.mongodb.com/api/private', | ||
| atlasLogin: { |
There was a problem hiding this comment.
Huh, was sure we cleaned-up everything atlas login related from compass
|
putting in draft bc we can continue this after we've landed the client and rolled it out. |
Description
adds new atlas config
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes