fix(glpi): accept HTTP 206 in list wrappers (#807) #810

Merged
jason.woltje merged 1 commits from fix/807-glpi-206 into main 2026-07-16 22:47:59 +00:00
Owner

Root cause

The three GLPI list wrappers issue ranged requests (?range=0-N) but accepted only HTTP 200. Healthy GLPI ranged responses use HTTP 206 Partial Content, so ticket, computer, and user listing all exited with an error against a working server.

Fix

  • Accept HTTP 200 or 206 in ticket-list.sh, computer-list.sh, and user-list.sh.
  • Preserve the existing diagnostic and non-zero exit for all other statuses.
  • Add a fixture-driven shell regression harness covering every wrapper.
  • Leave session-init.sh and ticket-create.sh unchanged.

Red-first evidence

Before the source fix, packages/mosaic/framework/tools/glpi/test-list-http-status.sh exited 1: all three HTTP 206 render assertions failed, while all three HTTP 401 failure assertions passed.

After the fix, the same test passes all six assertions.

Verification

  • packages/mosaic/framework/tools/glpi/test-list-http-status.sh
  • bash -n packages/mosaic/framework/tools/glpi/{ticket-list.sh,computer-list.sh,user-list.sh,test-list-http-status.sh}
  • shellcheck packages/mosaic/framework/tools/glpi/test-list-http-status.sh
  • pnpm typecheck (42/42)
  • pnpm lint (23/23)
  • pnpm format:check

Closes #807

## Root cause The three GLPI list wrappers issue ranged requests (`?range=0-N`) but accepted only HTTP 200. Healthy GLPI ranged responses use HTTP 206 Partial Content, so ticket, computer, and user listing all exited with an error against a working server. ## Fix - Accept HTTP 200 or 206 in `ticket-list.sh`, `computer-list.sh`, and `user-list.sh`. - Preserve the existing diagnostic and non-zero exit for all other statuses. - Add a fixture-driven shell regression harness covering every wrapper. - Leave `session-init.sh` and `ticket-create.sh` unchanged. ## Red-first evidence Before the source fix, `packages/mosaic/framework/tools/glpi/test-list-http-status.sh` exited 1: all three HTTP 206 render assertions failed, while all three HTTP 401 failure assertions passed. After the fix, the same test passes all six assertions. ## Verification - `packages/mosaic/framework/tools/glpi/test-list-http-status.sh` - `bash -n packages/mosaic/framework/tools/glpi/{ticket-list.sh,computer-list.sh,user-list.sh,test-list-http-status.sh}` - `shellcheck packages/mosaic/framework/tools/glpi/test-list-http-status.sh` - `pnpm typecheck` (42/42) - `pnpm lint` (23/23) - `pnpm format:check` Closes #807
jason.woltje added 1 commit 2026-07-16 22:32:59 +00:00
fix(glpi): accept partial content in list wrappers
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
e1d3891bd1
Accept HTTP 206 responses from ranged GLPI list endpoints while preserving failures for genuine error statuses. Add red-first regression coverage across ticket, computer, and user lists.

Closes #807

Co-Authored-By: OpenAI GPT <noreply@openai.com>
jason.woltje merged commit 8536454257 into main 2026-07-16 22:47:59 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#810