Merged
Conversation
Five targeted improvements — no behaviour changes, faster wall-clock time on every task that touches multiple repos or notifications. Taskfile — cleanup-noise Replace three sequential jq invocations over the same temp file (length, dismiss-id list, preserve count) with one jq pass that emits a compact JSON object; the three values are then plucked with cheap echo-pipe reads, saving two subprocess forks per run. Replace the sequential PATCH-per-notification loop with a batched background loop (10 concurrent): each batch of 10 dismissals fires in parallel and waits before the next batch. With 100+ notifications this reduces dismiss time ~8×. scripts/manage-webhooks.sh — check_webhooks() Was calling gh api repos/.../hooks twice (once to display, once to count active). Now fetches the JSON array once into a local variable and pipes it through jq twice — halves the API calls per repo. force-merge-prs.fish Was calling gh pr view twice per matched PR (separate --json title and --json state requests). Now fetches --json title,state in one call and parses both fields from the single response. scripts/list-release-prs.fish gh pr list already returned title in its JSON payload but the code extracted only number and then made a second gh pr view call to fetch the title again. Now emits [number, title] as @TSV from the list call and parses inline — eliminates one API call per matched PR. scripts/cancel-workflow-runs.sh The repo loop was fully sequential: one gh run list call per repo, then one gh run cancel per in-progress run, all blocking. Extracted the per-repo logic into _cancel_repo(), exported it, and replaced the loop with xargs -P 8 so up to 8 repos are checked concurrently. The TOTAL_CANCELLED aggregate counter is removed (subshells cannot update the parent scope); individual cancellations are still logged. https://claude.ai/code/session_01SFKChTX8gNGNmh4in5Fj8W
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
speeds