mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #207] [MERGED] fix(public-repo-hygiene): case-insensitive matching and sentence-period stripping (BE-8697) #213
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/207
Author: @mattmillerai
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @mattmillerai
Base:
matt/be-8654-public-repo-hygiene← Head:matt/be-8697-hygiene-case-and-period📝 Commits (2)
27ccd2efix(public-repo-hygiene): case-insensitive matching and sentence-period stripping (BE-8697)c1abd5ffix(public-repo-hygiene): close the four case/period edges the panel found (BE-8697)📊 Changes
5 files changed (+275 additions, -41 deletions)
View changed files
📝
.github/public-repo-hygiene/README.md(+6 -13)📝
.github/public-repo-hygiene/check_public_repo_hygiene.py(+73 -11)📝
.github/public-repo-hygiene/tests/test_check_public_repo_hygiene.py(+169 -9)📝
.github/workflows/test-public-repo-hygiene.yml(+15 -3)📝
docs/callers/public-repo-hygiene.md(+12 -5)📄 Description
ELI-5
The leak guard has a rule: "any
Comfy-Org/<repo>name that isn't on the known-public list is a finding." Two bugs made that rule both too loose and too noisy. Too loose: GitHub treats owner names case-insensitively, so writingcomfy-org/some-private-thingin lowercase reached the same repository but sailed straight past the check — a one-keystroke bypass of the whole category. Too noisy: the repo-name pattern allows dots, so ordinary English like "…built on Comfy-Org/ComfyUI." was read as a repo literally namedComfyUI.and flagged. This fixes both, plus the matching allowlist half so a differently-cased spelling of a public name isn't reported as a leak.What changed
REPO_REF_REis nowre.IGNORECASE. Whole-pattern is equivalent to org-segment-only here: the capture class[A-Za-z0-9_.-]is already case-complete, sogroup(1)comes back exactly as written either way..is stripped before the team/repo fork. It has to be before the fork, not in the repo branch: the confirmed false positive (@Comfy-Org/Comfy-Cloud-Team.) lives in the team branch, which the existing.gitstrip never reaches. The.gitstrip stays where it is and now runs on the already-period-stripped name, so…/Foo.git.resolves too. A name that is nothing but the period (Comfy-Org/.) references no repo and is skipped rather than flagged.PUBLIC_COMFY_ORG_REPOS/PUBLIC_COMFY_ORG_TEAMSstay the human-edited source lists in canonical GitHub spelling, and findings still quote the name as matched.Why each fix cannot weaken the control
., so a stripped trailing period is always sentence punctuation. Verified below.Corroborating precedent inside this repo:
bump-callers.shalready casefolds the org segment for exactly reason 1 (.github/bump-callers/bump-callers.sh:265,.github/bump-callers/README.md:663) and already rejects an all-dots name for reason 3 (bump-callers.sh:224). This brings the hygiene checker in line with a sibling component that settled the same question first.Falsification of the premises (not just unit tests)
Unit tests I author only assert my own premise, so each premise was checked against GitHub directly, read-only:
GET /repos/comfy-org/ComfyUIandGET /repos/COMFY-ORG/comfyuiboth returnfull_name: Comfy-Org/ComfyUI— i.e. the lowercase spelling was reaching the real repository while the checker ignored it.GET /repos/Comfy-Org/ComfyUI.andGET /repos/Comfy-Org/.both 404, so stripping a trailing dot cannot suppress a reference to a real repository — including theComfy-Org/.skip, which is the only place this diff removes a finding rather than adding one.GET /orgs/Comfy-Org/teams/Comfy-Cloud-Teamand.../comfy-cloud-teamboth return slugcomfy-cloud-team— so casefolded team membership clears the CODEOWNERS display spelling of an already-allowlisted public team, not a different team.Corpus sweep — both halves
Old and new checkers run over this repo's own 500+ tracked files (this repo is deliberately not self-enrolled, so it is a stress corpus, not a clean one). Repo-reference findings: 179 → 173.
bump-callers/,agents-md-integrity/, and the hygiene fixtures themselves)..github/dependabot.yml:1("…for Comfy-Org/github-workflows.") and.github/workflows/pr-risk.yml:396.comfy-org/at end-of-line and 15 lines ending on a wrappedComfy-/Comfy-Orgtoken, none of which any line-oriented matcher can see. That limitation is unchanged, and it is now the only bullet left in the checker README's "Known limitations".Detection parity with the SDK scripts ends here — deliberately
This intentionally ends findings parity with the two per-repo scripts the centralization replaced (
comfy-python-sdkscripts/check_public_repo_hygiene.py,comfy-typescript-sdkscripts/check-public-repo-hygiene.mjs). Parity existed only to prove the centralization changed nothing; once #206 lands, that proof has served its purpose. Those SDK copies are not patched here — they are deleted at adoption. There are currently zero callers ofpublic-repo-hygiene.yml(gh search code --owner Comfy-Org 'public-repo-hygiene.yml'returns no hits), which is exactly why these fixes should land before anyone enrols.Merge order
delete_branch_on_mergeis on for this repo. If #206's branch is deleted on merge, GitHub closes this PR instead of retargeting it, and a closed PR with a deleted base can be neither reopened nor retargeted. The branch itself survives, so the recovery is to open a fresh PR:gh pr create --base main --head matt/be-8697-hygiene-case-and-period(if #206 squash-merges,git merge origin/maininto this branch first so the three-dot diff shows only the net change).Judgment calls
Comfy-Org/prefix even when the source saidcomfy-org/. Only the name is echoed as matched (pre-existing behaviour — the org segment was always a literal in the message). A reader grepping for the exact lowercase string will not find it, but every finding carriesfile:line, which is the primary locator. Changing it would churn every message format for marginal gain.Unexercised artifacts
Verification
python3 -m unittest discover -s .github/public-repo-hygiene/tests -p 'test_*.py'— 63 passed, 0 failed, 1 skipped (the skip is pre-existing: APFS rejects the non-UTF-8 filename that test builds; it is Linux-only by design). Foundation branch was 54.test-public-repo-hygiene.ymlexecuted locally, including the tamper-resistance and reserved-path steps — all pass.python3 .github/workflow-pins/check_workflow_pins.py— OK, 11 workflows, none with a default, every ref checkout guarded; its 216 unit tests pass.test_team_allowlist_does_not_leak_into_repo_allowliststill passes: the team/repo namespace separation survives casefolding (Comfy-Org/comfy-cloud-teamwithout an@is still a repo finding).Refs BE-8697 — deliberately not
Closes: this PR is stacked on an unmerged #206 and cannot reachmainuntil that lands, and the ticket's own precondition ("#206 must be MERGED first") is therefore not yet satisfied. The ticket should stay open until this is on the default branch.Provenance
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.