Skip to content

feat(connections): warn then connecting to an end-of-life server COMPASS-9083 #6888

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 12 commits into from
May 12, 2025
Merged
Prev Previous commit
Next Next commit
Update API route
  • Loading branch information
kraenhansen committed May 7, 2025
commit 097eb5e79255e35498a47eecdb5a29de0b4f8023
14 changes: 8 additions & 6 deletions packages/data-service/src/end-of-life-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { createLogger } from '@mongodb-js/compass-logging';
const { mongoLogId, log } = createLogger('END-OF-LIFE-SERVER');

const FALLBACK_END_OF_LIFE_SERVER_VERSION = '4.4';
const { HADRON_AUTO_UPDATE_ENDPOINT, HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE } =
process.env;
const updateEndpoint =
HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE ?? HADRON_AUTO_UPDATE_ENDPOINT;
const {
HADRON_AUTO_UPDATE_ENDPOINT = process.env
.HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE,
} = process.env;

let latestEndOfLifeServerVersion: Promise<string> | null = null;

export async function getLatestEndOfLifeServerVersion(): Promise<string> {
if (!updateEndpoint) {
if (!HADRON_AUTO_UPDATE_ENDPOINT) {
log.debug(
mongoLogId(1_001_000_350),
'getLatestEndOfLifeServerVersion',
Expand All @@ -26,7 +26,9 @@ export async function getLatestEndOfLifeServerVersion(): Promise<string> {
'getLatestEndOfLifeServerVersion',
'Fetching EOL server version'
);
latestEndOfLifeServerVersion = fetch(`${updateEndpoint}/eol-server`)
latestEndOfLifeServerVersion = fetch(
`${HADRON_AUTO_UPDATE_ENDPOINT}/api/v2/eol-server`
)
.then(async (response) => {
if (response.ok) {
const result = await response.text();
Expand Down