Skip to content

Commit 24bb920

Browse files
authored
feat(dev): Update file generation logic and file upload functionality for dev-execution. (#6424)
#### Enhanced Development Prompt: - Modified GENERATE_DEV_FILE_PROMPT to support running install, build, and test commands independently. #### Improved Build and Code File Upload Logic: - Updated the logic to enable uploading build files alongside code files --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 6494c1d commit 24bb920

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/core/src/amazonqFeatureDev/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const featureDevChat = 'featureDevChat'
1515
export const featureName = 'Amazon Q Developer Agent for software development'
1616

1717
export const generateDevFilePrompt =
18-
"generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported command is test, so you should bundle all install, build and test commands in “test”. also you can use public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: test exec: component: dev commandLine: npm install && npm run build && npm run test”"
18+
"generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported commands are install, build and test (are all optional). so you may have to bundle some commands together using '&&'. also you can use public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: install exec: component: dev commandLine: npm install” - id: build exec: component: dev commandLine: ”npm run build” - id: test exec: component: dev commandLine: ”npm run test”"
1919

2020
// Max allowed size for file collection
2121
export const maxRepoSizeBytes = 200 * 1024 * 1024

packages/core/src/shared/filetypes.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,15 @@ export const codefileExtensions = new Set([
364364
// Code file names without an extension
365365
export const codefileNames = new Set(['Dockerfile', 'Dockerfile.build', 'gradlew', 'mvnw'])
366366

367+
// Build file names
368+
export const buildfileNames = new Set(['gradle/wrapper/gradle-wrapper.jar'])
369+
367370
/** Returns true if `filename` is a code file. */
368371
export function isCodeFile(filename: string): boolean {
369372
const ext = path.extname(filename).toLowerCase()
370-
return codefileExtensions.has(ext) || codefileNames.has(path.basename(filename))
373+
return (
374+
codefileExtensions.has(ext) ||
375+
codefileNames.has(path.basename(filename)) ||
376+
buildfileNames.has(path.basename(filename))
377+
)
371378
}

packages/core/src/test/shared/filetypes.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ describe('isCodeFile', () => {
160160
'mvnw',
161161
'build.gradle',
162162
'gradle/wrapper/gradle-wrapper.properties',
163+
'gradle/wrapper/gradle-wrapper.jar',
163164
]
164165
for (const codeFilePath of codeFiles) {
165166
assert.strictEqual(isCodeFile(codeFilePath), true)

0 commit comments

Comments
 (0)