Packs proposal
Version | 1.1 | |
Created | 2023/06/07 - Michael P. Dubner (https://github.com/pyhedgehog) | |
Modified | 2023/07/14 - Michael P. Dubner (https://github.com/pyhedgehog) |
Abstract
This SIP (Saltcorn Improvement Proposal) has goal to make packs more developer-friendly format.
Motivation
Packs pros
Features that should be keept:
- Pack has simple representation that can be constructed manually/programmatically.
- Pack has text representation that can be stored in VCS.
- Snapshots are packs.
- On pack re-import existing triggers are overrided.
Packs cons
Defects that should be fixed:
- Packs can be imported only once (#1507)
- Existing table cause pack import to fail.
- Existing view/page silently ignored.
- Packs export can't be easily repeated (#1505)
- Packs are not self-consistent.
- Custom events not included (#1806)
- Important parts of config is not included: menu, log settings, tags.
- Packs imported from cli (
saltcorn install-pack -f ...
) require saltcorn restart.
Proposal
- Update existing views, pages (and maybe library items) like triggers.
- Add ability to define default value for required column in pack.
- Update existing table definition if posiible fail otherwise.
- Add "create pack" to tag interface. This will simplify re-export.
- Send reload signal from cli install-pack command to server (i.e. SIGHUP which should be handled beforehand).
Format changes
- Add format version field (
"format": 1
) while absence of this field implies format=0, i.e. old format. - Add version field (
"version": "1.0"
by default). - Add custom_events field as list of
{"name":"...","hasChannel":false}
.
Import changes
- Update (aka replace) existing views, pages (and maybe library items) like triggers.
- Update existing table definition if posiible fail (and rollback) whole pack import otherwise.
Interface changes
- Add ability to define default value for required column in pack.
- Change pack export interface as a whole:
- Add versioning
- Add pack re-export
- Make pack installed on export (including version bump)
- Add "create pack" to tag interface. This will simplify re-export with version increment.
Misc changes
- Send reload signal from cli install-pack command to server (i.e. SIGHUP which should be handled beforehand).