-
Notifications
You must be signed in to change notification settings - Fork 599
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 PATCH /crates/:crate/:version
route
#9423
Add PATCH /crates/:crate/:version
route
#9423
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9423 +/- ##
==========================================
+ Coverage 89.05% 89.11% +0.06%
==========================================
Files 285 285
Lines 28757 28920 +163
==========================================
+ Hits 25610 25773 +163
Misses 3147 3147 ☔ View full report in Codecov by Sentry. |
4f51afb
to
629c370
Compare
629c370
to
7dd8d49
Compare
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.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
fb5c1f2
to
30b5ddb
Compare
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.
I've left some suggestions before a full review.
30b5ddb
to
3706791
Compare
I've rebased this on top of #9437 to get that first part out of the way and make the PR a bit easier to review :) |
3706791
to
873ccdb
Compare
f00807f
to
3e33515
Compare
PATCH /crates/:crate/:version
routePATCH /crates/:crate/:version
route
a9e1768
to
5f8fbb9
Compare
5f8fbb9
to
1a9722c
Compare
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.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
PATCH /crates/:crate/:version
routePATCH /crates/:crate/:version
route
☔ The latest upstream changes (presumably #9505) made this pull request unmergeable. Please resolve the merge conflicts. |
ab6eb47
to
bdc7968
Compare
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.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
☔ The latest upstream changes (presumably 60d3cfe) made this pull request unmergeable. Please resolve the merge conflicts. |
23adba8
to
92a4793
Compare
Signed-off-by: Rustin170506 <29879298+Rustin170506@users.noreply.github.com>
This was using the previous `yanked` state for the admin log message, instead of the new state.
src/tests/krate/yanking.rs
Outdated
// Attempt to set yank message on unyanked version (should fail) | ||
token | ||
.update_yank_status("patchable", "1.0.0", None, Some("Invalid message")) | ||
.await | ||
.status() | ||
.is_client_error(); | ||
// Attempt to unyank with message (should fail) | ||
token | ||
.update_yank_status("patchable", "1.0.0", Some(false), Some("Invalid message")) | ||
.await | ||
.status() | ||
.is_client_error(); |
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.
these calls just return bool
, but they are missing assertions. probably best to assert against a specific status code though.
src/controllers/version/metadata.rs
Outdated
|
||
if Handle::current().block_on(user.rights(state, &owners))? < Rights::Publish { | ||
if user.is_admin { | ||
let action = if version.yanked { |
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.
I think this should be using the yanked
variable from below 🤔
92a4793
to
45ec3fb
Compare
I rebased the branch and fixed the above two comments. I think this is good to go now :) |
ref #9193
This pull request introduces a new patch API for yanking and unyanking crates with a message.
The logic is very similar to the current yank and unyank API, but it supports setting a yank message.