Phase 09: Batch Operations - 4 plans in 4 waves - 3 autonomous, 1 with checkpoint - Ready for execution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8.2 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | must_haves | |||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 09-batch-operations | 03 | execute | 3 |
|
|
true |
|
Purpose: Enable convenient bulk updates and UI-based batch selection without typing container names. Output: "Update all" flow with pre-flight check and confirmation; multi-select toggle keyboard for batch actions.
<execution_context> @/home/luc/.claude/get-shit-done/workflows/execute-plan.md @/home/luc/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/09-batch-operations/09-CONTEXT.md @.planning/phases/09-batch-operations/09-RESEARCH.md @.planning/phases/09-batch-operations/09-01-SUMMARY.md @.planning/phases/09-batch-operations/09-02-SUMMARY.md @n8n-workflow.json Task 1: Add "update all" command with update availability check n8n-workflow.json Implement "update all" that only targets containers with updates available.-
In command detection (early in workflow), detect "update all" as special case:
- Add to command matching: if message.toLowerCase() includes "update all" or "updateall"
- Route to dedicated "Update All" flow (not the batch parsing flow)
-
Add HTTP node "Get All Containers For Update All":
- GET from Docker API via proxy:
http://docker-socket-proxy:2375/containers/json?all=true - Returns all containers
- GET from Docker API via proxy:
-
Add Code node "Check Available Updates":
- For each container, need to check if update is available
- This requires comparing current image digest to remote latest
- Pattern from existing update flow: a. Get container's current image ID b. Pull :latest tag (or appropriate tag) c. Compare digests
- This is expensive for many containers - consider approach:
- Option A: Full check for each (slow but accurate)
- Option B: Only check containers using :latest tag (faster, common case)
- Recommendation: Use Option B as default - most containers use :latest
-
For containers using :latest tag:
- Execute:
docker pull {image}:latest(via proxy exec or curl) - Compare pulled image digest to running container's image digest
- Mark container as "has update" if different
- Execute:
-
Add Code node "Build Update All Preview":
- If no containers have updates: Return "All containers are up to date!"
- If some have updates: Build list of containers with updates
- Output:
{ containersToUpdate: Container[], count: number }
-
Add IF node "Has Updates Available":
- TRUE: Continue to confirmation
- FALSE: Send "All up to date" message and stop
-
Add Code node "Build Update All Confirmation":
- Text: "Update {N} containers?\n\n{list container names with versions if available}"
- Inline keyboard: [Confirm] [Cancel]
- Callback format:
uall:confirm:{timestamp}anduall:cancel - Store containers to update in workflow context (or encode in callback if small enough)
-
Handle callbacks:
uall:confirm: Check 30-second timeout, then pass containers to batch execution flow (Plan 02)uall:cancel: Send "Update cancelled" and return to list
Note: The actual batch execution reuses Plan 02's Loop Over Items infrastructure. Test "update all" command:
- With containers that have updates: Shows confirmation "Update 3 containers? plex, sonarr, radarr"
- With no updates available: Shows "All containers are up to date!"
- Confirm executes batch update for listed containers
- Cancel returns to normal state "Update all" checks for available updates, shows confirmation with count and list, executes batch for only updatable containers
-
Add entry point to batch selection mode:
- In container list keyboard (from Phase 8), add button row: "Select Multiple"
- Callback:
batch:mode
-
Handle
batch:modecallback - Add Code node "Build Batch Select Keyboard":- Show container list with toggle checkmarks
- Each container button: text shows name with/without checkmark
- Callback format:
batch:toggle:{selected_csv}:{container_name}selected_csv: comma-separated currently selected containerscontainer_name: container being toggled
- Example:
batch:toggle:plex,sonarr:radarrmeans "plex and sonarr selected, toggling radarr"
-
Handle
batch:toggle:*callbacks:- Parse callback data to get current selection and container being toggled
- Toggle the container in/out of selection
- Rebuild keyboard with updated checkmarks
- Edit message to show new keyboard
-
Add action buttons when selection exists:
- At bottom of keyboard, show: "[Update Selected] [Start Selected] [Stop Selected]"
- Only show relevant actions based on container states (or show all and handle gracefully)
- Callback format:
batch:exec:{action}:{selected_csv}
-
Handle
batch:exec:*callbacks:- Parse action and selected containers
- For stop: Show confirmation (per existing batch stop rule)
- For start/restart: Execute immediately via batch loop
- For update: Execute immediately via batch loop
- Pass selected containers to batch execution infrastructure (Plan 02)
-
64-byte callback_data limit handling (per RESEARCH):
- Average container name: 6-10 chars
- With format
batch:toggle:{csv}:{name}, limit ~8-10 containers - If limit approached, show warning: "Maximum selection reached. Use 'update all' for more."
- Add Code node "Check Selection Size" before toggle to enforce limit
-
Add "Clear Selection" and "Cancel" buttons:
- "Clear":
batch:clear- reset selection, rebuild keyboard - "Cancel":
batch:cancel- return to normal container list
- "Clear":
Note: This is Claude's discretion area from CONTEXT. Toggle checkmark pattern chosen for consistency with Phase 8 keyboard patterns. Test batch selection flow:
- Click "Select Multiple" -> Container list with toggle buttons appears
- Click container -> Checkmark appears/disappears
- With 2+ selected -> Action buttons appear at bottom
- Click "Update Selected" -> Batch update executes for selected containers
- Clear selection resets all checkmarks
- Cancel returns to normal container list Inline keyboard multi-select works with toggle checkmarks; action buttons execute batch for selected containers; callback_data size limit enforced
<success_criteria>
- "Update all" scans and shows "Update 3 containers?" only for those needing updates
- When all up to date, shows "All containers are up to date!"
- Inline multi-select: checkmarks toggle on click
- "Update Selected" with 3 containers executes batch update
- Selection limit prevents callback_data overflow </success_criteria>