From b9c830ddab1642fad49813b5ea2d60c929fabb74 Mon Sep 17 00:00:00 2001 From: Andy Pickering Date: Thu, 25 Jun 2026 14:44:18 +0900 Subject: [PATCH 1/2] Add lint integration test pipeline for Konflux pre-commit checks Runs lint, unit tests, and i18n validation on PRs via a Tekton integration test pipeline, following the same pattern used in lightspeed-console. Co-Authored-By: Claude Opus 4.6 --- ...lightspeed-agentic-console-pre-commit.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .tekton/integration-tests/lightspeed-agentic-console-pre-commit.yaml diff --git a/.tekton/integration-tests/lightspeed-agentic-console-pre-commit.yaml b/.tekton/integration-tests/lightspeed-agentic-console-pre-commit.yaml new file mode 100644 index 0000000..591408b --- /dev/null +++ b/.tekton/integration-tests/lightspeed-agentic-console-pre-commit.yaml @@ -0,0 +1,85 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: Pipeline +metadata: + name: lightspeed-agentic-console-pre-commits +spec: + description: | + This pipeline runs pre-commit checks for OpenShift Lightspeed Agentic Console. + params: + - name: SNAPSHOT + description: 'The JSON string representing the snapshot of the application under test.' + default: '{"components": [{"name":"test-app", "containerImage": "quay.io/example/repo:latest", "source": {"git": {"revision": "main"}}}]}' + - name: test-name + description: 'The name of the test corresponding to a defined Konflux integration test.' + default: 'lightspeed-agentic-console-pre-commits' + tasks: + - name: extract-snapshot-metadata + description: Extract console image and commit from SNAPSHOT input + params: + - name: SNAPSHOT + value: $(params.SNAPSHOT) + taskSpec: + results: + - name: console-image + value: "$(steps.get-snapshot-images.results.console-image)" + - name: commit + value: "$(steps.get-snapshot-images.results.commit)" + params: + - name: SNAPSHOT + steps: + - name: get-snapshot-images + image: registry.redhat.io/openshift4/ose-cli:latest + env: + - name: SNAPSHOT + value: $(params.SNAPSHOT) + results: + - name: console-image + type: string + description: "console image from snapshot" + - name: commit + type: string + description: "commit sha to be used in console tests" + script: | + dnf -y install jq + echo -n "$(jq -r --arg component_name "lightspeed-agentic-console" '.components[] | select(.name == $component_name) | .containerImage' <<< "$SNAPSHOT")" > $(step.results.console-image.path) + echo -n "$(jq -r --arg component_name "lightspeed-agentic-console" '.components[] | select(.name == $component_name) | .source.git.revision' <<< "$SNAPSHOT")" > $(step.results.commit.path) + - name: lint + description: Run static checks + runAfter: + - extract-snapshot-metadata + params: + - name: commit + value: $(tasks.extract-snapshot-metadata.results.commit) + taskSpec: + params: + - name: commit + steps: + - name: run-lint + env: + - name: COMMIT_SHA + value: $(params.commit) + image: mcr.microsoft.com/playwright:v1.60.0-noble + resources: + limits: + memory: 4Gi + script: | + #!/bin/bash + set -euo pipefail + cd /home + git clone https://github.com/openshift/lightspeed-agentic-console.git + cd lightspeed-agentic-console + git fetch origin "${COMMIT_SHA}" + git config advice.detachedHead false + git checkout "${COMMIT_SHA}" + echo "---------------------------------------------" + echo "node version: $(node -v)" + echo "npm version: $(npm -v)" + echo "---------------------------------------------" + NODE_OPTIONS=--max-old-space-size=4096 npm ci --omit=optional --no-fund + echo "---------------------------------------------" + npm run lint + echo "---------------------------------------------" + npm run test + echo "---------------------------------------------" + npm run i18n From 811a227b131d8501c49011eb10a616dad15442e3 Mon Sep 17 00:00:00 2001 From: Andy Pickering Date: Thu, 25 Jun 2026 14:54:18 +0900 Subject: [PATCH 2/2] Run `npm run i18n` and `npm run lint` --- ...in__lightspeed-agentic-console-plugin.json | 3 +- .../proposals/ProposalDetailPage.tsx | 370 ++++++++++-------- src/hooks/useStageApproval.ts | 12 +- 3 files changed, 211 insertions(+), 174 deletions(-) diff --git a/locales/en/plugin__lightspeed-agentic-console-plugin.json b/locales/en/plugin__lightspeed-agentic-console-plugin.json index 8af40b8..afb60dc 100644 --- a/locales/en/plugin__lightspeed-agentic-console-plugin.json +++ b/locales/en/plugin__lightspeed-agentic-console-plugin.json @@ -8,10 +8,12 @@ "After execution, a separate verification agent with read-only cluster access independently checks whether the fix worked. It inspects actual cluster state, not the execution agent's self-reported results. The checks shown below are the analysis agent's recommendations. The verification agent uses its own judgment based on what it observes, and every check it runs is reported transparently in the Verification tab. If verification fails, and retries were selected at approval, the Lightspeed operator will automatically retry execution with the failure reasons included as context for the execution agent.": "After execution, a separate verification agent with read-only cluster access independently checks whether the fix worked. It inspects actual cluster state, not the execution agent's self-reported results. The checks shown below are the analysis agent's recommendations. The verification agent uses its own judgment based on what it observes, and every check it runs is reported transparently in the Verification tab. If verification fails, and retries were selected at approval, the Lightspeed operator will automatically retry execution with the failure reasons included as context for the execution agent.", "Age": "Age", "Agent tiers define the model and settings used at each stage of a proposal workflow.": "Agent tiers define the model and settings used at each stage of a proposal workflow.", + "Agentic system is suspended": "Agentic system is suspended", "Agents": "Agents", "AI Hub": "AI Hub", "Alert Diagnosis: {{name}}": "Alert Diagnosis: {{name}}", "Alert rule created successfully": "Alert rule created successfully", + "All operations are halted and new proposals will be terminated. Remove or update the AgenticOLSConfig to resume.": "All operations are halted and new proposals will be terminated. Remove or update the AgenticOLSConfig to resume.", "Analysis (seconds)": "Analysis (seconds)", "Analysis did not complete — no proposal was generated.": "Analysis did not complete — no proposal was generated.", "Analysis Sandbox": "Analysis Sandbox", @@ -27,7 +29,6 @@ "Approve the escalation step for proposal {{name}}. The agent will research the issue, draft a support case, and file it.": "Approve the escalation step for proposal {{name}}. The agent will research the issue, draft a support case, and file it.", "Approve Verification": "Approve Verification", "Approve with {{num}} retries": "Approve with {{num}} retries", - "Approve with retries": "Approve with retries", "Auto-scroll": "Auto-scroll", "Automatic": "Automatic", "Before": "Before", diff --git a/src/components/proposals/ProposalDetailPage.tsx b/src/components/proposals/ProposalDetailPage.tsx index 1a34574..c1a171a 100644 --- a/src/components/proposals/ProposalDetailPage.tsx +++ b/src/components/proposals/ProposalDetailPage.tsx @@ -217,8 +217,12 @@ const ApprovalCard: React.FC<{ )} - } - isInline - title={t('Action failed')} - variant="danger" + + - {actionError} - - )} + + + + + + + {proposal.metadata.name} + + + + + + + -
- {visibleTabs.map((id) => ( - - ))} -
-
- {effectiveTab === 'overview' && ( - setEscalateOpen(false)} proposal={proposal} - latestExecutionResult={latestExecutionResult} - latestVerificationResult={latestVerificationResult} /> )} - {effectiveTab === 'proposal' && ( - - )} - {effectiveTab === 'result' && ( - - )} - {effectiveTab === 'verification' && ( - setEscalateOpen(true)} - proposal={proposal} - verificationApproval={verificationApproval} - /> - )} - {effectiveTab === 'escalation' && ( - + + {actionError && ( + + {t('Close')} + + } + isInline + title={t('Action failed')} + variant="danger" + > + {actionError} + )} -
-
+ +
+ {visibleTabs.map((id) => ( + + ))} +
+
+ {effectiveTab === 'overview' && ( + + )} + {effectiveTab === 'proposal' && ( + + )} + {effectiveTab === 'result' && ( + + )} + {effectiveTab === 'verification' && ( + setEscalateOpen(true)} + proposal={proposal} + verificationApproval={verificationApproval} + /> + )} + {effectiveTab === 'escalation' && ( + + )} +
+ ); }; diff --git a/src/hooks/useStageApproval.ts b/src/hooks/useStageApproval.ts index ae7c250..9f892ec 100644 --- a/src/hooks/useStageApproval.ts +++ b/src/hooks/useStageApproval.ts @@ -91,5 +91,15 @@ export function useStageApproval( const clearError = React.useCallback(() => setError(null), []); - return { needsApproval: needs, stageStatus: status, approve, deny, inProgress, error, clearError, canApprove, canApproveLoading }; + return { + needsApproval: needs, + stageStatus: status, + approve, + deny, + inProgress, + error, + clearError, + canApprove, + canApproveLoading, + }; }