Wait for active pushing operations to finish before opening PR #4340
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.
An early pass at implementing Allow user to initiate open pull request prior to push completing #4339
One thing I very much dislike about this PR is the interface of
sync.Map
. I was shocked to learn there wasn't a standard lib implementation with generics yet. https://github.com/puzpuzpuz/xsync seems to be what people have standardized around for a thread safe Map with actual types instead of any, but I didn't want to suggest adding that for a single map. If people like the library though, I'm happy to add it in!I tested this with a pre-push hook that just did a
sleep 3
to simulate extra-slow pushes. I changed the non-input open pull requests to happen on a background worker thread, and remember their commit has for when they need to retrieve it. In the case of needing user input, I figured it would be better to block the UI so that we don't have a popup show up several seconds later after the keystroke.go generate ./...
)