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

Fix various filesystem api bugs #187

Merged
merged 14 commits into from Sep 11, 2017

Conversation

Projects
None yet
2 participants
@libre-man
Copy link
Collaborator

commented Sep 9, 2017

Description

The following things are changed:

  • Make it possible to delete directories with children It is only possible to delete children if it has no children that are owned by it. So a teacher can only delete directory $x if all children of $x are owned by student.
  • Make it impossible to upload too large files. This was already checked during archive uploading but is now also checked when uploading files using the filesystem. On drawback is that you can upload many files just under the file system limit, maybe we should add a second limit: a fs file limit.
  • Make it possible to rename files using the API.

Checklist:

  • Linter & type checker OK
  • Tests
  • Added type information
  • Docs

Screenshot or -recording (if applicable)

libre-man added some commits Sep 9, 2017

Make it possible to delete directories with children
It is only possible to delete children if it has no children that are
owned by it. So a teacher can only delete directory $x if all children
of $x are owned by student.
@codecov

This comment has been minimized.

Copy link

commented Sep 9, 2017

Codecov Report

Merging #187 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #187      +/-   ##
==========================================
+ Coverage   92.14%   92.26%   +0.12%     
==========================================
  Files          22       22              
  Lines        2596     2638      +42     
==========================================
+ Hits         2392     2434      +42     
  Misses        204      204
Impacted Files Coverage Δ
psef/helpers.py 100% <100%> (ø) ⬆️
psef/models.py 98.42% <100%> (+0.03%) ⬆️
psef/files.py 99.3% <100%> (+0.02%) ⬆️
psef/v1/submissions.py 100% <100%> (ø) ⬆️
psef/v1/code.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c01d026...8a7edc1. Read the comment docs.

libre-man added some commits Sep 9, 2017

Add rename option to patch code route
This makes it possible for the fs to do quick renaming of files.

libre-man and others added some commits Sep 10, 2017

@olmokramer

This comment has been minimized.

Copy link
Collaborator

commented Sep 11, 2017

I found a few issues:

  • I don't get an error message when I upload a file that is too large:
    codegrade-upload-limit
  • I don't get an error when I upload a tar archive with a 192MB file compressed to 22MB
new_name = path_arr[-1]
while new_name and new_name[-1] == '/':
new_name = new_name[:-1]
print(other.name)

This comment has been minimized.

Copy link
@olmokramer

olmokramer Sep 11, 2017

Collaborator

Should be removed

libre-man added some commits Sep 11, 2017

@olmokramer
Copy link
Collaborator

left a comment

Nice!

@libre-man libre-man merged commit b3c5339 into master Sep 11, 2017

4 checks passed

codecov/patch 100% of diff hit (target 92.14%)
Details
codecov/project 92.26% (+0.12%) compared to c01d026
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 92.267%
Details

@olmokramer olmokramer deleted the fix-fs-api-bugs branch Sep 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.