feat: add batch workspace analysis command and UI#880
feat: add batch workspace analysis command and UI#880ruromero merged 8 commits intofabric8-analytics:mainfrom
Conversation
Review Summary by QodoAdd batch workspace analysis command with configuration and UI
WalkthroughsDescription• Add workspace-level batch stack analysis command for analyzing all packages • Implement batch configuration settings (concurrency, error handling, metadata) • Create batch analysis orchestration with progress UI and error handling • Propagate exclude patterns and all analysis settings to batch service • Add comprehensive tests and telemetry for batch analysis workflow Diagramflowchart LR
A["User Command"] -->|"rhda.stackAnalysisBatch"| B["executeBatchStackAnalysis"]
B -->|"Collects config"| C["BatchOptions"]
C -->|"Includes settings"| D["batchConcurrency<br/>continueOnError<br/>batchMetadata"]
C -->|"Propagates patterns"| E["workspaceDiscoveryIgnore"]
B -->|"Calls service"| F["batchStackAnalysisService"]
F -->|"Invokes JS client"| G["stackAnalysisBatch"]
G -->|"Returns HTML"| H["WebviewPanel"]
B -->|"Tracks events"| I["Telemetry"]
File Changes1. src/batchAnalysis.ts
|
Code Review by Qodo
1.
|
ruromero
left a comment
There was a problem hiding this comment.
Verification Report for TC-3864
| Check | Result | Details |
|---|---|---|
| Scope Containment | WARN | 6 out-of-scope files (README.md, package-lock.json, src/commands.ts, src/redhatTelemetry.ts, test/config.test.ts, test/exhortServices.test.ts) — all justified. src/dependencyReportPanel.ts listed in task but not modified (panel already handles HTML; no changes needed). |
| Diff Size | PASS | 494 additions, 2111 deletions (bulk from package-lock.json), 12 files — proportionate to scope. |
| Commit Traceability | PASS | Both commits reference TC-3864. |
| Sensitive Patterns | PASS | Only matches are secrets: in test mock stubs — no real credentials. |
| CI Status | PASS | All checks pass. |
| Acceptance Criteria | PASS | 7/7 criteria met (see details below). |
| Verification Commands | WARN | npm run test-compile succeeds. npm test: 188 passing, 20 failing — but main has 181 passing, 25 failing. All batch tests pass; failures are pre-existing. |
Acceptance Criteria Details
| # | Criterion | Result |
|---|---|---|
| 1 | New VS Code command rhda.stackAnalysisBatch is registered and appears in command palette |
PASS — registered in package.json:83 and src/extension.ts:318 |
| 2 | Command detects workspace root from vscode.workspace.workspaceFolders |
PASS — src/extension.ts:321-326 |
| 3 | Existing redHatDependencyAnalytics.exclude patterns propagated as workspaceDiscoveryIgnore |
PASS — src/batchAnalysis.ts:25,54 |
| 4 | New batch settings (concurrency, continueOnError, batchMetadata) configurable via VS Code settings | PASS — package.json:391-408, src/config.ts:52 |
| 5 | Batch analysis report displayed in DependencyReportPanel | PASS — DependencyReportPanel.createOrShowWebviewPanel() + updateCurrentWebviewPanel(resp) in src/batchAnalysis.ts:60,68 |
| 6 | Progress indicator shown during batch analysis | PASS — vscode.window.withProgress() in src/batchAnalysis.ts:22 |
| 7 | Errors reported to user via VS Code notifications | PASS — error path updates panel with error template and logs error in src/batchAnalysis.ts:76-82 |
Overall: WARN
Minor warnings only — no failures. Out-of-scope files are all justified (docs, auto-generated lockfile, supporting modules for commands/telemetry/tests). The omission of src/dependencyReportPanel.ts is correct since the panel already handles HTML strings. Test failures are pre-existing (fewer on PR branch than main). All acceptance criteria are satisfied.
This comment was AI-generated by sdlc-workflow/verify-pr v0.4.3.
Add a workspace-level batch stack analysis command (rhda.stackAnalysisBatch) to the VS Code extension. This enables users to analyze all packages in a JS/TS monorepo or Cargo workspace at once, producing a combined report. - Register new command in package.json and extension.ts - Add batch settings (batchConcurrency, continueOnError, batchMetadata) to VS Code configuration and Config class - Create batchAnalysis.ts with progress UI and config propagation - Add batchStackAnalysisService wrapper in exhortServices.ts - Propagate existing exclude patterns as workspaceDiscoveryIgnore - Update JS client to 0.3.0 for batch API support - Add telemetry actions for batch analysis - Add comprehensive tests for batch analysis and config Implements TC-3864 Assisted-by: Claude Code
- Use tokenProvider.getToken() for TRUSTIFY_DA_TOKEN instead of telemetryId, matching the pattern used by component/image analysis - Create/show DependencyReportPanel before updating it so the batch report is visible to the user - Add onCommand:rhda.stackAnalysisBatch and workspaceContains:**/Cargo.toml activation events so the extension activates for batch analysis - Add test for token propagation from tokenProvider - Document batch analysis settings and feature in README.md Implements TC-3864 Assisted-by: Claude Code
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
==========================================
+ Coverage 57.20% 57.54% +0.33%
==========================================
Files 35 36 +1
Lines 1797 1842 +45
Branches 344 347 +3
==========================================
+ Hits 1028 1060 +32
- Misses 746 759 +13
Partials 23 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Move the common TRUSTIFY_DA_* options construction from stackAnalysis.ts and batchAnalysis.ts into a shared buildBaseOptions() helper in exhortServices.ts. Both callers now spread the base options and only add their specific overrides (token, batch settings). Also regenerate package-lock.json minimally from upstream to avoid unnecessary churn from npm version differences. Implements TC-3864 Assisted-by: Claude Code
The existing stack analysis was incorrectly using globalConfig.telemetryId as the auth token. Use tokenProvider.getToken() consistently with batch analysis. Implements TC-3864 Assisted-by: Claude Code
Includes lockfile walk-up for monorepo support (TC-3891). Ref: TC-3864 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When batchMetadata is enabled (the default), the JS client returns
{ analysis, metadata } instead of a raw HTML string. Unwrap it so
the report panel receives the expected HTML.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
Summary
rhda.stackAnalysisBatchcommand for workspace-level batch analysisworkspaceDiscoveryIgnoreImplements TC-3864
Test plan
🤖 Generated with Claude Code