Skip to content

Skip traverse PR/MR creation for branches annotated with push=no - #1780

Merged
PawelLipski merged 1 commit into
developfrom
fix/traverse-skip-create-pr-when-push-no
Sep 9, 2026
Merged

Skip traverse PR/MR creation for branches annotated with push=no#1780
PawelLipski merged 1 commit into
developfrom
fix/traverse-skip-create-pr-when-push-no

Conversation

@PawelLipski

Copy link
Copy Markdown
Collaborator

Summary

  • traverse --sync-github-prs / --sync-gitlab-mrs no longer offers to create a PR/MR when the branch is annotated with push=no.
  • A push=no qualifier already means the branch should not be published; offering to open a request for it could create a duplicate PR for someone else's branch (for example after checkout-prs added rebase=no push=no).

Test plan

  • Unit tests: traverse --sync-github-prs / --sync-gitlab-mrs skip a push=no sibling and still prompt for a normal sibling
  • git machete traverse --sync-github-prs on a branch with push=no and no open PR does not ask to create one
  • The same branch without push=no still gets the create prompt

@PawelLipski PawelLipski self-assigned this Sep 8, 2026
@PawelLipski PawelLipski added the bug Something isn't working label Sep 8, 2026
@codecov-commenter

codecov-commenter commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.68%. Comparing base (b02b9d0) to head (a828c03).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1780   +/-   ##
========================================
  Coverage    98.68%   98.68%           
========================================
  Files           45       45           
  Lines         5383     5384    +1     
  Branches       978      979    +1     
========================================
+ Hits          5312     5313    +1     
  Misses          43       43           
  Partials        28       28           

☔ 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.

@PawelLipski
PawelLipski force-pushed the fix/traverse-skip-create-pr-when-push-no branch from dad766a to fac6a22 Compare September 9, 2026 11:24
prs = [_pr for _pr in self._get_all_open_prs() if _pr.head == branch]
if not prs:
needs_create_pr = True
if branch_anno is None or branch_anno.qualifiers.push:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split for the sake of coverage

A push=no qualifier already means the branch should not be published, so offering to open a pull/merge request for it is inconsistent and can create a duplicate PR for someone else's branch.
@PawelLipski
PawelLipski force-pushed the fix/traverse-skip-create-pr-when-push-no branch from fac6a22 to a828c03 Compare September 9, 2026 11:25
@PawelLipski
PawelLipski merged commit 0c1928c into develop Sep 9, 2026
12 checks passed
@PawelLipski
PawelLipski deleted the fix/traverse-skip-create-pr-when-push-no branch September 9, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants