Skip to content

feat(ticketing): add job statuses + wait_until_complete helper#103

Merged
lmeilibr merged 1 commit into
mainfrom
feature/job-statuses
Apr 22, 2026
Merged

feat(ticketing): add job statuses + wait_until_complete helper#103
lmeilibr merged 1 commit into
mainfrom
feature/job-statuses

Conversation

@lmeilibr
Copy link
Copy Markdown
Contributor

Summary

  • Adds JobStatusApiClient + JobStatusesService covering Zendesk job-statuses: list, get, show_many (via ?ids=a,b).
  • Adds a wait_until_complete(job_id, interval, timeout) polling helper that loops on .get until the job reaches a terminal state (completed, failed, killed) or raises JobStatusTimeout. sleep and now are injectable for deterministic testing.
  • Reuses the existing shared JobStatus value object — no new domain model needed.
  • Wires self.job_statuses onto the Ticketing facade.

Test plan

  • Unit: tests/unit/ticketing/test_job_status_client.py — paths, show_many list/null/missing handling, error propagation
  • Unit: tests/unit/ticketing/test_job_statuses_service.py — delegation, poll-until-terminal, timeout, injected sleep/now, all three terminal states
  • Coverage: 100% on both new modules (44 statements)
  • Full unit suite passes (596 tests)
  • Live-tenant integration: tests/integration/ticketing/test_job_statuses.py (list, NotFound for bogus id, wait_until_complete on an already-finished job)

Part of #79 (Batch 2 — job statuses).

🤖 Generated with Claude Code

Adds JobStatusApiClient + JobStatusesService exposing the Zendesk
job-statuses endpoints plus a poll-until-terminal helper for callers
doing bulk updates.

- list paginates /api/v2/job_statuses
- get /api/v2/job_statuses/{id}
- show_many via ?ids=a,b,c
- wait_until_complete polls .get until status is completed/failed/killed
  (injectable sleep + now for testing) and raises JobStatusTimeout when
  the deadline elapses

Reuses the shared JobStatus value object.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@lmeilibr lmeilibr merged commit 2de8228 into main Apr 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant