spacedentist / spr

Submit pull requests for individual, amendable, rebaseable commits to GitHub
https://getcord.github.io/spr/
MIT License
378 stars 33 forks source link

Parallelise GitHub API calls when fetching multiple PRs #88

Closed sven-of-cord closed 2 years ago

sven-of-cord commented 2 years ago

For spr amend --all and spr diff --all we need to fetch information on multiple PRs. This commits ensures that happens in parallel. The major change here is to make Git: Send + Sync so that it can be used in spawned tasks.

Test Plan: I used spr diff --all on a branch with multiple local commits in a test repo. I then amended the bottom commit and ran spr diff --all again. Next I ran spr diff --all --cherry-pick to base them all against master. I amended the bottom commit once again and ran spr diff --all --cherry-pick again. All of these operation worked as expected. In the final run of spr, I could see that after typing in a message for the PR update, all other PRs were processed immediately, because their PR info had been fetched in the background already.