Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: olexii4 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
147736e to
dd23665
Compare
e40ac01 to
6633c64
Compare
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1505 (linux/amd64, linux/arm64) kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1505", name: che-dashboard}]}}]" |
Adds an AI Selector widget on the Create Workspace page and an AI Provider Keys tab in User Preferences for managing API keys — the same pattern as Personal Access Tokens and SSH Keys tabs. AI Selector (Create Workspace): - Panel+Accordion+Gallery mirroring the Editor Selector - Saves API key as Kubernetes Secret with DevWorkspace Controller auto-mount labels; key becomes an env var in all workspace containers without spec patching - Detects manually-created secrets (demo-repo pattern) by matching envVarName data key in mounted secrets AI Provider Keys tab (User Preferences): - Add / Update / Delete API keys per configured provider - Full CRUD modal flow following SshKeys tab pattern - Empty state when no providers configured or no keys stored Also fixes: - AiProviderEntry card onClick restored so Gemini/Claude cards respond to user clicks in the Create Workspace widget - createOrReplace: flat existence-check replaces fragile nested try/catch with string-matching re-throw - handleToggle: early-return on already-active accordion item - Unsafe as casts replaced with typed selectors - minLength:1 enforced on apiKey body schema - Tests: AiApiKeyField, AiProviderEntry, AiSelector null render Assisted-by: Claude Sonnet 4.5 Signed-off-by: Oleksii Orel <oorel@redhat.com>
1d13918 to
7a2dae5
Compare
Adds an AI Selector widget on the Create Workspace page and an AI Provider Keys tab in User Preferences for managing API keys — following the same pattern as SSH Keys tab. AI Selector (Create Workspace): - Panel+Accordion+Gallery for selecting the AI provider - Cards show provider name, description, and a "Key configured" badge if a key exists; no key input on cards - "Manage API keys in User Preferences" link inside the gallery - Detects manually-created secrets (demo-repo pattern) by matching envVarName data key in mounted DevWorkspace secrets AI Provider Keys tab (User Preferences /user-preferences?tab=AiProviderKeys): - Add / Update / Delete API keys per configured provider - Full CRUD modal flow following the SshKeys tab pattern - Empty state when no providers configured or no keys stored Backend: - AiProviderKeyApiService with DevWorkspace Controller auto-mount labels (controller.devfile.io/mount-to-devworkspace) - /api/ai-config and /api/namespace/:ns/ai-provider-key routes - Dual-source key detection: labeled secrets + envVarName key Also fixes: - AiProviderEntry onClick restored for card body clicks - createOrReplace: flat existence-check pattern - Unsafe as casts replaced with typed selectors - minLength:1 enforced on apiKey body schema Assisted-by: Claude Sonnet 4.5 Signed-off-by: Oleksii Orel <oorel@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds an AI Selector widget to the Create Workspace page, allowing users to pick an AI provider (Google Gemini or Anthropic Claude) and save their API key directly from the dashboard UI.
The widget mirrors the existing Editor Selector design (PatternFly Panel + Accordion + Gallery of provider Cards). Once a user saves an API key, the dashboard stores it as a Kubernetes
OpaqueSecret in the user's namespace with DevWorkspace Controller auto-mount labels (controller.devfile.io/mount-to-devworkspace: 'true',controller.devfile.io/mount-as: env). The DevWorkspace Controller then automatically injects the key as an environment variable (e.g.GEMINI_API_KEY,ANTHROPIC_API_KEY) into every workspace container — no DevWorkspace spec patching needed.Changes by layer:
packages/common—AiProviderDefinitioninterface;IServerConfigextended withaiProvidersanddefaultAiProviderpackages/dashboard-backend—AiProviderKeyApiService(Kubernetes Secret CRUD usingCoreV1API); four new Fastify routes under/dashboard/api/ai-configand/dashboard/api/namespace/:namespace/ai-provider-key;ServerConfigApiServicereadsaiProvidersfrom CheCluster CR;serverConfigroute exposes thempackages/dashboard-frontend—AiSelectorReact class component (Panel + Accordion +AiProviderGallery+AiApiKeyField+DocsLink);AiConfigRedux slice (actions, reducer, selectors);aiConfigApiAxios client;GetStartedpage rendersAiSelectorbetween Editor Selector and Import form;ImportFromGitandSamplesListappendai-providerURL parameter for analytics;AI_PROVIDER_ATTRadded tobuildFactoryParamsScreenshot/screencast of this PR
What issues does this PR fix or reference?
Is it tested? How?
Release Notes
Docs PR