-
Notifications
You must be signed in to change notification settings - Fork 195
feat: add batch workspace analysis command and UI #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eea0e5d
feat: add batch workspace analysis command and UI
ruromero 976af2a
fix: address review feedback for batch analysis
ruromero abe4501
refactor: extract shared buildBaseOptions to eliminate duplication
ruromero 9a066d0
fix: use tokenProvider for TRUSTIFY_DA_TOKEN in stack analysis
ruromero bc844b6
chore: update JS client to 0.3.0-ea.4689ffb
ruromero 34448c4
fix: unwrap batchMetadata response to return HTML string
ruromero 5028909
chore(refactor): use latest published js client
ruromero 3b0a28c
docs: add comment for BatchOptions usage
ruromero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| 'use strict'; | ||
|
|
||
| import * as vscode from 'vscode'; | ||
|
|
||
| import { StatusMessages, Titles } from './constants'; | ||
| import { buildBaseOptions, batchStackAnalysisService, BatchOptions } from './exhortServices'; | ||
| import { globalConfig } from './config'; | ||
| import { updateCurrentWebviewPanel } from './rhda'; | ||
| import { buildLogErrorMessage } from './utils'; | ||
| import { DepOutputChannel } from './depOutputChannel'; | ||
| import { DependencyReportPanel } from './dependencyReportPanel'; | ||
| import { TokenProvider } from './tokenProvider'; | ||
|
|
||
| /** | ||
| * Executes the RHDA batch stack analysis process for a workspace. | ||
| * @param tokenProvider The token provider for authentication. | ||
| * @param workspaceRoot The file path to the workspace root directory. | ||
| * @param outputChannel The output channel for logging. | ||
| * @returns The batch stack analysis response string. | ||
| */ | ||
| export async function executeBatchStackAnalysis(tokenProvider: TokenProvider, workspaceRoot: string, outputChannel: DepOutputChannel): Promise<string> { | ||
| return await vscode.window.withProgress({ location: vscode.ProgressLocation.Window, title: Titles.EXT_TITLE }, async p => { | ||
| p.report({ message: StatusMessages.WIN_ANALYZING_DEPENDENCIES }); | ||
|
|
||
| const options: BatchOptions = { | ||
| ...buildBaseOptions(), | ||
| 'TRUSTIFY_DA_TOKEN': await tokenProvider.getToken() ?? '', | ||
| 'batchConcurrency': globalConfig.batchConcurrency, | ||
| 'continueOnError': globalConfig.continueOnError, | ||
| 'batchMetadata': globalConfig.batchMetadata, | ||
| 'workspaceDiscoveryIgnore': globalConfig.excludePatterns.map(m => m.pattern), | ||
| }; | ||
|
|
||
| try { | ||
| outputChannel.info(`generating batch stack analysis report for workspace "${workspaceRoot}"`); | ||
|
|
||
| DependencyReportPanel.createOrShowWebviewPanel(); | ||
|
|
||
| const promise = batchStackAnalysisService(workspaceRoot, options); | ||
|
|
||
| p.report({ message: StatusMessages.WIN_GENERATING_DEPENDENCIES }); | ||
|
|
||
| const resp = await promise; | ||
|
|
||
| updateCurrentWebviewPanel(resp); | ||
|
|
||
| outputChannel.info(`done generating batch stack analysis report for workspace "${workspaceRoot}"`); | ||
|
|
||
| p.report({ message: StatusMessages.WIN_SUCCESS_DEPENDENCY_ANALYSIS }); | ||
|
|
||
| return resp; | ||
| } catch (err) { | ||
| p.report({ message: StatusMessages.WIN_FAILURE_DEPENDENCY_ANALYSIS }); | ||
|
|
||
| updateCurrentWebviewPanel('error'); | ||
|
|
||
| outputChannel.error(buildLogErrorMessage(err as Error)); | ||
|
|
||
| throw err; | ||
| } | ||
| }); | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.