gruntwork-io / git-xargs

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
https://blog.gruntwork.io/introducing-git-xargs-an-open-source-tool-to-update-multiple-github-repos-753f9f3675ec
Apache License 2.0
933 stars 63 forks source link

Fix concurrency bug(s) #85

Closed zackproser closed 2 years ago

zackproser commented 2 years ago

These changes fix some sneaky concurrency bugs that were manifesting in various ways, either with PRs failing to be opened correctly or occasional opaque waitgroup errors that are hard to replicate because they're all timing related.

The core issue was mishandling of the waitgroup that was being created to orchestrate the work of operating on repositories and handling pull request opening with awareness of the GitHub API rate limits.

These changes simplify the waitgroup logic:

These changes make it much simpler to reason about the concurrent logic and in local testing they resolve the issues observed in #77 and #74.

Description

Fixes #77 and #74.

TODOs

Read the Gruntwork contribution guidelines.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

The --max-concurrent-repos flag has been removed. Please update any earlier git-xargs invocations / scripts that use that flag to remove it.

zackproser commented 2 years ago

Thanks for reviews! Going to merge this in now.