Skip to content

Fix advance green-edge detection when parent is behind remote#1751

Open
PawelLipski wants to merge 2 commits into
developfrom
fix/green-edge-advance
Open

Fix advance green-edge detection when parent is behind remote#1751
PawelLipski wants to merge 2 commits into
developfrom
fix/green-edge-advance

Conversation

@PawelLipski

Copy link
Copy Markdown
Collaborator

Summary

  • Extract shared is_connected_with_green_edge() on MacheteClient so advance and status use the same green-edge criteria.
  • Fixes a leftover from 3.41.0: when the parent branch is behind its remote counterpart and a child was forked from the remote tip, status already renders a green edge but advance only considered children whose fork point equals the parent's local tip.
  • Add regression tests for the parent-behind-remote scenario (single and multiple green-edge children).

Test plan

  • tox -e py -- tests/test_advance.py
  • tox -e py -- tests/test_advance.py tests/test_status.py -k "advance_when_parent_behind_remote or no_yellow_edge_when_parent_behind_remote"
  • tox -e mypy
  • Verified manually in rules_scala: advance -y on master now sees both green-edge children (ambiguous advance) instead of only the one whose fork point equals local master.

Extract shared is_connected_with_green_edge() so advance recognizes the same green-edge children as status (the 3.41.0 parent-behind-remote fix).
@codecov-commenter

codecov-commenter commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.67%. Comparing base (1c007c1) to head (d12c173).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
git_machete/client/base.py 78.94% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1751      +/-   ##
===========================================
- Coverage    98.77%   98.67%   -0.10%     
===========================================
  Files           45       45              
  Lines         5372     5378       +6     
  Branches       981      983       +2     
===========================================
+ Hits          5306     5307       +1     
- Misses          41       44       +3     
- Partials        25       27       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Cover overridden fork point and parent-without-remote branches that were missing from patch coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants