feat: CLI command + gha workflow to contribute patches back to source#9
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial “contribute patch back upstream” capability by adding a syncweaver contribute CLI command plus a GitHub Actions workflow template, backed by new metadata-resolution and PR-opening logic in syncweaver.contribute_patch.
Changes:
- Add
syncweaver contributeCLI subcommand that resolves lockfile/patch metadata and opens a PR in the source repository. - Add
syncweaver-contribute-patch.ymlworkflow template to apply a tracked patch to a source repo and open a PR via workflow_dispatch. - Add unit tests covering token resolution, metadata resolution, and contribute command behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_contribute_patch.py | Adds tests for token resolution, lockfile-driven metadata resolution, and PR-opening flow. |
| tests/test_cli.py | Extends CLI tests to cover the new contribute command and help output. |
| src/syncweaver/templates/syncweaver-contribute-patch.yml | New workflow template to resolve patch metadata and open a PR in the source repo. |
| src/syncweaver/templates/init.py | Registers the new workflow template and updates template inventory docs/descriptions. |
| src/syncweaver/contribute_patch.py | Implements metadata resolution, token resolution, patch application + push + PR creation. |
| src/syncweaver/cli/main.py | Wires the new contribute command into the top-level CLI. |
| src/syncweaver/cli/contribute.py | Implements the syncweaver contribute Click command and its options. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Changes
adds
syncweaver contributecommand and corresponding gha workflow template to contribute patches back to source repos.Issues
resolves #4
PR Checklist
(
Strikethroughany points that are not applicable.)CHANGELOG.mdwith a short description of any user-facing changes and reference the PR number. Guidelines: https://keepachangelog.com/en/1.1.0/