Commit 493688cd authored by Andrei Zubov's avatar Andrei Zubov
Browse files

feat: change agentic platform webview availability logic

parent 70cb4566
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -887,7 +887,7 @@
        },
        {
          "id": "gitlab-agent-platform",
          "title": "GitLab Duo Agent Platform (Beta)",
          "title": "GitLab Duo Agent Platform",
          "icon": "assets/icons/gitlab-agent-platform.svg"
        },
        {
@@ -933,7 +933,7 @@
          "type": "webview",
          "id": "gl.webview.agentic-tabs",
          "name": "",
          "when": "config.gitlab.duoAgentPlatform.enabled && (gitlab.featureFlags.duo_agentic_chat || gitlab.featureFlags.duo_workflow)"
          "when": "gitlab.webview.agentic-tabs.available"
        }
      ],
      "gitlab-agent-platform-next": [
+7 −7
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
      "license": "MIT",
      "dependencies": {
        "@anycable/core": "^0.9.2",
        "@gitlab-org/gitlab-lsp": "^8.55.0",
        "@gitlab-org/gitlab-lsp": "^8.57.0",
        "@gitlab/needle": "1.5.1",
        "@snowplow/tracker-core": "4.6.8",
        "cross-fetch": "^4.1.0",
@@ -3181,9 +3181,9 @@
      }
    },
    "node_modules/@gitlab-org/gitlab-lsp": {
      "version": "8.55.0",
      "resolved": "https://gitlab.com/api/v4/projects/46519181/packages/npm/@gitlab-org/gitlab-lsp/-/@gitlab-org/gitlab-lsp-8.55.0.tgz",
      "integrity": "sha1-HF6KfCMMVdYSp4QUFK21mzorMH4=",
      "version": "8.57.0",
      "resolved": "https://gitlab.com/api/v4/projects/46519181/packages/npm/@gitlab-org/gitlab-lsp/-/@gitlab-org/gitlab-lsp-8.57.0.tgz",
      "integrity": "sha1-Udh4+LNMf3ePflH6gCJKtSmurK0=",
      "hasInstallScript": true,
      "dependencies": {
        "@anycable/core": "^0.9.2",
@@ -27939,9 +27939,9 @@
      }
    },
    "@gitlab-org/gitlab-lsp": {
      "version": "8.55.0",
      "resolved": "https://gitlab.com/api/v4/projects/46519181/packages/npm/@gitlab-org/gitlab-lsp/-/@gitlab-org/gitlab-lsp-8.55.0.tgz",
      "integrity": "sha1-HF6KfCMMVdYSp4QUFK21mzorMH4=",
      "version": "8.57.0",
      "resolved": "https://gitlab.com/api/v4/projects/46519181/packages/npm/@gitlab-org/gitlab-lsp/-/@gitlab-org/gitlab-lsp-8.57.0.tgz",
      "integrity": "sha1-Udh4+LNMf3ePflH6gCJKtSmurK0=",
      "requires": {
        "@anycable/core": "^0.9.2",
        "@asteasolutions/zod-to-openapi": "^7.3.4",
+1 −1
Original line number Diff line number Diff line
@@ -623,7 +623,7 @@
  },
  "dependencies": {
    "@anycable/core": "^0.9.2",
    "@gitlab-org/gitlab-lsp": "^8.55.0",
    "@gitlab-org/gitlab-lsp": "^8.57.0",
    "@gitlab/needle": "1.5.1",
    "@snowplow/tracker-core": "4.6.8",
    "cross-fetch": "^4.1.0",
+11 −0
Original line number Diff line number Diff line
import {
  AGENT_PLATFORM,
  AGENT_PLATFORM_GA_ROLLOUT,
  AGENTIC_CHAT,
  AUTHENTICATION,
  CHAT,
@@ -122,6 +123,11 @@ const createMockState = (engaged: boolean): AllFeaturesState => {
        createCheck('agentic-chat-no-support', 'Not supported'),
      ],
    },
    [AGENT_PLATFORM_GA_ROLLOUT]: {
      featureId: AGENT_PLATFORM_GA_ROLLOUT,
      engagedChecks: [],
      allChecks: [],
    },
    [FLOWS]: {
      featureId: FLOWS,
      engagedChecks: engaged
@@ -191,6 +197,11 @@ describe('FeatureStateDiagnosticsRenderer', () => {
    const renderer = new FeatureStateDiagnosticsRenderer();
    const mockEmptyState: AllFeaturesState = {
      [AGENT_PLATFORM]: { featureId: AGENT_PLATFORM, engagedChecks: [], allChecks: [] },
      [AGENT_PLATFORM_GA_ROLLOUT]: {
        featureId: AGENT_PLATFORM_GA_ROLLOUT,
        engagedChecks: [],
        allChecks: [],
      },
      [AUTHENTICATION]: { featureId: AUTHENTICATION, engagedChecks: [], allChecks: [] },
      [CHAT]: { featureId: CHAT, engagedChecks: [], allChecks: [] },
      [CHAT_TERMINAL_CONTEXT]: {
+11 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ export class InstanceFeatureFlagService implements vscode.Disposable {

  readonly #disposables: vscode.Disposable[] = [];

  readonly #currentFlags: Map<InstanceFeatureFlag, boolean> = new Map();

  constructor(manager: GitLabPlatformManager) {
    this.#manager = manager;
    this.#disposables.push(
@@ -68,6 +70,7 @@ export class InstanceFeatureFlagService implements vscode.Disposable {
    return Promise.all(
      INSTANCE_FEATURE_FLAGS.map(flag => {
        const enabled = Boolean(values[flag]);
        this.#currentFlags.set(flag, enabled);

        return setFeatureFlagContext(flag, enabled);
      }),
@@ -136,6 +139,14 @@ export class InstanceFeatureFlagService implements vscode.Disposable {
    }
  }

  getFlagValue(flag: InstanceFeatureFlag): boolean {
    return this.#currentFlags.get(flag) ?? false;
  }

  getAllFlags(): Map<InstanceFeatureFlag, boolean> {
    return new Map(this.#currentFlags);
  }

  dispose(): void {
    this.#disposables.forEach(ch => ch.dispose());
  }
Loading