hivemq / hivemq-edge

HiveMQ Edge is an MQTT gateway that enables interoperability between OT devices and IT systems. It translates diverse protocols into MQTT for streamlined communication and helps organize data into a unified namespace, making managing and streaming data across your infrastructure easier.
http://hivemq.com
Apache License 2.0
91 stars 20 forks source link

feat(20143): Add Schema versioning #334

Closed vanch3d closed 2 months ago

vanch3d commented 3 months ago

See https://hivemq.kanbanize.com/ctrl_board/57/cards/20143/details/

The PR introduces a new UX for the creation, publishing and loading of Schemas as a reusable resource. The previous version only allowed the creation of a new resource from scratch.

The new UX is defined by a controlled finite state machine based on the three properties of a schema: name, version and the couple type + content

stateDiagram-v2
    [*] --> DRAFT: create
    [*] --> VERSION_N: load

    DRAFT --> DRAFT: select type
    DRAFT --> DRAFT: edit content
    DRAFT --> DRAFT: create new name

    DRAFT --> VERSION_LATEST: select name
    VERSION_N:::namedSchema --> VERSION_LATEST: select name

    VERSION_N --> DRAFT: create new name
    VERSION_LATEST:::namedSchema --> DRAFT: create new name

    VERSION_LATEST --> VERSION_N: select version
    VERSION_N --> VERSION_N: select version

    VERSION_LATEST --> MODIFIED: edit content
    VERSION_N --> MODIFIED: edit content

    DRAFT --> [*]: publish
    VERSION_N --> [*]: publish
    VERSION_LATEST --> [*]: publish
    MODIFIED --> [*]: publish

  classDef namedSchema fill:#f96,color:black

The UX described above allows a controlled versioning of resources, schema in this PR. It will be also applied to script.

Before

screenshot-localhost_3000-2024 03 25-13_06_52

After

screenshot-localhost_3000-2024 03 21-17_07_00

screenshot-localhost_3000-2024 03 21-17_07_52

screenshot-localhost_3000-2024 03 21-17_09_27

screenshot-localhost_3000-2024 03 21-17_08_22

vanch3d commented 2 months ago

The Script user flow (https://github.com/hivemq/hivemq-edge/pull/357) has been marged