Commit b706f85
feat(backport): improve backport notifications with persistent warnings and author tagging (#179)
* feat(backport): improve backport notifications with persistent warnings and author tagging
- Replace fixed maxReleasesToCheck with version-based filtering (4 minor versions behind)
- Add core-backport-not-needed and cloud-backport-not-needed label support
- Tag PR authors in Slack backport notifications
- Fall back to release sheriff (from #frontend-releases channel description) for external contributors
- Fix pre-existing TS errors in bot/slack-bot.ts, $pipeline.ts, EmailTasks.ts, filterDebugMessages.ts
- Add comprehensive tests for new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(backport): add --dry-run flag and graceful error handling for compare API
- Add --dry-run CLI flag to preview output without sending Slack messages
- Skip Slack user lookups in dry-run mode (show @github-username instead)
- Gracefully handle 404s from GitHub compare API (skip failed releases instead of crashing)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(test): add missing upsertSlackMarkdownMessage to mock in desktop-release spec
The mock.module() for upsertSlackMessage only included upsertSlackMessage
but not upsertSlackMarkdownMessage or mdFmt. When bun runs the test suite
and gh-frontend-backport-checker tests run after desktop-release tests,
the module mock is still active without the export, causing a SyntaxError.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(backport): guard profile.real_name against undefined before .replace()
Optional chaining on .toLowerCase() returns undefined when real_name is
missing, causing .replace() to throw. Normalize to empty string first.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(backport): paginate through all Slack users instead of only first 500
slack.users.list() returns at most one page of 500 users; large workspaces
would silently fail to find authors beyond the first page. Now loops using
response_metadata.next_cursor until all pages are fetched.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(backport): use <= for version-distance filter so releases exactly N behind are included
The previous < comparison excluded releases exactly maxMinorVersionsBehind
behind the latest. The PR intent is to include those releases, so <= is correct.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(backport): remove redundant filter in targetBranches
branchName already came from labels.filter(reBackportTargets), so
labels.some(...includes(branchName)) was always true. Remove the no-op.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(bot): remove duplicate ANSI escape regex in filterDebugMessages
Lines 36 and 37 had identical patterns. Remove the duplicate.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style: format code with prettier (no logic changes)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(test): align version-distance filter test with <= boundary change
The test used < (strict) to mirror the old production code, but d0fd106
changed production to <=. Update the test to match: v1.36.0 (exactly 4
behind latest) is now expected to be included.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(slack): handle integer-only timestamps in slackTsToISO
Channel creation timestamps from Slack API are plain Unix seconds
(e.g. "1234567890") with no decimal/microseconds part. Splitting
on "." leaves microseconds undefined, causing a crash.
Default microseconds to "000" when the decimal part is absent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(backport): cache Slack member list and set bugfixCommits on failure
Two fixes per Copilot review:
1. Cache the Slack workspace member list with a run-scoped promise so
findSlackUserIdByGithubUsername doesn't paginate through all members
on every author lookup (avoids repeated full-directory scans and
Slack rate-limit exposure).
2. Include bugfixCommits: [] when saving a failed compareCommits task
so downstream callers that flatMap over bugfixCommits get a consistent
array shape regardless of task status.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(backport): add detailed doc comment and comprehensive edge-case tests
Add thorough documentation comment at top of index.ts explaining the
full workflow and all edge cases. Export middleTruncated and
getBackportStatusEmoji for testing. Add 12 new test suites covering
missing edge cases: middleTruncated, emoji mapping, backport commit
filtering, bot comment regex, overall status derivation, compare link
parsing, branch name generation, processSince filtering, targetBranches
guard, idempotent Slack updates, author tag filtering, and report
status categorization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style(backport): format code and use slackCached for member lookups
Prettier formatting changes. Switch slack.users.list to
slackCached.users.list for Slack member lookups.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent b3dbac5 commit b706f85
20 files changed
Lines changed: 987 additions & 217 deletions
File tree
- .husky
- app/tasks
- gh-desktop-release-notification
- gh-frontend-backport-checker
- gh-issue-transfer-comfyui-to-frontend
- gh-issue-transfer-comfyui-to-workflow_templates
- gh-issue-transfer-frontend-to-comfyui
- gh-priority-sync
- bot
- utils
- lib/slack
- packages/mongodb-pipeline-ts
- scripts
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
| |||
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
177 | | - | |
178 | | - | |
179 | | - | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| |||
261 | 269 | | |
262 | 270 | | |
263 | 271 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 272 | + | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
| |||
343 | 349 | | |
344 | 350 | | |
345 | 351 | | |
346 | | - | |
347 | | - | |
348 | | - | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 379 | + | |
378 | 380 | | |
379 | 381 | | |
380 | 382 | | |
| |||
0 commit comments