Skip to content

[O2B-1623] Document the GAQ detectors endpoints in the HTTP API documentation - #2279

Open
graduta wants to merge 5 commits into
feature/O2B-1623/docs-lhc-periods-statistics-endpointsfrom
feature/O2B-1623/docs-gaq-detectors-endpoints
Open

graduta wants to merge 5 commits into
feature/O2B-1623/docs-lhc-periods-statistics-endpointsfrom
feature/O2B-1623/docs-gaq-detectors-endpoints

Conversation

@graduta

@graduta graduta commented Oct 22, 2026

Copy link
Copy Markdown
Member

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

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 main once #2271 is merged.

Notable changes for users:

  • The GET /api/gaqDetectors and POST /api/gaqDetectors endpoints are now documented at /api-docs (the POST is flagged x-llm-exclude).
  • POST /api/gaqDetectors now requires dataPassId, runNumbers and detectorIds and rejects (400) ids that are not positive integers, instead of failing in the service when a field is missing. GET /api/gaqDetectors rejects (400) a data pass id or a run number that is not a positive integer.

Notable changes for developers:

  • Checked the chain of the endpoint: all files have their license header, no use case is involved, and the adapter returns no createdAt / updatedAt (the GaqDetector typedef wrongly listed them: fixed).
  • GaqDetectorService queried three repositories directly with only getOneDataPassOrFail as a small function: it now relies on getAllGaqDetectors, createGaqDetectors, removeGaqDetectors, getRunNumbersLinkedToDataPass, getRunsWithDetectorsByIds and getRunsWithDefaultGaqDetectors plus the existing getAllDetectors, 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).
  • The ids of the two endpoints are validated with EntityIdDto and the three fields of the POST body are required, with API tests.
  • The documentation of setGaqDetectors and useDefaultGaqDetectors said they resolve with nothing whereas they resolve with the created entries.

Changes made to the database:

  • None

🤖 Generated with Claude Code

`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.
@graduta
graduta requested a review from isaachilly as a code owner October 22, 2026 13:44
@graduta graduta added documentation Improvements or additions to documentation backend labels Oct 22, 2026
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.64%. Comparing base (ec34926) to head (2f0bc63).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@graduta
graduta added this pull request to stack #2276 October 22, 2026 14:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants