feat(sync[dry-run]): auto-show all matched repos when filtering explicitly#540
Draft
tony wants to merge 3 commits intosync-edgecasesfrom
Draft
feat(sync[dry-run]): auto-show all matched repos when filtering explicitly#540tony wants to merge 3 commits intosync-edgecasesfrom
tony wants to merge 3 commits intosync-edgecasesfrom
Conversation
…atterns why: when filtering to specific repos, the user expects all matched repos to appear — needing --show-unchanged to see the 4 unchanged out of 5 matched is unintuitive. Regression test documents the desired behavior before the fix. what: - add xfail field to DryRunPlanFixture (defaults False, zero churn on existing fixtures) - add pytest.xfail() guard in test_sync_dry_run_plan_human when xfail=True - add unchanged-implicit-filter fixture: --dry-run with explicit name pattern, pre-synced repo, expects ✓ row without --show-unchanged flag
…itly why: vcspull sync tanstack-* shows 5 matched repos but only the 1 needing action — the user has already scoped the command to specific repos and shouldn't need --show-unchanged to confirm the filter worked. what: - add has_explicit_patterns field to PlanRenderOptions - set it true in sync() when repo_patterns passed without --all - fold it into the show_unchanged OR at both _filter_entries_for_display call sites (human and JSON/NDJSON paths) - add PLAN_TIP_MESSAGE_FILTERED: suppress --show-unchanged hint when unchanged rows are already visible due to explicit filtering - wire request.applymarker into test_sync_dry_run_plan_human to support per-fixture xfail without stopping test execution
…ed fixed why: unchanged-implicit-filter now passes unconditionally. what: - remove xfail=True from unchanged-implicit-filter fixture
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## sync-edgecases #540 +/- ##
===============================================
Coverage 84.29% 84.29%
===============================================
Files 29 29
Lines 3813 3815 +2
Branches 759 759
===============================================
+ Hits 3214 3216 +2
Misses 377 377
Partials 222 222 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
vcspull sync tanstack-* --dry-runmatched 5 repos but only displayed the 1 needing action — the 4 unchanged repos were hidden unless--show-unchangedwas passed, even though the user had already scoped the command to specific repos.has_explicit_patternstoPlanRenderOptions: computed asnot sync_all and bool(repo_patterns)insync(), propagated to both the human and JSON/NDJSON render paths.--show-unchangedhint when unchanged rows are already visible due to explicit filtering; show a shorter "run without --dry-run to apply" tip instead.xfailfield andrequest.applymarkersupport toDryRunPlanFixture/test_sync_dry_run_plan_humanfor per-fixture conditional xfail without stopping test execution.Design decisions
OR semantics at the call site:
show_unchanged or has_explicit_patternsis passed to_filter_entries_for_display()rather than changing the function's own signature — the helper stays minimal and doesn't need to know about the concept of "explicit patterns".--allunaffected:has_explicit_patternsis onlyTruewhenrepo_patternsis non-empty andsync_allisFalse. Bulk--alldry-runs retain the hide-unchanged default.request.applymarkeroverpytest.xfail(): imperativepytest.xfail()short-circuits execution and can never become XPASS.request.applymarkerapplies the marker but still runs the test body, so the fixture transitions XFAIL → XPASS → PASS cleanly across the three-commit workflow.Before / After
Before:
After:
Test plan
unchanged-implicit-filter—--dry-runwith explicit name pattern and pre-synced repo shows✓row without--show-unchangedunchanged-show— existing--show-unchangedflag still worksuv run ruff check . --fix --show-fixes— no lint errorsuv run ruff format .— no formatting changesuv run mypy— no type errorsuv run py.test --reruns 0— full suite passes