projectcaluma / caluma

A collaborative form editing service
https://caluma.io/
GNU General Public License v3.0
67 stars 26 forks source link

[RFC] Form Versioning #2231

Open winged opened 2 weeks ago

winged commented 2 weeks ago

There is a requirement to have support for versioning forms, and what comes with them. Some ideas are floating around, but to get this thing going, we need to follow a structured approach.

Note: This issue is an RFC, discussions are welcome, and no concrete, actionable specification is done yet.

Requirements / Starting point

Hard requirements

The following are things that are not negotiable. Things that absolutely must work.

Soft requirements

These should be optimized for, but if for some reason something needs to be worked around or cannot be done, it can be considered acceptable. Ordered by priority/importance.

Questions

Existing implementations / Workarounds

One installation implements a versioning scheme where a form's version is determined by a hash of the question's slugs within. The hash is appended to the form and corresponding question (hierarchical form), which again affects the slug hash of it's parent form in turn.

The side effect of this is that it is possible to modify questions in-place without triggering a new version, and new versions can be done by creating a new question with a versioned suffix (question-foo-v2 for example). The form structure in this installation is built up automatically from an Excel sheet and some other data sources. In it's current form, it would not be ergonomical to use the form builder for modifications.

Other installations use a more manual versioning approach: Form structures are managed in JSON dumps that are loaded on deploy; structures such as Tasks are also managed in JSON. When a new form version is released, the old forms remain in place, but the new forms are referenced in the tasks and will then be picked up on the next work item or case.

Both of these implementations work, but have downsides. The second variant will potentially still be around, as these forms are not manually configured on the "live" system, but transported via export/import.

Proposal

The following proposal is a rough outline. Not all the details are fleshed out yet, and the impact of these changes needs to be evaluated as well.

Model changes

Processing changes

Form builder changes

winged commented 2 weeks ago

Let us, as a first step, get an agreement on the requirements: Are there any other "hard" requirements? And do we agree on the "soft" ones as well?