chore(bounty): overhaul bounty automation with bulk sync and daily schedule#2663
Merged
tusharmath merged 5 commits intomainfrom Mar 24, 2026
Merged
chore(bounty): overhaul bounty automation with bulk sync and daily schedule#2663tusharmath merged 5 commits intomainfrom
tusharmath merged 5 commits intomainfrom
Conversation
Instead of triggering sync-issue.ts once per event with a specific issue number, introduce sync-all-issues.ts which fetches all open issues carrying any 'bounty' label prefix in a single pass and reconciles each one. Changes: - Add listIssuesWithLabelPrefix() to GitHubApi interface and GitHubRestApi (paginates /issues?state=open automatically) - New sync-all-issues.ts: planAllIssues / syncAllIssues with full test coverage (sync-all-issues.test.ts) - Replace sync_issue_job with sync_all_issues_job in forge_ci; update bounty workflow to add a daily schedule (02:00 UTC) in addition to the existing issues/label events - Regenerate .github/workflows/bounty.yml - Add bounty:sync-all-issues npm script Co-Authored-By: ForgeCode <noreply@forgecode.dev>
d5ea085 to
faa95ca
Compare
…ixtures Update makeIssue helpers in sync-pr.test.ts and sync-all-issues.test.ts to include the html_url field (now required on Issue) and add the title field to makePr (now required on PullRequest), matching the enriched LabelOp metadata threading added for plan output. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
- Add html_url to Issue and title to PullRequest interface fields - Add optional title and url fields to LabelOp for display metadata - Thread title/url through diff() helper via meta parameter - Enrich all LabelOps in computeIssuePatch and computePrPatch with title and html_url from the source issue/PR objects - Update printPlan to render: '#N — <title>\n <url>' so operators can click directly to the issue or PR Co-Authored-By: ForgeCode <noreply@forgecode.dev>
Replace hand-rolled ANSI escape helpers with chalk (v5, pure ESM). Colours applied: - ✔ green — successful add / already-in-sync - ✖ red — removal - ✉ yellow — comment posted - cyan — issue/PR reference (#N) - green — added label names - red — removed label names - blue/dim — clickable URL - dim — footer hint chalk automatically disables colours when stdout is not a TTY (e.g. CI log capture), so no NO_COLOR handling needed. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
This was referenced Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overhaul the bounty label automation by replacing the per-issue event-driven sync with a bulk reconciliation pass, adding a daily schedule, and fixing the CI scripts to actually apply changes.
Context
The previous
sync-issueCI job would run once per GitHub event (label added, assignee changed) and sync a single issue number. This approach had two problems: the--executeflag was missing so no writes ever happened, and issues that were labeled before the workflow was active (like #2630) were never synced. The new approach fetches all open issues with any bounty label in one API pass, computes the minimal patch for each, and applies them all — closing the gap on missed events and providing a daily catch-all sweep.Changes
sync-all-issues.ts— fetches all open issues with anybountylabel prefix via the GitHub API (paginated), runs the rules engine on each, and applies the combined patchlistIssuesWithLabelPrefixAPI method — added toGitHubApiinterface andGitHubRestApi, with automatic pagination and PR exclusionsync-issueCI job withsync-all-issuesin the Rust workflow generator (forge_ci)0 2 * * *) to the bounty workflow so labels stay in sync even without a triggering eventbounty:sync-all-issuesnpm script for local dry-runs--executeflag — bothsync-issueandsync-prnow pass--executein CI so writes are actually appliedsync-all-issues.test.ts, 6 new tests; 52 total passing)Testing