-
Notifications
You must be signed in to change notification settings - Fork 751
fix(amazonq): setMaven correctly #6384
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -447,6 +447,7 @@ export async function startJob(uploadId: string) { | |
| target: { language: targetLanguageVersion }, // always JDK17 | ||
| }, | ||
| }) | ||
| getLogger().info('CodeTransformation: called startJob API successfully') | ||
| if (response.$response.requestId) { | ||
| transformByQState.setJobFailureMetadata(` (request ID: ${response.$response.requestId})`) | ||
| } | ||
|
|
@@ -670,6 +671,7 @@ export async function pollTransformationJob(jobId: string, validStates: string[] | |
| }) | ||
| } | ||
| transformByQState.setPolledJobStatus(status) | ||
| getLogger().info(`CodeTransformation: polled job status = ${status}`) | ||
|
Contributor
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. FYI: then |
||
|
|
||
| const errorMessage = response.transformationJob.reason | ||
| if (errorMessage !== undefined) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ import { spawnSync } from 'child_process' // eslint-disable-line no-restricted-i | |
| import { CodeTransformBuildCommand, telemetry } from '../../../shared/telemetry/telemetry' | ||
| import { CodeTransformTelemetryState } from '../../../amazonqGumby/telemetry/codeTransformTelemetryState' | ||
| import { ToolkitError } from '../../../shared/errors' | ||
| import { writeLogs } from './transformFileHandler' | ||
| import { setMaven, writeLogs } from './transformFileHandler' | ||
| import { throwIfCancelled } from './transformApiHandler' | ||
|
|
||
| // run 'install' with either 'mvnw.cmd', './mvnw', or 'mvn' (if wrapper exists, we use that, otherwise we use regular 'mvn') | ||
|
|
@@ -108,6 +108,8 @@ function copyProjectDependencies(dependenciesFolder: FolderInfo, modulePath: str | |
| } | ||
|
|
||
| export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, rootPomPath: string) { | ||
| await setMaven() | ||
|
Contributor
Author
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. Better to set the Maven to use ( |
||
| getLogger().info('CodeTransformation: running Maven copy-dependencies') | ||
| try { | ||
| copyProjectDependencies(dependenciesFolder, rootPomPath) | ||
| } catch (err) { | ||
|
|
@@ -117,6 +119,7 @@ export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, | |
| ) | ||
| } | ||
|
|
||
| getLogger().info('CodeTransformation: running Maven install') | ||
| try { | ||
| installProjectDependencies(dependenciesFolder, rootPomPath) | ||
| } catch (err) { | ||
|
|
@@ -134,9 +137,9 @@ export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, | |
|
|
||
| export async function getVersionData() { | ||
| const baseCommand = transformByQState.getMavenName() // will be one of: 'mvnw.cmd', './mvnw', 'mvn' | ||
| const modulePath = transformByQState.getProjectPath() | ||
| const projectPath = transformByQState.getProjectPath() | ||
| const args = ['-v'] | ||
| const spawnResult = spawnSync(baseCommand, args, { cwd: modulePath, shell: true, encoding: 'utf-8' }) | ||
| const spawnResult = spawnSync(baseCommand, args, { cwd: projectPath, shell: true, encoding: 'utf-8' }) | ||
|
|
||
| let localMavenVersion: string | undefined = '' | ||
| let localJavaVersion: string | undefined = '' | ||
|
|
||
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.
This was always recording
[undefined, undefined]since the user hasn't selected a project to transform at this point. Plus, we already emit this in thetotalRunTimemetric at the very end of a transformation anyway.