From d3a9f366fb52e0fbee464eeb49812a196dc1ba3c Mon Sep 17 00:00:00 2001 From: Eduard Schander <66794307+EddeCCC@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:38:32 +0100 Subject: [PATCH] Update git staging (#1622) * show agent_mapppings.yml in promotion list * enable promotion of agent mappings to live branch * add sourceBranch to AgentMappingSerializer * add configuration reload, when agent mapping source branch changed * add check if agent mapping exit on newly set source branch * include agent_mappings.yaml into initial staging * refactor and add AgentMapping tests * change initial source branch * include versioning to AgentMappingController * add dropdown menu to change mappings source branch * show current source branch in dropdown menu * add Versioning sidebar and apply selected version * add notice, if not latest version is selected * add data-tip to dropdown menu * refactor agent mapping css * generalise promotion namings * add dialog before changeing source branch * fix formatting * update documentation * add configurable initial source branch --- .../src/components/editor/EditorView.js | 2 +- .../configuration/ConfigurationSidebar.js | 4 +- .../views/configuration/ConfigurationView.js | 4 +- .../views/configuration/FileToolbar.js | 2 +- ...oryView.js => ConfigurationHistoryView.js} | 8 +- .../views/mappings/AgentMappingsView.js | 65 ++++++- .../views/mappings/MappingSidebar.js | 66 +++++++ .../views/mappings/MappingToolbar.js | 102 +++++++++-- .../views/mappings/MappingsTable.js | 136 +++++++------- .../components/views/mappings/SidebarTypes.js | 6 + .../dialogs/ChangeSourceBranchDialog.js | 50 ++++++ .../mappings/history/MappingsHistoryView.js | 94 ++++++++++ .../views/promotion/PromotionFileApproval.js | 2 +- .../views/promotion/PromotionFileView.js | 4 +- .../views/promotion/PromotionSidebar.js | 4 +- .../views/promotion/PromotionToolbar.js | 4 +- .../views/promotion/PromotionView.js | 12 +- .../dialogs/PromotionConflictDialog.js | 4 +- .../views/status/dialogs/ClearDialog.js | 6 +- .../src/data/side-navigation-items.json | 2 +- .../src/redux/ducks/configuration/actions.js | 10 +- .../src/redux/ducks/initial-states.js | 10 +- .../src/redux/ducks/mappings/actions.js | 109 +++++++++++- .../src/redux/ducks/mappings/reducers.js | 113 +++++++++--- .../src/redux/ducks/mappings/selectors.js | 20 +++ .../src/redux/ducks/mappings/types.js | 14 ++ .../AgentConfigurationManager.java | 5 +- .../AgentConfigurationReloadTask.java | 8 +- .../config/model/InspectitServerSettings.java | 5 + ...AgentMappingsSourceBranchChangedEvent.java | 18 ++ ...romotionEvent.java => PromotionEvent.java} | 6 +- .../inspectit/ocelot/file/FileManager.java | 12 +- .../file/accessor/git/RevisionAccess.java | 36 +++- .../versioning/ExternalChangeDetector.java | 6 +- .../file/versioning/VersioningManager.java | 166 ++++++++++++++---- ...igurationPromotion.java => Promotion.java} | 4 +- .../versioning/model/SimpleDiffEntry.java | 3 + .../ocelot/mappings/AgentMappingManager.java | 58 +++++- .../mappings/AgentMappingSerializer.java | 68 +++++++ .../ocelot/rest/file/DirectoryController.java | 2 +- .../rest/mappings/AgentMappingController.java | 39 +++- .../PromotionController.java | 14 +- .../src/main/resources/application.yml | 2 + .../AgentConfigurationManagerTest.java | 1 + .../AgentConfigurationReloadTaskTest.java | 68 +++++-- .../ExternalChangeDetectorTest.java | 8 +- .../versioning/VersioningManagerTest.java | 112 ++++++++---- .../mappings/AgentMappingManagerTest.java | 45 ++++- .../mappings/AgentMappingSerializerTest.java | 64 +++++-- .../mappings/AgentMappingControllerTest.java | 8 +- .../PromotionControllerIntTest.java | 42 ++--- .../VersioningControllerIntTest.java | 10 +- .../assets/agent_mappings_source_branch.png | Bin 0 -> 226287 bytes .../docs/config-server/agent-mappings.md | 39 +++- ...figuration-staging.md => files-staging.md} | 12 +- ...ng-configurations.md => managing-files.md} | 41 +++-- .../website/sidebars.json | 4 +- 57 files changed, 1424 insertions(+), 335 deletions(-) rename components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/history/{HistoryView.js => ConfigurationHistoryView.js} (92%) create mode 100644 components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/MappingSidebar.js create mode 100644 components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/SidebarTypes.js create mode 100644 components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/dialogs/ChangeSourceBranchDialog.js create mode 100644 components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/history/MappingsHistoryView.js create mode 100644 components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/events/AgentMappingsSourceBranchChangedEvent.java rename components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/events/{ConfigurationPromotionEvent.java => PromotionEvent.java} (73%) rename components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/file/versioning/model/{ConfigurationPromotion.java => Promotion.java} (92%) rename components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/rest/{configuration => promotion}/PromotionController.java (84%) rename components/inspectit-ocelot-configurationserver/src/test/java/rocks/inspectit/ocelot/rest/{configuration => promotion}/PromotionControllerIntTest.java (76%) create mode 100644 inspectit-ocelot-documentation/docs/assets/agent_mappings_source_branch.png rename inspectit-ocelot-documentation/docs/config-server/{configuration-staging.md => files-staging.md} (95%) rename inspectit-ocelot-documentation/docs/config-server/{managing-configurations.md => managing-files.md} (64%) diff --git a/components/inspectit-ocelot-configurationserver-ui/src/components/editor/EditorView.js b/components/inspectit-ocelot-configurationserver-ui/src/components/editor/EditorView.js index 3358e676ec..c26e29a027 100644 --- a/components/inspectit-ocelot-configurationserver-ui/src/components/editor/EditorView.js +++ b/components/inspectit-ocelot-configurationserver-ui/src/components/editor/EditorView.js @@ -56,7 +56,7 @@ const EditorView = ({ const configurationType = getConfigurationType(value); const selectlatestVersion = () => { - dispatch(configurationActions.selectVersion(null)); + dispatch(configurationActions.selectConfigurationVersion(null)); }; let editorContent; diff --git a/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationSidebar.js b/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationSidebar.js index e9f81a4afd..c2610efa25 100644 --- a/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationSidebar.js +++ b/components/inspectit-ocelot-configurationserver-ui/src/components/views/configuration/ConfigurationSidebar.js @@ -1,6 +1,6 @@ import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import HistoryView from './history/HistoryView'; +import ConfigurationHistoryView from './history/ConfigurationHistoryView'; import { configurationActions } from '../../../redux/ducks/configuration'; import DocumentationView from './documentation/DocumentationView'; import SidebarTypes from './SidebarTypes'; @@ -53,7 +53,7 @@ const ConfigurationSidebar = () => {