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

Snapshot import export component options #4610

Merged
merged 21 commits into from
Oct 14, 2024

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Oct 3, 2024

closes #4605

Description

  • Deletes duplicate (unused) vue components
    • frontend/src/pages/application/components/ExportProjectComponents.vue
    • frontend/src/pages/application/components/ImportProjectComponents.vue
    • Removes eslint exceptions
  • Updates snapshot controller to support component options
  • Update snapshot import/export API to support component options
  • Updates frontend API to support component options
  • Updates UI for snapshot import/export component options
    • Repurposes ExportInstanceComponents as ExportImportComponents
    • adds adds instance of repurposed ExportImportComponents to:
      • frontend/src/components/dialogs/SnapshotImportDialog.vue
      • frontend/src/pages/application/Snapshots/components/dialogs/SnapshotExportDialog.vue
  • add unit tests for import/export snapshot component options

Potential clean up: move SnapshotExportDialog.vue to be more reusable, sitting along side frontend/src/components/dialogs/SnapshotImportDialog.vue

Unit Tests added

  Snapshot controller
    exportSnapshot
      ✔ should export a full snapshot by default
      ✔ should export a snapshot without creds
      ✔ should export a snapshot without flows
      ✔ should export a snapshot without env (envVars: false)
      ✔ should export a snapshot without env values (envVars: "keys")
    uploadSnapshot
      ✔ should upload a snapshot
      ✔ should upload a snapshot without creds
      ✔ should upload a snapshot without flows
      ✔ should upload a snapshot without env (envVars: false)
      ✔ should upload a snapshot without env values (envVars: "keys")

e2e tests added

image

TODO:

Related Issue(s)

#4605

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.34%. Comparing base (fd3a97d) to head (7a7fe65).
Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4610      +/-   ##
==========================================
+ Coverage   78.28%   78.34%   +0.06%     
==========================================
  Files         303      302       -1     
  Lines       14367    14390      +23     
  Branches     3267     3283      +16     
==========================================
+ Hits        11247    11274      +27     
+ Misses       3120     3116       -4     
Flag Coverage Δ
backend 78.34% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Steve-Mcl
Copy link
Contributor Author

Steve-Mcl commented Oct 3, 2024

@joepavitt added as reviewer for frontend.

This was rejigged slightly from the mock up screens agreed in the issue - in that the credential secret is now BELOW the new component options.

The reason being: When toggling the component option "credentials", the component options group were jumping up and down the dialog due to toggling the visibility of the credential secret field - making it somewhat janky.

Copy link
Contributor

@joepavitt joepavitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX-wise, happy with it all. One comment on the instruction in the "download" dialog. Functionally, seems to work too, although front-end E2E's should be added, as this is a risky area that will definitely impact user's production environments

…apshotExportDialog.vue

Co-authored-by: Joe Pavitt <99246719+joepavitt@users.noreply.github.com>
@Steve-Mcl
Copy link
Contributor Author

Steve-Mcl commented Oct 4, 2024

although front-end E2E's should be added,

Yeah, absolutely makes sense & agree. Will add E2E tests.

@Steve-Mcl
Copy link
Contributor Author

@joepavitt e2e tests added

image

That was not easy - but definitely worth the effort as it turned up a couple of edge cases (like re-selecting same snapshot to upload would not work)

NOTE: There were a number of challenges in implementing the e2e tests for multiple downloads/uploads tests! One particular puzzling doozy was with uploading fixtures that several other users of cypress have faced over the years (and a hand full of "me too" issues on cypress issue tracker - none of which worked here!). Essentially, selectFile call (for setting a fixture into a file input ready for upload) would not work in 2nd, 3rd, nth subsequent tests unless a different fixture file was used (that's why there are now upload1.json, upload2.json, ... files added in the fixtures dir - that took far to long to figure out and fix - bah!)

fingers crossed they pas on GH too 🤞

@Steve-Mcl
Copy link
Contributor Author

@joepavitt FYI

Copy link
Contributor

@joepavitt joepavitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd already said it was all good in a comment, just hadn't clicked the Approve button/ With Nick's approval, you could have just gone ahead, but anyway, my explicit approval is given.

@joepavitt joepavitt merged commit 49321fc into main Oct 14, 2024
14 checks passed
@joepavitt joepavitt deleted the 4605-snapshot-import-export-options branch October 14, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add control over contents of exported and imported Snapshots
4 participants