Skip to content

feat: add gh-pr-release-tagger task to label released PRs#171

Draft
comfy-pr-bot wants to merge 3 commits intomainfrom
feature/gh-pr-release-tagger
Draft

feat: add gh-pr-release-tagger task to label released PRs#171
comfy-pr-bot wants to merge 3 commits intomainfrom
feature/gh-pr-release-tagger

Conversation

@comfy-pr-bot
Copy link
Copy Markdown
Member

Summary

  • Adds app/tasks/gh-pr-release-tagger/index.ts - new task that monitors core/1.* and cloud/1.* branches in ComfyUI_frontend and automatically labels PRs included in each release with released:core or released:cloud
  • Adds app/tasks/gh-pr-release-tagger/index.spec.ts - comprehensive test suite covering config validation, branch grouping, label operations, filtering logic, and error handling
  • Registers the new task in app/tasks/run-gh-tasks.ts for 5-minute scheduled execution

How it works

  1. Lists branches matching core/1.* and cloud/1.* patterns via ghPageFlow
  2. Fetches recent releases, filters by target_commitish to match release branches and processSince cutoff
  3. Groups releases by branch and sorts ascending; takes the most recent maxReleasesToCheck per branch
  4. For each release, compares to the previous release tag using gh.repos.compareCommits to get all commits in the release
  5. For each commit, calls gh.repos.listPullRequestsAssociatedWithCommit to find associated PRs
  6. Ensures the released:core / released:cloud label exists in the repo (creates it with a blue color if not)
  7. Adds the label to each PR using the non-cached gh client (write operations)
  8. Tracks all processed releases + labeled PRs in MongoDB collection GithubPRReleaseTaggerTask (with releaseUrl as unique index)

Test plan

  • Config: branch pattern matching (core/1.*, cloud/1.*), label generation, processSince date
  • Task state: valid shape, all taskStatus values, empty labeledPRs
  • Branch grouping: grouping by target_commitish, ascending sort, maxReleasesToCheck limiting
  • Label operations: skip already-labeled PRs, skip PRs with existing label, detect missing labels
  • processSince filtering: include/exclude/boundary conditions
  • Error handling: failed task status, preservation of labeled PRs on failure
  • Database indexes: releaseUrl uniqueness, expected index fields

🤖 Generated with Claude Code

@comfy-pr-bot comfy-pr-bot requested a review from snomiao February 19, 2026 01:52
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comfy-pr Ready Ready Preview, Comment Mar 28, 2026 6:55pm

Request Review

Adds a new GitHub task that monitors core/1.* and cloud/1.* branches
in ComfyUI_frontend and automatically adds 'released:core' or
'released:cloud' labels to PRs included in each release.

- Lists release branches matching the configured patterns
- Fetches releases and groups by branch, filtering by processSince
- Compares consecutive releases to find included commits
- Labels associated PRs with the appropriate branch prefix label
- Ensures labels exist in repo before applying (creates if missing)
- Tracks processed releases in MongoDB GithubPRReleaseTaggerTask collection
- Registers in run-gh-tasks.ts for 5-minute scheduled execution

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… confirmed deployments

- `released:core` = available in latest desktop app (reads pinned version from Comfy-Org/desktop)
- `released:cloud` = live on cloud.comfy.org (reads deployed SHA from Comfy-Org/cloud ArgoCD overlay)
- Labels original PRs on main (not backport PRs) by tracing "Backport of #XXXX" references
- Supports both core (GitHub releases) and cloud (commit SHA) deployment models
- Idempotent: skips already-processed deployed refs and already-labeled PRs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants