Skip to content

[O2B-1563] Create GAQ summary invalidation mechanism#2174

Open
isaachilly wants to merge 28 commits into
mainfrom
feature/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Open

[O2B-1563] Create GAQ summary invalidation mechanism#2174
isaachilly wants to merge 28 commits into
mainfrom
feature/O2B-1563/Create-GAQ-summary-invalidation-mechanism

Conversation

@isaachilly

Copy link
Copy Markdown
Collaborator

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:

  • N/A

Notable changes for developers:

  • A few areas, mostly to do with QC flags, now have an extra DB call.

Changes made to the database:

  • N/A

Will invalidate a GAQ summary row, if present or otherwise, if an identified trigger occurs (see JIRA ticket).

Simply calls a GAQ summary repository helper to create the invalidation from each triggers code.

Add GaqSummaryRepository and GaqSummaryInvalidationRepository and export them from the repositories index.

Update migration to replace the previous invalidated_at field with created_at and add updated_at to mirror default Sequelize tables.
Rename and change mcReproducible to be the coverage float not the boolean.
Add GAQ summary invalidation whenever underlying data affecting GAQ changes.

These changes ensure GAQ summary caches/records are marked for recomputation whenever detectors, QC flags, or run QC times that influence GAQ summaries are modified.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Validate GAQ summary invalidation behaviour on QC flag create/verify/delete, deleteAllForDataPass, explicit/default GAQ detector changes, and run QC time updates.
Add a calculation_failed boolean column to gaq_summaries. This allows us to know whether a summary has been attempted to be calculated but unsuccessful due to limited data etc.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Remove not-null constraints from several GAQ summary columns in the migration to allow NULL when values are unavailable.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Store invalidation timestamp directly on gaq_summaries instead of a separate gaq_summary_invalidations table.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Replace usage of GaqSummaryInvalidationRepository with GaqSummaryRepository across services and tests.

Upsert calls now set an invalidatedAt timestamp to mark GAQ summaries as invalidated.
Create an index on invalidated_at column of gaq_summaries table to improve query performance, as it is commonly used to fetch the invalidated summary queue.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
…already soft deleted

The simplest way of invalidating GAQ summaries affected by the deletion of a dataPass' Flags is to just take the list of deleted flags. But this is inefficient if some flags were already deleted and thus had already had their summaries at the time.
Sequelize model omitted the primaryKey that migration file defines.
…e/O2B-1563/Create-GAQ-summary-invalidation-mechanism
Extract invalidation into helpers.
Guard GAQ updateRun reload so don't run reload unnecessarily.
Add to notComputable field in model allowNull default params.
Add more test coverage for invalidation on run patch.
@isaachilly isaachilly self-assigned this Jun 19, 2026
@isaachilly isaachilly requested a review from graduta June 19, 2026 16:05
…invalidation-mechanism"

This reverts commit ce0ac8c, reversing
changes made to 9c1116b.
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.93548% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.94%. Comparing base (838e6a8) to head (ce0ac8c).

Files with missing lines Patch % Lines
lib/database/adapters/GaqSummaryAdapter.js 50.00% 3 Missing ⚠️
...ons/v1/20260223120000-create-gaq-summary-tables.js 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2174      +/-   ##
==========================================
- Coverage   45.82%   41.94%   -3.89%     
==========================================
  Files        1039     1043       +4     
  Lines       17189    17246      +57     
  Branches     3138     3144       +6     
==========================================
- Hits         7877     7233     -644     
- Misses       9312    10013     +701     

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

Comment thread lib/public/Model.js
this.home.bubbleTo(this);

this.lhcPeriods = new LhcPeriodsModel(this.router);
this.lhcPeriods = new LhcPeriodsModel(this);
Comment thread lib/public/Model.js
this.lhcPeriods.bubbleTo(this);

this.dataPasses = new DataPassesModel(this.router);
this.dataPasses = new DataPassesModel(this);
Comment thread lib/public/Model.js
this.qcFlags.bubbleTo(this);

this.simulationPasses = new SimulationPassesModel(this.router);
this.simulationPasses = new SimulationPassesModel(this);

try {
this._value = hasDateAndTime ? extractTimestampFromDateTimeInput(raw) : null;
this._value = raw.date && raw.time ? extractTimestampFromDateTimeInput(raw, { seconds: this._seconds }) : null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant