Skip to content

fix(amazonq): always use projectName in zipEntryPath #6182

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

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

ctlai95
Copy link
Contributor

@ctlai95 ctlai95 commented Dec 7, 2024

Problem

Projects with a nested folder of the same name does not scan properly.

For example if the project name is foo, and there exists a folder foo/foo/ then the zip artifact only contains the inner foo/ folder.

Solution

Always include the project name in the zip artifact instead of conditionally adding it.


  • 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.

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

github-actions bot commented Dec 7, 2024

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@ctlai95 ctlai95 marked this pull request as ready for review December 9, 2024 18:56
@ctlai95 ctlai95 requested review from a team as code owners December 9, 2024 18:56
Copy link
Contributor

@jpinkney-aws jpinkney-aws left a comment

Choose a reason for hiding this comment

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

Can we add a couple tests

@@ -112,6 +113,32 @@ describe('zipUtil', function () {
)
assert.equal(zipMetadata2.lines, zipMetadata.lines + 1)
})

it('should handle path with repeated project name for file scan', async function () {
const appCodePathWithRepeatedProjectName = join(workspaceFolder, 'workspaceFolder', 'App.java')
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pull this out of this test, it looks like you're using it 4 times

@justinmk3 justinmk3 merged commit 5f72ec9 into aws:master Dec 10, 2024
26 of 27 checks passed
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
## Problem
Projects with a nested folder of the same name does not scan properly.

For example if the project name is `foo`, and there exists a folder
`foo/foo/` then the zip artifact only contains the inner `foo/` folder.

## Solution
Always include the project name in the zip artifact instead of
conditionally adding it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants