mirror of
https://github.com/Comfy-Org/Comfy-PR.git
synced 2026-11-04 23:37:33 +00:00
[PR #211] [MERGED] Backport checker: skip irrelevant paths, resolve bot-authored PR attribution #209
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/Comfy-PR#209
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/Comfy-PR/pull/211
Author: @claude[bot]
Created: 8/17/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @christian-byrne
Base:
main← Head:backport-checker-bot-attribution-and-filtering📝 Commits (2)
8ac4c76feat(backport-checker): skip irrelevant paths, resolve bot-authored PR attribution9ccbba7fix: restore process.env after people.spec.ts to stop leaking a fake SLACK_BOT_TOKEN📊 Changes
4 files changed (+584 additions, -6 deletions)
View changed files
📝
app/tasks/gh-frontend-backport-checker/index.spec.ts(+154 -1)📝
app/tasks/gh-frontend-backport-checker/index.ts(+182 -4)➕
lib/notion/people.spec.ts(+202 -0)📝
lib/notion/people.ts(+46 -1)📄 Description
Requested via Slack thread
What changed
Two improvements to
app/tasks/gh-frontend-backport-checker/index.ts, per Christian's Slack request:1. Skip PRs that only touch irrelevant paths
A bugfix PR is now skipped (not flagged as "might need backport") when every one of its changed files matches an ignore-path glob. If it touches anything else too, it's still flagged as before — this only suppresses PRs that are 100% out of scope.
The ignore list is an exported, easily-editable array (
IGNORED_BACKPORT_PATH_GLOBS) near the top of the file:I inspected the
ComfyUI_frontendrepo layout to build this list —apps/website(Astro marketing site) andapps/desktop-ui(a real product, kept in scope) are the twoapps/*packages;.github/workflows/holds ~30 CI/CD pipelines. Changed files are fetched viapulls.listFiles(paginated with the existingghPageFlowhelper).Flag for Christian: I deliberately did not add
apps/desktop-ui— it's a real shipped app, not "irrelevant" — but wanted to call that out explicitly in case you meant to include it too. Also open to trimming/expanding the tooling-config file list; it's just an array, easy to adjust.2. Resolve bot-authored PR attribution
When a PR's author is a bot/automation account (
claude[bot],comfy-pr-bot,cloud-code-bot[bot],dependabot[bot], ... — detected viaisBotLogin(), reusing the existing bot-comment-filter regex), the checker now tries to resolve the real human to tag:Co-authored-by:trailer on the PR's commits (pulls.listCommits) — if the trailer's email is a GitHub noreply address (123+login@users.noreply.github.com), the embedded login is used directly; otherwise the trailer's name is matched against the Notion People database._Requested by **Name**_near the top of the PR body (added by whatever opens these PRs on someone's behalf), matched by name against the Notion People database.resolveSlackTagForAuthorpipeline already can't map to a Slack user, so it already falls through to tagging the release sheriff (unchanged).What justified this, from inspecting the two example PRs:
claude[bot], single commit authored byClaude <noreply@anthropic.com>with noCo-authored-by:trailer. Body starts with_Requested by **nav** · [Slack thread](...)_. So resolution here comes entirely from the body-attribution fallback, matching"nav"→ Notion People row withUniqueIDtitle"Nav"→ GitHub usernamenav-tej→ SlackU0AMJURRLKV.claude[bot]-authored, single commit, no co-author trailer, body starts with_Requested by **Christian Byrne** · [Slack thread](...)_→ matches Notion rowchristian-byrne→ SlackU087MJCDHHC.Neither example actually has a
Co-authored-by:trailer, so the co-author path is implemented per the request ("try to find co-author... fall back to attribution") but untested against a real example — I added unit test coverage for its parsing logic (noreply-email login extraction, trailer regex) using synthetic fixtures instead.To make the name → GitHub-username matching possible, I extended
lib/notion/people.ts:PersonMappinggained anamefield sourced from the row'sUniqueID(title) column — needed because thenav-tejrow has no linked NotionPerson(that field was empty), so the title column is the only place "Nav" appears.findGithubUsernameByPersonName(name)matches case-insensitively on full name or first-name-only (e.g. "Christian" → "Christian Byrne"), skipping inactive rows — mirrors the existingfindSlackIdByGithubUsernameconventions.Flag for Christian: the fallback order (co-author trailer, then body attribution, then existing bot-login-falls-through-to-sheriff behavior) matches your message, but worth double-checking that's the priority you want — and whether
comfy-pr-bot/cloud-code-bot[bot]should even be treated as "bot" for this purpose (their PRs are automated release/CI bumps with no human requester, so the fallback will just find nothing and fall through harmlessly, but flagging in case you'd rather scope this toclaude[bot]only).Testing
bun run typecheck(tsgo) — cleanbun run lint(oxlint) — 0 warnings/errors on changed files (pre-existing warnings elsewhere in the repo are unrelated)bun run fmt(oxfmt) — cleanbun test app/tasks/gh-frontend-backport-checker/ lib/notion/— 107 pass, 0 failindex.spec.ts, including fixtures built from the real bodies of PR #14206 and #15342.lib/notion/people.spec.ts(new — no prior test file existed) coveringfindGithubUsernameByPersonName, mocking the Notion client per the pattern already used inapp/tasks/gh-priority-sync/index.spec.ts.No live Slack/Notion/GitHub calls were made by this change; nothing was posted to Slack or Notion as part of this work.
Generated by Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.