Repository navigation
Conversation
graduta
added this pull request to stack #2265
October 20, 2026 13:04
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2271 +/- ##
==========================================
+ Coverage 46.45% 46.54% +0.08%
==========================================
Files 1054 1057 +3
Lines 17379 17404 +25
Branches 3165 3174 +9
==========================================
+ Hits 8073 8100 +27
+ Misses 9306 9304 -2 ☔ 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-simulation-passes-endpoints
to
main
October 22, 2026 12:53
`lib/server/services/period/getOrCreateLhcPeriod.js` was a copy of `lib/server/services/lhcPeriod/getOrCreateLhcPeriod.js`, which is the one used by `RunService`, by the MonAlisa synchronizer and by the tests. Nothing required the copy: the only thing it had more was a `LhcPeriodIdentifier` typedef that `LhcPeriodStatisticsService` already defines.
The controller disabled the JSDoc rules for the whole file: its two handlers now describe their parameters and their result. The documentation of `getOrCreateLhcPeriod` described a run type, it describes the LHC period.
`LhcPeriodStatisticsService` queried the repository directly, including an inline sub-query to filter on PDP beam types. It now relies on small functions: `getLhcPeriodStatistics` and `getLhcPeriodStatisticsOrFail` (find by id or name), `getAllLhcPeriodStatistics(qbConfiguration)` and `getLhcPeriodStatisticsIdsByPdpBeamTypes` (each id returned once), and `prepareQueryBuilder` can reuse an existing query builder. The behaviour is unchanged (the not found message and the `BadParameterError` stay the same), and the four functions have their own tests. This also fixes a `&` used instead of `&&` in the check of the id, and the documentation of the service that described a run type.
…r entity ids `GET /api/lhcPeriodsStatistics/:lhcPeriodId` 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.
…API specification
… statistics endpoints
graduta
force-pushed
the
feature/O2B-1623/docs-lhc-periods-statistics-endpoints
branch
from
October 22, 2026 12:58
c43d848 to
ec34926
Compare
2 of 4 tasks
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). The earlier PRs of the stack are merged: this one is rebased on
mainand regenerated with the current generator. It is the last PR of the stack.Notable changes for users:
GET /api/lhcPeriodsStatistics/{lhcPeriodId}now rejects (400) an id that is not a positive integer (0, negative numbers, decimals), instead of answering with a 404.LHC periods statisticsendpoints are now documented at/api-docs, with parameters, responses andcurlexamples:GET /api/lhcPeriodsStatistics: paginated list with filters (ids, names, years, PDP beam types) and sortingGET /api/lhcPeriodsStatistics/{lhcPeriodId}: statistics of one LHC periodNotable changes for developers:
createdAt/updatedAt, and the router references existing handlers.LhcPeriodStatisticsServicequeried the repository directly (with an inline sub-query for the PDP beam types) and has no small functions: it now usesgetLhcPeriodStatistics,getLhcPeriodStatisticsOrFail,getAllLhcPeriodStatistics(qbConfiguration)andgetLhcPeriodStatisticsIdsByPdpBeamTypes(each id returned once), andprepareQueryBuildercan reuse an existing query builder. The behaviour is unchanged (same not found message, sameBadParameterError) and the four functions have tests. A&used instead of&&in the check of the id is fixed.lib/server/services/period/getOrCreateLhcPeriod.js: an unused copy oflib/server/services/lhcPeriod/getOrCreateLhcPeriod.js(nothing required it).getOrCreateLhcPeriodand ofgetLhcPeriod, copied from the run types and the logs, describes LHC periods.EntityIdDto(it was a plainJoi.number()), with an API test of the four kinds of invalid values.lib/server/api-docs/openapi.yamlis updated by hand,API.mdandindex.htmlare regenerated withnpm run docs:api(separate commit).Changes made to the database:
🤖 Generated with Claude Code