Skip to content

Add additional query endpoints for adjunct batches - #1228

Merged
JackLewis-digirati merged 4 commits into
developfrom
feature/adjunctQueueEndpoint
Jul 28, 2026
Merged

Add additional query endpoints for adjunct batches#1228
JackLewis-digirati merged 4 commits into
developfrom
feature/adjunctQueueEndpoint

Conversation

@JackLewis-digirati

@JackLewis-digirati JackLewis-digirati commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What does this change?

Resolves #1157
Resolves #1158

This PR implements the following endpoints

  • GET /customers/{customer}/adjunctQueue
    • Overall details of batches for the customer
  • GET /customers/{customer}/adjunctQueue/batches
    • Details of all batches for the customer
  • GET /customers/{customer}/adjunctQueue/active
    • Details of batches currently in-flight
  • GET /customers/{customer}/adjunctQueue/recent
    • Batches that have been recently completed

@JackLewis-digirati

Copy link
Copy Markdown
Collaborator Author

What this implements

Closes #1157 and #1158.

#1157GET /customers/{customer}/adjunctQueue

New overview endpoint, equivalent to GET /customers/{customer}/queue:

  • size — total adjuncts in the queue across all batches, decreases as adjuncts are processed. Backed by a new Queues row with Name = "adjunct" (the table already supports arbitrary names; no schema change needed). This reuses the increment path that already existed in IngestNotificationSender.SendIngestAdjunctRequest.
  • batchesWaiting / adjunctsWaiting — batches/adjuncts that have been submitted but not yet started (Completed = 0 AND Errors = 0, batch not Finished). Deliberately excludes batches currently being worked on, which still count towards size.
  • batches / active / recent links, resolving to the endpoints below.

#1158 — bulk adjunct batch GET endpoints

  • GET /adjunctQueue/batches — all batches, most recently submitted first by default.
  • GET /adjunctQueue/active — batches with at least one adjunct still being worked on (Finished IS NULL).
  • GET /adjunctQueue/recent — completed batches, ordered by finished descending.
  • All three support page/pageSize (same config as the asset batch endpoints). /batches and /active support orderBy/orderByDescending, ordering by submission date (AdjunctBatch doesn't have a Created field, only Submitted — mirrors the existing convention for adjunct items where any unrecognised field name is ignored and the one supported field is used).

Bug fix along the way

Engine/Ingest/IngestHandler.cs was decrementing the wrong Queues row for every completed adjunct — it only distinguished "priority" vs "default" by SQS queue name, so adjunct completions fell through to "default" and silently corrupted the customer's image queue size while never decrementing "adjunct". Fixed to resolve the queue name from the ingest request type.

Also fixed DlcsDatabaseFixture.CleanUp(), which never cleared AdjunctBatches/AdjunctBatchAdjuncts between integration tests, causing state to leak across the suite.

@JackLewis-digirati
JackLewis-digirati changed the base branch from develop to feature/bulkAdjunctOperations July 27, 2026 13:26
@JackLewis-digirati JackLewis-digirati changed the title Feature/adjunct queue endpoint Add additional query endpoints for adjunct batches Jul 27, 2026
Base automatically changed from feature/bulkAdjunctOperations to develop July 27, 2026 14:06
@JackLewis-digirati
JackLewis-digirati marked this pull request as ready for review July 27, 2026 14:11
@JackLewis-digirati
JackLewis-digirati requested a review from a team as a code owner July 27, 2026 14:12
Comment thread src/protagonist/DLCS.Repository/Processing/CustomerQueueRepository.cs Outdated
Comment thread src/protagonist/API.Tests/Integration/CustomerAdjunctQueueTests.cs Outdated
@JackLewis-digirati
JackLewis-digirati merged commit 19aaa72 into develop Jul 28, 2026
8 checks passed
@JackLewis-digirati
JackLewis-digirati deleted the feature/adjunctQueueEndpoint branch July 28, 2026 16:38
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.

GET /adjunctQueue/ endpoints Get customer AdjunctQueue

2 participants