Skip to content

Skynet Upload Code Cleanup

Peter-Jan Brone requested to merge pj/skynet-upload-code-cleanup into master

MERGE REQUEST

MR Guidelines

Overview

This MR only adds tests and refactors the way we handle upload parameters by neatly parsing all of them and passing them to the handler as skyfileUploadHeaders and skyfileUploadParams, which are new helper structs that contain everything. I think this is greatly beneficial to the readability of the upload code in general.

Something I have not done yet, is split up the skynetSkyfileHandlerPOST in three neatly separated upload handlers. I haven't done this yet to keep the refactoring to a minimum and be absolutely sure I don't break anything.

It's worth mentioning this does slightly affect the behaviour seeing as it used to be possible for certain request params to simply not be evaluated due to being on a different code path. I can't think of any occurrence though where this would be an issue and if anything I very much prefer to educate the user on the fact that his request is 'illegal' or 'bad' rather than failing silently in a way just because his mistake is never evaluated.

Example for Visual Changes

N/A

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Any new packages are added to Makefile and .gitlab-ci.yml
  • API documentation updated for API updates
  • Module README.md updated for changes to workflow
  • Issue added to Sia-UI repo for new supporting features
  • Changelog File Created

Issues Closed

N/A

Merge request reports