From bb3d386de39eff14488478dcc7ae624fb473d363 Mon Sep 17 00:00:00 2001 From: "Anton_Tuhai@epam.com" Date: Mon, 25 Sep 2023 11:05:08 +0300 Subject: [PATCH] [EDP-DDM-28658] github: issue 18, fixed puml files, added partials, reviewed and added updates to document /admin-portal/data-model/admin-portal-data-model-management.adoc Change-Id: I9cf9fb2c94abf321a00c3ee3bf8abeb0bca4c3a6 (cherry picked from commit 5856e7060470bf10569c785791fbfb65dbad6680) --- .../administrative-zone-subsystems.svg | 2 +- .../admin-portal-data-model-management.adoc | 58 +++++-------- .../admin-portal/db-tables-management-er.puml | 74 ++++++++++++++++ .../db-tables-management-sequence.puml | 85 +++++++++++++++++++ 4 files changed, 179 insertions(+), 40 deletions(-) create mode 100644 docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-er.puml create mode 100644 docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-sequence.puml diff --git a/docs/en/modules/arch/images/architecture/platform/administrative/administrative-zone-subsystems.svg b/docs/en/modules/arch/images/architecture/platform/administrative/administrative-zone-subsystems.svg index 2242bbd705..45b7d77ed8 100644 --- a/docs/en/modules/arch/images/architecture/platform/administrative/administrative-zone-subsystems.svg +++ b/docs/en/modules/arch/images/architecture/platform/administrative/administrative-zone-subsystems.svg @@ -1,4 +1,4 @@ -
Platform administrative zone
Platform administrative zone
Operational zone of the Platform
Operational zone of the Platform
Secrets and encryption
management subsystem
Secrets and encryption...
Platform and registries management subsystem
Platform and registries management s...
Platform and registries deployment and configuration subsystem
Platform and registries deployment a...
Users and roles management subsystem
Users and roles management subsystem
Container orchestration Platform
Container orchestration Platform
Cross-service communication
Cross-service communication
Target subsystem
Target subsystem
Deployment and application of configuration changes
Deployment and application of con...
Platform subsystem
Platform subsystem
External traffic management subsystem
External traffic management subsyst...
Email messaging subsystem
Email messaging subsystem
Cross-service communication management subsystem
Cross-service communication managem...
Backup and recovery subsystem
Backup and recovery subsystem

Event logging subsystem
Event logging subsystem
Event monitoring and notification subsystem
Event monitoring and notification s...
Request tracing subsystem
Request tracing subsystem
Distributed data storage subsystem
Distributed data storage subsystem
Registry subsystems
Registry subsystems
Service administrators
Service...
Registry subsystem
Registry subsystem
Text is not SVG - cannot display
\ No newline at end of file +
Platform administrative zone
Platform administrative zone
Operational zone of the Platform
Operational zone of the Platform
Secrets and encryption
management subsystem
Secrets and encryption...
Platform and registries management subsystem
Platform and registries management s...
Platform and registries deployment and configuration subsystem
Platform and registries deployment a...
Users and roles management subsystem
Users and roles management subsystem
Container orchestration Platform
Container orchestration Platform
Cross-service communication
Cross-service communication
Target subsystem
Target subsystem
Deployment and application of configuration changes
Deployment and application of con...
Platform subsystem
Platform subsystem
External traffic management subsystem
External traffic management subsyst...
Email messaging subsystem
Email messaging subsystem
Cross-service communication management subsystem
Cross-service communication managem...
Backup and recovery subsystem
Backup and recovery subsystem

Event logging subsystem
Event logging subsystem
Event monitoring and notification subsystem
Event monitoring and notification s...
Request tracing subsystem
Request tracing subsystem
Distributed data storage subsystem
Distributed data storage subsystem
Registry subsystems
Registry subsystems
Service administrators
Service...
Registry subsystem
Registry subsystem
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/en/modules/arch/pages/architecture/registry/administrative/regulation-management/admin-portal/data-model/admin-portal-data-model-management.adoc b/docs/en/modules/arch/pages/architecture/registry/administrative/regulation-management/admin-portal/data-model/admin-portal-data-model-management.adoc index 1228de75c0..752ac61112 100644 --- a/docs/en/modules/arch/pages/architecture/registry/administrative/regulation-management/admin-portal/data-model/admin-portal-data-model-management.adoc +++ b/docs/en/modules/arch/pages/architecture/registry/administrative/regulation-management/admin-portal/data-model/admin-portal-data-model-management.adoc @@ -9,80 +9,59 @@ include::admin-portal-data-model-scenarious.adoc[] == Out of scope - Working with data types -//- Робота з типами даних - Working with analytical representations -//- Робота з аналітичними представленнями -- Resolving conflicts using the administrative portal of the registry regulations management -//- Вирішення конфліктів з використанням адмінпорталу менеджменту регламенту реєстру +- Resolving conflicts using the administrative portal's regulations management == Principles of working with changes in the database -//== Принципи роботи зі змінами в БД === Existing mechanism for working with changes in the database -//=== Існуючий механізм роботи зі змінами в БД The existing mechanism for working with changes in the database is based on two principles: -//Існуючий механізм роботи зі змінами в БД базуєтсья на двух принципах: -- Creation of liquibase changeset -//- Cтворення liquibase changeset -- Saving liquibase changeset in git -//- Збереження liquibase changeset в git +- Creating the Liquibase changeset +- Saving the Liquibase changeset in git image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-luqibase-current-flow.svg[] === Advanced mechanism for working with changes in the database -//=== Розширений механізм роботи зі змінами в БД -It is suggested to extend the existing mechanism for working with database changes by adding a DataModelSnapshot document to the git repository, which will reflect the state of the data model. -//Пропонується розширити існуючий механізм роботи зі змінами БД шляхом додавання DataModelSnapshot документу в git репозиторій, котрий буде відображати стан моделі даних. + +It is suggested to extend the existing mechanism for working with database changes by adding a _DataModelSnapshot_ document to the git repository, which will reflect the data model's state. image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-luqibase-extended-flow.svg[] === Basic concepts -//=== Основні концепції -- DataModelSnapshot model: JSON documents reflecting the state of the registry regulations data model. -//- DataModelSnapshot model - JSON документи, що відображають стан моделі даних регламенту реєстру + +- _DataModelSnapshot_ model: JSON documents reflecting the state of the registry regulations data model. - Diff Document: The document showing the difference between the two states of the registry regulations data model. -//- Diff Document - документ, що відображає різницю між двома станами моделі даних регламенту реєстру -- History Document: The document reflecting the history of changes made to the master version or the candidate version of the registry regulations. -//- History Document - документ, що відображає історію змін мастер версії або версії- кандидату регламенту реєстру +- History Document: The document reflects the history of changes made to the master or candidate versions of the registry regulations. === DataModelSnapshot structure description -//=== Описання структури DataModelSnapshot + [NOTE] -The above data model was obtained as the result of the analysis of the existing state of lqiuibase changelogs (including the functionality analysis of the custom liquibase tags). -//Вищенаведена модель даних була отримана в результаті аналізу існуючого стану lqiuibase changelogs (включно з аналізом функціональності custom liquibase тегів) +The above data model was obtained from analyzing the existing state of liquibase changelogs (including the functionality analysis of the custom liquibase tags). [plantuml, db-tables-management-er, svg] ---- include::partial$architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-er.puml[] ---- - === Description of the file structure in the file system -//=== Опис структури файлів на файловій системі -The DataModelSnapshot model has the following file structure in the file system: -//DataModelSnapshot model має наступну структуру файлів на файловій системі +The _DataModelSnapshot_ model has the following file structure in the file system: image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-datamodel-filestructure.svg[] - The list of tables is determined by the list of files in the file system. -//- Перелік таблиць визначається переліком файлів на файловій системі - The name of the table file matches the name of the table and is `.json`. -//- Ім'я файлу таблиць відповідає назві таблиці та має наступний вигляд: `.json` - The name of the role permission file corresponds to the name id role permission and is the following: `.json`. -//- Ім'я файлу role permission відповідає назві id role permission та має наступний вигляд: `.json` ==== Temporary file structure in the file system (first iteration) -//==== Тимчасова структура файлів на файловій системі (first iteration) image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-datamodel-filestructure-simple.svg[] === Description of the DataModelSnapshot data format -//=== Опис DataModelSnapshot формату даних -The Json format is used as a technical tool for describing the data structure of DataModelSnapshot. As a description of the contract document, https://json-schema.org/ [JsonSchema] is used. -//В якості технічного інструменту опису структури даних DataModelSnapshot використовується Json формат. В якості опису контракту документу використовується https://json-schema.org/[JsonSchema] + +We use the JSON format as a technical tool for describing the data structure of _DataModelSnapshot_. As a description of the contract document, https://json-schema.org/ [JsonSchema] is used. xref:arch:architecture/registry/administrative/regulation-management/admin-portal/data-model/admin-portal-data-model-json-schema-description.adoc[DataModelSnapshotSchema] @@ -91,26 +70,27 @@ include::domain-attributes-description.adoc[] include::admin-portal-data-model-principles.adoc[] -== Description of the technical solution -//== Опис технічного рішення +== Technical solution description === Container + image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-c4-container.svg[] === Admin portal API container + image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-c4-apiContainer.svg[] === CICD container + image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-c4-cicd-container.svg[] == System component interaction scenario when editing the structure of the registry tables -//== Сценарій взаємодії компонентів системи під час редагування структури таблиць регламенту реєстру + [plantuml, db-tables-management-sequence, svg] ---- include::partial$architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-sequence.puml[] ---- -== General diagram of the system components interaction when editing the data model of the registry regulations -//== Загальна діаграма взаємодії компонентів системи під час редагування моделі даних регламенту реєстру +== General diagram of the system components' interaction when editing the data model of the registry regulations image::architecture/registry/administrative/regulation-management/admin-portal/data-model/tables-management-component-structure.svg[] diff --git a/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-er.puml b/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-er.puml new file mode 100644 index 0000000000..df3a784d8f --- /dev/null +++ b/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-er.puml @@ -0,0 +1,74 @@ +@startuml +' hide the spot +hide circle + +' avoid problems with angled crows feet +skinparam linetype ortho + +entity "Table" as table { + *id : UUID + -- + name: string + historicalFlag: boolean + objectReference: + description: String +} + +entity "Index" as index { + *id : UUID + -- + name: string + columns: array[Index.Column] +} + +entity "Index.Column" as index_column { + name: string + sorting: enum[ASC, DESC, NONE] +} + +entity "UniqueConstraint" as unique_constraint extends index + +entity "PrimaryKeyConstraint" as primary_key_constraint extends unique_constraint + +entity "Column" as column { + *id : UUID + -- + name: string + description: string + type: enum[clarify types] + defaultValue: object + notNull: boolean +} + +entity "ForeignKey" as foreign_key { + *id : UUID + -- + name: string + targetTable: string + columnPairs: array[ForeignKey.ColumnPair] +} + +entity "ForeignKey.ColumnPair" as foreign_key_column_pair { + sourceColumnName: string + targetColumnName: string +} + +entity "DdmRolePermission" as ddm_role_permission { + *permissionId : UUID + -- + roleName : string + objectName : string // it's table name + columnName : string + operation: enum[INSERT, SELECT, UPDATE, DELETE] +} + + +table ||..o{ index +table ||..o{ column +table ||..o{ foreign_key +table ||..o{ unique_constraint +table ||..o{ primary_key_constraint + +foreign_key +-- foreign_key_column_pair +index +-- index_column +@enduml \ No newline at end of file diff --git a/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-sequence.puml b/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-sequence.puml new file mode 100644 index 0000000000..b2cbe0bf1b --- /dev/null +++ b/docs/en/modules/arch/partials/architecture/registry/administrative/regulation-management/admin-portal/db-tables-management-sequence.puml @@ -0,0 +1,85 @@ +@startuml + +autonumber +skinparam responseMessageBelowArrow true + +actor "Regulations\n administrator" as User +actor "Regulations\n inspector" as Reviewer + +participant "Administrative portal" as FrontEnd +participant "Registry regulations\n management service" as BackendService +participant "Change inspection service" as Gerrit +participant "Registry regulations\n publishing service" as Jenkins + +activate User +User -> FrontEnd: Create candidate version of the regulations +FrontEnd -> BackendService: Create candidate version of the regulations +activate BackendService +BackendService -> Gerrit: Create a separate branch +activate Gerrit +BackendService -> Gerrit: Get updated version of DataModelSnapshot +BackendService <-- Gerrit: DataModelSnapshot + +BackendService -> Gerrit: Get change history of DataModelSnapshot +FrontEnd <-- BackendService: DataModelSnapshot + +BackendService -> BackendService: Processing change history +FrontEnd <-- BackendService: History +User <-- FrontEnd: Regulations candidate version + +User -> FrontEnd: Request to save changes of\n regulations candidate version +FrontEnd -> BackendService: New version of DataModelSnapshot + +User -> FrontEnd: Request for change inspection of\n regulations candidate version +FrontEnd -> BackendService: Send the candidate version for review + +deactivate User + +BackendService -> Gerrit: Get DataModelSnapshot of the document\n that is up-to-date when creating the change branch +BackendService <-- Gerrit: DataModelSnapshot + +BackendService -> Gerrit: Get changed DataModelSnapshot +BackendService <-- Gerrit: DataModelSnapshot +BackendService -> BackendService: build Diff document +BackendService -> BackendService: conversion of Diif document\n in liquibase changeset + +BackendService -> BackendService: Add information to liquibase сhangelog\n from liquibase changeset +BackendService -> Gerrit: Save liquibase changeset +deactivate BackendService + +activate Reviewer +Reviewer -> FrontEnd: Request for version inspection +FrontEnd -> BackendService: Request for version inspection + +activate BackendService +BackendService -> Gerrit: Get candidate version status +BackendService <-- Gerrit: Condition status (conflicts and tests) +BackendService -> Gerrit: Get DataModelSnapshot\n from the candidate version change branch + +'Add diff here + +BackendService -> Gerrit: Get document with change history +BackendService <-- Gerrit: History +FrontEnd <-- BackendService: Candidate version +Reviewer <-- FrontEnd: Candidate version + +Reviewer -> FrontEnd: Request to apply changes +deactivate Reviewer + +FrontEnd -> BackendService: Request to apply changes + +BackendService -> Gerrit: Merge PR +deactivate BackendService + +Gerrit --> Jenkins: Send event to start RegistryRegulationJob + +activate Jenkins +Jenkins -> Jenkins: Create DB structure\n and informing metadata table\n using liquibase changelog +Jenkins -> Jenkins: Create DataModelSnapshot\n using DB + +Jenkins -> Gerrit: Save updated DataModelSnapshot +deactivate Jenkins +Gerrit -> Gerrit: merge changes to master +deactivate Gerrit + +@enduml \ No newline at end of file