-
Notifications
You must be signed in to change notification settings - Fork 448
ci: add AI agent prompt to backport conflict comments #7367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdded BACKPORT_AGENT_PROMPT_TEMPLATE and envsubst-driven computation of CONFLICTS_INLINE, SAFE_TARGET, BACKPORT_BRANCH, PR_URL, and AGENT_PROMPT; replaced the prior single-line backport-failure comment with a multi-section COMMENT_BODY template (failure reason, conflicts block, embedded AI prompt, and author note), and ensured envsubst is available. Changes
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/15/2025, 06:53:11 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 12/15/2025, 07:45:32 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.25 MB (baseline 3.25 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 989 kB (baseline 989 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 184 kB (baseline 184 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 3.18 kB (baseline 3.18 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.82 MB (baseline 3.82 MB) • ⚪ 0 BBundles that do not match a named category
|
When backports fail due to conflicts, the comment now includes a copyable prompt for AI coding assistants (Claude Code, Cursor, etc.) to resolve conflicts automatically. Fixes #n/a 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
363f60f to
9845f5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/pr-backport.yaml (1)
289-295: Trim trailing delimiter fromCONFLICTSto avoid empty “- ” entries.
CONFLICTS=$(... | tr '\n' ',')commonly produces a trailing comma, which later becomes an empty line inCONFLICTS_LIST(and extra whitespace inCONFLICTS_INLINE).Minimal fix: strip trailing commas once at capture-time (best) or before rendering.
- CONFLICTS=$(git diff --name-only --diff-filter=U | tr '\n' ',') + CONFLICTS=$( + git diff --name-only --diff-filter=U \ + | paste -sd, - \ + | sed 's/,$//' + )If you prefer not to touch the earlier block, you can also
sed 's/,\+$//'right afterconflictsis read.Also applies to: 393-399
♻️ Duplicate comments (1)
.github/workflows/pr-backport.yaml (1)
360-370: Make the “AI agent prompt” template easier to maintain (and match prior feedback).This is much better than inline concatenation, but it’s still fairly wrapped/hard to edit due to manual line breaks. Consider switching to a single coherent template (no mid-sentence wraps) and/or a heredoc-style block (as discussed in prior review).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pr-backport.yaml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: deploy-and-comment
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: setup
- GitHub Check: collect
Install gettext-base if envsubst is not available on the runner. While envsubst is typically present on ubuntu-latest, this adds a safety net for the critical conflict-comment step.
Use heredoc for cleaner multiline string construction. Wrap conflicting files in fenced code block instead of markdown list to handle special characters in filenames safely.
Summary
Example Output
When a backport fails due to conflicts, the workflow now posts a cleaner comment with an AI agent prompt:
core/1.33failedReason: Merge conflicts detected during cherry-pick of
5233749📄 Conflicting files
🤖 Prompt for AI Agents
The "Prompt for AI Agents" section can be copied directly into Claude Code, Cursor, or other AI coding assistants to resolve the conflicts automatically.
┆Issue is synchronized with this Notion page by Unito