feat(gh push): fixed-batch processing and --id single-item push#547
Merged
SorraTheOrc merged 2 commits intomainfrom Mar 10, 2026
Merged
feat(gh push): fixed-batch processing and --id single-item push#547SorraTheOrc merged 2 commits intomainfrom
SorraTheOrc merged 2 commits intomainfrom
Conversation
- Add --id <work-item-id> flag to push a single work item by ID - Implement fixed 10-item batching in src/commands/github.ts: - Splits itemsToProcess into 10-item windows - Calls upsertIssuesFromWorkItems per batch, persists updatedItems after each - Stops immediately on first batch error with descriptive message - Accumulates results across all batches for unified output - Add GithubSyncResult to imports from github-sync.js - Add tests for --id flag and batching behavior Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enable batching in wl gh push for work items
feat(gh push): fixed-batch processing and --id single-item push
Mar 10, 2026
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.
wl gh pushpushed all candidates in one pass — unreliable on large worklogs with no partial-progress persistence on failure.Changes
Batching (
src/commands/github.ts)itemsToProcessinto fixed windows of 10; callsupsertIssuesFromWorkItemsper batchdb.upsertItems(updatedItems)after each successful batch — partial progress is durableBatch N/M failed: …for diagnosticsGithubSyncResultand timing across batches; all existing output/log paths unchangedcommentsByItemIdmap once so each batch receives only its relevant comments--idflag--id <work-item-id>option filters candidates to a single item (batch of 1) after pre-filtering--no-update-timestampand all other existing flagsTests (
tests/cli/github-push-batching.test.ts)--idhappy path, not-found error, timestamp write/skipWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh issue create --repo owner/name --title Item 1 --body-file -(http block)/usr/bin/gh gh issue create --repo owner/name --title Item 2 --body-file -(http block)/usr/bin/gh gh issue create --repo owner/name --title Item without GitHub mapping --body-file -(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Enable batching in wl gh push</issue_title>
<issue_description>
Headline
Enable batching in
wl gh pushto process work items in fixed batches of 10, persist progress after each batch, and support pushing a single item by id.Problem statement
wl gh pushcurrently attempts to push all candidate work items in one pass. On large worklogs this is unreliable and slow; failures mid-run can leave the process partially complete with no persisted progress. We need a deterministic, conservative batching approach that reduces per-run load and ensures partial progress is persisted safely.Users
wl gh pushagainst repositories with many work items.wl gh pushas part of larger automation.Example user stories
wl gh pushto complete in predictable batches so a single failure doesn't require reprocessing everything.wl gh push --id <WL-...>.Success criteria
db.upsertItems) so progress is persisted.wl gh push --id <work-item-id>to push a single specified item (behaves like a batch of 1) and persist its mapping on success.--all,--no-update-timestamp, pre-filtering, and comment upserts must continue to work as before.Constraints
--all,--no-update-timestamp) and JSON output shape.Existing state
src/commands/github.tscontains thegh pushcommand that currently builds the full candidate list and callsupsertIssuesFromWorkItems(itemsToProcess, ...)which performs upserts and returnsupdatedItems.src/github-sync.tsis the heavy-lifter that upserts issues/comments and currently expects to receive the full candidate set; it already implements per-item skip logic and concurrency control.src/github-pre-filter.tsand is used to reduceitemsToProcessbefore calling the sync logic.Desired change
src/commands/github.ts: splititemsToProcessandcommentsToProcessinto 10-item windows, callupsertIssuesFromWorkItemsper batch, persist returnedupdatedItemsafter each batch, stop on error.src/github-sync.ts: accept an additionalbatchSizeparameter and process incoming items in internal batches, persisting mappings via a provided callback after each internal batch. (Conservative preference: implement batching incommands/github.tsto minimize changes to sync core.)--id <work-item-id>flag togh pushto allow pushing a single work item; when provided, build a single-item batch and run the same flow (persist mappings and update last-push timestamp behavior should match other runs).--no-update-timestampcontinues to skip writing last-push timestamp; when pushing a single id the command should still honor--no-update-timestamp.Related work
src/commands/github.ts(push entrypoint),src/github-sync.ts(upsert logic),src/github-pre-filter.ts(last-push pre-filter),DATA_SYNCING.md(process notes).WL-0MLX34EAV1DGI7QD— wl gh push: sub-issue self-link error; guards and data-corruption fixes in hierarchy linking (relevant to hierarchy/link phases).WL-0MLX34RED18U7KB7— Clear corrupted githubIssueNumber data for 33 items sharing issue 675 (data hygiene related to pushes).WL-0MM8Q1MQU02G8820— Github delegation should not create duplicate issues (related to single-item pushes an...✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.