Skip to content

fix: file and overwrite parameters in the context commands#991

Merged
andrii-bodnar merged 7 commits intomainfrom
fix-file-filter-context-management
Feb 26, 2026
Merged

fix: file and overwrite parameters in the context commands#991
andrii-bodnar merged 7 commits intomainfrom
fix-file-filter-context-management

Conversation

@yevheniyJ
Copy link
Copy Markdown
Collaborator

No description provided.

@yevheniyJ yevheniyJ marked this pull request as ready for review February 23, 2026 17:52
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 69.69697% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.33%. Comparing base (e17a953) to head (449705a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...com/crowdin/cli/properties/helper/FileMatcher.java 68.97% 4 Missing and 5 partials ⚠️
...wdin/cli/commands/actions/ContextUploadAction.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #991      +/-   ##
============================================
+ Coverage     65.29%   65.33%   +0.05%     
- Complexity     1763     1773      +10     
============================================
  Files           255      255              
  Lines          7285     7314      +29     
  Branches       1101     1109       +8     
============================================
+ Hits           4756     4778      +22     
- Misses         1890     1892       +2     
- Partials        639      644       +5     

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes file filtering to properly handle file paths containing literal square brackets (like [test.Folder dev]) versus glob character class patterns (like [a-z] or [0-9]). The fix distinguishes between these two cases by analyzing bracket content and escaping those that contain special characters like spaces and dots, while preserving valid character class patterns for glob matching.

Changes:

  • Added bracket escaping logic in FileMatcher to distinguish literal brackets from glob character classes
  • Updated path normalization in FileHelper.isPathMatch to ensure both paths and patterns start with a separator for consistent matching
  • Added tests to verify the fix handles paths with literal brackets and character class patterns correctly

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/main/java/com/crowdin/cli/properties/helper/FileMatcher.java Added escapeInvalidBrackets and isValidCharacterClass methods to intelligently escape square brackets that are not part of valid glob character class patterns
src/main/java/com/crowdin/cli/properties/helper/FileHelper.java Updated isPathMatch to normalize both path and pattern with leading separators for consistent matching behavior
src/test/java/com/crowdin/cli/properties/helper/FileHelperTest.java Added test cases to verify matching works with literal brackets and character class patterns, including cross-matching with/without leading slashes
src/test/java/com/crowdin/cli/commands/actions/ContextDownloadActionTest.java Added comprehensive test case testJsonlSavesFileFilter2 to verify file filtering works with paths containing literal brackets like [test.Folder dev]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

yevheniyJ and others added 6 commits February 26, 2026 08:46
…ActionTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ActionTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ActionTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrii-bodnar andrii-bodnar merged commit af4b9e6 into main Feb 26, 2026
15 checks passed
@andrii-bodnar andrii-bodnar deleted the fix-file-filter-context-management branch February 26, 2026 12:16
@andrii-bodnar andrii-bodnar changed the title fix: files filter with fix: file and overwrite parameters in the context commands Feb 26, 2026
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