docs: add WorkQueueOps and BatchOps design pattern pages#25178
docs: add WorkQueueOps and BatchOps design pattern pages#25178
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a40b109f-035b-497e-a384-af1ea14b78ee Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot use the unbloat agent to review the changes and clean up |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/805c88b7-d406-43b9-ba4d-7377f52c1b8c Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Applied the unbloat principles from the
Result: 248 → 187 lines ( |
|
@mnkiefer can you take a peek? |
There was a problem hiding this comment.
Pull request overview
Adds missing documentation for two common agentic workflow design patterns—queue-based processing and batch processing—and wires them into the docs navigation and redirects.
Changes:
- Added new pattern pages: WorkQueueOps and BatchOps, each with multiple strategy examples.
- Added unhyphenated redirect slugs for both patterns.
- Added both pages to the Design Patterns sidebar.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/patterns/workqueue-ops.md | New WorkQueueOps pattern page with queue strategy examples and concurrency/idempotency guidance |
| docs/src/content/docs/patterns/batch-ops.md | New BatchOps pattern page with chunking, fan-out, rate-limit-aware batching, and aggregation examples |
| docs/astro.config.mjs | Adds redirects for unhyphenated slugs and adds new pages to the Design Patterns sidebar |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (6)
docs/src/content/docs/patterns/workqueue-ops.md:45
- This example instructs the agent to close the queue issue when all items are checked, but the configured safe outputs do not allow closing or status updates. Add
close-issue(or enableupdate-issue.status) so the workflow can actually complete the queue by closing the issue.
1. Read issue #${{ inputs.queue_issue }} and find all unchecked items (`- [ ]`).
2. For each unchecked item (at most 10 per run): perform the required work, then edit the issue body to change `- [ ]` to `- [x]`.
3. Add a comment summarizing what was completed and what remains.
4. If all items are checked, close the issue with a summary comment.
**docs/src/content/docs/patterns/workqueue-ops.md:154**
* This scheduled Discussion queue processor needs `add-comment` configured for discussions (and typically `target: "*"`), otherwise the agent can't post replies to the discovered discussion thread. Update `safe-outputs.add-comment` to set `discussion: true` (and appropriate targeting) to match the described behavior.
safe-outputs:
add-comment:
max: 5
create-discussion:
title-prefix: "[queue-log] "
category: "General"
**docs/src/content/docs/patterns/batch-ops.md:85**
* This example uses `jobs.<job>.strategy.matrix`, but gh-aw custom `jobs:` explicitly do not support `strategy`/matrix (see docs/src/content/docs/reference/frontmatter.md:686). As written, the workflow won't compile—consider rewriting this section to use a supported fan-out approach (e.g., sharded runs via inputs/schedules) or describe a plain GitHub Actions `.yml` matrix that invokes compiled gh-aw workflows.
jobs:
batch:
strategy:
matrix:
shard: [0, 1, 2, 3]
fail-fast: false # Continue other shards even if one fails
**docs/src/content/docs/patterns/batch-ops.md:93**
* The prompt describes posting references/comments when duplicates are found, but `safe-outputs` here only allows `add-labels`. Either add the needed safe output(s) (e.g., `add-comment`) or adjust the instructions so they only perform operations that are permitted by the configured safe outputs.
safe-outputs:
add-labels:
allowed: [reviewed, duplicate, wontfix]
max: 50
**docs/src/content/docs/patterns/batch-ops.md:186**
* In bash, if the directory exists but contains no `*.json` files, `jq -s ... "$RESULTS_DIR"/*.json` will fail because the glob won't expand. Add a guard (e.g., check for matching files) before invoking `jq` so the aggregation step is robust on first run / empty results.
# Aggregate results from all result files written by previous batch runs
RESULTS_DIR="/tmp/gh-aw/cache-memory/batch-results"
if [ -d "$RESULTS_DIR" ]; then
jq -s '
{
total_processed: (map(.processed) | add // 0),
total_failed: (map(.failed) | add // 0),
total_skipped: (map(.skipped) | add // 0),
runs: length,
errors: (map(.errors // []) | add // [])
}
' "$RESULTS_DIR"/*.json > /tmp/gh-aw/cache-memory/aggregate.json
cat /tmp/gh-aw/cache-memory/aggregate.json
**docs/src/content/docs/patterns/batch-ops.md:170**
* `safe-outputs` does not appear to support an `edit-issue` handler; the documented handler is `update-issue`. Also, the prompt includes creating sub-issues for failed items, but `safe-outputs` does not enable `create-issue`/`link-sub-issue`. Update the safe-outputs configuration to include the correct issue-update handler and the additional handlers required by the described behavior.
safe-outputs:
add-comment:
max: 1
edit-issue: true
</details>
- **Files reviewed:** 3/3 changed files
- **Comments generated:** 2
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/aba1e26f-efbe-4b99-bf12-43c95208db8d Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Adds two missing pattern pages covering work-queue and batch-processing — common agentic use cases with no prior documentation coverage.
New pages
patterns/workqueue-ops.mdFour queue strategies, each with a complete frontmatter + prompt example:
Includes a concurrency/idempotency reference table and guidance on preventing race conditions.
patterns/batch-ops.mdFour batch strategies with complete examples:
GITHUB_RUN_NUMBERfail-fast: false)Includes a sequential-vs-batch decision table, retry/failure-isolation patterns, and a real-world label migration example (100+ issues).
Config
/patterns/batchops/,/patterns/workqueueops/) matching existing conventions