Skip to content

Commit

Permalink
add local environment to dropdown, other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Jan 24, 2025
1 parent 468acac commit fd80c42
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
22 changes: 11 additions & 11 deletions core/config/ConfigHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "./onboarding.js";
import ControlPlaneProfileLoader from "./profile/ControlPlaneProfileLoader.js";
import LocalProfileLoader from "./profile/LocalProfileLoader.js";
import PlatformProfileLoader from "./profile/PlatformProfileLoader.1.js";
import PlatformProfileLoader from "./profile/PlatformProfileLoader.js";
import {
ProfileDescription,
ProfileLifecycleManager,
Expand Down Expand Up @@ -116,10 +116,7 @@ export class ConfigHandler {
this.controlPlaneClient
.listAssistants()
.then(async (assistants) => {
this.profiles = this.profiles.filter(
(profile) => profile.profileDescription.id === "local",
);
await Promise.all(
const hubProfiles = await Promise.all(
assistants.map(async (assistant) => {
let renderedConfig: ConfigYaml | undefined = undefined;
if (assistant.configResult.config) {
Expand All @@ -141,15 +138,18 @@ export class ConfigHandler {
this.writeLog,
this.reloadConfig.bind(this),
);
this.profiles = [
...this.profiles.filter(
(profile) => profile.profileDescription.id === "local",
),
new ProfileLifecycleManager(profileLoader, this.ide),
];

return new ProfileLifecycleManager(profileLoader, this.ide);
}),
);

this.profiles = [
...this.profiles.filter(
(profile) => profile.profileDescription.id === "local",
),
...hubProfiles,
];

this.notifyProfileListeners(
this.profiles.map((profile) => profile.profileDescription),
);
Expand Down
4 changes: 3 additions & 1 deletion core/control-plane/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export function getControlPlaneEnvSync(
? "hub"
: ideTestEnvironment === "test"
? "test"
: process.env.CONTROL_PLANE_ENV;
: ideTestEnvironment === "local"
? "local"
: process.env.CONTROL_PLANE_ENV;

return env === "local"
? LOCAL_ENV
Expand Down
2 changes: 1 addition & 1 deletion core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export interface IdeSettings {
remoteConfigSyncPeriod: number;
userToken: string;
enableControlServerBeta: boolean;
continueTestEnvironment: "none" | "production" | "test";
continueTestEnvironment: "none" | "production" | "test" | "local";
pauseCodebaseIndexOnStart: boolean;
enableDebugLogs: boolean;
}
Expand Down
3 changes: 2 additions & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
"enum": [
"none",
"production",
"test"
"test",
"local"
],
"default": "none",
"description": "Continue test environment"
Expand Down

0 comments on commit fd80c42

Please sign in to comment.