Skip to content

[O2B-1528] Split GAQ summary requests#2071

Open
isaachilly wants to merge 12 commits intomainfrom
improv/O2B-1528/Split-GAQ-summary-requests
Open

[O2B-1528] Split GAQ summary requests#2071
isaachilly wants to merge 12 commits intomainfrom
improv/O2B-1528/Split-GAQ-summary-requests

Conversation

@isaachilly
Copy link
Collaborator

@isaachilly isaachilly commented Feb 3, 2026

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

Notable changes for users:

  • GAQ Summary re-enabled with sequential loading of each summary in the table

Notable changes for developers:

  • N/A

Changes made to the database:

  • N/A

Replace misspelled parameter `verifiedd_flags_list` with the correct `verified_flags_list` in QcFlagRepository.
Remove incorrect/duplicated identifier `verifiedd_flags_list` from the destructuring and mapping in QcFlagRepository.
Add optional runNumber filtering for GAQ summaries.

Controller validation and handler accept runNumber query param and pass it to GaqService; GaqService forwards runNumber to QcFlagRepository and unwraps a single-run summary when requested.

RunsPerDataPassOverviewModel tracks per-run RemoteData in _gaqSummary$, fetches GAQ summaries for visible runs, and RunsPerDataPassOverviewPage renders loading/success/failure states.

These changes enable fetching and displaying GAQ data scoped to individual runs to reduce load and improve UX.
Make GAQ summary fetches run sequentially so to ease reduce load on the database.
…se load

Make runNumber a required Joi parameter to prevent user stressing the database fetching data for all runs of a dataPass.

Intended to be reverted once database query has been optimised.
Tighten Joi validation for GAQ summary by requiring dataPassId and runNumber to be positive numbers.
Adjust the runsPerDataPass overview test to match updated row and expected GAQ values.
Update qcFlags GAQ summary tests to include runNumber and strengthen request validation coverage.
@isaachilly isaachilly self-assigned this Feb 3, 2026
@isaachilly isaachilly added frontend javascript Pull requests that update Javascript code labels Feb 3, 2026
@isaachilly isaachilly changed the title Improv/o2 b 1528/split gaq summary requests [O2B-1528] Split GAQ summary requests Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 19.67213% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.62%. Comparing base (aeea2c4) to head (e6e6388).

Files with missing lines Patch % Lines
...uns/RunPerDataPass/RunsPerDataPassOverviewModel.js 0.00% 36 Missing ⚠️
...Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2071      +/-   ##
==========================================
+ Coverage   45.55%   45.62%   +0.06%     
==========================================
  Files        1031     1031              
  Lines       17196    17249      +53     
  Branches     3129     3136       +7     
==========================================
+ Hits         7834     7870      +36     
- Misses       9362     9379      +17     

☔ View full report in Codecov by Sentry.
📢 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.

Use RemoteDataSource and AbortController to make per-run GAQ summary fetches cancelable.

Can be easily adapted to use an array of remotedatasources if in the future we decide to request them in parallel.
When updating the GAQ summary for a run, store the actual success payload instead of the raw remoteData object.
Add a test that captures outgoing GAQ summary requests and asserts each run triggers exactly one GAQ request.
@isaachilly isaachilly marked this pull request as ready for review February 4, 2026 15:36
@isaachilly isaachilly requested a review from graduta as a code owner February 4, 2026 15:36
try {
await this._fetchGaqSummary(runNumber);
} catch {
if (signal.aborted) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this last check is needed. Additionally, you might want to print some kind of warning about the run number that was aborted

Copy link
Collaborator Author

@isaachilly isaachilly Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. remoteDataSource will handle any errors internally without re-throwing so we can remove this try/catch.

Regarding printing a warning, the requests will only be aborted when a user does something to remove the table, I.E change page, change pagination etc. I think in these situations the user does not need to know the past data was aborted.

* @return {Promise<GaqSummary>} Resolves with the GAQ Summary
*/
async getSummary(dataPassId, { mcReproducibleAsNotBad = false } = {}) {
async getSummary(dataPassId, { mcReproducibleAsNotBad = false, runNumber } = {}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataPassId is not documented

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate? If you mean in terms of the JSDoc then it is there, at the top.

* @return {Promise<GaqSummary>} Resolves with the GAQ Summary
*/
async getSummary(dataPassId, { mcReproducibleAsNotBad = false } = {}) {
async getSummary(dataPassId, { mcReproducibleAsNotBad = false, runNumber } = {}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you name runNumber something different, to differentiate it from the runNumber you're using in the map function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I agree.

Copy link
Collaborator

@NarrowsProjects NarrowsProjects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like you to rename the arguments of getSummary() in GaqService, and i'd like you to reconsider the last signal.aborted check inside _fetchGaqSummaryForCurrentRuns() in RunsPerDataPassOverviewModel

this._markAsSkimmableRequestResult$ = new ObservableData(RemoteData.notAsked());
this._markAsSkimmableRequestResult$.bubbleTo(this);

this._gaqSummary$ = new ObservableData({});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you use observable data, you can already tell it what the source to look for is rather than doing it on L82

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how to use it with the asynchronous nature of the summaries.

this._gaqSummary$ = new ObservableData({});
this._gaqSummary$.bubbleTo(this);

this._gaqSummarySource = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, implies that all the time we will want a sequence in requests but in reality, as soon as we improve the back-end SQL we will want to have all these in parallel. The proposed code design does not allow that.
I would propose that we start with a parallel design in mind already (e.g. using a Map to keep al sources) so that we can quickly migrate to it afterwards

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I originally added this because I was doing it in parallel at the start but removed given we thought best to do in sequence for now. I can add back.

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

Labels

frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

3 participants