Skip to content

filter-files: ignore empty entries in comma-separated inputs - #484

Merged
somewhatabstract merged 2 commits into
mainfrom
fei-5485-filter-files-empty-entries
Dec 2, 2026
Merged

somewhatabstract merged 2 commits into
mainfrom
fei-5485-filter-files-empty-entries

Conversation

@somewhatabstract

Copy link
Copy Markdown
Member

Posted by Claude on behalf of Jeff.

Summary

filter-files crashed with TypeError: Expected pattern to be a non-empty string from picomatch when a list input contained an empty entry.

The ticket describes the crash for a multiline globs input with a trailing newline. On current main that case no longer crashes: the 2.0.0 comment-line filtering already drops blank and whitespace-only lines. The same crash still happens for comma-separated input with an empty entry, e.g. a/**,,b/**, a/**,b/**, or , a/**. The same parsing is used for the files and extensions inputs, so they had the same bug.

This PR:

  • Drops empty entries after trimming in the comma-separated branch of parseList.
  • Adds regression tests for the multiline cases (a trailing newline, and blank or whitespace-only lines in the middle) and for the comma-separated cases. The comma-separated tests failed before the fix.
  • Adds a filter-files patch changeset.

Test plan

  • pnpm test (all 2558 tests pass)
  • pnpm lint
  • pnpm typecheck

Issue: FEI-5485


Generated by Claude Code

A comma-separated `globs` (or `files`/`extensions`) input with an empty
entry, such as `a,,b` or a trailing `, `, produced an empty pattern that
made picomatch throw "Expected pattern to be a non-empty string". Drop
empty entries after trimming. Multiline input already dropped blank
lines; add regression tests covering that too.

Issue: FEI-5485

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Rd4bUMPhXqR6j4kyG5QUk
@somewhatabstract somewhatabstract self-assigned this Dec 1, 2026
@changeset-bot

changeset-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e868cc6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
filter-files Patch
check-for-changeset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@somewhatabstract
somewhatabstract marked this pull request as ready for review December 1, 2026 18:59
@somewhatabstract
somewhatabstract requested a review from a team December 1, 2026 18:59
@khan-actions-bot
khan-actions-bot requested a review from a team December 1, 2026 19:00

@github-actions github-actions Bot 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.

Commented — medium-importance findings found; nothing blocks.

Lower-confidence observations (3; top: `.changeset/filter-files-empty-entries.md:5` suggestion (non-blocking, documentation): The changeset attributes the picomatch crash to all three inputs, but only `globs` reaches picomatch — the `extensions`...)
  • .changeset/filter-files-empty-entries.md:5 suggestion (non-blocking, documentation): The changeset attributes the picomatch crash to all three inputs, but only globs reaches picomatch — the extensions bug was a silent over-match. (documentation)
  • actions/filter-files/index.ts:82 suggestion (non-blocking): The single-entry fast path still returns raw untrimmed, so parseList now trims in two of its three branches and a lone padded entry like " a/** " silently matches nothing. (holistic)
  • actions/filter-files/filter-files.test.ts:280 nitpick (non-blocking): Every it.each callback in this repo that discards a leading description column names it — actions/fix-workflows/allowed-runs-on.test.ts:61 ])("returns no values for %s", (_name, text) => {, actions/fix-workflows/index.test.ts:78 ])("%s", (_name, yaml) => {, workflows/review/eval/extract-json.test.ts:82 ])("throws on %s", (_label, text) => { — 15 occurrences, all _name or _label, none bare. (conventions)
review details review-v1.25.0 | schema 2 | depth full | re-review scoped blocking-medium | enable holistic,completeness,test-adequacy,first-principles,conventions,documentation
review fingerprint pr-reviewer:rereview v=1 depth=full verdict=COMMENT anchor-draft=false hunks=eyIuY2hhbmdlc2V0L2ZpbHRlci1maWxlcy1lbXB0eS1lbnRyaWVzLm1kIjpbIjc5NDc2YTVhM2IzMTk0ZWEiXSwiYWN0aW9ucy9maWx0ZXItZmlsZXMvZmlsdGVyLWZpbGVzLnRlc3QudHMiOlsiNjdkOTFjYTM0Mjg5NGJlNSJdLCJhY3Rpb25zL2ZpbHRlci1maWxlcy9pbmRleC50cyI6WyIxY2Q5ZTk3Zjk0Y2IyZWZiIl19

Comment thread actions/filter-files/index.ts Resolved
Comment thread actions/filter-files/index.ts Resolved
Add regression tests for empty entries in a comma-separated `extensions`
input, which previously matched every file because `endsWith("")` is
always true. Correct the changeset: only `globs` crashed picomatch, while
`extensions` silently over-matched. Name the discarded `it.each`
description parameter `_name`, matching the rest of the repo.

Issue: FEI-5485

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Rd4bUMPhXqR6j4kyG5QUk
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Guidance for reviewers

Triage notes for reviewers: risky files by owning team, repeated changes, and files excluded from review.

github-actions (1 file)
File Reason
index.ts Shipped composite action code: actions/filter-files/action.yml runs the bundle built from this module in consuming repos' CI, and this change alters what the files/extensions/globs inputs parse to, so a mis-parse would propagate to every consumer's job gating on the next filter-files release. The change itself is narrow and carries comma-case regression tests that fail without it.
review details review-v1.25.0 | schema 2 | depth full | re-review scoped blocking-medium | enable holistic,completeness,test-adequacy,first-principles,conventions,documentation

@github-actions github-actions Bot 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.

Approved — no blocking issues found.
Note: divergence tripwire re-armed a full review (unreviewed share 0.67).

review details review-v1.25.0 | schema 2 | depth full | re-review scoped blocking-medium | enable holistic,completeness,test-adequacy,first-principles,conventions,documentation
review fingerprint pr-reviewer:rereview v=1 depth=full verdict=APPROVE anchor-draft=false hunks=eyIuY2hhbmdlc2V0L2ZpbHRlci1maWxlcy1lbXB0eS1lbnRyaWVzLm1kIjpbImY4M2RjMmI0ZjQ1MGJlNGIiXSwiYWN0aW9ucy9maWx0ZXItZmlsZXMvZmlsdGVyLWZpbGVzLnRlc3QudHMiOlsiMjVhZjk2ZmQwNDEwODY2OCJdLCJhY3Rpb25zL2ZpbHRlci1maWxlcy9pbmRleC50cyI6WyIxY2Q5ZTk3Zjk0Y2IyZWZiIl19

@kevinb-khan kevinb-khan 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.

LGTM 👍

@somewhatabstract
somewhatabstract merged commit 1ce4685 into main Dec 2, 2026
14 checks passed
@somewhatabstract
somewhatabstract deleted the fei-5485-filter-files-empty-entries branch December 2, 2026 20:46
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