Skip to content

fix(amazonq): apply the configured ignore patterns to local indexing - #2972

Draft
hezelin-work wants to merge 1 commit into
Amazon-Q-Developer:feature/security-fixes-v2from
hezelin-work:fix/index-ignore-patterns
Draft

hezelin-work wants to merge 1 commit into
Amazon-Q-Developer:feature/security-fixes-v2from
hezelin-work:fix/index-ignore-patterns

Conversation

@hezelin-work

@hezelin-work hezelin-work commented Oct 23, 2026 •

Copy link
Copy Markdown

Problem

Files that the configured indexing ignore patterns match were still indexed, listed in the "@" context menu, and sent as project context.

Solution

  • Leave the files that the ignore patterns match out of the local index, including files added or saved after the index is built.
  • Leave them out of the "@" context list and out of the files that an "@" folder brings in. Files that an item names directly, such as workspace rules, are kept.
  • Don't query project context for an ignored file, because the index library adds the queried file to the index.
  • Build the index again when the patterns change, also when they change while a build is running.

Behavior change: workspace files that match the ignoreFilePatterns setting are no longer indexed, listed in "@", or sent as project context. Inline suggestions in an ignored file get no project context.

Testing: added unit tests. The QAgenticChatServer tests now stub LocalProjectContextController.getInstance(). Without the stub, the chat controllers they create wait up to 60 seconds for an instance and then set onContextItemsUpdated on a controller from a later test file.

License

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

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 91.98473% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...sperer/src/shared/localProjectContextController.ts 91.98% 18 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@dungdong-aws
dungdong-aws force-pushed the fix/index-ignore-patterns branch from fa0d7b0 to 1c0b73a Compare October 28, 2026 17:30
@dungdong-aws
dungdong-aws changed the base branch from feature/security-fixes to feature/security-fixes-v2 October 28, 2026 17:31
@hezelin-work
hezelin-work force-pushed the fix/index-ignore-patterns branch 5 times, most recently from f8b0c94 to 1420fbc Compare November 6, 2026 06:42
@hezelin-work
hezelin-work force-pushed the fix/index-ignore-patterns branch from 1420fbc to 6fe9d32 Compare November 6, 2026 09:19
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.

2 participants