cdisc-org / conformance-rules-editor

MIT License
6 stars 3 forks source link

61 add version control #200

Closed gerrycampion closed 11 months ago

gerrycampion commented 1 year ago

Versioning Each version of a rule is stored as a separate item in the container. Versions are maintained using the "created" timestamp property. Versions are grouped using the "latestId" property, which points to the id of the current version. If the item is the latest item, it will not have a "latestId" property If the item has been deleted, the "latestId" property will be empty and if the rule is published, it will be unpublished so that the library/engine do not think the rule exists. If a published item is patched, the new item will remain published and the previous version will be unpublished.

Testing The following functionality should be tested:

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-200.centralus.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-200.centralus.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-200.centralus.azurestaticapps.net

nhaydel commented 1 year ago

@gerrycampion overall the code looks good. I am a little concerned about saving a copy of the rule in the rules table on each save. I think if enough users save frequently the table could get pretty large and queries could slow down. What do you think about creating a new table: RuleHistory, which would store old versions of the rule? The rule record in the main rules table would have references to the rule history table:

[
{
    "created": timestamp
    "creator": <name>
    "replaced/updated": <timestamp when a new version of the rule became the latest>
    "rule_history_id": "id of the rule version in the rule history table"
}
]

This way we would only query rule history when getting a specific diff, so we could look up by ID when the rule author selects a rule to diff with. It might also be cheaper since we would not be doing as many queries on all rules ever created

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-200.centralus.azurestaticapps.net

gerrycampion commented 12 months ago

@gerrycampion overall the code looks good. I am a little concerned about saving a copy of the rule in the rules table on each save. I think if enough users save frequently the table could get pretty large and queries could slow down. What do you think about creating a new table: RuleHistory, which would store old versions of the rule? The rule record in the main rules table would have references to the rule history table:

[
{
    "created": timestamp
    "creator": <name>
    "replaced/updated": <timestamp when a new version of the rule became the latest>
    "rule_history_id": "id of the rule version in the rule history table"
}
]

This way we would only query rule history when getting a specific diff, so we could look up by ID when the rule author selects a rule to diff with. It might also be cheaper since we would not be doing as many queries on all rules ever created

The Rules table now stores a historical list of { created, creator, id}. The historical rules are stored in a separate container. I also updated the core id population to avoid reusing core ids for rules that have been deleted.

github-actions[bot] commented 12 months ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-200.centralus.azurestaticapps.net