flowfuse icon indicating copy to clipboard operation
flowfuse copied to clipboard

Enable Snapshot Upload Functionality

Open MarianRaphael opened this issue 1 year ago • 2 comments

Epic

https://github.com/FlowFuse/flowfuse/issues/3617

Description

As a: FlowFuse User

I want: the ability to upload snapshots

So that: I can easily import my work or configurations from one FlowFuse environment to another, facilitating a seamless transition and integration of my workflows.

Which customers would this be availble to

Everyone - CE/Starter/Team/Enterprise

Acceptance Criteria

  • [ ] Introduce an "Upload Snapshot" button in a prominent location, preferably near the area where snapshots can be created
  • [ ] Ensure the upload process includes a validation step to check the integrity and compatibility of the snapshot
  • [ ] Provide feedback to the user upon successful upload or in the case of an error, with clear messages indicating the status of the upload process
  • [ ] credentialsSecret recomputed upon export

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

MarianRaphael avatar Mar 25 '24 06:03 MarianRaphael

This needs some design around UX.

It is not really clear where these will be uploaded to but based on conversation and work done in the sister issue FlowFuse/flowfuse#3627 I assume it is to be a feature somewhere in the instance snapshots vue page?

Image

Additional questions/thoughts

  • As a snapshot can be sent to an application device directly too, would we also want to support upload on the devices->snapshots page?

    • NOTE: FlowFuse/flowfuse#3627 is for downloading an instance snapshot only at this time
  • What about the Applications -> Snapshots page? Support upload here too & if so, would we need to implement an "instance/device selection" which which to associate the snapshot? Or would we permit a snapshot to be owned by the application (which would mean ProjectSnapshots table would need its own Application DB field and supporting logic around when it can be selected etc)

Steve-Mcl avatar May 03 '24 08:05 Steve-Mcl

To be frank, I think scoping to instances only makes for a weirdly inconsistent UX - especially when the delta to apply to all types of snapshots is very small. We already have a fair few inconsistencies around snapshot UX (see FlowFuse/flowfuse#3815 I raised yesterday whilst playing with the new download feature).

Let's have a quick refinement discussion (IRL) on this epic to make sure we don't add more inconsistencies than we solve.

knolleary avatar May 03 '24 08:05 knolleary

With the Backend and Frontend PRs raised, there are 2 points of contention that need to be either acknowledged or addressed


Backend API #3868

  • Adds RBAC role snapshots:import for which only the owner of the instance or device can import snapshots
    • This may be a bit restrictive, since member is permitted to create snapshots?

Background: Since importing a snapshot is potentially an "unknown" set of flows/settings/env/modules, I aired on the side of caution. Question: Change or leave as owner only?


Backend API #3868

  • credentialSecret is NOT rehashed and is stored in the DB as provided

Background: As it is, the user uploading already knows the correct secret and I can think of no reason to leave "as is" OR to recompute it! I defaulted to leaving it "as is" Question: Change or leave as is?

Steve-Mcl avatar May 16 '24 10:05 Steve-Mcl

@knolleary before I merge https://github.com/FlowFuse/flowfuse/pull/3868 can I get your take on the above pls?

Steve-Mcl avatar May 16 '24 14:05 Steve-Mcl

@Steve-Mcl I reviewed #3866 already which sets the permission to owner and accepts the credential secret as-is. I'm happy with that for a first iteration. The permission can be relaxed easily enough if we change our minds - and we can start regenerating the secret if we realise that's what we should be doing without any impact.

knolleary avatar May 16 '24 14:05 knolleary

@knolleary perfect. Thanks.

Steve-Mcl avatar May 16 '24 14:05 Steve-Mcl