Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions packages/core/src/codewhisperer/models/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,19 @@ export class ZipManifest {
hilCapabilities: string[] = ['HIL_1pDependency_VersionUpgrade']
transformCapabilities: string[] = ['EXPLAINABILITY_V1'] // TO-DO: for SQL conversions, maybe make this = []
customBuildCommand: string = 'clean test'
requestedConversions: {
sqlConversion:
| {
source: string | undefined
target: string | undefined
schema: string | undefined
host: string | undefined
sctFileName: string | undefined
}
| undefined
} = { sqlConversion: undefined }
requestedConversions:
| {
sqlConversion:
| {
source: string | undefined
target: string | undefined
schema: string | undefined
host: string | undefined
sctFileName: string | undefined
}
| undefined
}
| undefined = undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change. Instead of defaulting to { sqlConversion: undefined }, which puts requestedConversions in the manifest.json, default to undefined, which leaves requestedConversions out of the manifest.json entirely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would look nicer and also IMO be less confusing since we are removing so much text.

Suggested change
requestedConversions:
| {
sqlConversion:
| {
source: string | undefined
target: string | undefined
schema: string | undefined
host: string | undefined
sctFileName: string | undefined
}
| undefined
}
| undefined = undefined
requestedConversions?: {
sqlConversion?: {
source?: string
target?: string
schema?: string
host?: string
sctFileName?: string
}
}

}

export interface IHilZipManifestParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,15 @@ export async function zipCode(
) {
// note that zipManifest must be a ZipManifest since only other option is HilZipManifest which is not used for SQL conversions
const metadataZip = new AdmZip(transformByQState.getMetadataPathSQL())
zipManifest.requestedConversions.sqlConversion = {
source: transformByQState.getSourceDB(),
target: transformByQState.getTargetDB(),
schema: transformByQState.getSchema(),
host: transformByQState.getSourceServerName(),
sctFileName: metadataZip.getEntries().filter((entry) => entry.entryName.endsWith('.sct'))[0].entryName,
zipManifest.requestedConversions = {
sqlConversion: {
source: transformByQState.getSourceDB(),
target: transformByQState.getTargetDB(),
schema: transformByQState.getSchema(),
host: transformByQState.getSourceServerName(),
sctFileName: metadataZip.getEntries().filter((entry) => entry.entryName.endsWith('.sct'))[0]
.entryName,
},
}
// TO-DO: later consider making this add to path.join(zipManifest.dependenciesRoot, 'qct-sct-metadata', entry.entryName) so that it's more organized
metadataZip
Expand Down
Loading