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 bug in api/contents requests for an allowed copy #939

Merged
merged 1 commit into from Aug 2, 2022

Conversation

kiersten-stokes
Copy link
Contributor

As pointed out in this comment, #937 introduced a bug in api/contents POST copy_from requests, leading to both _copy and a _new_untitled executing for an allowed copy. This PR fixes that bug by adding the else clause for the copy_from block.

Tested manually to ensure no untitled file is created on duplicate or copy/paste.

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #939 (e7b010c) into main (54164ac) will not change coverage.
The diff coverage is 60.00%.

@@           Coverage Diff           @@
##             main     #939   +/-   ##
=======================================
  Coverage   72.30%   72.30%           
=======================================
  Files          65       65           
  Lines        8001     8001           
  Branches     1336     1336           
=======================================
  Hits         5785     5785           
  Misses       1810     1810           
  Partials      406      406           
Impacted Files Coverage Δ
jupyter_server/services/contents/handlers.py 86.63% <60.00%> (ø)

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 54164ac...e7b010c. Read the comment docs.

@kevin-bates kevin-bates added the bug label Aug 2, 2022
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

Thank you for the quick turnaround @kiersten-stokes!

@blink1073 blink1073 merged commit a8bf3f6 into jupyter-server:main Aug 2, 2022
@blink1073
Copy link
Collaborator

@meeseeksdev please backport to 1.x

@lumberbot-app
Copy link

lumberbot-app bot commented Aug 2, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 1.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 a8bf3f6f3949e3a6ae0398386d59b5cdc432d461
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #939: Fix bug in `api/contents` requests for an allowed copy'
  1. Push to a named branch:
git push YOURFORK 1.x:auto-backport-of-pr-939-on-1.x
  1. Create a PR against branch 1.x, I would have named this PR:

"Backport PR #939 on branch 1.x (Fix bug in api/contents requests for an allowed copy)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants