Skip to content

Fix/parse filter ids whitespace - #1227

Open
cmondragon023 wants to merge 7 commits into
AdguardTeam:masterfrom
cmondragon023:fix/parse-filter-ids-whitespace
Open

Fix/parse filter ids whitespace#1227
cmondragon023 wants to merge 7 commits into
AdguardTeam:masterfrom
cmondragon023:fix/parse-filter-ids-whitespace

Conversation

@cmondragon023

Copy link
Copy Markdown

No description provided.

@piquark6046

Copy link
Copy Markdown
Member

Why?

@cmondragon023
cmondragon023 force-pushed the fix/parse-filter-ids-whitespace branch from de718bd to 1bf836b Compare August 18, 2026 04:28
@cmondragon023

Copy link
Copy Markdown
Author

The change addresses issue #1223. On Windows PowerShell, an unquoted
--include=1,2,3 passed through the yarn.cmd shim can arrive as --include=1 2 3.
The previous parseInt() logic silently reduced that value to [1], producing a
successful but incomplete build.

This PR accepts both comma- and whitespace-separated IDs, rejects malformed IDs,
applies the same parser to patch generation, and adds regression tests plus
documentation.

@Alex-302
Alex-302 requested review from 105th and mu-hun and a lite review from Copilot August 20, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves parsing of --include / --skip filter ID lists, especially for Windows/PowerShell invocation quirks, by centralizing parsing and tightening validation.

Changes:

  • Introduced a shared parseFilterIDs helper that accepts comma- or whitespace-separated IDs and rejects malformed tokens.
  • Updated existing build/patch scripts to use the shared parser instead of ad-hoc split(',') + parseInt.
  • Refreshed tests and developer documentation to reflect the new parsing rules.

Reviewed changes

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

Show a summary per file
File Description
scripts/build/patches.js Switch include/skip parsing to shared parseFilterIDs.
scripts/build/filter-id-list.js Add centralized parsing + validation for filter ID lists.
scripts/build/build-config.ts Use parseFilterIDs in parseFlags to unify behavior and validation.
scripts/build/tests/build-config.test.ts Add coverage for whitespace-separated values and invalid token rejection.
DEVELOPMENT.md Document comma/whitespace support for include/skip flags.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread DEVELOPMENT.md Outdated
Comment thread scripts/build/build-config.ts
Comment thread scripts/build/__tests__/build-config.test.ts Outdated
Comment thread scripts/build/patches.js Outdated
Comment thread scripts/build/patches.js Outdated
Comment thread scripts/build/filter-id-list.js Outdated
Comment thread scripts/build/filter-id-list.js Outdated
Comment thread scripts/build/filter-id-list.js Outdated
@cmondragon023
cmondragon023 force-pushed the fix/parse-filter-ids-whitespace branch from 1bf836b to d3358d3 Compare August 21, 2026 05:21
@cmondragon023

Copy link
Copy Markdown
Author

Addressed the requested changes in the latest push: the shared parser is now TypeScript, JSDoc types were removed, parsing uses native string/number functions instead of regex, invalid IDs retain the previous filter-out behavior, and the whitespace examples are quoted and explained. Rebased onto current master; 23 focused tests, TypeScript typecheck, and ESLint all pass.

Comment thread scripts/build/patches.js Outdated
@cmondragon023

Copy link
Copy Markdown
Author

All review threads are addressed in the current branch and have been marked resolved. Fresh verification on current master: 50/50 tests pass, TypeScript typecheck passes, and ESLint passes. @105th, could you please re-review when convenient?

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