Skip to content

Commit ce0ac8c

Browse files
authored
Merge branch 'main' into feature/O2B-1563/Create-GAQ-summary-invalidation-mechanism
2 parents 9c1116b + 838e6a8 commit ce0ac8c

170 files changed

Lines changed: 4957 additions & 4642 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @graduta
2+
* @isaachilly

.github/workflows/bookkeeping.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
parallel_tests:
1519
name: ${{ matrix.test_type }}
@@ -39,7 +43,7 @@ jobs:
3943
steps:
4044
- uses: actions/checkout@v6
4145
- name: Set up Docker
42-
uses: docker/setup-buildx-action@v3
46+
uses: docker/setup-buildx-action@v4
4347
- name: Create Coverage Directory
4448
run: mkdir -p ${{ github.workspace }}/coverage
4549

@@ -71,7 +75,7 @@ jobs:
7175
env:
7276
TEST_TYPE: ${{ matrix.test_type }}
7377
- name: Upload Coverage to Codecov
74-
uses: codecov/codecov-action@v5
78+
uses: codecov/codecov-action@v6
7579
with:
7680
files: ./coverage/lcov.info
7781
env:

.github/workflows/docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
linter:
1418
runs-on: ubuntu-latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apk add --no-cache \
2222
freetype=2.13.2-r0 \
2323
freetype-dev=2.13.2-r0 \
2424
harfbuzz=8.5.0-r0 \
25-
ca-certificates=20250911-r0
25+
ca-certificates=20260413-r0
2626

2727
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
2828
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
'use strict';
15+
16+
/** @type {import('sequelize-cli').Migration} */
17+
module.exports = {
18+
up: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
19+
await queryInterface.addIndex('quality_control_flags', {
20+
name: 'quality_control_flags_run_detector_idx',
21+
fields: ['run_number', 'detector_id'],
22+
}, { transaction });
23+
}),
24+
25+
down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
26+
await queryInterface.removeIndex('quality_control_flags', 'quality_control_flags_run_detector_idx', { transaction });
27+
}),
28+
};

lib/database/seeders/20240404100811-qc-flags.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,21 @@ module.exports = {
281281
created_at: '2024-08-12 12:00:10',
282282
updated_at: '2024-08-12 12:00:10',
283283
},
284+
{
285+
id: 103,
286+
deleted: true,
287+
from: null,
288+
to: '2019-08-08 20:50:00',
289+
comment: 'deleted flag',
290+
291+
run_number: 56,
292+
flag_type_id: 13, // Bad
293+
created_by_id: 2,
294+
detector_id: 7, // FT0
295+
296+
created_at: '2024-08-12 12:00:15',
297+
updated_at: '2024-08-12 12:00:15',
298+
},
284299

285300
// Run : 56, ITS
286301
{
@@ -394,6 +409,12 @@ module.exports = {
394409
from: '2019-08-08 20:50:00',
395410
to: null,
396411
},
412+
{
413+
id: 103,
414+
flag_id: 103,
415+
from: null,
416+
to: '2019-08-08 20:50:00',
417+
},
397418

398419
// Run : 56, ITS
399420
{

lib/domain/dtos/GetAllLogsDto.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,25 @@ const PaginationDto = require('./PaginationDto');
1717
const { CustomJoi } = require('./CustomJoi.js');
1818
const { TagsFilterDto } = require('./filters/TagsFilterDto.js');
1919
const { FromToFilterDto } = require('./filters/FromToFilterDto.js');
20-
const { EnvironmentsFilterDto } = require('./filters/EnvironmentsFilterDto');
2120

22-
const RunFilterDto = Joi.object({
23-
values: CustomJoi.stringArray().items(EntityIdDto).single().required(),
24-
operation: Joi.string().valid('and', 'or').required(),
25-
});
26-
27-
const LhcFillFilterDto = Joi.object({
28-
values: CustomJoi.stringArray().items(EntityIdDto).single().required(),
29-
operation: Joi.string().valid('and', 'or').required(),
30-
});
21+
const RunFilterDto = CustomJoi.stringArray().items(EntityIdDto).single();
22+
const EnvironmentsFilterDto = CustomJoi.stringArray().items(Joi.string()).single();
23+
const LhcFillFilterDto = CustomJoi.stringArray().items(EntityIdDto).single();
3124

3225
const FilterDto = Joi.object({
3326
title: Joi.string().trim(),
3427
content: Joi.string().trim(),
3528
author: Joi.string().trim(),
3629
created: FromToFilterDto,
3730
tags: TagsFilterDto,
38-
lhcFills: LhcFillFilterDto,
39-
run: RunFilterDto,
31+
fillNumbers: LhcFillFilterDto,
32+
runNumbers: RunFilterDto,
4033
origin: Joi.string()
4134
.valid('human', 'process'),
4235
parentLog: EntityIdDto,
4336
rootLog: EntityIdDto,
4437
rootOnly: Joi.boolean(),
45-
environments: EnvironmentsFilterDto,
38+
environmentIds: EnvironmentsFilterDto,
4639
});
4740

4841
const SortDto = Joi.object({

lib/domain/dtos/filters/RunFilterDto.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,27 @@ exports.RunFilterDto = Joi.object({
8888
inelasticInteractionRateAtEnd: FloatComparisonDto,
8989

9090
gaq: Joi.object({
91-
notBadFraction: FloatComparisonDto.when(
92-
'dataPassIds',
93-
{
94-
is: Joi.array().length(1),
95-
then: FloatComparisonDto,
96-
otherwise: Joi.forbidden().error(new Error('Filtering by GAQ is enabled only when filtering with one dataPassId')),
97-
},
98-
),
91+
notBadFraction: FloatComparisonDto.custom((value, helpers) => {
92+
const [, { dataPassIds }] = helpers.state.ancestors;
93+
94+
if (!dataPassIds || dataPassIds.length !== 1) {
95+
return helpers.message('Filtering by GAQ is enabled only when filtering with one dataPassId');
96+
}
97+
98+
return value;
99+
}),
99100
mcReproducibleAsNotBad: Joi.boolean().optional(),
100101
}),
101102

102-
detectorsQc: Joi.object()
103+
detectorsQcNotBadFraction: Joi.object()
103104
.pattern(
104105
Joi.string().regex(/^_\d+$/), // Detector id with '_' prefix
105-
Joi.object({ notBadFraction: FloatComparisonDto }),
106+
FloatComparisonDto,
106107
)
107108
.keys({
108109
mcReproducibleAsNotBad: Joi.boolean().optional(),
109110
})
110-
.custom((detectorsQcObj, helpers) => {
111+
.custom((detectorsQcNotBadFractionObj, helpers) => {
111112
const [{ dataPassIds, simulationPassIds, lhcPeriodIds }] = helpers.state.ancestors;
112113

113114
singleRunsCollectionCustomCheck(
@@ -117,6 +118,6 @@ exports.RunFilterDto = Joi.object({
117118
'the dataPassIds, simulationPassIds and lhcPeriodIds filters collectively contain exactly one ID',
118119
);
119120

120-
return detectorsQcObj;
121+
return detectorsQcNotBadFractionObj;
121122
}),
122123
});

lib/domain/enums/NonPhysicsProductionsNamesWords.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ const NonPhysicsProductionsNamesWords = Object.freeze({
2323
module.exports.NonPhysicsProductionsNamesWords = NonPhysicsProductionsNamesWords;
2424

2525
module.exports.NON_PHYSICS_PRODUCTIONS_NAMES_WORDS = Object.values(NonPhysicsProductionsNamesWords);
26+
27+
module.exports.NON_PHYSICS_PRODUCTIONS_NAMES_TOTAL_LENGTH = Object.values(NonPhysicsProductionsNamesWords).join(',').length;

lib/public/Model.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,27 @@ export default class Model extends Observable {
9595
this._appConfiguration$ = new Observable();
9696
this._inputDebounceTime = INPUT_DEBOUNCE_TIME;
9797

98+
// Setup router
99+
this.router = new QueryRouter();
100+
this.router.observe(this.handleLocationChange.bind(this));
101+
this.router.bubbleTo(this);
102+
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));
103+
98104
// Models
99105

100106
this.home = new HomePageModel(this);
101107
this.home.bubbleTo(this);
102108

103-
this.lhcPeriods = new LhcPeriodsModel(this);
109+
this.lhcPeriods = new LhcPeriodsModel(this.router);
104110
this.lhcPeriods.bubbleTo(this);
105111

106-
this.dataPasses = new DataPassesModel(this);
112+
this.dataPasses = new DataPassesModel(this.router);
107113
this.dataPasses.bubbleTo(this);
108114

109115
this.qcFlags = new QcFlagsModel(this);
110116
this.qcFlags.bubbleTo(this);
111117

112-
this.simulationPasses = new SimulationPassesModel(this);
118+
this.simulationPasses = new SimulationPassesModel(this.router);
113119
this.simulationPasses.bubbleTo(this);
114120

115121
this.qcFlagTypes = new QcFlagTypesModel(this);
@@ -178,12 +184,6 @@ export default class Model extends Observable {
178184
this.errorModel = new ErrorModel();
179185
this.errorModel.bubbleTo(this);
180186

181-
// Setup router
182-
this.router = new QueryRouter();
183-
this.router.observe(this.handleLocationChange.bind(this));
184-
this.router.bubbleTo(this);
185-
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));
186-
187187
// Init pages
188188
this.handleLocationChange();
189189
this.window.addEventListener('resize', debounce(() => this.notify(), 100));

0 commit comments

Comments
 (0)