Skip to content

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

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

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

Conversation

@isaachilly

@isaachilly isaachilly commented Jun 19, 2026 •

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:

  • GAQ summaries are now marked as invalidated (gaq_summaries.invalidated_at) whenever what they are computed from changes. Nothing reads or recomputes them yet, that comes in the next PRs
  • Triggers, each in the transaction of the write:
    • QC flags of a data pass are created, deleted (one or all of the data pass) or verified for the first time (QcFlagService)
    • GAQ detectors of a run in a data pass are set or reset to the default ones (GaqDetectorsService)
    • The QC time of a run changes, i.e. a patch of a field feeding qc_time_start / qc_time_end actually changes them (updateRun)
  • Invalidation is done once per batch, not once per flag: creating many QC flags (with or without verify) invalidates the summary once. A batch where nothing could be written does not invalidate
  • New GaqSummaryRepository.invalidate and invalidateMany. invalidateMany writes all rows with a single deduplicated and sorted statement (INSERT ... ON DUPLICATE KEY UPDATE), so concurrent invalidations lock rows in the same order
  • Repository.insertAll accepts an optional options parameter passed to bulkCreate
  • QcFlagService.verifyFlag has a new option invalidateGaqSummary (default true), used by create to invalidate once for the batch
  • QcFlagService.deleteAllForDataPass now ignores flags that are already deleted, so deletedCount of DELETE /api/qcFlags/perDataPass no longer counts them
  • Known limitation (documented in the model and in QcFlagTypeService): changing bad of a QC flag type does not invalidate the summaries of flags of this type
  • Tests: GaqSummary suite rewritten to be independent of seeded data, with new cases for batches, verify, no-op creations, simulation and synchronous flags, deleteAllForDataPass and invalidateMany. The API test for deletedCount is computed from the data

Changes made to the database:

  • N/A

@isaachilly isaachilly self-assigned this Jun 19, 2026
@isaachilly
isaachilly requested a review from graduta June 19, 2026 16:05
@codecov

codecov Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.17%. Comparing base (c89cd52) to head (54ab039).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2174      +/-   ##
==========================================
+ Coverage   46.05%   46.17%   +0.11%     
==========================================
  Files        1074     1074              
  Lines       17641    17678      +37     
  Branches     3263     3274      +11     
==========================================
+ Hits         8125     8163      +38     
+ Misses       9516     9515       -1     

☔ 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 Fixed
Comment thread lib/public/Model.js Fixed
Comment thread lib/public/Model.js Fixed
@graduta
graduta force-pushed the feature/O2B-1563/Create-GAQ-summary-invalidation-mechanism branch from 467630a to 807d9da Compare December 2, 2026 10:20

This branch has not been deployed

No deployments
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.

2 participants