Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab-level Snapshots #1694

Open
Tracked by #2334
knolleary opened this issue Feb 10, 2023 · 1 comment
Open
Tracked by #2334

Tab-level Snapshots #1694

knolleary opened this issue Feb 10, 2023 · 1 comment
Labels
epic A significant feature or piece of work that doesn't easily fit into a single release scope:device Agent feature for Gateways and PLCs

Comments

@knolleary
Copy link
Member

knolleary commented Feb 10, 2023

Description

Originally covered in #1509, but pulled out as its own epic

Currently a snapshot incorporates the entire flow configuration. When used with Devices, it means everything gets deployed to the device.

There is a use case (eg #1323) where a single project contains 'cloud' flows and 'device' flows all being edited together, but only the 'devices' flows should be deployed to devices.

This epic covers the ability to create snapshot that contains a subset of the full flow configuration. This would allow that subset to be deployed to devices without having to build in logic that selectively enables/disabled parts of the flows based on where it is running.


This does raise the question of: if a snapshot can be a subset of flows to push to a device, what is the reverse where a user wants only the inverse subset to be running in the cloud? They have to deploy the full set of flows to generate the device snapshot in the first place. Need to work through the UX on that side.


Possible approaches:

  1. When creating a snapshot, have a way to pick 'all flows' or 'selected flows'.
  2. Have a way to annotate a tab in the editor to indicate it is a 'device' only flow.
    MVP could be an env var set on the tab. More interesting would be some custom UI added via plugin that makes it more intuitive and integrated
    • When creating a snapshot, they can pick 'all flows' or 'selected flows' - but with a way to pick all that have the annotation.

Generating a valid flow configuration that is a subset of the full flows needs to be done with some care. Global config nodes and subflows don't exist on tabs, but may be depended on.

@knolleary knolleary added the epic A significant feature or piece of work that doesn't easily fit into a single release label Feb 10, 2023
@knolleary
Copy link
Member Author

Having thought about this feature some more over the last week, I think the best approach is for this to be entirely managed within Node-RED.

If we were to introduce the ability to create snapshots of just some parts of a project, then it hugely complicates the snapshots UX - keeping track of which snapshot is for what, having to remember the right things to include in the snapshot each time, being able to diff snapshots to see what has changed... lots of things would become much harder if snapshots became fragmented.

As a flow developer, all of that decision making should be done inside the editor when creating the flows.

For example,

  • have a way to identify a flow as device-only
    • This could range from a crude naming convention, setting a well-defined env-var on the flow, some custom UI option in the flow properties dialog.
  • automatically disable any non-device-only flows when deploying a snapshot to a device. This is a simple preprocessor step to set the disabled property on the tab object based on the above condition.

@MarianRaphael MarianRaphael added the scope:device Agent feature for Gateways and PLCs label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic A significant feature or piece of work that doesn't easily fit into a single release scope:device Agent feature for Gateways and PLCs
Projects
Status: Icebox
Development

No branches or pull requests

2 participants