Skip to content

Add machete.github.retrieveByAuthor and machete.gitlab.retrieveByAuthor git config keys - #1746

Open
PawelLipski wants to merge 3 commits into
developfrom
feature/fetch-only-my-prs
Open

Add machete.github.retrieveByAuthor and machete.gitlab.retrieveByAuthor git config keys#1746
PawelLipski wants to merge 3 commits into
developfrom
feature/fetch-only-my-prs

Conversation

@PawelLipski

@PawelLipski PawelLipski commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add machete.github.retrieveByAuthor / machete.gitlab.retrieveByAuthor: when set, PR/MR-listing commands download open PRs/MRs by author (GitHub GraphQL search / GitLab author_username filter) instead of every open PR/MR in the repository.
  • By default (and with --mine) that author is the current user; --by=<user> selects a different author, and chain reconstruction walks that author's PRs rather than the current user's.
  • --all still downloads every open PR/MR regardless of the key.

This makes annotating and traversing one's own PRs feasible in repositories with hundreds or thousands of open PRs, at the cost of not discovering PRs opened by other users when traversing mixed-author chains.

Test plan

@PawelLipski PawelLipski self-assigned this Jul 7, 2026
@PawelLipski PawelLipski added feature New feature or request performance Something works too slow github Relates to integration with GitHub gitlab Relates to integration with GitLab labels Jul 7, 2026
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch 2 times, most recently from 0085281 to ddc3f53 Compare July 7, 2026 19:07
@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (0c1928c) to head (4d2b5e6).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1746      +/-   ##
===========================================
- Coverage    98.68%   98.67%   -0.01%     
===========================================
  Files           45       45              
  Lines         5384     5452      +68     
  Branches       979      991      +12     
===========================================
+ Hits          5313     5380      +67     
  Misses          43       43              
- Partials        28       29       +1     

☔ 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 changed the title Add machete.{github.fetchOnlyMyPullRequests,gitlab.fetchOnlyMyMergeRequests} git config keys Add machete.github.fetchOnlyMyPullRequests and machete.gitlab.fetchOnlyMyMergeRequests git config keys Jul 7, 2026
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch 4 times, most recently from c0b4a66 to 78ce323 Compare July 8, 2026 14:05
@PawelLipski PawelLipski changed the title Add machete.github.fetchOnlyMyPullRequests and machete.gitlab.fetchOnlyMyMergeRequests git config keys Add machete.github.retrieveOnlyMyPullRequests and machete.gitlab.retrieveOnlyMyMergeRequests git config keys Jul 8, 2026
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from 78ce323 to d0f2146 Compare July 8, 2026 14:35
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from d0f2146 to 95a8572 Compare July 28, 2026 16:30
@sjbarag

sjbarag commented Sep 2, 2026

Copy link
Copy Markdown

Thanks for implementing this @PawelLipski - it'll be super helpful for $dayjob use. Is there anything I can do to help this get closer to merging?

@PawelLipski

PawelLipski commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for implementing this @PawelLipski - it'll be super helpful for $dayjob use. Is there anything I can do to help this get closer to merging?

For clarity, what's $dayjob here? 😅 are you a human? 🧐
Also, could you describe your specific case where this will be useful? I'm on the fence whether to actually add this feature 🤔

@sjbarag

sjbarag commented Sep 4, 2026

Copy link
Copy Markdown

Thanks for implementing this @PawelLipski - it'll be super helpful for $dayjob use. Is there anything I can do to help this get closer to merging?

For clarity, what's $dayjob here? 😅 are you a human? 🧐 Also, could you describe your specific case where this will be useful? I'm on the fence whether to actually add this feature 🤔

Hehe, sorry, old-internet habits. I work at Netflix. The monorepo I do most of my work in has 932 PRs open right now1, and git machete github anno-prs takes ~17 seconds. Not the end of the world, but a bit of a flow-breaker to wait that long. At peak, my open PR count was probably… 6? 10? 🤷

To be more specific: I'm using git machete for some manual PR stacking and as a running ledger of which PRs I've got open, which I've merged, etc. Obv gh pr list --author '@me' does that too, but machete makes the bulk-rebasing process easier. Especially for shallow PR trees (think 3-4 independent changes that can merge in any order).

All that's to say: a machete.github.retrieveOnlyMyPullRequests toggle would be nice, but I recognize it's edge-casey and maybe not worth the maintenance cost long-term!

Footnotes

  1. Most of those PRs are old. I suspect listing PRs created in the last 30-60 days would cut the number of required pages to < 3, but haven't checked.

@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from 95a8572 to 2395dfb Compare September 8, 2026 16:40
@PawelLipski PawelLipski changed the title Add machete.github.retrieveOnlyMyPullRequests and machete.gitlab.retrieveOnlyMyMergeRequests git config keys Add machete.github.retrieveByAuthor and machete.gitlab.retrieveByAuthor git config keys Sep 9, 2026
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from 2395dfb to cabe821 Compare September 9, 2026 13:43
When set, commands that list open PRs/MRs download those authored by a given user
(via GitHub GraphQL search / GitLab author_username filter) instead of every open PR/MR in the repository.
By default (and with `--mine`) that author is the current user; `--by=<user>` selects a different author,
and chain reconstruction walks that same author's PRs.
This makes annotating and traversing one's own PRs feasible in repositories with hundreds or thousands of open PRs,
at the cost of not discovering PRs opened by other users when traversing mixed-author chains.
The `--all` flag still downloads every open PR/MR regardless of the key.
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from cabe821 to 3663659 Compare September 9, 2026 14:02
@PawelLipski

Copy link
Copy Markdown
Collaborator Author

Okay! I'll probably get that shipped then - I'll use retrieveByAuthor key name instead (as we need to handle --by case cleanly as well - only retrieve PRs/MRs by that author)

…by number.

Checkout of specific PR/MR numbers now downloads that first PR's author's open PRs
and reconstructs the stack from them, rather than from the current user's.
@PawelLipski
PawelLipski force-pushed the feature/fetch-only-my-prs branch from de32e37 to c0940ea Compare September 9, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request github Relates to integration with GitHub gitlab Relates to integration with GitLab performance Something works too slow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize github anno-prs and github checkout-prs for the case of 500+ PRs in a repo

3 participants