-
Notifications
You must be signed in to change notification settings - Fork 119
feat(git): add sync-downstream command for fork maintenance #156
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
base: main
Are you sure you want to change the base?
Conversation
Add /git:sync-downstream command to automate syncing downstream forks
with upstream repositories while preserving downstream-specific files.
Key features:
- Merges upstream/main into downstream using -s ours strategy
- Preserves downstream files listed in .downstream-preserve config
- Automatically updates Go vendor dependencies
- Creates single commit with all changes
- Supports --dry-run mode for preview
This addresses a common OpenShift workflow where projects maintain
forks of upstream repositories with custom CI/CD, build configs, and
governance files that need to be preserved during upstream syncs.
Usage:
/git:sync-downstream [--dry-run]
Configuration:
Create .downstream-preserve file listing files to preserve:
.ci-operator.yaml
.tekton/
OWNERS
renovate.json
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: matzew The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @matzew. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
WalkthroughAdds documentation for a new Git plugin command Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (6 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
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: 0
🧹 Nitpick comments (1)
plugins/git/commands/sync-downstream.md (1)
10-10: Add language specifiers to code blocks.The markdown linter identifies 6 fenced code blocks without language specifiers. Add appropriate language identifiers to improve documentation clarity and enable syntax highlighting.
Apply these diffs to add language specifiers:
## Synopsis
/git:sync-downstream [--dry-run]```diff 2. **Configuration file must exist:** Create a `.downstream-preserve` file in repository root listing files/directories to preserve from downstream: - ``` + ```bash # Example .downstream-preserve .ci-operator.yaml .tekton/ Dockerfile.ci OWNERS renovate.json ```### Output After successful execution, show: - ✅ Commit hash and message - 📊 Summary of changes: `git diff --stat downstream/main..HEAD | tail -1` - 📝 Next steps: - ``` + ```bash # Push the branch git push origin sync-downstream # Create pull request gh pr create --base downstream/main --title "Sync with upstream main" ```**Output:** - ``` + ``` ✅ Created sync-downstream branch from upstream/main ✅ Merged downstream/main with -s ours strategy ✅ Restored 9 downstream files from .downstream-preserve ✅ Updated Go dependencies (vendor/) ✅ Committed: abc1234 "sync: merge upstream main with downstream config" 📊 Changes: 45 files changed, 892 insertions(+), 234 deletions(-) 📝 Next steps: git push origin sync-downstream gh pr create --base downstream/main --title "Sync with upstream main"```diff **Output:** - ``` + ``` 🔍 DRY RUN MODE - No changes will be committed ✅ Fetched upstream and downstream ✅ Would create sync-downstream branch from upstream/main ✅ Would restore these downstream files: - .ci-operator.yaml - .tekton/ - Dockerfile.ci - OWNERS - renovate.json 📊 Would change: 45 files changed, 892 insertions(+), 234 deletions(-) Use /git:sync-downstream (without --dry-run) to apply these changes.```diff **Example:** - ``` + ``` # CI/CD configurations .ci-operator.yaml .snyk .tekton/ # Build files Dockerfile.ci Dockerfile.ocp Makefile-ocp.mk # Governance OWNERS # Configuration mcp_config.toml renovate.jsonAlso applies to: 45-45, 116-116, 154-154, 175-175, 234-234 </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Cache: Disabled due to data retention organization setting** **Knowledge base: Disabled due to data retention organization setting** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between aeea2772a5824a15ed61260d66ebd47eaca322ee and 259f75bc5a632b7e3fa30b3b589f7e9143d4a326. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `PLUGINS.md` (1 hunks) * `docs/data.json` (1 hunks) * `plugins/git/README.md` (1 hunks) * `plugins/git/commands/sync-downstream.md` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 markdownlint-cli2 (0.18.1)</summary> <details> <summary>plugins/git/commands/sync-downstream.md</summary> 10-10: Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 45-45: Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 116-116: Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 154-154: Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 175-175: Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 234-234: Fenced code blocks should have a language specified (MD040, fenced-code-language) </details> </details> </details> <details> <summary>🔇 Additional comments (4)</summary><blockquote> <details> <summary>plugins/git/README.md (1)</summary><blockquote> `23-25`: **LGTM!** The new command documentation is properly placed and concise, following the established pattern in the README. </blockquote></details> <details> <summary>PLUGINS.md (1)</summary><blockquote> `86-86`: **LGTM!** The command entry is properly formatted and positioned, consistent with neighboring commands. </blockquote></details> <details> <summary>docs/data.json (1)</summary><blockquote> `46-51`: **LGTM!** The command metadata is properly structured and positioned in the data manifest. </blockquote></details> <details> <summary>plugins/git/commands/sync-downstream.md (1)</summary><blockquote> `1-294`: **Excellent documentation coverage.** The sync-downstream command documentation is well-structured and comprehensive, providing clear prerequisites, step-by-step implementation details, multiple usage examples, error handling guidance, and practical workflow patterns. This will effectively support users adopting the command for downstream fork maintenance. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
Please join the openshift-eng org to get your PR tested. Once you're in the org, close and re-open the PR to retrigger evaluation of your org membership. |
Add /git:sync-downstream command to automate syncing downstream forks with upstream repositories while preserving downstream-specific files.
Key features:
This addresses a common OpenShift workflow where projects maintain forks of upstream repositories with custom CI/CD, build configs, and governance files that need to be preserved during upstream syncs.
Usage:
/git:sync-downstream [--dry-run]
Configuration:
Create .downstream-preserve file listing files to preserve:
.ci-operator.yaml
.tekton/
OWNERS
renovate.json
🤖 Generated with Claude Code
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit
Release Notes
New Features
/git:sync-downstreamcommand to synchronize downstream forks with upstream while preserving downstream-specific files, with optional--dry-runflag for preview mode.Documentation