feat: add Claude-powered upstream sync report generator#8
Draft
LucasRoesler wants to merge 5 commits intomainfrom
Draft
feat: add Claude-powered upstream sync report generator#8LucasRoesler wants to merge 5 commits intomainfrom
LucasRoesler wants to merge 5 commits intomainfrom
Conversation
Add automated tool that uses Claude AI to analyze upstream commits and generate comprehensive backporting guidance. Features: - Semantic grouping of related commits (features + fixes + refactors) - Conflict detection with fork's changes - Backport strategy recommendations (cherry-pick/reimplement/skip) - Risk assessment (High/Medium/Low conflict probability) - Prioritization by value and effort - Step-by-step implementation plans - Actionable checklist organized by phase The script: - Auto-detects Claude Code authentication - Fetches upstream commits automatically - Analyzes file changes and diffs - Compares with our fork's commit history - Generates detailed markdown report with table summary Usage: uv run scripts/generate-upstream-sync-report.py Output: UPSTREAM_SYNC_REPORT.md with executive summary table and detailed analysis of each commit group including implementation plans Integration: - Run weekly to catch new upstream changes - Follow Phase 1 quick wins for low-risk backports - Update UPSTREAM_SYNC_LOG.md with actual results Documentation: - scripts/README.md: Full setup and usage guide - scripts/EXAMPLE_USAGE.md: Real-world examples and workflows
Add automated workflow that runs every Monday at 9 AM UTC to: - Generate upstream sync analysis report using Claude AI - Create or update GitHub issue with report - Upload full report as workflow artifact - Provide actionable checklist and quick links Features: - Auto-updates existing issue if less than 1 week old - Prevents issue spam by reusing recent issues - Includes report preview (first 3000 chars) in issue - Links to sync strategy and log documents - Can be manually triggered via workflow_dispatch Setup required: - Add ANTHROPIC_API_KEY as repository secret - Workflow will run automatically on schedule Issue includes: - Executive summary preview - Link to download full report artifact - Next steps checklist - Workflow run details Updated scripts/README.md with automation setup instructions.
Add comprehensive setup guide explaining how to enable the automated upstream sync workflow after merging. Covers: - What the automation adds (script + workflow + docs) - Step-by-step setup (merge PR + add API key) - Manual usage option - What to expect from weekly runs - Issue reuse logic (prevents spam) - Weekly workflow integration - Cost estimates (-6/month) - Troubleshooting common issues - Links to all documentation Makes onboarding straightforward for enabling automation.
Moving the GitHub Actions workflow to .github/workflow-examples/ so the branch can be pushed without the workflow scope on the token. To activate, copy to .github/workflows/ and add ANTHROPIC_API_KEY as a repository secret.
3ca8dde to
3dd523a
Compare
Add Backport: commit footer convention and supporting script logic to
exclude previously-handled upstream commits from future reports.
Convention: backport commits on our fork include a trailer footer:
Backport: sha1...sha2,sha3,sha4...sha5
Where each entry is a single upstream SHA or an inclusive range
(old_sha...new_sha). One footer covers all upstream commits addressed
by a single backport — whether cherry-picked, reimplemented, or
bundled together. Commits without a footer reappear in future reports.
Script changes:
- parse_backport_footer(): parses the comma-separated footer value
- get_handled_upstream_shas(): scans main's commit history for
Backport: footers and expands ranges via git log old^..new
- get_upstream_commits(): now accepts handled set and filters it out
- main(): prints how many commits were found vs filtered vs remaining,
exits early with a clean message if nothing remains to report
Both short and full SHAs are accepted in footers; unresolvable SHAs
produce a warning and are skipped rather than crashing.
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
workflow-examples/, see setup below)How it works
The script (
scripts/generate-upstream-sync-report.py):tiann/hapiUPSTREAM_SYNC_REPORT.mdwith an executive summary table and per-group implementation plansUsage
Uses your existing Claude Code authentication — no extra API key setup needed locally.
GitHub Actions automation
A workflow template is included in
.github/workflow-examples/weekly-upstream-sync-report.yml.To activate it:
.github/workflows/ANTHROPIC_API_KEYas a repository secretThe workflow was placed in
workflow-examples/rather thanworkflows/because the current GitHub token doesn't have theworkflowscope. Once the token is updated, the file can be moved to activate it.Test plan
uv run scripts/generate-upstream-sync-report.pyand verifyUPSTREAM_SYNC_REPORT.mdis generated