-
Notifications
You must be signed in to change notification settings - Fork 14
[OGUI-1840 & OGUI-1841] Refactor the response object of retrieveRunStatus
#3229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graduta
merged 7 commits into
dev
from
feature/QCG/OGUI-1840/Refactor-the-response-object-of-retrieveRunStatus
Dec 17, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
95e0352
Refactor the response object of `retrieveRunStatus` and rename it to …
hehoon e9be197
Add and use BookkeepingDto.js
hehoon c160e01
Remove unused variable
hehoon cf3ece5
Add typedef for RunInformation
hehoon c00ecc3
Rename `detectorQualities` to `detectorsQualities` and add default va…
hehoon c9b0c8b
Add a test to validate whether the run information endpoint returns t…
hehoon 35f42ec
Merge branch 'dev' into feature/QCG/OGUI-1840/Refactor-the-response-o…
graduta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| * All rights not expressly granted are reserved. | ||
| * | ||
| * This software is distributed under the terms of the GNU General Public | ||
| * License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| /** | ||
| * Quality information for a single detector participating in the run. | ||
| * @typedef {object} DetectorQuality | ||
| * @property {number} id - Unique detector identifier. | ||
| * @property {string} name - The name (abbreviation) of the detector. | ||
| * @property {string} quality - Quality flag or classification for the detector. | ||
| */ | ||
|
|
||
| /** | ||
| * Bookkeeping run information. | ||
| * @typedef {object} RunInformation | ||
| * @property {RunStatus} runStatus - Custom status for front-end consumption: | ||
| * - ONGOING: run is currently ongoing | ||
| * - ENDED: run has completed (timeO2End is present) | ||
| * - NOT_FOUND: run data does not exist | ||
| * - UNKNOWN: error occurred or data unavailable | ||
| * @property {number} startTime - Time (epoch) at which the run started. | ||
| * @property {number|undefined} endTime - Time (epoch) at which the run ended. If `undefined`, the run hasn't ended yet. | ||
| * @property {number|undefined} environmentId - Partition/environment the run belongs to. | ||
| * @property {string|undefined} definition - The definition of the run. | ||
| * @property {string} runQuality - Overall run quality. | ||
| * @property {string|undefined} lhcBeamMode - LHC beam mode during which the run was taken, if any. | ||
| * @property {DetectorQuality[]} detectorsQualities - Per-detector quality information. | ||
| */ | ||
|
|
||
| /** | ||
| * Wrapped Run Status object | ||
| * @typedef {object} WrappedRunStatus | ||
| * @property {RunStatus} runStatus - The Run Status | ||
| */ | ||
|
|
||
| /** | ||
| * Wraps a given run status value into a standardized result object. | ||
| * Use this helper when you need to return only a `runStatus` field without any | ||
| * additional payload. This ensures that all callers receive a consistent | ||
| * object shape, matching the structure returned by `retrieveRunInformation`. | ||
| * @param {RunStatus} runStatus The run status to wrap. Must be a valid `RunStatus` enum value. | ||
| * @returns {WrappedRunStatus} A simple object containing only the provided `runStatus`. | ||
| */ | ||
| export function wrapRunStatus(runStatus) { | ||
| return { runStatus }; | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that Bookkeeping service is now returning more information, your tests should also be testing that.
Try to update the mock responses with fields that are not to be used so that you test here that your method only keeps fields that are intended