Skip to content

Commit dd32e09

Browse files
Merge master into feature/amazonqLSP
2 parents 7ba424d + 3ed322e commit dd32e09

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

packages/core/src/codewhisperer/commands/startTransformByQ.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,14 @@ export async function getValidSQLConversionCandidateProjects() {
654654
let resultLog = ''
655655
for (const project of javaProjects) {
656656
// as long as at least one of these strings is found, project contains embedded SQL statements
657-
const searchStrings = ['oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@', 'jdbc:oracle:oci:@', 'jdbc:odbc:']
657+
const searchStrings = ['oracle.jdbc.', 'jdbc:oracle:', 'jdbc:odbc:']
658658
for (const str of searchStrings) {
659659
const spawnResult = await findStringInDirectory(str, project.path)
660660
// just for telemetry purposes
661661
if (spawnResult.error || spawnResult.stderr) {
662-
resultLog += `search failed: ${JSON.stringify(spawnResult)}`
662+
resultLog += `search error: ${JSON.stringify(spawnResult)}--`
663663
} else {
664-
resultLog += `search succeeded: ${spawnResult.exitCode}`
664+
resultLog += `search complete (exit code: ${spawnResult.exitCode})--`
665665
}
666666
getLogger().info(`CodeTransformation: searching for ${str} in ${project.path}, result = ${resultLog}`)
667667
if (spawnResult.exitCode === 0) {

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export const codeTransformLocThreshold = 100000
501501
export const jobStartedChatMessage =
502502
'I am starting to transform your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your project. To monitor progress, go to the Transformation Hub. If I run into any issues, I might pause the transformation to get input from you on how to proceed.'
503503

504-
export const chooseTransformationObjective = `I can help you with the following tasks:\n- Upgrade your Java 8 and Java 11 codebases to Java 17, or upgrade Java 17 code with up to date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS.\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".`
504+
export const chooseTransformationObjective = `I can help you with the following tasks:\n- Upgrade your Java 8 and Java 11 codebases to Java 17, or upgrade Java 17 code with up to date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS. [Learn more](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-embedded-sql.html).\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".`
505505

506506
export const chooseTransformationObjectivePlaceholder = 'Enter "language upgrade" or "sql conversion"'
507507

packages/core/src/shared/wizards/wizard.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Wizard<TState extends Partial<Record<keyof TState, unknown>>> {
9494
private assertReady() {
9595
// Check for `false` explicity so that the base-class constructor can access `this._form`.
9696
// We want to guard against confusion when implementing a subclass, not this base-class.
97-
if (this._ready === false && this.init) {
97+
if (this._ready === false) {
9898
throw Error('run() (or init()) must be called immediately after creating the Wizard')
9999
}
100100
}
@@ -113,7 +113,7 @@ export class Wizard<TState extends Partial<Record<keyof TState, unknown>>> {
113113
return this._stepOffset[1] + this.stateController.totalSteps
114114
}
115115

116-
public get _form() {
116+
protected get _form() {
117117
this.assertReady()
118118
return this.__form
119119
}
@@ -136,14 +136,22 @@ export class Wizard<TState extends Partial<Record<keyof TState, unknown>>> {
136136
this._estimator = estimator
137137
}
138138

139-
public constructor(private readonly options: WizardOptions<TState> = {}) {
139+
public constructor(protected readonly options: WizardOptions<TState> = {}) {
140140
this.stateController = new StateMachineController(options.initState as TState)
141141
this.__form = options.initForm ?? new WizardForm()
142142
this._exitStep =
143143
options.exitPrompterProvider !== undefined ? this.createExitStep(options.exitPrompterProvider) : undefined
144144

145145
// Subclass constructor logic should live in `init()`, if it exists.
146146
this._ready = !this.init
147+
148+
if (typeof this.init === 'function') {
149+
const _init = this.init.bind(this)
150+
this.init = () => {
151+
this._ready = true
152+
return _init()
153+
}
154+
}
147155
}
148156

149157
/**
@@ -166,7 +174,6 @@ export class Wizard<TState extends Partial<Record<keyof TState, unknown>>> {
166174
if (!this._ready && this.init) {
167175
this._ready = true // Let init() use `this._form`.
168176
await this.init()
169-
delete this.init
170177
}
171178

172179
this.assignSteps()

packages/core/src/test/shared/wizards/wizardTestUtils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ function failIf(cond: boolean, message?: string): void {
6565
export async function createWizardTester<T extends Partial<T>>(wizard: Wizard<T> | WizardForm<T>): Promise<Tester<T>> {
6666
if (wizard instanceof Wizard && wizard.init) {
6767
// Ensure that init() was called. Needed because createWizardTester() does not call run().
68-
;(wizard as any)._ready = true
6968
await wizard.init()
70-
delete wizard.init
7169
}
7270

7371
const form = wizard instanceof Wizard ? wizard.boundForm : wizard

0 commit comments

Comments
 (0)