Merge pull request #4365 from continuedev/nate/feature-flags-gone
set feature flags to true
This commit is contained in:
commit
a4b442dca1
11 changed files with 66 additions and 125 deletions
4
binary/package-lock.json
generated
4
binary/package-lock.json
generated
|
|
@ -48,13 +48,13 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.49",
|
||||
"@continuedev/config-yaml": "^1.0.50",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@xenova/transformers": "2.14.0",
|
||||
"adf-to-md": "^1.1.0",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import fetch from "node-fetch";
|
||||
import * as fs from "node:fs";
|
||||
import { IdeSettings } from "..";
|
||||
import { getStagingEnvironmentDotFilePath } from "../util/paths";
|
||||
|
|
@ -62,30 +61,31 @@ const LOCAL_ENV: ControlPlaneEnv = {
|
|||
};
|
||||
|
||||
export async function enableHubContinueDev() {
|
||||
try {
|
||||
const resp = await fetch("https://api.continue.dev/features/hub");
|
||||
const data = (await resp.json()) as any;
|
||||
if ("enabled" in data && data.enabled === true) {
|
||||
return true;
|
||||
}
|
||||
} catch (e: any) {}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export async function getControlPlaneEnv(
|
||||
ideSettingsPromise: Promise<IdeSettings>,
|
||||
): Promise<ControlPlaneEnv> {
|
||||
const ideSettings = await ideSettingsPromise;
|
||||
return getControlPlaneEnvSync(ideSettings.continueTestEnvironment);
|
||||
return getControlPlaneEnvSync(
|
||||
ideSettings.continueTestEnvironment,
|
||||
ideSettings.enableControlServerBeta,
|
||||
);
|
||||
}
|
||||
|
||||
export function getControlPlaneEnvSync(
|
||||
ideTestEnvironment: IdeSettings["continueTestEnvironment"],
|
||||
enableControlServerBeta: IdeSettings["enableControlServerBeta"],
|
||||
): ControlPlaneEnv {
|
||||
if (fs.existsSync(getStagingEnvironmentDotFilePath())) {
|
||||
return STAGING_ENV;
|
||||
}
|
||||
|
||||
if (enableControlServerBeta === true) {
|
||||
return PRODUCTION_ENV;
|
||||
}
|
||||
|
||||
const env =
|
||||
ideTestEnvironment === "production"
|
||||
? "hub"
|
||||
|
|
|
|||
|
|
@ -92,49 +92,19 @@ class IntelliJIDE(
|
|||
}
|
||||
|
||||
suspend fun enableHubContinueDev(): Boolean {
|
||||
try {
|
||||
val client = OkHttpClient()
|
||||
val url = URL("https://api.continue.dev/features/hub")
|
||||
|
||||
val request = Request.Builder()
|
||||
.url(url)
|
||||
.get()
|
||||
.header("Content-Type", "application/json")
|
||||
.build()
|
||||
|
||||
val response = client.newCall(request).execute()
|
||||
|
||||
val responseBody = response.body?.string()
|
||||
val gson = Gson()
|
||||
val responseMap = gson.fromJson(responseBody, Map::class.java)
|
||||
|
||||
if (responseMap["enabled"] == true) {
|
||||
return true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
override suspend fun getIdeSettings(): IdeSettings {
|
||||
val settings = service<ContinueExtensionSettings>()
|
||||
|
||||
|
||||
var continueTestEnvironment = settings.continueState.continueTestEnvironment
|
||||
if (continueTestEnvironment != "production") {
|
||||
val enableHub = enableHubContinueDev()
|
||||
if (enableHub) {
|
||||
continueTestEnvironment = "production"
|
||||
}
|
||||
}
|
||||
|
||||
return IdeSettings(
|
||||
remoteConfigServerUrl = settings.continueState.remoteConfigServerUrl,
|
||||
remoteConfigSyncPeriod = settings.continueState.remoteConfigSyncPeriod,
|
||||
userToken = settings.continueState.userToken ?: "",
|
||||
enableControlServerBeta = settings.continueState.enableContinueTeamsBeta,
|
||||
continueTestEnvironment = continueTestEnvironment,
|
||||
continueTestEnvironment = "production",
|
||||
pauseCodebaseIndexOnStart = false, // TODO: Needs to be implemented
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ class ContinueSettingsComponent : DumbAware {
|
|||
val enableOSR: JCheckBox = JCheckBox("Enable Off-Screen Rendering")
|
||||
val displayEditorTooltip: JCheckBox = JCheckBox("Display Editor Tooltip")
|
||||
val showIDECompletionSideBySide: JCheckBox = JCheckBox("Show IDE completions side-by-side")
|
||||
val enableContinueHub: JCheckBox = JCheckBox("Enable Continue Hub")
|
||||
|
||||
init {
|
||||
val constraints = GridBagConstraints()
|
||||
|
|
@ -68,8 +67,6 @@ class ContinueSettingsComponent : DumbAware {
|
|||
constraints.gridy++
|
||||
panel.add(showIDECompletionSideBySide, constraints)
|
||||
constraints.gridy++
|
||||
panel.add(enableContinueHub, constraints)
|
||||
constraints.gridy++
|
||||
|
||||
// Add a "filler" component that takes up all remaining vertical space
|
||||
constraints.weighty = 1.0
|
||||
|
|
@ -102,7 +99,7 @@ open class ContinueExtensionSettings : PersistentStateComponent<ContinueExtensio
|
|||
var enableOSR: Boolean = shouldRenderOffScreen()
|
||||
var displayEditorTooltip: Boolean = true
|
||||
var showIDECompletionSideBySide: Boolean = false
|
||||
var continueTestEnvironment: String = "none"
|
||||
var continueTestEnvironment: String = "production"
|
||||
}
|
||||
|
||||
var continueState: ContinueState = ContinueState()
|
||||
|
|
@ -216,8 +213,7 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
mySettingsComponent?.enableContinueTeamsBeta?.isSelected != settings.continueState.enableContinueTeamsBeta ||
|
||||
mySettingsComponent?.enableOSR?.isSelected != settings.continueState.enableOSR ||
|
||||
mySettingsComponent?.displayEditorTooltip?.isSelected != settings.continueState.displayEditorTooltip ||
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected != settings.continueState.showIDECompletionSideBySide ||
|
||||
(if (mySettingsComponent?.enableContinueHub?.isSelected == true) settings.continueState.continueTestEnvironment != "production" else settings.continueState.continueTestEnvironment == "production")
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected != settings.continueState.showIDECompletionSideBySide
|
||||
return modified
|
||||
}
|
||||
|
||||
|
|
@ -233,8 +229,6 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
settings.continueState.displayEditorTooltip = mySettingsComponent?.displayEditorTooltip?.isSelected ?: true
|
||||
settings.continueState.showIDECompletionSideBySide =
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected ?: false
|
||||
settings.continueState.continueTestEnvironment =
|
||||
if (mySettingsComponent?.enableContinueHub?.isSelected == true) "production" else "none"
|
||||
|
||||
ApplicationManager.getApplication().messageBus.syncPublisher(SettingsListener.TOPIC)
|
||||
.settingsUpdated(settings.continueState)
|
||||
|
|
@ -252,8 +246,6 @@ class ContinueExtensionConfigurable : Configurable {
|
|||
mySettingsComponent?.displayEditorTooltip?.isSelected = settings.continueState.displayEditorTooltip
|
||||
mySettingsComponent?.showIDECompletionSideBySide?.isSelected =
|
||||
settings.continueState.showIDECompletionSideBySide
|
||||
mySettingsComponent?.enableContinueHub?.isSelected =
|
||||
settings.continueState.continueTestEnvironment == "production"
|
||||
|
||||
ContinueExtensionSettings.instance.addRemoteSyncJob()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { SelectorUtils } from "./SelectorUtils";
|
|||
|
||||
export class GUISelectors {
|
||||
public static getDescription(view: WebView) {
|
||||
return view.findWebElement(By.xpath("//*[contains(text(), 'Quickly')]"));
|
||||
return view.findWebElement(By.xpath("//*[contains(text(), 'quickly')]"));
|
||||
}
|
||||
|
||||
public static getMessageInputFields(view: WebView) {
|
||||
|
|
|
|||
|
|
@ -47,52 +47,56 @@ describe("GUI Test", () => {
|
|||
});
|
||||
|
||||
describe("Onboarding", () => {
|
||||
it("should display correct panel description", async () => {
|
||||
it.skip("should display correct panel description", async () => {
|
||||
const description = await GUISelectors.getDescription(view);
|
||||
|
||||
expect(await description.getText()).has.string(
|
||||
"Quickly get up and running using our API keys.",
|
||||
"Log in to quickly build your first custom AI code assistant",
|
||||
);
|
||||
}).timeout(DEFAULT_TIMEOUT.XL);
|
||||
|
||||
it("should display tutorial card after accepting onboarding quick start", async () => {
|
||||
// Get paragraph with text Best
|
||||
const bestTab = await GUISelectors.getOnboardingTabButton(view, "Best");
|
||||
await bestTab.click();
|
||||
// We no longer have a quick start button
|
||||
it.skip(
|
||||
"should display tutorial card after accepting onboarding quick start",
|
||||
async () => {
|
||||
// Get paragraph with text Best
|
||||
const bestTab = await GUISelectors.getOnboardingTabButton(view, "Best");
|
||||
await bestTab.click();
|
||||
|
||||
const anthropicInput = await TestUtils.waitForSuccess(
|
||||
async () => await GUISelectors.getBestChatApiKeyInput(view),
|
||||
);
|
||||
anthropicInput.sendKeys("invalid_api_key");
|
||||
const anthropicInput = await TestUtils.waitForSuccess(
|
||||
async () => await GUISelectors.getBestChatApiKeyInput(view),
|
||||
);
|
||||
anthropicInput.sendKeys("invalid_api_key");
|
||||
|
||||
const mistralInput =
|
||||
await GUISelectors.getBestAutocompleteApiKeyInput(view);
|
||||
mistralInput.sendKeys("invalid_api_key");
|
||||
const mistralInput =
|
||||
await GUISelectors.getBestAutocompleteApiKeyInput(view);
|
||||
mistralInput.sendKeys("invalid_api_key");
|
||||
|
||||
// Get button with text "Connect" and click it
|
||||
const connectButton = await view.findWebElement(
|
||||
By.xpath("//button[text()='Connect']"),
|
||||
);
|
||||
await connectButton.click();
|
||||
// Get button with text "Connect" and click it
|
||||
const connectButton = await view.findWebElement(
|
||||
By.xpath("//button[text()='Connect']"),
|
||||
);
|
||||
await connectButton.click();
|
||||
|
||||
await TestUtils.waitForSuccess(
|
||||
async () => await GUISelectors.getTutorialCard(view),
|
||||
);
|
||||
await TestUtils.waitForSuccess(
|
||||
async () => await GUISelectors.getTutorialCard(view),
|
||||
);
|
||||
|
||||
// TODO validate that claude has been added to list
|
||||
// TODO validate that claude has been added to list
|
||||
|
||||
// Skip testing Quick Start because github auth opens external app and breaks test
|
||||
// const quickStartButton = await view.findWebElement(
|
||||
// By.xpath("//*[contains(text(), 'Get started using our API keys')]")
|
||||
// );
|
||||
// await quickStartButton.click();
|
||||
// await view.switchBack();
|
||||
// const allowButton = await TestUtils.waitForSuccess(
|
||||
// async () => await driver.findElement(By.xpath(`//a[contains(text(), "Allow")]`))
|
||||
// );
|
||||
// await allowButton.click();
|
||||
// ({ view, driver } = await GUIActions.switchToReactIframe());
|
||||
}).timeout(DEFAULT_TIMEOUT.XL);
|
||||
// Skip testing Quick Start because github auth opens external app and breaks test
|
||||
// const quickStartButton = await view.findWebElement(
|
||||
// By.xpath("//*[contains(text(), 'Get started using our API keys')]")
|
||||
// );
|
||||
// await quickStartButton.click();
|
||||
// await view.switchBack();
|
||||
// const allowButton = await TestUtils.waitForSuccess(
|
||||
// async () => await driver.findElement(By.xpath(`//a[contains(text(), "Allow")]`))
|
||||
// );
|
||||
// await allowButton.click();
|
||||
// ({ view, driver } = await GUIActions.switchToReactIframe());
|
||||
},
|
||||
).timeout(DEFAULT_TIMEOUT.XL);
|
||||
});
|
||||
|
||||
describe("Chat", () => {
|
||||
|
|
|
|||
6
extensions/vscode/package-lock.json
generated
6
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.272",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.272",
|
||||
"version": "1.1.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.51",
|
||||
"@continuedev/config-yaml": "^1.0.52",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "0.9.272",
|
||||
"version": "1.1.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -96,11 +96,6 @@
|
|||
"default": false,
|
||||
"markdownDescription": "Enable Continue for teams beta features. To sign in, click the gear icon to go to the settings page, and click Sign In."
|
||||
},
|
||||
"continue.enableContinueHub": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Enable Continue Hub (internal)"
|
||||
},
|
||||
"continue.showInlineTip": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as child_process from "node:child_process";
|
|||
import { exec } from "node:child_process";
|
||||
|
||||
import { Range } from "core";
|
||||
import { enableHubContinueDev, EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { EXTENSION_NAME } from "core/control-plane/env";
|
||||
import { GetGhTokenArgs } from "core/protocol/ide";
|
||||
import { editConfigJson, getConfigJsonPath } from "core/util/paths";
|
||||
import * as vscode from "vscode";
|
||||
|
|
@ -645,9 +645,7 @@ class VsCodeIde implements IDE {
|
|||
"enableContinueForTeams",
|
||||
false,
|
||||
),
|
||||
continueTestEnvironment: settings.get<boolean>("enableContinueHub")
|
||||
? "production"
|
||||
: "none",
|
||||
continueTestEnvironment: "production",
|
||||
pauseCodebaseIndexOnStart: settings.get<boolean>(
|
||||
"pauseCodebaseIndexOnStart",
|
||||
false,
|
||||
|
|
@ -662,15 +660,6 @@ class VsCodeIde implements IDE {
|
|||
|
||||
async getIdeSettings(): Promise<IdeSettings> {
|
||||
const ideSettings = this.getIdeSettingsSync();
|
||||
|
||||
// Feature flag for when hub is enabled
|
||||
if (ideSettings.continueTestEnvironment !== "production") {
|
||||
const enableHub = await enableHubContinueDev();
|
||||
if (enableHub) {
|
||||
ideSettings.continueTestEnvironment = "production";
|
||||
}
|
||||
}
|
||||
|
||||
return ideSettings;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,9 +362,6 @@ export class VsCodeExtension {
|
|||
void this.core.invoke("didChangeActiveTextEditor", { filepath });
|
||||
});
|
||||
|
||||
const enableContinueHub = vscode.workspace
|
||||
.getConfiguration(EXTENSION_NAME)
|
||||
.get<boolean>("enableContinueHub");
|
||||
vscode.workspace.onDidChangeConfiguration(async (event) => {
|
||||
if (event.affectsConfiguration(EXTENSION_NAME)) {
|
||||
const settings = await this.ide.getIdeSettings();
|
||||
|
|
@ -372,14 +369,6 @@ export class VsCodeExtension {
|
|||
void webviewProtocol.request("didChangeIdeSettings", {
|
||||
settings,
|
||||
});
|
||||
|
||||
if (
|
||||
enableContinueHub
|
||||
? settings.continueTestEnvironment !== "production"
|
||||
: settings.continueTestEnvironment === "production"
|
||||
) {
|
||||
await vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ import { SecretStorage } from "./SecretStorage";
|
|||
|
||||
const AUTH_NAME = "Continue";
|
||||
|
||||
const enableControlServerBeta = workspace
|
||||
.getConfiguration(EXTENSION_NAME)
|
||||
.get<boolean>("enableContinueForTeams", false);
|
||||
const controlPlaneEnv = getControlPlaneEnvSync(
|
||||
workspace.getConfiguration(EXTENSION_NAME).get<boolean>("enableContinueHub")
|
||||
? "production"
|
||||
: "none",
|
||||
true ? "production" : "none",
|
||||
enableControlServerBeta,
|
||||
);
|
||||
|
||||
const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue