Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Assert that previously significant run stays significant #36

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions runregistry_backend/cron/3.calculate_rr_attributes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const assert = require('assert').strict;
const appendToAllAttributes = require('append-to-all-attributes');
const {
getComponentsIncludedBooleans,
Expand Down Expand Up @@ -61,6 +62,14 @@ exports.calculate_updated_rr_run_attributes = async (
oms_lumisections
);

// Make sure that if for some reason lumisections disappear
// and the run is no longer significant, we don't mess up the run information.
// TODO: This is probably not the best place to do this check
if (run_was_previously_significant) {
assert.deepStrictEqual(rr_run_attributes.significant && oms_lumisections.length !== 0, true,
`Run ${oms_run_attributes.run_number} would no longer be deemed significant`)
}

return rr_run_attributes;
};

Expand Down