You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 17 Next »
Role required: admin.
A local pack is a record in the VCS Local Pack (sys_vcs_local_pack) table compiling a scecific collection of records from the VCS Record (sys_vcs_record) table. Use it to associate VCS records with a particular pack according to the type of changes they refer to and export them as a complete configuration set. With export of local packs, it is possible to move the development of the application configurations to a separate instance. To do so, export them as a .SOP file, and implement the changes to another instance.
See the Configuration Packs article to learn more.
The exported configuration pack includes:
- Local Pack – compiles all VCS records, referring to a particular change set. These records can be implemented as one configuration pack on another instance. In other words, a local pack contains references to the records that should be changed, inserted, or deleted on the target instance.
- VCS Record – contains a record version.
- .SOP file – a physical file in the .SOP format. It contains all record versions from the local pack. Transfer and implement it on any other SimpleOne instance.
Assembling a local pack
Local pack configuration and export include the following stages:
- Creation of a new local pack to store some specific VCS records.
- Collecting VCS records in a local pack:
- restoring records (optional)
- moving records to another pack (optional)
- Merging several local packs (optional).
- Exporting a .SOP file.
When exporting records for a custom application, ensure that the relevant application is implemented on the target instance or that the local pack contains the application VCS record.
To implement a custom application, follow the steps below on the source instance:
- Navigate to Configuration → Applications.
- Find the application record using the list search or the Condition Builder. Open the record.
- Scroll down to the Related Lists area.
In the VCS Record tab, open a relevant record (with the selected Is Current checkbox).
- In the VCS Record form, select the local pack you need in the Local Pack field.
- Click Save or Save and Exit.
Team development
In SimpleOne, you can export separate local packs and upload them one by one. Another option is to work as a team on one task. To do so, developers should do their part of work in separate local packs and then merger the results into the final local pack. The process scheme is described below:
It is also possible for the developers to work using the same local pack, though it is risky and not recommended.
To facilitate the team development process, do the following:
- Every team member creates a separate local pack and works within it collecting necessary versions of the VCS records. The results of work on a specific task should go into a separate local pack.
- When all the developers who work on the same task complete thier local packs, these local packs must be merged into the final one.
Create a local pack
To create a local pack, complete the steps below:
- Navigate to Configuration → Local Packs.
- Click New and fill in the fields.
- There are two ways to apply changes and continue assembling a local pack:
- Click Save. Then click Set current to switch the local pack in the Admin Preferences menu and start working on it.
- Click Set current and Save to switch the local pack in the Admin Preferences menu, apply changes and start working on it.
Managing VCS records
Configure the set of record versions in the VCS Records related list to manage the local pack content. Restore and move records to collect only those you need.
Restoring a VCS record
To restore one of the previous record versions and make it current, click Restore Version. Restoring is available only for the VCS records with the cleared Is Current checkbox.
Restoring is unavailable for the records of the Simple application with the Protected record policy.
To restore a record version, complete the steps below:
- Open the record you need.
- Scroll down the form to the Related Lists area and open the VCS Records tab.
- Open the record version to restore.
- Click Restore Version.
Another way to restore a record version is the following:
- Navigate to Configuration → VCS Records.
- Find the record to be recovered. You can use list search boxes or the Condition Builder.
- Open the record you need.
- Click Restore Version.
After that, a new VCS record is created in the current local pack.
Removing a VCS record
The SimpleOne platform is disigned the way that no record can be removed from the system. When you click Move to Default, they are moved to the default local pack. If one of your local packs contains a VCS record that was created accidentally or belongs to another configuration pack, you can remove it from this local pack.
To move a VCS record, do the following:
- Navigate to Configuration → Local Packs.
- Open the local pack containing the VCS record you need to move.
- Scroll down to the Related Lists area and open the VCS Record tab.
- Select a record or records to be moved using the checkboxes and click Move to Default.
- These records will be moved to the default local pack of the corresponding application.
As a result:
- All selected record versions are moved to the default pack.
- All record versions with the same Record ID as the selected ones are moved to the default pack, too. That is, all previous and current versions of the same record are moved.
It is impossible to delete records from the default local pack.
Changing local pack for a VCS record
If a version was created in a wrong local pack by mistake (for example, in the default local pack), you can move it to the required local pack. To do so, complete the steps below:
- Navigate to Configuration → VCS Records.
- Find a record to recover. You can use list search or the Condition Builder.
- Open the record you need.
- Click the magnifier icon
by the Local Pack field and select the desired local pack.
- Click Save or Save and Exit to apply changes.
Snapshots
Snapshots restore record versions in the following cases:
- a record lacks current versions.
- the current version of a record is outdated – when the JSON Copy of this record version has a later date than the Updated at field of the record itself.
In version control systems (VCS), a snapshot is a fixed state description of a system or database.
There are two ways to create a table snapshot:
- via table managing form (table configuration)
- with a server-side API class SimpleVcs.
Option 1
- Navigate to System Definition → All Tables.
- Using the search bar and/or a Condition Builder, find the table for which you want to create a snapshot, and navigate to it.
- Open the hamburger menu and navigate to Configure → Table.
- Click the Create VCS snapshot button at the right top. This button is visible only when the versioning for this table is on (the Is VCS Enabled checkbox is selected).
Option 2
- Navigate to System Definition → Scripts.
- Write down a script and call createTableSnapshot(tableName) method in it.
The example script below makes snapshot of all versioned tables within the current application:
const table = new SimpleRecord('sys_db_table'); table.addQuery('is_vcs_enabled', true); table.addQuery('sys_id', '!=', '999999999999999998'); // exclude REM table.selectAttributes('name'); table.query(); while (table.next()) { const vcs = new SimpleVcs(); const versionCount = vcs.createTableSnapshot(table.name); if (versionCount > 0) { ss.info(`${table.name.padStart(80, " ")}: ${versionCount} versions created`); } }
Completing local packs
To complete local packs, complete the steps below:
- Click on the gear icon
at the top right to enter the Admin Preferences menu.
- Select your application in the Application choice list.
- Click the icon
on the right to the Local Pack choice field.
- Change the value of the State field to Completed.
- Click Save or Save and Exit to apply the changes.
- Click the Export Local Pack button to download the application, so it can be installed on different instances. See the Configuration Packs article to learn more.
Another way to open a local pack record is the following:
- Navigate to Configuration → Local Packs.
- Open the record you need to complete and export.
- Change the value of the State field to Completed.
- Click Save or Save and Exit to apply changes.
- Click the Export Local Pack button to download the application, so it can be installed on other instances.
Note that, when you develop an application, the records created in the pipeline of another application are unavailable for updating (either editing or deleting). Any attempt to modify a record related to another application causes a warning message.
To perform any actions with a record, switch to the application it belongs to.
For more information about switching between the applications, see the Admin Preferences article.
/
- No labels