Skip to content

Conversation

liumofei-amazon
Copy link
Contributor

@liumofei-amazon liumofei-amazon commented Jul 31, 2025

Problem

From the priors change workspace context is not handling .scala .kt project correctly by uploading an empty project file.

This PR to address this issue, only adding the pom.xml gradle.build.kts gradle.build build.xml if there's java source file existing.

Solution

  • Move the logic assign the language override inside artifactManager, only process these projectFile if there's .java source file exist so we do not upload it for kotlin/scala/smithy projects which will result an empty zip with project file only

  • Also introduce the fix using glob.stream and have upper limit of file count from this commit

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@liumofei-amazon liumofei-amazon requested a review from a team as a code owner July 31, 2025 17:50
@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 3.33333% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.91%. Comparing base (ac00b94) to head (612766f).

Files with missing lines Patch % Lines
...anguage-server/workspaceContext/artifactManager.ts 3.33% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2017      +/-   ##
==========================================
- Coverage   60.91%   60.91%   -0.01%     
==========================================
  Files         239      239              
  Lines       52576    52597      +21     
  Branches     3176     3179       +3     
==========================================
+ Hits        32027    32038      +11     
- Misses      20487    20497      +10     
  Partials       62       62              
Flag Coverage Δ
unittests 60.91% <3.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

onlyFiles: true,
})

const hasJavaFile = files.some(file => file.endsWith('.java'))
Copy link
Contributor

Choose a reason for hiding this comment

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

in this function when you get files, please use fast glob streaming methods. See #2003

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack let me refactor this to streaming methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leigaol added the same glob.stream with early exist on MAX_FILES

@liumofei-amazon liumofei-amazon force-pushed the classpathfix branch 2 times, most recently from b876c76 to e3b4cd2 Compare July 31, 2025 22:14
@leigaol leigaol merged commit 9e4d0af into aws:main Aug 1, 2025
6 checks passed
chungjac pushed a commit that referenced this pull request Aug 4, 2025
* fix(amazonq): improve cross theme support (#2036)

* fix(amazonq): fix processing empty unsupported workspace file (#2017)

* test: fix integration tests on windows (#2041)

* fix(amazonq): fix for mcp server permissions to prefer workspace agent config files (#2038)

* chore: add integ test badge (#2042)

* feat(amazonq): implement displayFindings tool (#2029)

* feat(amazonq): implement displayFindings tool

* feat(amazonq): add unit tests for display findings tool

* fix(amazonq): simplify displayFindings unit tests, collapse switch statement

* fix(amazonq): emit metrics for displayFindings, fix error handling, improve unit tests

---------

Co-authored-by: abhraina-aws <abhraina@amazon.com>
Co-authored-by: liumofei-amazon <98127670+liumofei-amazon@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>
Co-authored-by: invictus <149003065+ashishrp-aws@users.noreply.github.com>
Co-authored-by: BlakeLazarine <blake.l.lazarine@gmail.com>
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.

3 participants