Repository navigation
[O2B-1623] Document the simulation passes endpoints in the HTTP API documentation - #2270
Merged
Merged
Conversation
graduta
added this pull request to stack #2265
October 20, 2026 13:02
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2270 +/- ##
==========================================
+ Coverage 46.39% 46.45% +0.05%
==========================================
Files 1051 1054 +3
Lines 17363 17379 +16
Branches 3161 3165 +4
==========================================
+ Hits 8056 8073 +17
+ Misses 9307 9306 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
graduta
removed this pull request from stack #2265
October 22, 2026 09:29
graduta
added this pull request to stack #2276
October 22, 2026 09:30
Base automatically changed from
feature/O2B-1623/docs-shift-data-endpoint
to
main
October 22, 2026 12:05
graduta
force-pushed
the
feature/O2B-1623/docs-simulation-passes-endpoints
branch
from
October 22, 2026 12:09
56653ef to
7ebbb0a
Compare
`SimulationPassService.getAll` queried the repository directly, including two inline sub-queries to filter on LHC periods and on data passes, while `getByIdentifier` and `getOneOrFail` already rely on small functions. It now uses `getAllSimulationPasses(qbConfiguration)` and the two functions returning the ids of the simulation passes linked to LHC periods (`getSimulationPassIdsByLhcPeriods`) and to data passes (`getSimulationPassIdsByDataPasses`, each id is returned once). The behaviour of the service is unchanged, and the three functions have their own tests.
The two handlers of the simulation passes controller disabled the JSDoc rules instead of describing their parameters and their result.
`GET /api/simulationPasses/:id` accepted any number (`0`, negative numbers, decimals) and answered with a 404. The id is now validated with `EntityIdDto`, so that invalid values are rejected with a 400, and an API test checks the four kinds of invalid ids.
graduta
force-pushed
the
feature/O2B-1623/docs-simulation-passes-endpoints
branch
from
October 22, 2026 12:20
7ebbb0a to
0fb89cf
Compare
…ation passes as numbers `filter[lhcPeriodIds]` and `filter[dataPassIds]` were validated as strings, although the ids of the LHC periods and of the data passes are integers in the database and the `ids` filter of the same endpoint (and the filters of the runs and of the data passes endpoints) are validated as numbers. A value that is not a number was accepted and answered with an empty list: it is now rejected with a 400, and the ids given as strings in the query are converted to numbers. An API test checks the three filters.
graduta
force-pushed
the
feature/O2B-1623/docs-simulation-passes-endpoints
branch
from
October 22, 2026 12:41
0fb89cf to
06fe873
Compare
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). The earlier PRs of the stack are merged: this one is rebased on
mainand regenerated with the current generator. The following PRs of the stack are rebased one by one, once the previous one is merged.Notable changes for users:
filter[lhcPeriodIds][]andfilter[dataPassIds][]ofGET /api/simulationPassesnow reject (400) a value that is not a number, instead of answering with an empty list (the ids given in the query are converted to numbers).GET /api/simulationPasses/{id}now rejects (400) an id that is not a positive integer (0, negative numbers, decimals), instead of answering with a 404.simulation passesendpoints are now documented at/api-docs, with parameters, responses andcurlexamples:GET /api/simulationPasses: paginated list with filters (ids, names, LHC periods, data passes) and sortingGET /api/simulationPasses/{id}: one simulation passNotable changes for developers:
createdAt/updatedAt, and the router references existing handlers.SimulationPassService.getAllqueried the repository directly (with two inline sub-queries) whilegetByIdentifierandgetOneOrFailuse small functions: it now usesgetAllSimulationPasses(qbConfiguration),getSimulationPassIdsByLhcPeriodsandgetSimulationPassIdsByDataPasses(each id returned once). The behaviour is unchanged and the three functions have tests. The other counted lists (DataPassService,LhcPeriodStatisticsService,LogService,QcFlagTypeService) still query the repository directly and could follow the same pattern.EntityIdDto(it was a plainJoi.number()), with an API test of the four kinds of invalid values.lhcPeriodIdsanddataPassIdsfilters are validated as numbers (they were strings, whereas the ids are integers in the database and theidsfilter of the same endpoint,RunFilterDtoand the data passes endpoint use numbers). An API test checks the three id filters.PageLimit,PageOffset,PageMeta) are added to the spec, as this is the first paginated endpoint documented.lib/server/api-docs/openapi.yamlis updated by hand,API.mdandindex.htmlare regenerated withnpm run docs:api(separate commit).filter[x][]parameters, which is what the Joi validation requires (a single value without[]is rejected). Adds the sharedSortOrderschema.Changes made to the database:
🤖 Generated with Claude Code