[O2B-1463] Refactor logic of detector fetching for RCT and hide legacy detector for periods passes 25 onwards - #2211
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2211 +/- ##
==========================================
- Coverage 46.23% 46.00% -0.24%
==========================================
Files 1039 1040 +1
Lines 17142 17163 +21
Branches 3124 3133 +9
==========================================
- Hits 7925 7895 -30
- Misses 9217 9268 +51 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Refactors how RCT detectors are fetched/derived across runs overview models and introduces logic intended to hide legacy detectors (CPV, PHS) starting from LHC25-period/data-pass labels.
Changes:
- Added
filterOutLegacyDetectorsForNewerPeriodsutility (and tests) to remove CPV/PHS for labels matching LHC25+. - Centralized detectors-observable construction in
RunsWithQcModelvia_setDetectorsObservable/_buildDetectorsObservable, and updated the three overview models to reuse it. - Updated utilities index exports to surface the new filtering helper.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/lib/utilities/stringUtils.test.js | Adds unit test coverage for the new legacy-detector filtering helper. |
| lib/utilities/stringUtils.js | Implements filterOutLegacyDetectorsForNewerPeriods and exports it. |
| lib/utilities/index.js | Re-exports the new helper from the utilities index. |
| lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js | Switches detectors handling to the shared observable builder + applies legacy-detector filtering. |
| lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js | Reuses the shared observable builder + applies legacy-detector filtering before type filtering. |
| lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js | Reuses the shared observable builder + applies legacy-detector filtering alongside existing CPASS filtering. |
| lib/public/views/Runs/Overview/RunsWithQcModel.js | Introduces shared detectors observable builder and makes detectors getter concrete. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
lib/public/views/Runs/Overview/RunsWithQcModel.js:273
RunsWithQcModel.detectorsnow silently initializes_detectors$toRemoteData.notAsked()when it hasn't been configured. This masks misconfiguration and prevents the default detector source (rctDetectorsProvider.qc$) from ever loading. Consider initializing via_setDetectorsObservable()so the default behavior is consistent and detectors will load when first accessed.
get detectors() {
if (!this._detectors$) {
this._detectors$ = new ObservableData(RemoteData.notAsked());
this._detectors$.bubbleTo(this);
}
return this._detectors$.getCurrent();
}
lib/public/utilities/filterOutLegacyDetectorsForNewerPeriods.js:22
- The JSDoc lists a
legacyDetectorNamesparameter, but the function signature does not accept it (the list is currently hard-coded inLEGACY_DETECTOR_NAMES_FOR_AFTER_25). This mismatch can mislead callers and tooling.
* @param {Detector[]} detectors detectors to filter
* @param {string} [label=''] name of the period or data pass
* @param {string[]} [legacyDetectorNames=['CPV', 'PHS']] detectors to remove for newer periods after LHC25
* @return {Detector[]} filtered detectors
I have a JIRA ticket
Notable changes for users:
Notable changes for developers:
Changes made to the database: