From b4a63a9a7734802446317314db4ecb1ff2701fa4 Mon Sep 17 00:00:00 2001 From: CollinHva <70367582+CollinHva@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:18:10 +0100 Subject: [PATCH] Main into this branch (contains subtask 2) (#1314) * Release 0.75.0 (#1305) * [O2B-1092] add migration file (#1313) * add migration file * add model, fix outputsize type * add typedef * rename * [O2B-883]: Add bold continuous/dashed line for detector quality in overview (#1293) * Overview of runs now show quality by using a line under them in green(continous) /red(dotted) * [O2B-1096] Fix run-overview to run-details navigation link (#1311) * fix issue in which all run parameters were passed to the URL when navigating from run-overview to run-details * [O2B-1097] Display environments IDs in white in envs-overview page (#1312) * [O2B-1095] Fix log's attachment token passed parameter (#1306) * Bump umzug from 3.4.0 to 3.5.0 (#1309) Bumps [umzug](https://github.com/sequelize/umzug) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/sequelize/umzug/releases) - [Changelog](https://github.com/sequelize/umzug/blob/main/CHANGELOG.md) - [Commits](https://github.com/sequelize/umzug/compare/v3.4.0...v3.5.0) --- updated-dependencies: - dependency-name: umzug dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump the dev-dependencies group with 2 updates (#1310) Bumps the dev-dependencies group with 2 updates: [eslint](https://github.com/eslint/eslint) and [puppeteer](https://github.com/puppeteer/puppeteer). Updates `eslint` from 8.55.0 to 8.56.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0) Updates `puppeteer` from 21.5.2 to 21.6.1 - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.5.2...puppeteer-v21.6.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: puppeteer dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: George Raduta * [O2B-926] Added switch button to overview for PHYSICS filter (#1303) Co-authored-by: Menno Konijn Co-authored-by: George Raduta * [O2B-1085] update proto files and grpc run controller with new user struct (#1304) --------- Signed-off-by: dependabot[bot] Co-authored-by: Martin Boulais <31805063+martinboulais@users.noreply.github.com> Co-authored-by: xsalonx <65893715+xsalonx@users.noreply.github.com> Co-authored-by: mennokonijn <99171568+mennokonijn@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: George Raduta Co-authored-by: Menno Konijn --- CHANGELOG.md | 15 ++ docs/get-started.md | 2 +- .../20231211080706-create-data-passes.js | 52 ++++++ lib/database/models/dataPass.js | 51 ++++++ lib/database/models/index.js | 2 + lib/database/models/lhcPeriod.js | 1 + .../models/typedefs/SequelizeDataPass.js | 23 +++ lib/public/app.css | 3 + .../Filters/RunsFilter/definitionFilter.js | 3 +- .../Filters/RunsFilter/runNumber.js | 2 +- .../identifierColumnAndActionsDropdown.js | 2 +- lib/public/domain/enums/RunDefinition.js | 2 + .../Logs/Details/logTreeViewComponent.js | 2 +- .../Runs/ActiveColumns/runsActiveColumns.js | 12 +- .../views/Runs/Overview/RunsOverviewPage.js | 14 +- .../views/Runs/Overview/showPhysicsButton.js | 29 ++++ .../Runs/format/formatRunDetectorsInline.js | 48 ++++++ package-lock.json | 157 +++++++++--------- package.json | 8 +- proto/common.proto | 5 +- proto/run.proto | 6 + 21 files changed, 337 insertions(+), 102 deletions(-) create mode 100644 lib/database/migrations/20231211080706-create-data-passes.js create mode 100644 lib/database/models/dataPass.js create mode 100644 lib/database/models/typedefs/SequelizeDataPass.js create mode 100644 lib/public/views/Runs/Overview/showPhysicsButton.js create mode 100644 lib/public/views/Runs/format/formatRunDetectorsInline.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c4029e3fd..5441b855f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ 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. +## [0.75.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%400.75.0) +* Notable changes for users: + * Added run per Period view + * The run number filter has been put back in place after being accidentally removed + * Fixed error displayed when deleting environment filter on logs overview + * A margin has been added between the popover and the screen edges + * Missing dates on the LHC overview pages are now shown to the user as '-' instead of 01/01/1970 01:00:00 + * The LHC Periods page filter button is now styled in the same way as other pages + * Clicking in popover keep the scroll in place +* Notable change for developers: + * Refactored LogsModel, extracted overview to separate class + * Created separate model for Home page + * Reduce number of request of RunsOverviewModel + * Added getOrCreate function to UserService replacing the CreateOrUpdateUser use case and cleaned the user authentication code + ## [0.74.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%400.74.0) * Notable changes for users: diff --git a/docs/get-started.md b/docs/get-started.md index bf3e5562b4..de50a0289a 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -26,7 +26,7 @@ Use the npm script (the `docker-compose` command must be available to npm) npm run docker-run ``` -You will then see in this tabs the server's log +You will then see in these tabs the server's log ### Run seeders diff --git a/lib/database/migrations/20231211080706-create-data-passes.js b/lib/database/migrations/20231211080706-create-data-passes.js new file mode 100644 index 0000000000..e265a34398 --- /dev/null +++ b/lib/database/migrations/20231211080706-create-data-passes.js @@ -0,0 +1,52 @@ +'use strict'; + +/** @type {import('sequelize-cli').Migration} */ +module.exports = { + up: async (queryInterface, Sequelize) => queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.createTable('data_passes', { + id: { + type: Sequelize.INTEGER, + allowNull: false, + primaryKey: true, + autoIncrement: true, + }, + name: { + type: Sequelize.STRING, + allowNull: false, + }, + description: { + type: Sequelize.TEXT, + }, + output_size: { + type: Sequelize.BIGINT, + }, + reconstructed_events_count: { + type: Sequelize.INTEGER, + }, + last_run_number: { + type: Sequelize.INTEGER, + }, + lhc_period_id: { + type: Sequelize.INTEGER, + references: { + model: 'lhc_periods', + key: 'id', + }, + }, + created_at: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + }, + updated_at: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + }, + }, { transaction }); + }), + + down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.dropTable('data_passes', { transaction }); + }), +}; diff --git a/lib/database/models/dataPass.js b/lib/database/models/dataPass.js new file mode 100644 index 0000000000..b0adff92d8 --- /dev/null +++ b/lib/database/models/dataPass.js @@ -0,0 +1,51 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +const Sequelize = require('sequelize'); + +module.exports = (sequelize) => { + const DataPass = sequelize.define( + 'DataPass', + { + id: { + type: Sequelize.INTEGER, + allowNull: false, + primaryKey: true, + autoIncrement: true, + }, + name: { + type: Sequelize.STRING, + allowNull: false, + }, + description: { + type: Sequelize.TEXT, + }, + outputSize: { + type: Sequelize.BIGINT, + }, + reconstructedEventsCount: { + type: Sequelize.INTEGER, + }, + lastRunNumber: { + type: Sequelize.INTEGER, + }, + }, + { tableName: 'data_passes' }, + ); + + DataPass.associate = (models) => { + DataPass.belongsTo(models.LhcPeriod, { foreignKey: 'lhcPeriodId', as: 'lhcPeriod' }); + }; + + return DataPass; +}; diff --git a/lib/database/models/index.js b/lib/database/models/index.js index a9ad4d39fe..5fd94432e6 100644 --- a/lib/database/models/index.js +++ b/lib/database/models/index.js @@ -36,6 +36,7 @@ const Tag = require('./tag'); const User = require('./user'); const LhcPeriod = require('./lhcPeriod'); const LhcPeriodStatistics = require('./lhcPeriodsStatistics'); +const DataPass = require('./dataPass.js'); module.exports = (sequelize) => { const models = { @@ -64,6 +65,7 @@ module.exports = (sequelize) => { User: User(sequelize), LhcPeriod: LhcPeriod(sequelize), LhcPeriodStatistics: LhcPeriodStatistics(sequelize), + DataPass: DataPass(sequelize), }; Object.entries(models).forEach(([_key, model]) => { diff --git a/lib/database/models/lhcPeriod.js b/lib/database/models/lhcPeriod.js index 369d90d474..d089670b3a 100644 --- a/lib/database/models/lhcPeriod.js +++ b/lib/database/models/lhcPeriod.js @@ -33,6 +33,7 @@ module.exports = (sequelize) => { LhcPeriod.associate = (models) => { LhcPeriod.hasMany(models.Run, { foreignKey: 'lhcPeriodId', as: 'runs' }); + LhcPeriod.hasOne(models.DataPass); }; return LhcPeriod; diff --git a/lib/database/models/typedefs/SequelizeDataPass.js b/lib/database/models/typedefs/SequelizeDataPass.js new file mode 100644 index 0000000000..f2ddff69b1 --- /dev/null +++ b/lib/database/models/typedefs/SequelizeDataPass.js @@ -0,0 +1,23 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +/** + * @typedef SequelizeDataPass + * + * @property {number} id + * @property {string} name + * @property {string} description + * @property {number} outputSize + * @property {number} reconstructedEventsCount + * @property {number} lastRunNumber + */ diff --git a/lib/public/app.css b/lib/public/app.css index 05889123f2..7906465d8c 100644 --- a/lib/public/app.css +++ b/lib/public/app.css @@ -21,6 +21,9 @@ html, body { .b-success { border-color: var(--color-success); } .b-primary { border-color: var(--color-primary); } +.b-underline-good { border-bottom: 4px solid var(--color-success); } +.b-underline-bad { border-bottom: 4px dashed var(--color-danger); } + .overflow { height: 1.5rem; overflow: hidden; diff --git a/lib/public/components/Filters/RunsFilter/definitionFilter.js b/lib/public/components/Filters/RunsFilter/definitionFilter.js index 0707d56f6c..9f62b157f9 100644 --- a/lib/public/components/Filters/RunsFilter/definitionFilter.js +++ b/lib/public/components/Filters/RunsFilter/definitionFilter.js @@ -12,8 +12,7 @@ */ import { checkboxFilter } from '../common/filters/checkboxFilter.js'; - -const RUN_DEFINITIONS = ['PHYSICS', 'COSMICS', 'TECHNICAL', 'SYNTHETIC', 'CALIBRATION', 'COMMISSIONING']; +import { RUN_DEFINITIONS } from '../../../domain/enums/RunDefinition.js'; /** * Returns the definition filter component diff --git a/lib/public/components/Filters/RunsFilter/runNumber.js b/lib/public/components/Filters/RunsFilter/runNumber.js index 6d1c6345a1..50164a002a 100644 --- a/lib/public/components/Filters/RunsFilter/runNumber.js +++ b/lib/public/components/Filters/RunsFilter/runNumber.js @@ -18,7 +18,7 @@ import { h } from '/js/src/index.js'; * @param {RunsOverviewModel} runsOverviewModel the runs overview model * @return {vnode} A text box that lets the user look for logs with a specific author */ -const runNumberFilter = (runsOverviewModel) => h('input.w-75', { +const runNumberFilter = (runsOverviewModel) => h('input', { type: 'text', id: 'runNumber', value: runsOverviewModel.getRunNumberFilter(), diff --git a/lib/public/components/common/selection/infoLoggerButtonGroup/identifierColumnAndActionsDropdown.js b/lib/public/components/common/selection/infoLoggerButtonGroup/identifierColumnAndActionsDropdown.js index eaf5349ea9..16df28bd5d 100644 --- a/lib/public/components/common/selection/infoLoggerButtonGroup/identifierColumnAndActionsDropdown.js +++ b/lib/public/components/common/selection/infoLoggerButtonGroup/identifierColumnAndActionsDropdown.js @@ -29,7 +29,7 @@ export const identifierColumnAndActionsDropdown = (page, linkContent, parameters h( '.flex-row.items-center.btn-group', [ - frontLink(linkContent, page, parameters, { class: 'btn btn-primary' }), + frontLink(linkContent, page, parameters, { class: 'btn btn-primary white' }), dropdown( h('.btn.btn-group-item.last-item', iconCaretBottom()), h( diff --git a/lib/public/domain/enums/RunDefinition.js b/lib/public/domain/enums/RunDefinition.js index 1ce1fbaf6f..f44919439a 100644 --- a/lib/public/domain/enums/RunDefinition.js +++ b/lib/public/domain/enums/RunDefinition.js @@ -19,3 +19,5 @@ export const RunDefinition = { Calibration: 'CALIBRATION', Commissioning: 'COMMISSIONING', }; + +export const RUN_DEFINITIONS = Object.values(RunDefinition); diff --git a/lib/public/views/Logs/Details/logTreeViewComponent.js b/lib/public/views/Logs/Details/logTreeViewComponent.js index a52da99c8b..c5d8b74793 100644 --- a/lib/public/views/Logs/Details/logTreeViewComponent.js +++ b/lib/public/views/Logs/Details/logTreeViewComponent.js @@ -47,7 +47,7 @@ export const logTreeViewComponent = (treeViewModel, authenticationToken) => { isCollapsed, () => treeViewModel.collapseLog(log.id), () => treeViewModel.expandLog(log.id), - authenticationToken, + { authenticationToken }, ), ); diff --git a/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js index c130c4bc39..0da5a59b90 100644 --- a/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js @@ -47,6 +47,7 @@ import { RunDefinition } from '../../../domain/enums/RunDefinition.js'; import { coloredCalibrationStatusComponent } from '../coloredCalibrationStatusComponent.js'; import { infoLoggerButtonGroup } from '../../../components/common/selection/infoLoggerButtonGroup/infoLoggerButtonGroup.js'; import { BeamModes } from '../../../domain/enums/BeamModes.js'; +import { formatRunDetectorsInline } from '../format/formatRunDetectorsInline.js'; import { formatAliceCurrent } from '../format/formatAliceCurrent.js'; /** @@ -63,7 +64,7 @@ export const runsActiveColumns = { visible: true, classes: 'w-10 f6 w-wrapped', filter: runNumberFilter, - format: (_, run) => infoLoggerButtonGroup(run), + format: (runNumber) => infoLoggerButtonGroup({ runNumber }), profiles: { lhcFill: true, environment: true, @@ -81,13 +82,8 @@ export const runsActiveColumns = { name: 'Detectors', visible: true, profiles: [profiles.none, 'lhcFill'], - classes: 'w-15 f6', - format: (detectors, run) => { - if (detectors && detectors.length > 0) { - return [h('.badge.bg-gray-light.mh2.nDetectors-badge', run.nDetectors), `${detectors.toString()}`]; - } - return '-'; - }, + size: 'w-15 f6', + format: (_, run) => formatRunDetectorsInline(run.detectorsQualities, run.nDetectors), filter: detectorsFilterComponent, balloon: true, }, diff --git a/lib/public/views/Runs/Overview/RunsOverviewPage.js b/lib/public/views/Runs/Overview/RunsOverviewPage.js index eee5ce63a4..782396dc1a 100644 --- a/lib/public/views/Runs/Overview/RunsOverviewPage.js +++ b/lib/public/views/Runs/Overview/RunsOverviewPage.js @@ -12,12 +12,13 @@ */ import { h } from '/js/src/index.js'; -import { table } from '../../../components/common/table/table.js'; -import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js'; -import { exportRunsTriggerAndModal } from './exportRunsTriggerAndModal.js'; import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js'; -import { paginationComponent } from '../../../components/Pagination/paginationComponent.js'; +import { exportRunsTriggerAndModal } from './exportRunsTriggerAndModal.js'; import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js'; +import { paginationComponent } from '../../../components/Pagination/paginationComponent.js'; +import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js'; +import { showPhysicsButton } from './showPhysicsButton.js'; +import { table } from '../../../components/common/table/table.js'; import runNumberFilter from '../../../components/Filters/RunsFilter/runNumber.js'; const TABLEROW_HEIGHT = 59; @@ -36,9 +37,10 @@ export const RunsOverviewPage = ({ runs: { overviewModel: runsOverviewModel }, m )); return h('', [ - h('.flex-row.header-container.pv2', [ + h('.flex-row.header-container.g2.pv2', [ filtersPanelPopover(runsOverviewModel, runsActiveColumns), - h('.pl2.w-20#runOverviewFilter', runNumberFilter(runsOverviewModel)), + h('.pl2#runOverviewFilter', runNumberFilter(runsOverviewModel)), + showPhysicsButton(runsOverviewModel), exportRunsTriggerAndModal(runsOverviewModel, modalModel), ]), h('.flex-column.w-100', [ diff --git a/lib/public/views/Runs/Overview/showPhysicsButton.js b/lib/public/views/Runs/Overview/showPhysicsButton.js new file mode 100644 index 0000000000..af232d5626 --- /dev/null +++ b/lib/public/views/Runs/Overview/showPhysicsButton.js @@ -0,0 +1,29 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import { RunDefinition } from '../../../domain/enums/RunDefinition.js'; +import { switchInput } from '../../../components/common/form/switchInput.js'; + +/** + * Builds a button which will toggle the physics filter + * @param {OverviewModel} runsOverviewModel the model of the runs overview + * @returns {vnode} with button + */ +export const showPhysicsButton = (runsOverviewModel) => { + const isPhysicsActive = runsOverviewModel.isDefinitionInFilter(RunDefinition.Physics); + const onChange = isPhysicsActive ? + () => runsOverviewModel.removeDefinitionFilter(RunDefinition.Physics) + : + () => runsOverviewModel.addDefinitionFilter(RunDefinition.Physics); + return switchInput(isPhysicsActive, onChange, { labelAfter: 'PHYSICS' }); +}; diff --git a/lib/public/views/Runs/format/formatRunDetectorsInline.js b/lib/public/views/Runs/format/formatRunDetectorsInline.js new file mode 100644 index 0000000000..544404b41b --- /dev/null +++ b/lib/public/views/Runs/format/formatRunDetectorsInline.js @@ -0,0 +1,48 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import { h } from '/js/src/index.js'; +import { RunDetectorQualities } from '../../../domain/enums/RunDetectorQualities.js'; + +/** + * Format a list of detectors inline and underline them based on their quality + * + * @param {RunDetectorQuality[]} detectorsQualities The run detector quality per detector + * @param {number} nDetectors The number of run detectors + * @return {Component} the formatted run detectors inline + */ +export const formatRunDetectorsInline = (detectorsQualities, nDetectors) => { + if (detectorsQualities?.length <= 0) { + return '-'; + } + + return [ + h('.badge.bg-gray-light.mh2.nDetectors-badge', nDetectors), + detectorsQualities.flatMap((detector, index) => { + const detectorClass = detectorStyleClass(detector); + + return [ + h(`span.${detectorClass}`, detector.name), + h('span', index < detectorsQualities.length - 1 ? ',' : ''), + ]; + }), + ]; +}; + +/** + * Gets the class for the style of the detector + * + * @param {RunDetectorQuality} detectorsQuality The detector with its quality + * @return {string} The class of the detecor + */ +const detectorStyleClass = (detectorsQuality) => detectorsQuality.quality === RunDetectorQualities.GOOD ? 'b-underline-good' : 'b-underline-bad'; diff --git a/package-lock.json b/package-lock.json index bb4a62ba54..f48b6cde60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aliceo2/bookkeeping", - "version": "0.74.0", + "version": "0.75.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@aliceo2/bookkeeping", - "version": "0.74.0", + "version": "0.75.0", "bundleDependencies": [ "@aliceo2/web-ui", "cls-hooked", @@ -29,17 +29,17 @@ "multer": "1.4.5-lts.1", "node-fetch": "3.3.1", "sequelize": "6.35.0", - "umzug": "3.4.0" + "umzug": "3.5.0" }, "devDependencies": { "@types/d3": "7.4.0", "chai": "4.3.4", - "eslint": "8.55.0", + "eslint": "8.56.0", "js-yaml": "4.1.0", "mocha": "10.2.0", "nodemon": "3.0.1", "nyc": "15.1.0", - "puppeteer": "21.5.2", + "puppeteer": "21.6.1", "puppeteer-to-istanbul": "1.4.0", "sequelize-cli": "6.6.0", "sinon": "17.0.1", @@ -523,9 +523,9 @@ "dev": true }, "node_modules/@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -869,9 +869,9 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@puppeteer/browsers": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.8.0.tgz", - "integrity": "sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.0.tgz", + "integrity": "sha512-QwguOLy44YBGC8vuPP2nmpX4MUN2FzWbsnvZJtiCzecU3lHmVZkaC1tq6rToi9a200m8RzlVtDyxCS0UIDrxUg==", "dev": true, "dependencies": { "debug": "4.3.4", @@ -1648,9 +1648,9 @@ ] }, "node_modules/basic-ftp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", - "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", "dev": true, "engines": { "node": ">=10.0.0" @@ -1969,9 +1969,9 @@ } }, "node_modules/chromium-bidi": { - "version": "0.4.33", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.33.tgz", - "integrity": "sha512-IxoFM5WGQOIAd95qrSXzJUv4eXIrh+RvU3rwwqIiwYuvfE7U/Llj4fejbsJnjJMUYCuGtVQsY2gv7oGl4aTNSQ==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.1.tgz", + "integrity": "sha512-dcCqOgq9fHKExc2R4JZs/oKbOghWpUNFAJODS8WKRtLhp3avtIH5UDCBrutdqZdh3pARogH8y1ObXm87emwb3g==", "dev": true, "dependencies": { "mitt": "3.0.1", @@ -3086,15 +3086,15 @@ } }, "node_modules/eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -6339,32 +6339,35 @@ } }, "node_modules/puppeteer": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.5.2.tgz", - "integrity": "sha512-BaAGJOq8Fl6/cck6obmwaNLksuY0Bg/lIahCLhJPGXBFUD2mCffypa4A592MaWnDcye7eaHmSK9yot0pxctY8A==", + "version": "21.6.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.6.1.tgz", + "integrity": "sha512-O+pbc61oj8ln6m8EJKncrsQFmytgRyFYERtk190PeLbJn5JKpmmynn2p1PiFrlhCitAQXLJ0MOy7F0TeyCRqBg==", "dev": true, "hasInstallScript": true, "dependencies": { - "@puppeteer/browsers": "1.8.0", + "@puppeteer/browsers": "1.9.0", "cosmiconfig": "8.3.6", - "puppeteer-core": "21.5.2" + "puppeteer-core": "21.6.1" + }, + "bin": { + "puppeteer": "lib/esm/puppeteer/node/cli.js" }, "engines": { "node": ">=16.13.2" } }, "node_modules/puppeteer-core": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.5.2.tgz", - "integrity": "sha512-v4T0cWnujSKs+iEfmb8ccd7u4/x8oblEyKqplqKnJ582Kw8PewYAWvkH4qUWhitN3O2q9RF7dzkvjyK5HbzjLA==", + "version": "21.6.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.6.1.tgz", + "integrity": "sha512-0chaaK/RL9S1U3bsyR4fUeUfoj51vNnjWvXgG6DcsyMjwYNpLcAThv187i1rZCo7QhJP0wZN8plQkjNyrq2h+A==", "dev": true, "dependencies": { - "@puppeteer/browsers": "1.8.0", - "chromium-bidi": "0.4.33", + "@puppeteer/browsers": "1.9.0", + "chromium-bidi": "0.5.1", "cross-fetch": "4.0.0", "debug": "4.3.4", "devtools-protocol": "0.0.1203626", - "ws": "8.14.2" + "ws": "8.15.1" }, "engines": { "node": ">=16.13.2" @@ -7312,9 +7315,9 @@ } }, "node_modules/streamx": { - "version": "2.15.5", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", - "integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", "dev": true, "dependencies": { "fast-fifo": "^1.1.0", @@ -7705,9 +7708,9 @@ } }, "node_modules/umzug": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.4.0.tgz", - "integrity": "sha512-bTen9ElCBoWU1mhcaXqVZWXxB1PojsBQBs/4vW0YV8f5CfhuhkfRjQZj6SCb6IuHWPkccDzF+T+RGZCYUiXaKg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.5.0.tgz", + "integrity": "sha512-bL6JjH716l0kg7V2Acrw5UmUgeLxdAZv3drMhKrJCXxEfK/qyM+B5s3ai1BjG1NyEGeXTOkhFIUgkMFo6zqVBg==", "inBundle": true, "dependencies": { "@rushstack/ts-command-line": "^4.12.2", @@ -8062,9 +8065,9 @@ } }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.15.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", + "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", "inBundle": true, "engines": { "node": ">=10.0.0" @@ -8569,9 +8572,9 @@ } }, "@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true }, "@grpc/grpc-js": { @@ -8842,9 +8845,9 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "@puppeteer/browsers": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.8.0.tgz", - "integrity": "sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.0.tgz", + "integrity": "sha512-QwguOLy44YBGC8vuPP2nmpX4MUN2FzWbsnvZJtiCzecU3lHmVZkaC1tq6rToi9a200m8RzlVtDyxCS0UIDrxUg==", "dev": true, "requires": { "debug": "4.3.4", @@ -9513,9 +9516,9 @@ "dev": true }, "basic-ftp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", - "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", "dev": true }, "bignumber.js": { @@ -9740,9 +9743,9 @@ } }, "chromium-bidi": { - "version": "0.4.33", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.33.tgz", - "integrity": "sha512-IxoFM5WGQOIAd95qrSXzJUv4eXIrh+RvU3rwwqIiwYuvfE7U/Llj4fejbsJnjJMUYCuGtVQsY2gv7oGl4aTNSQ==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.1.tgz", + "integrity": "sha512-dcCqOgq9fHKExc2R4JZs/oKbOghWpUNFAJODS8WKRtLhp3avtIH5UDCBrutdqZdh3pARogH8y1ObXm87emwb3g==", "dev": true, "requires": { "mitt": "3.0.1", @@ -10583,15 +10586,15 @@ } }, "eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -13000,28 +13003,28 @@ "dev": true }, "puppeteer": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.5.2.tgz", - "integrity": "sha512-BaAGJOq8Fl6/cck6obmwaNLksuY0Bg/lIahCLhJPGXBFUD2mCffypa4A592MaWnDcye7eaHmSK9yot0pxctY8A==", + "version": "21.6.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.6.1.tgz", + "integrity": "sha512-O+pbc61oj8ln6m8EJKncrsQFmytgRyFYERtk190PeLbJn5JKpmmynn2p1PiFrlhCitAQXLJ0MOy7F0TeyCRqBg==", "dev": true, "requires": { - "@puppeteer/browsers": "1.8.0", + "@puppeteer/browsers": "1.9.0", "cosmiconfig": "8.3.6", - "puppeteer-core": "21.5.2" + "puppeteer-core": "21.6.1" } }, "puppeteer-core": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.5.2.tgz", - "integrity": "sha512-v4T0cWnujSKs+iEfmb8ccd7u4/x8oblEyKqplqKnJ582Kw8PewYAWvkH4qUWhitN3O2q9RF7dzkvjyK5HbzjLA==", + "version": "21.6.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.6.1.tgz", + "integrity": "sha512-0chaaK/RL9S1U3bsyR4fUeUfoj51vNnjWvXgG6DcsyMjwYNpLcAThv187i1rZCo7QhJP0wZN8plQkjNyrq2h+A==", "dev": true, "requires": { - "@puppeteer/browsers": "1.8.0", - "chromium-bidi": "0.4.33", + "@puppeteer/browsers": "1.9.0", + "chromium-bidi": "0.5.1", "cross-fetch": "4.0.0", "debug": "4.3.4", "devtools-protocol": "0.0.1203626", - "ws": "8.14.2" + "ws": "8.15.1" }, "dependencies": { "debug": { @@ -13692,9 +13695,9 @@ "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" }, "streamx": { - "version": "2.15.5", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", - "integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", "dev": true, "requires": { "fast-fifo": "^1.1.0", @@ -13990,9 +13993,9 @@ } }, "umzug": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.4.0.tgz", - "integrity": "sha512-bTen9ElCBoWU1mhcaXqVZWXxB1PojsBQBs/4vW0YV8f5CfhuhkfRjQZj6SCb6IuHWPkccDzF+T+RGZCYUiXaKg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.5.0.tgz", + "integrity": "sha512-bL6JjH716l0kg7V2Acrw5UmUgeLxdAZv3drMhKrJCXxEfK/qyM+B5s3ai1BjG1NyEGeXTOkhFIUgkMFo6zqVBg==", "requires": { "@rushstack/ts-command-line": "^4.12.2", "emittery": "^0.13.0", @@ -14263,9 +14266,9 @@ } }, "ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.15.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", + "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", "requires": {} }, "xtend": { diff --git a/package.json b/package.json index 56fee4dd99..75ed989ef6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aliceo2/bookkeeping", - "version": "0.74.0", + "version": "0.75.0", "author": "ALICEO2", "scripts": { "coverage": "nyc npm test && npm run coverage:report", @@ -30,7 +30,7 @@ "multer": "1.4.5-lts.1", "node-fetch": "3.3.1", "sequelize": "6.35.0", - "umzug": "3.4.0" + "umzug": "3.5.0" }, "files": [ "lib/", @@ -40,12 +40,12 @@ "devDependencies": { "@types/d3": "7.4.0", "chai": "4.3.4", - "eslint": "8.55.0", + "eslint": "8.56.0", "js-yaml": "4.1.0", "mocha": "10.2.0", "nodemon": "3.0.1", "nyc": "15.1.0", - "puppeteer": "21.5.2", + "puppeteer": "21.6.1", "puppeteer-to-istanbul": "1.4.0", "sequelize-cli": "6.6.0", "sinon": "17.0.1", diff --git a/proto/common.proto b/proto/common.proto index 438003c45d..f78769d04d 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -103,6 +103,9 @@ message Run { int64 updatedAt = 30; // A string that marks the period of the lhc string lhcPeriod = 31; + // Optional users that stopped or started the run (can also be undefined) + optional User user_o2_start = 32; + optional User user_o2_stop = 33; } message LHCFill { @@ -121,7 +124,7 @@ message User { // The unique CERN identifier of this user. int32 externalId = 1; // The unique identifier of this entity. - int32 id = 2; + optional int32 id = 2; // Name of the user. string name = 3; } diff --git a/proto/run.proto b/proto/run.proto index 58aef8b183..cb04fac226 100644 --- a/proto/run.proto +++ b/proto/run.proto @@ -40,6 +40,9 @@ message RunCreationRequest { string epnTopology = 10; optional string odcTopologyFullName = 11; repeated Detector detectors = 12; + // Optional users that stopped or started the run (can also be undefined) + optional User user_o2_start = 13; + optional User user_o2_stop = 14; } message RunUpdateRequest { @@ -58,6 +61,9 @@ message RunUpdateRequest { optional string pdpBeamType = 14; optional string readoutCfgUri = 15; repeated EorReason eorReasons = 16; + // Optional users that stopped or started the run (can also be undefined) + optional User user_o2_start = 17; + optional User user_o2_stop = 18; } // Enums