-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add a simple REST API for fetching a file's ID #72
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 85.49% 88.38% +2.88%
==========================================
Files 5 6 +1
Lines 531 568 +37
Branches 68 70 +2
==========================================
+ Hits 454 502 +48
+ Misses 55 44 -11
Partials 22 22 ☔ View full report in Codecov by Sentry. |
The test failures appear unrelated—something with readthedocs is failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zsailer Thank you for contributing this (and especially for including unit tests)! Left a few comments below.
The CI failure is unrelated. I'll fix it in a separate PR and you can rebase on main
after that PR is merged.
Do you need this change included in a release after this PR is merged?
The RTD failure is fixed in #73, which is merged. You should rebase on |
Thank you for the review, @dlqqq! I appreciate your time here! I have a couple of follow-up questions before I push changes. Let me know what you think!
Yeah, if you don't mind. I'm happy to handle the release too. It looks like y'all have Jupyter releaser set-up, so I should be able to cut a release. |
@Zsailer Thanks. I've resolved all of the feedback above, except my suggestion for splitting the endpoint in two. |
Cool cool, thanks David! I've split the endpoints into two. Let me know what you think. I made a minor choice to raise a |
await jp_fetch("api/fileid/id", params={"path": "test"}) | ||
|
||
assert err.value.code == 404 | ||
assert err.value.message.startswith("The ID for file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I don't love doing this, checking the message might be necessary to avoid false positives in this test.
If we changed the endpoint in the future and forgot to update the unit test, this unit test would otherwise pass when it should fail.
Hey @dlqqq, gentle ping here for final review and merge. I can cut the release after that. |
I'm going to proceed on merging this, since all review has been addressed. Thanks for your reviews @dlqqq! |
Released: https://github.com/jupyter-server/jupyter_server_fileid/releases/tag/v0.9.1 (I meant to release as a minor bump, i.e. 0.10.0. Somehow I missed the automatic bumping by releaser to a patch release. Apologies for not catching this; there were a few steps to get Jupyter releaser working so I missed this. I think it's okay to leave this as a patch release—instead of yanking and re-releasing—since the changes are additive and minimal enough.) |
@Zsailer Oh, really sorry about this. I was on vacation last week and forgot to update my GitHub icon to reflect that. Thanks for cutting the release independently. I agree that it's fine to keep this as v0.9.1. |
No apologies needed! I'm glad you got some time away. I'm here to help maintain 😎 |
Addresses #71
Adds a simple REST API for fetching a files ID or path
I'm using a single endpoint,
/api/fileid
and query parameters to identify the fileboth return the same JSON response for a file