Skip to content
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

Expand to EU and AU geos for copilot #781

Merged
merged 11 commits into from
Feb 12, 2024
4 changes: 2 additions & 2 deletions src/common/ArtemisService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import fetch, { RequestInit } from "node-fetch";
import { COPILOT_UNAVAILABLE, US_GEO } from "./copilot/constants";
import { COPILOT_UNAVAILABLE, SUPPORTED_GEO } from "./copilot/constants";
import { ITelemetry } from "../client/telemetry/ITelemetry";
import { sendTelemetryEvent } from "./copilot/telemetry/copilotTelemetry";
import { CopilotArtemisFailureEvent, CopilotArtemisSuccessEvent } from "./copilot/telemetry/telemetryConstants";
Expand All @@ -20,7 +20,7 @@ export async function getIntelligenceEndpoint(orgId: string, telemetry: ITelemet
const { geoName, environment, clusterNumber } = artemisResponse[0];
sendTelemetryEvent(telemetry, { eventName: CopilotArtemisSuccessEvent, copilotSessionId: sessionID, geoName: String(geoName), orgId: orgId });

if (geoName !== US_GEO) {
if (!SUPPORTED_GEO.includes(geoName)) {
return { intelligenceEndpoint: COPILOT_UNAVAILABLE, geoName: geoName };
}

Expand Down
1 change: 1 addition & 0 deletions src/common/copilot/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const US_GEO = 'us';
export const AUSTRALIA_GEO = 'au';
export const EUROPE_GEO = 'eu';
export const UK_GEO = 'uk';
export const SUPPORTED_GEO = [US_GEO, AUSTRALIA_GEO, EUROPE_GEO, UK_GEO];
export const COPILOT_UNAVAILABLE = 'copilotunavailable';
export const AUTH_CREATE_MESSAGE = vscode.l10n.t('Creating new Auth Profile');
export const AUTH_CREATE_FAILED = vscode.l10n.t("Error creating auth profile for org")
Expand Down
Loading