mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #51] [MERGED] harden pr-size reusable: batch check-attr, --source probe, git timeouts, comment-token scope #61
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#61
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/51
Author: @mattmillerai
Created: 7/21/2026
Status: ✅ Merged
Merged: 7/21/2026
Merged by: @mattmillerai
Base:
main← Head:matt/pr-size-checkattr-hardening📝 Commits (6)
5959e36perf(pr-size): batch check-attr + harden --source probe + bound git calls8e9d787fix(pr-size): scope comment token to issues:write + make minting best-effort64c4803fix(pr-size): build the tool with GOWORK=off for go.work-monorepo consumers6a766edfix(check-pr-size): harden git-timeout Wait + restore runGit stderr diagnostics0b2b72dfix(pr-size): note degraded mode on artifact download failure tooa4e7e9efix(pr-size): quote GOWORK "off" so Actions does not stringify it to false📊 Changes
4 files changed (+344 additions, -46 deletions)
View changed files
📝
.github/workflows/pr-size.yml(+33 -5)➕
scripts/check-pr-size/check-pr-size(+0 -0)📝
scripts/check-pr-size/main.go(+184 -29)📝
scripts/check-pr-size/main_test.go(+127 -12)📄 Description
Hardens the reusable PR-size cap so every consumer inherits the improvements from one place. Three tool fixes + one workflow fix, all surfaced while migrating
Comfy-Org/cloudonto this reusable (cloud#5335).Tool:
scripts/check-pr-size/(Go)Ports two follow-ups that were open against cloud's now-deleted local copy — they belong here, in the shared tool:
BE-3247 (was cloud#5163) —
checkAttrSourceSupportedpreviously treated any probe error as "flag unsupported," so a transient error or unreadable base ref on a modern git would drop every baselinguist-generatedexclusion and print a misleading "your git is too old" note. It now inspects git stderr and only treats git's ownunknown option/unknown switchwording as unsupported (LC_ALL=Cforces canonical English). Fail direction stays conservative: any other failure keeps--sourcetrusted and the read fails closed → over-count, never under.BE-3248 (was cloud#5164) —
attrGenerated(one subprocess per file) becomesattrGeneratedBatch: a singlegit check-attr -z --stdinpass. Every git call now runs under a 60scontext.WithTimeout(runGitStdin+runGitCapped), so a wedged git can't stall the job.The two cloud PRs each rewrote
runGit; here they're unified into onerunGitStdin(stdin + timeout + bounded stderr capture + C locale), and the deadline extends to the reusable'srunGitCappedblob path too. Base-only reading (BE-3220) preserved.Workflow:
pr-size.ymlcomment-token scopeThe comment job minted the bot token requesting
issues:writeandpull-requests:write, but the sticky-comment upsert only calls the issues comments API. On an installation not grantedpull-requests:write(cloud's Cloud Code Bot), the mint 422s and the comment job fails — a red check from the best-effort comment path alone. Now:permission-issues: write(exactly what's used);continue-on-erroron the mint so a consumer whose bot lacks the scope degrades to status + step summary, never a red check;Testing
gofmt -l,go vet,go build,go test ./...,actionlint pr-size.ymlall clean locally on git 2.50.1 (--sourceexercised, not skipped). New/updated tests:TestAttrGeneratedBatchMultiplePaths,TestIsUnknownFlagError,TestCheckAttrSourceSupported,TestCapWriter,TestAttrGeneratedSourceIsolatesBase(→ batch API).After this merges
Re-pin cloud#5335's
uses:+workflows_refto the resulting SHA, then close cloud#5163 / cloud#5164.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.