-
Notifications
You must be signed in to change notification settings - Fork 684
Feature - Update aws-toolkit-commons package #4159
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
Changes from all commits
bfc05e4
039d738
66f9a52
74654a8
21f0b0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,7 +18,7 @@ import { spawnSync } from 'child_process' | |||||
import AdmZip from 'adm-zip' | ||||||
import fetch from '../../common/request' | ||||||
import globals from '../../shared/extensionGlobals' | ||||||
import { CodeTransformPreValidationError, telemetry } from '../../shared/telemetry/telemetry' | ||||||
import { telemetry } from '../../shared/telemetry/telemetry' | ||||||
import { ToolkitError } from '../../shared/errors' | ||||||
import { codeTransformTelemetryState } from '../../amazonqGumby/telemetry/codeTransformTelemetryState' | ||||||
import { calculateTotalLatency } from '../../amazonqGumby/telemetry/codeTransformTelemetry' | ||||||
|
@@ -93,7 +93,7 @@ export async function validateProjectSelection(project: vscode.QuickPickItem) { | |||||
vscode.window.showErrorMessage(CodeWhispererConstants.noSupportedJavaProjectsFoundMessage, { modal: true }) | ||||||
telemetry.codeTransform_isDoubleClickedToTriggerInvalidProject.emit({ | ||||||
codeTransformSessionId: codeTransformTelemetryState.getSessionId(), | ||||||
codeTransformPreValidationError: 'No Java project found' as CodeTransformPreValidationError, | ||||||
codeTransformPreValidationError: 'NoJavaProject', | ||||||
result: MetadataResult.Fail, | ||||||
}) | ||||||
throw new TransformByQJavaProjectNotFound() | ||||||
|
@@ -107,7 +107,7 @@ export async function validateProjectSelection(project: vscode.QuickPickItem) { | |||||
vscode.window.showErrorMessage(CodeWhispererConstants.noSupportedJavaProjectsFoundMessage, { modal: true }) | ||||||
telemetry.codeTransform_isDoubleClickedToTriggerInvalidProject.emit({ | ||||||
codeTransformSessionId: codeTransformTelemetryState.getSessionId(), | ||||||
codeTransformPreValidationError: 'No Java project found' as CodeTransformPreValidationError, | ||||||
codeTransformPreValidationError: 'NoJavaProject', | ||||||
result: MetadataResult.Fail, | ||||||
}) | ||||||
throw new ToolkitError('Unable to determine Java version', { | ||||||
|
@@ -125,8 +125,7 @@ export async function validateProjectSelection(project: vscode.QuickPickItem) { | |||||
vscode.window.showErrorMessage(CodeWhispererConstants.noSupportedJavaProjectsFoundMessage, { modal: true }) | ||||||
telemetry.codeTransform_isDoubleClickedToTriggerInvalidProject.emit({ | ||||||
codeTransformSessionId: codeTransformTelemetryState.getSessionId(), | ||||||
codeTransformPreValidationError: | ||||||
'Project selected is not Java 8 or Java 11' as CodeTransformPreValidationError, | ||||||
codeTransformPreValidationError: 'UnsupportedJavaVersion', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New values DO NOT have spaces. |
||||||
result: MetadataResult.Fail, | ||||||
reason: javaVersion, | ||||||
}) | ||||||
|
@@ -140,11 +139,18 @@ export async function validateProjectSelection(project: vscode.QuickPickItem) { | |||||
if (buildFile.length < 1) { | ||||||
const buildType = await checkIfGradle(projectPath!) | ||||||
vscode.window.showErrorMessage(CodeWhispererConstants.noPomXmlFoundMessage, { modal: true }) | ||||||
if (buildType === 'Gradle') { | ||||||
telemetry.codeTransform_isDoubleClickedToTriggerInvalidProject.emit({ | ||||||
codeTransformSessionId: codeTransformTelemetryState.getSessionId(), | ||||||
codeTransformPreValidationError: 'NonMavenProject', | ||||||
result: MetadataResult.Fail, | ||||||
reason: buildType, | ||||||
}) | ||||||
} | ||||||
telemetry.codeTransform_isDoubleClickedToTriggerInvalidProject.emit({ | ||||||
codeTransformSessionId: codeTransformTelemetryState.getSessionId(), | ||||||
codeTransformPreValidationError: 'Only Maven projects supported' as CodeTransformPreValidationError, | ||||||
codeTransformPreValidationError: 'NoPom', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could save some repeated code (though I see that
Suggested change
|
||||||
result: MetadataResult.Fail, | ||||||
reason: buildType, | ||||||
}) | ||||||
throw new ToolkitError('No valid Maven build file found', { code: 'CouldNotFindPomXml' }) | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typecast with
as
is unnecessary.