Skip to content

Commit f2b1296

Browse files
committed
Merge branch 'main' into hattinf/O2B-719/add-range-based-filtering-for-run-number
2 parents 83b8dd3 + 119a6f0 commit f2b1296

Some content is hidden

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

47 files changed

+872
-1121
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.4.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.4.0)
6+
* Notable changes for users:
7+
* Fixed tag color not being updated when switching to run details after updating a tag
8+
* Environment variable ENABLE_HOUSEKEEPING must be set to true (case-insensitive) to actually enable housekeeping
9+
* Use time range picker for runs start & stop filtering
10+
* Run details page has been modernized
11+
* Notable changes for developers:
12+
* Runs and QC flags timestamps now store milliseconds
13+
* Fixed users that start/stop runs not being extracted from kafka message
14+
* Fixed TF timestamps being ignored when creating QC flags
15+
* Fixed randomly failing test in FLP frontend tests
16+
* Use coalesced run time in raw SQL querries
17+
* Removed the max number of retries for kafka connection
18+
519
## [1.3.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.3.0)
620
* Notable changes for users:
721
* Fixed physical constants values which resulted in wrong AVG center of mass energy

database/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [1.4.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.4.0)
2+
* Changes made to the database
3+
* Following columns in runs table has been changed to Datetime(3):
4+
* time_o2_start
5+
* time_trg_start
6+
* first_tf_timestamp
7+
* last_tf_timestamp
8+
* time_trg_end
9+
* time_o2_end
10+
* Following columns in quality_control_flags table has been changed to Datetime(3):
11+
* from
12+
* to
13+
* created_at
14+
* updated_at
15+
* Following columns in quality_control_flag_effective_periods table has been changed to Datetime(3):
16+
* from
17+
* to
18+
* created_at
19+
* updated_at
20+
* Added two more virtual columns to runs, rct_time_start and rct_time_end that coalesce first/last TF timestamps with run start/stop
21+
122
## [1.3.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.3.0)
223
* Changes made to the database
324
* Fixed physical constants values in database

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ services:
2424
FLP_INFOLOGGER_URL: "${ALI_ECS_GUI_URL:-http://localhost:8081}"
2525
QC_GUI_URL: "${ALI_ECS_GUI_URL:-http://localhost:8082}"
2626
ALI_FLP_INDEX_URL: "${ALI_ECS_GUI_URL:-http://localhost:80}"
27-
CCDB_ENABLE_SYNCHRONIZATION: false
27+
CCDB_ENABLE_SYNCHRONIZATION: "${CCDB_ENABLE_SYNCHRONIZATION:-false}"
28+
CCDB_RUN_INFO_URL: "${CCDB_RUN_INFO_URL:-}"
2829
links:
2930
- database
3031
restart: unless-stopped

lib/application.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class BookkeepingApplication {
4848
const kafkaClient = new Kafka({
4949
clientId: 'bookkeeping',
5050
brokers: KafkaConfig.brokers,
51-
retry: { retries: 3 },
5251
logLevel: logLevel.NOTHING,
5352
});
5453

@@ -94,15 +93,9 @@ class BookkeepingApplication {
9493
const ccdbSynchronizer = new CcdbSynchronizer(ccdbConfig.runInfoUrl);
9594
this.scheduledProcessesManager.schedule(
9695
// Sync runs a few sync period ago in case some synchronization failed
97-
async () => {
98-
try {
99-
await ccdbSynchronizer.syncFirstAndLastTf(new Date(Date.now() - ccdbConfig.synchronizationPeriod * 5));
100-
} catch (e) {
101-
this._logger.errorMessage(`Failed to synchronize runs first and last TF:\n ${e.stack}`);
102-
}
103-
},
96+
() => ccdbSynchronizer.syncFirstAndLastTf(new Date(Date.now() - ccdbConfig.synchronizationPeriod * 5)),
10497
{
105-
wait: 3 * 1000,
98+
wait: 10 * 1000,
10699
every: ccdbConfig.synchronizationPeriod,
107100
},
108101
);

lib/config/services.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const {
2626
} = process.env ?? {};
2727

2828
exports.services = {
29-
enableHousekeeping: process.env?.ENABLE_HOUSEKEEPING ?? false,
29+
enableHousekeeping: process.env?.ENABLE_HOUSEKEEPING?.toLowerCase() === 'true',
3030
aliEcsGui: {
3131
url: process.env?.ALI_ECS_GUI_URL || null,
3232
token: process.env?.ALI_ECS_GUI_TOKEN || null,
@@ -64,7 +64,7 @@ exports.services = {
6464

6565
ccdb: {
6666
enableSynchronization: CCDB_ENABLE_SYNCHRONIZATION?.toLowerCase() === 'true',
67-
synchronizationPeriod: Number(CCDB_SYNCHRONIZATION_PERIOD) || 24 * 60 * 60 * 1000, // 1h in milliseconds
67+
synchronizationPeriod: Number(CCDB_SYNCHRONIZATION_PERIOD) || 24 * 60 * 60 * 1000, // 1d in milliseconds
6868
runInfoUrl: CCDB_RUN_INFO_URL,
6969
},
7070
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
const ADD_RUN_RCT_START_AND_STOP = `
4+
ALTER TABLE runs
5+
ADD COLUMN qc_time_start DATETIME(3) AS (COALESCE(first_tf_timestamp, time_trg_start, time_o2_start)) VIRTUAL AFTER time_start,
6+
ADD COLUMN qc_time_end DATETIME(3) AS (COALESCE(last_tf_timestamp, time_trg_end, time_o2_end)) VIRTUAL AFTER qc_time_start;
7+
`;
8+
9+
/** @type {import('sequelize-cli').Migration} */
10+
module.exports = {
11+
up: async (queryInterface) => queryInterface.sequelize.query(ADD_RUN_RCT_START_AND_STOP),
12+
13+
down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
14+
await queryInterface.removeColumn('runs', 'qc_time_start', { transaction });
15+
await queryInterface.removeColumn('runs', 'qc_time_end', { transaction });
16+
}),
17+
};

lib/database/repositories/QcFlagRepository.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -203,32 +203,17 @@ class QcFlagRepository extends Repository {
203203
GROUP_CONCAT(effectivePeriods.flagsList) AS flagsList,
204204
205205
IF(
206-
(
207-
COALESCE(run.time_trg_end, run.time_o2_end ) IS NULL
208-
OR COALESCE(run.time_trg_start, run.time_o2_start) IS NULL
209-
),
206+
run.time_start IS NULL OR run.time_end IS NULL,
210207
IF(
211-
SUM(
212-
COALESCE(effectivePeriods.\`to\` , 0)
213-
+ COALESCE(effectivePeriods.\`from\`, 0)
214-
) = 0,
208+
effectivePeriods.\`from\` IS NULL AND effectivePeriods.\`to\` IS NULL,
215209
1,
216210
null
217211
),
218212
SUM(
219-
COALESCE(
220-
effectivePeriods.\`to\`,
221-
UNIX_TIMESTAMP(run.time_trg_end),
222-
UNIX_TIMESTAMP(run.time_o2_end)
223-
)
224-
- COALESCE(
225-
effectivePeriods.\`from\`,
226-
UNIX_TIMESTAMP(run.time_trg_start),
227-
UNIX_TIMESTAMP(run.time_o2_start)
228-
)
213+
COALESCE(effectivePeriods.\`to\`, UNIX_TIMESTAMP(run.time_end))
214+
- COALESCE(effectivePeriods.\`from\`, UNIX_TIMESTAMP(run.time_start))
229215
) / (
230-
UNIX_TIMESTAMP(COALESCE(run.time_trg_end, run.time_o2_end))
231-
- UNIX_TIMESTAMP(COALESCE(run.time_trg_start, run.time_o2_start))
216+
UNIX_TIMESTAMP(run.time_end) - UNIX_TIMESTAMP(run.time_start)
232217
)
233218
) AS effectiveRunCoverage
234219

lib/public/views/Runs/Details/editTagsPanel.js renamed to lib/public/components/Filters/RunsFilter/o2StartFilter.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
import { h } from '/js/src/index.js';
15-
import { tagPicker } from '../../../components/tag/tagPicker.js';
14+
import { timeRangeFilter } from '../common/filters/timeRangeFilter.js';
1615

1716
/**
18-
* A panel containing:
19-
* a list of potential tags to add to a RUN
20-
* a button to update the tag selection
21-
* @param {RunDetailsModel} runDetailsModel the details model
22-
* @return {vnode} virtual node with representation of the panel
17+
* Returns a filter to be applied on run start
18+
*
19+
* @param {RunsOverviewModel} runsOverviewModel the run overview model object
20+
* @return {Component} the filter component
2321
*/
24-
export const editTagsPanel = (runDetailsModel) => h(
25-
'#tags-selection.flex-column.w-30.p2.g2',
26-
tagPicker(runDetailsModel.editionTagPickerModel),
27-
);
22+
export const o2StartFilter = (runsOverviewModel) => timeRangeFilter(runsOverviewModel.o2StartFilterModel);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
import { timeRangeFilter } from '../common/filters/timeRangeFilter.js';
14+
15+
/**
16+
* Returns a filter to be applied on run stop
17+
*
18+
* @param {RunsOverviewModel} runsOverviewModel the run overview model object
19+
* @return {Component} the filter component
20+
*/
21+
export const o2StopFilter = (runsOverviewModel) => timeRangeFilter(runsOverviewModel.o2stopFilterModel);

lib/public/components/Filters/RunsFilter/o2start.js

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)