The SimpleOne system allows exporting and importing configuration packs to keep unrelated instances synchronized.
In brief, the VCS configuration pack conception can be defined as an ability to transfer data from one instance to another, in an automatic or semi-automatic way. It is intended for application version control. Configuration packs help to automate transfer data and configurations from one instance to another, lessen the manual effort. The key point is configurations transfer, for not to reiterate it more and more on every instance, you can just import a configuration pack. So, this technology really is to make it easy and automate a migration update from one instance to another.
Application configurations are stored in configuration packs which are represented as a .SOP file containing a set of the application version records. In an OOB supply, the SimpleOne platform contains only the Simple application, but administrators (users with the admin role) can create their own Applications if needed.
There can be more than one local pack in the system, but the changes made by a single source can be written only in one localpack at every moment. You can choose the preferable localpack using the Preferences menu at the right. Please refer to the Interface#AdminPreferences article for the details. |
Initially, the configuration pack should be assembled on the source instance (the instance containing source data) within the local pack related to the specific application. After that, the local pack can be exported to the configuration pack as a .SOP file.
Please note: all system configuration activities should be performed within a detached local pack (do not use default local pack for these needs). |
Using configuration packs allows deploying this configuration on other instances, or, if needed, rollback versions of the specified record or some local pack as a whole to the previous state.
Technically, the configuration pack is the set of the saved records of the VCS Record (sys_vcs_record) table. Every record of this table contains JSON formatted changes and other attributes described below.
{"value": "Report Item", "policy": "Open", "sys_id": 159653803414986194, "column_id": 156941403909472422, "record_id": 159653803414985080, "language_id": 156628684306541141, "application_id": 155931135900000002, "sys_created_at": "2020-08-04 10:47:14", "sys_created_by": 155931135900000001, "sys_updated_at": "2020-08-04 10:47:14", "sys_updated_by": 155931135900000001} |
The configuration pack transfer between instances can be also called "import". On the picture below, you can find the cross-instance configuration versions import flow:
On the picture above. blocks colorization is based on the tables affected as described below:
|
After any transaction (create/update/delete) for the versioned table object, the record is created in the VCS Record (sys_vcs_record) table corresponding to the object state after the transaction. The record version contains the information described below.
VCS record cannot be created or deleted manually in order to avoid collisions. If you need to remove a VCS record from a pack, then please complete the steps below:
|
VCS Record form fields
Field | Description | |
---|---|---|
Record | An ID of the source record processed by the transaction. | |
Table name | The table name for the target record.
| |
Record document | This ID stores table name and target record ID for which the current record is created. For example: | |
Is Current | This attribute is responsible for current version relevance. When its value is equal to TRUE, then the version corresponds to the target record state relevant for now. | |
JSON Copy | The record version data in JSON format as an associative array. This array stores the target record object relevant state after the transaction. | |
Action | Transaction type. Available options:
| |
Local pack | Reference to the local pack containing this record version. | |
Retrieved pack | Reference to the configuration pack containing this record version. | |
Record Policy | The current record protection policy after the transaction is over. |
Technically, a local pack is a record in the VCS Local Pack (sys_vcs_local_pack) table related to versions of the related records in a VCS Record (sys_vcs_record) table. Every single version is an atomic state of versioned tables (those ones which have the is_VCS_enabled attribute turned ON). All record versions in the local pack are displayed on a related list on a local pack form.
To create a local pack, please complete the steps below:
VCS Local Pack form fields
Field | Mandatory | Description |
---|---|---|
Origin ID | N | This ID is assigned to the local pack after creating it on a source instance. |
ID | N | This ID is assigned to the local pack after importing. |
Name | Y | Local pack name. |
Is Default | N | This attribute defines that this local pack will be set as default for any user changing the application to the one specified in the Application field. |
Application | N | Specify an application of which record changes are stored in this local pack. |
State | Y | Local pack state. Available options:
|
Description | N | Local pack description. |
Completed at | N | The date and time when the local pack state changed to Completed. |
Completed by | N | Reference to the user who has set the state to Completed. |
A non-actual version (the is_current attribute value is equal to FALSE) can be restored if needed. To perform this, please complete the steps below:
After that, a new VCS record is created in the current local pack; the Restored by field value of this record is equal to the ID of the version used for restoring.
You can add a versions list to the versioned table form as a related list. After that, all previous versions of the current record are displayed on the record form. |
Default local pack is a local pack named "Default 1" created automatically after creating a new application. It is not recommended to use this local pack to store versions for the purpose of further import to other instances; create separate packs for these tasks.
If a version has been created in a default local pack erroneously, then you can move it to the required local pack. For this, please complete the steps below:
The Protection Policy (policy) attribute is responsible for the possibility of the record changing (for example, overwriting). It it used, in particular, for data protection purposes.
When the record in the versioned table is created, its Record and Record Policy attribute values are equal to Open. After first updating, its Record and Record Policy attribute values changes to Changed.
Records with these two states for the Record and Record Policy attributes are freely modifiable.
Also, one more protection policy state for record is Protected. Records with this state cannot be changed or deleted.
During the importing process,. the records with the policy state allowing overwriting can be updated. Both record policy values set in the system and in configuration pack are taken into account. All possible policies combinations are described in the table below.
Local Pack importing policy value | Local record policy value | Local Pack importing attempt result |
---|---|---|
Protected | Protected | Success |
Open | Success | |
Changed | Success | |
Changed | Protected | Failed; use Strong Overwrite to proceed. |
Open | Success | |
Changed | Success | |
Open | Protected | Failed; use Strong Overwrite to proceed. |
Open | Success | |
Changed | Failed; use Strong Overwrite to proceed. |
After you are done with record versions collection within the task implementing, you need to export the changes for further import to other instances. For this, please complete the steps below:
Recommendations:
|
Two local packs can be merged in one if necessary. For this, please complete the steps below:
Team DevelopmentIn SimpleOne, you can perform your parallel development on multiple instances. For now, team development is represented an an operation approach and is handled by two engines:
In brief, in order to facilitate the team development process, you need to perform the steps below:
|
To deliver an exported local pack on a target instance, the import procedure should proceed. What is implemented within this procedure:
To import a local pack, please complete the steps below:
After records are loaded, additional UI actions appear on the retrieved pack record form:
VCS retrieved pack form fields
Field | Mandatory | Description |
---|---|---|
Name | N | Retrieved Pack name, taken from the SOP file attached. |
State | Y | State of the current configuration pack imported. Available options:
|
Remote ID | N | ID of the local pack exported. |
Remote Application | N | Application specified in the local pack exporting. |
Application | N | Specify the application within which the pack should be imported. |
Inserted | N | The number of records in this pack with the Action attribute value equal to Insert. |
Updated | N | The number of records in this pack with the Action attribute value equal to Update. |
Deleted | N | The number of records in this pack with the Action attribute value equal to Delete. |
Warning | N | The number of the Preview Log records with the State equal to Warning. |
Skipped | N | The number of the Preview Log records with the State equal to Skipped. |
Collisions | N | The number of the Preview Log records with the State equal to Collisions. |
Total | N | Total records number. |
Description | N | Retrieved Pack description, taken from the SOP file attached. |
Loaded at | N | The date and time when the configuration pack import has been finished (the state has been changed to Loaded). |
Committed at | N | The date and time when the configuration pack was applied (the state has been changed to Committed) |
The import process includes two immanent phases described below:
During this phase, the import engine checks for the possible conflicts before the pack is imported. To preview the configuration pack, please complete the steps below:
On this tab, you can find all records loaded from the configurations file. The Retrieved Records functionality allows to filter records out by state, fix errors if necessary and go on with importing without reassembling the .SOP file.
Retrieved record form field
Field | Description | |
---|---|---|
Table name | The target table name in which this record version should be created. Please note that only system names for tables are used in this field, not titles.
| |
Record ID | This field stores target record ID for which the current record is created. | |
Document Record | This field contains VCS record unique ID of the Document ID type. It is generated out of the table ID the record related to and the record ID. | |
Created by | Reference to the user who has created the initial record. | |
JSON Copy | Record version in JSON format. | |
Is Strong Overwrite | If this attribute value is equal to TRUE, then this version will take precedence over the existing version when the import process will go on. | |
Action | Transaction type. Available options:
| |
Retrieved pack | Reference to the retrieved pack containing record version. | |
Record policy | The current record protection policy after the transaction is over. See the relevant article section for more information. Available options:
|
After loading a .SOP file into a retrieved pack record, some VCS records have thrown errors due to any reasons (for example, the translation records on the target instance are different with the ones in retrieved pack, what causes data inconsistency, or any other reason). In this case, a person implementing import should follow the steps as described below:
After a pack is finally imported:
|
VCS Preview Log fields description
Field | Description | |
---|---|---|
Local Pack | Reference to the local pack containing this preview log record. | |
Retrieved pack | Reference to the configuration pack containing this preview log record. | |
Document Record | ID of the target record for which the transaction has been executed. | |
Table Name | The table name for the target record.
| |
Record | This ID stores table name and target record ID for which the current record is created. | |
Platform Version | The solution platform version used when the record created. | |
JSON Copy | The record version data in JSON format as an associative array. This array stores the target record object relevant state after the transaction. | |
Error Text | The error text displayed in case of collision (the preview log record state is equal to Warning or Skipped or Collision). | |
State | The preview log record state. Available options:
| |
Action | The type of transaction created the version object. Available options:
| |
Record Policy | The attribute responsible for the record protection policy. See the relevant article section for more information. Available options:
| |
Is Strong Overwrite | This attribute determines the priority of the imported version over the existing one. | |
VCS Record | The related version record created after configuration pack importing. | |
Application | The application within of which the preview has been executed. |
|
Please keep in mind that if any collisions occurred during the local pack preview, the process will be canceled on the first occasion, the others will not be shown. |
Generally, collisions may appear during the configuration pack import process. Their leading cause is that the dependent table or record does not exist in the database.
Consider a common use case:
After that, you can find the erroneous record at the VCS preview log related list (in the VCS retrieved pack section). This record has the state=collision and the appropriate Error Text containing the error cause. Erroneous records cannot be included in the saved records pack (VCS records) bound to the retrieved pack that is used for data recovery.
The idea in the collision fixing process is to try to dispose of collisions in the highest level tables; this method lets to remove collisions in the lower-level tables automatically. It can be done about like this:
When installing a configuration pack in the system, some record “X” is added. At the same time, it is referenced to another records “Y” in this system and in this configuration pack. Both records that the record ‘X’ is referenced to do not exist. When the export admin initiates a configuration pack preview (using a Preview Local Pack button), the collision is thrown on this record, which is an expected result.
Collision solving:
The solution is the configuration pack rebuilt in order to get the record “Y” into it.
The record “X” is deleted from the system. At the same time, there is a reference to this record in the configuration pack. When the export admin initiates a configuration pack preview (using a Preview Local Pack button), the collision is thrown on this record, which is an expected result.
Collision solving:
The solution is the configuration pack rebuilt in order to remove this record from it.
Create a table on a source instance, with the field number equal to N.
Create the same table with the same name on a target instance, with the field number equal to N-1.
On the source instance, perform the export of the table fields into a configuration pack, after that download a .SOP file and unpack it on the target instance.
The result will be a collision thrown, and a message that this object is not valid, any actions on it cannot be taken.
Collision solving:
To solve this collision, create or update an object, excluding attributes missing on the target instance. In the above example, the N-fielded table will be successfully imported to the target instance, where the (N-1)-fielded table is created. But, the fields that exist in the source instance and are not in the target instance will not be created in the target instance. See the schema below.
The records on a target instance are newer than in a configuration pack to install. It can be determined by the date and time of record creation.
Collision solving:
Export admin needs to initiate a local pack preview. In the process:
A table deleting from instance contains records (is not empty). If the table is deleted being empty, then there is no collision.
Collision solving:
Use case description: configuration pack contains objects related to the application X. At some moment, export admin tries to apply this configuration pack on the instance that do not have this application installed.
Collision solving:
The solution is the configuration pack rebuilt in order to add records related to the missing application.
Partial attribute mismatch between instances.
Use case description.
Create a table on a source instance, with the field number equal to N.
Create the same table with the same name on a target instance, with the field number equal to N-1.
On the source instance, perform the export of the table fields into a configuration pack, after that, download a .SOP file and unpack it on the target instance.
The field names on source and target instances are slightly different. See the schema below.
The collision cause is unique key violation.
Use case description
Collision solving
The collision solving method is decide which translation record is more actual.
If an initial record located on the target instance is more actual, then the collision record can be dropped from the configuration pack and not imported.
If a new record being imported is more actual, then this record should be imported, what will cause initial record overwrite.
In version control systems (VCS), snapshot is the fixed system or database status description. To create a table snapshot, a table managing form can be used, and also, server-side API class SimpleVcs was implemented.
Role required: admin.
In both cases, the result is the snapshot, that is, the set of the VCS records for all the documents in this table that do not have such records at the moment of the snapshot creating.
Example
To rollback a local pack, please complete the steps below:
Resolve the issues encountered.
This process both record updates and dictionary changes. Some changes caused by the rollback may lead to data loss.
Here is the expected result of the process:
Update | Rollback result |
---|---|
A new table | The table is dropped from the database, deleting any data from it. |
A new field | The field is dropped from the database, deleting any data from it. |
A deleted field | The field is restored to the database, but the original data is lost. |
A record is inserted | The record is deleted. |
A record is deleted | The record is restored with its original data. |