Skip to content

fix(license-check): match name:version:license identifier, not bare name - #44

Merged
JarbasAl merged 1 commit into
devfrom
fix/license-exclude-identifier-match
Jun 15, 2026
Merged

fix(license-check): match name:version:license identifier, not bare name#44
JarbasAl merged 1 commit into
devfrom
fix/license-exclude-identifier-match

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jun 15, 2026

Copy link
Copy Markdown
Member

The pilosus/action-pip-license-checker exclude regex matches against the full package identifier string name:version:license (e.g. tqdm:4.68.2:Mozilla Public License 2.0), not just the package name.

So the anchored patterns introduced for the self-exclusion and central whitelist never matched — ^tqdm$ cannot match tqdm:4.68.2:..., so tqdm kept tripping the WeakCopyleft gate, and the auto-derived package-under-test exclusion (^name$) was a no-op.

Both patterns now anchor the name then allow the version separator or end-of-string ((?::|$)), so they match the identifier without over-matching siblings like tqdm-extra.

Summary by CodeRabbit

This pull request contains only internal infrastructure updates with no user-facing changes or new features. The modifications to the license-check workflow do not affect application functionality or user experience.

No user-visible changes in this release.

pilosus matches the exclude regex against the full 'name:version:license'
string, so an anchored '^pkg$' never matches. Anchor the name then allow
the version separator or end-of-string for both the self-exclusion and the
central tqdm whitelist.
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Two regex patterns inside the license-check GitHub Actions workflow are updated. The self-package exclude pattern is broadened to match pilosus-style name:version:license identifiers by allowing : or end-of-string after the canonicalized name. The tqdm whitelist pattern receives the same treatment.

Changes

License-check workflow regex fixes

Layer / File(s) Summary
Self-package and tqdm exclude regex updates
.github/workflows/license-check.yml
The self-package exclude regex now allows either : or end-of-string after the canonicalized name to cover pilosus name:version:... identifiers. The tqdm whitelist regex is updated the same way, replacing a bare ^tqdm$ match with one that also accepts tqdm:....

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A colon or nothing, both paths now hold true,
The license-check rabbit fixes regex anew.
^tqdm alone left some packages unseen,
Now tqdm: or end-of-string keeps the list clean.
Hop hop, the workflow runs without a fuss! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the license-check workflow to match the full name:version:license identifier format instead of just bare package names.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/license-exclude-identifier-match

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/license-check.yml:
- Line 158: The regex pattern for tqdm in the license-check.yml workflow has
been updated to (?i:^tqdm(?::|$)), but the documented whitelist pattern in
docs/license-whitelist.md still shows the old ^tqdm$ form. Update the tqdm entry
in docs/license-whitelist.md to use the new regex pattern (?i:^tqdm(?::|$)) to
ensure the documentation matches the actual workflow behavior and maintains the
source-of-truth contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 335cf666-a1eb-47e1-bb91-7899e3b18105

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec9019 and a1fbf39.

📒 Files selected for processing (1)
  • .github/workflows/license-check.yml

# tqdm — dual-licensed MPL-2.0 AND MIT; permissive via the MIT option,
# used as an unmodified imported library (pulled by huggingface_hub).
central = r"(?i:^tqdm$)"
central = r"(?i:^tqdm(?::|$))"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update whitelist documentation to match the new regex contract.

Line 158 updates tqdm to (?i:^tqdm(?::|$)), but the documented source-of-truth pattern still shows the old ^tqdm$ form. Please update docs/license-whitelist.md in the same PR so the human-auditable contract matches the workflow behavior.

As per coding guidelines, “When you change one, change the other to match” in the whitelist documentation/workflow contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/license-check.yml at line 158, The regex pattern for tqdm
in the license-check.yml workflow has been updated to (?i:^tqdm(?::|$)), but the
documented whitelist pattern in docs/license-whitelist.md still shows the old
^tqdm$ form. Update the tqdm entry in docs/license-whitelist.md to use the new
regex pattern (?i:^tqdm(?::|$)) to ensure the documentation matches the actual
workflow behavior and maintains the source-of-truth contract.

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.

1 participant