Skip to content

Ability to download and upload config files#1083

Merged
rdmark merged 6 commits intodevelopfrom
rdmark-config-file-backup
Jan 28, 2023
Merged

Ability to download and upload config files#1083
rdmark merged 6 commits intodevelopfrom
rdmark-config-file-backup

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Jan 28, 2023

  • Rename /config/load endpoint to /config/action since it has multiple functions
  • Add a send function to above endpoint, which triggers a download of the config file, and use it with a new Download button on the index page
  • Add an option to upload to the CFG_DIR
  • Improve layout of the file transfer destination web form: radio buttons before labels, and better padding between options
  • Add a test for config downloading

@rdmark rdmark requested a review from nucleogenic January 28, 2023 05:51
@rdmark rdmark marked this pull request as ready for review January 28, 2023 05:57
Copy link
Copy Markdown
Member

@nucleogenic nucleogenic left a comment

Choose a reason for hiding this comment

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

This really improves the usability of the config file system, great work!

Comment on lines +170 to +178
response_data = response.json()

assert response.status_code == 200
assert response_data["status"] == STATUS_SUCCESS
assert response_data["messages"][0]["message"] == (
f"File created: {env['cfg_dir']}/{config_json_file}"
)

assert config_json_file in http_client.get("/").json()["data"]["config_files"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Opinion) It would be fine to skip these assertions as we have assurance the save process works from test_save_load_and_delete_configs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I suggest we keep the response.status_code assert so that we know that the process succeeded up that point, in the rare case there is flakiness in this area.

@rdmark rdmark merged commit 956195d into develop Jan 28, 2023
@rdmark rdmark deleted the rdmark-config-file-backup branch January 28, 2023 22:34
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.

2 participants