Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/021.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: copy
ts: 2026-02-13 10:39:28.526332+00:00
type: fix
author: Espen Albert
changelog_message: 'fix(copy): skip PR close when running with --local/--skip-commit'
message: 'fix(copy): skip PR close when running with --local/--skip-commit'
short_sha: c98900
1 change: 1 addition & 0 deletions docs/copy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Copy files from SRC to DEST repositories.

| Version | Change |
|---------|--------|
| unreleased | fix(copy): skip PR close when running with --local/--skip-commit |
| 0.7.1 | fix(cmd_copy): add warning for unknown comment prefix in sync process |
| 0.6.0 | fix(copy): apply skip_sections when creating new files with sections |
| 0.6.0 | fix(copy): commit synced files before running verify steps |
Expand Down
2 changes: 1 addition & 1 deletion path_sync/_internal/cmd_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _run_copy(config: SrcConfig, src_root: Path, dest_filter: str, opts: CopyOpt


def _close_stale_pr(dest_root: Path, copy_branch: str, opts: CopyOptions, config: SrcConfig) -> None:
if opts.dry_run or opts.no_pr or config.keep_pr_on_no_changes:
if opts.dry_run or opts.skip_commit or opts.no_pr or config.keep_pr_on_no_changes:
return
if git_ops.has_open_pr(dest_root, copy_branch):
git_ops.close_pr(dest_root, copy_branch, "Closing: source and destination are in sync, no changes needed")
Expand Down
8 changes: 8 additions & 0 deletions path_sync/cmd_copy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,14 @@ def test_close_stale_pr_skipped_when_keep_pr_on_no_changes(tmp_path: Path):
mock_git.has_open_pr.assert_not_called()


def test_close_stale_pr_skipped_when_skip_commit(tmp_path: Path):
opts = CopyOptions(skip_commit=True)
config = _make_src_config()
with patch(f"{COPY_MODULE}.git_ops") as mock_git:
_close_stale_pr(tmp_path, "sync/test", opts, config)
mock_git.has_open_pr.assert_not_called()


def test_close_stale_pr_runs_by_default(tmp_path: Path):
opts = CopyOptions()
config = _make_src_config()
Expand Down