Repository navigation
[O2B-1623] Document the GAQ detectors endpoints in the HTTP API documentation - #2279
Open
graduta wants to merge 5 commits into
Conversation
`GaqDetectorAdapter.toEntity` only returns the run number, the data pass id and the detector id, but the `GaqDetector` typedef also listed `createdAt` and `updatedAt`, which are never sent.
`GaqDetectorService` queried three repositories directly (GAQ detectors, runs and detectors), with only `getOneDataPassOrFail` as a small function. It now relies on `getAllGaqDetectors`, `createGaqDetectors`, `removeGaqDetectors`, `getRunNumbersLinkedToDataPass`, `getRunsWithDetectorsByIds` and `getRunsWithDefaultGaqDetectors`, and on the existing `getAllDetectors`, and the six new functions have tests. The documentation of `setGaqDetectors` and `useDefaultGaqDetectors` said they resolve with nothing whereas they resolve with the created entries. The service makes the same calls and gives the same results as before. The only difference is that the detectors are now fetched through a query builder, which gives the same query with one more pair of parentheses around the condition.
…e the fields `POST /api/gaqDetectors` did not require its fields (`dataPassId`, `runNumbers`, `detectorIds`), so a missing one reached the service and failed there, and its ids were accepted as any number. `GET /api/gaqDetectors` accepted any number as data pass id and run number. All the ids are now validated with `EntityIdDto` (positive integers) and the three fields of the body are required, so that invalid requests are rejected with a 400 before reaching the service. API tests check missing fields and invalid values.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/O2B-1623/docs-lhc-periods-statistics-endpoints #2279 +/- ##
==========================================================================================
+ Coverage 46.54% 46.64% +0.10%
==========================================================================================
Files 1057 1063 +6
Lines 17404 17435 +31
Branches 3174 3176 +2
==========================================================================================
+ Hits 8100 8133 +33
+ Misses 9304 9302 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
graduta
added this pull request to stack #2276
October 22, 2026 14:02
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a JIRA ticket
Part of a stack of PRs documenting the HTTP API (O2B-1623). This PR is stacked on #2271 (its base is the branch of that PR): GitHub retargets it to
mainonce #2271 is merged.Notable changes for users:
GET /api/gaqDetectorsandPOST /api/gaqDetectorsendpoints are now documented at/api-docs(thePOSTis flaggedx-llm-exclude).POST /api/gaqDetectorsnow requiresdataPassId,runNumbersanddetectorIdsand rejects (400) ids that are not positive integers, instead of failing in the service when a field is missing.GET /api/gaqDetectorsrejects (400) a data pass id or a run number that is not a positive integer.Notable changes for developers:
createdAt/updatedAt(theGaqDetectortypedef wrongly listed them: fixed).GaqDetectorServicequeried three repositories directly with onlygetOneDataPassOrFailas a small function: it now relies ongetAllGaqDetectors,createGaqDetectors,removeGaqDetectors,getRunNumbersLinkedToDataPass,getRunsWithDetectorsByIdsandgetRunsWithDefaultGaqDetectorsplus the existinggetAllDetectors, with tests for the new functions. Checked against the previous service with stubbed repositories: same calls and same results, the only difference being that the detectors are fetched through a query builder (same SQL with an extra pair of parentheses).EntityIdDtoand the three fields of thePOSTbody are required, with API tests.setGaqDetectorsanduseDefaultGaqDetectorssaid they resolve with nothing whereas they resolve with the created entries.Changes made to the database:
🤖 Generated with Claude Code