Skip to content

Commit

Permalink
Add yank_message field to API version responses (#9437)
Browse files Browse the repository at this point in the history
This field can currently only be set directly in the database, but introducing it in a dedicated commit/PR makes the diff of the commit that introduces the update API much more manageable.
  • Loading branch information
Turbo87 authored Sep 12, 2024
1 parent ffa4d86 commit 3678583
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo/1.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo/1.0.0/readme",
"rust_version": "1.69",
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo/1.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_show/1.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
},
{
Expand Down Expand Up @@ -103,6 +104,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_show/0.5.1/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
},
{
Expand Down Expand Up @@ -135,6 +137,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_show/0.5.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c3/1.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c2/1.1.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c3/3.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
},
{
Expand All @@ -89,6 +90,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c2/2.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c2/1.0.18446744073709551615/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c2/2.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/c2/2.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_versions/1.0.0/readme",
"rust_version": "1.64",
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
},
{
Expand Down Expand Up @@ -60,6 +61,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_versions/0.5.1/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
},
{
Expand Down Expand Up @@ -92,6 +94,7 @@ expression: response.json()
"readme_path": "/api/v1/crates/foo_versions/0.5.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ expression: json
"readme_path": "/api/v1/crates/foo_vers_show_no_pb/1.0.0/readme",
"rust_version": null,
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ expression: json
"readme_path": "/api/v1/crates/foo_vers_show/2.0.0/readme",
"rust_version": "1.64",
"updated_at": "[datetime]",
"yank_message": null,
"yanked": false
}
}
4 changes: 4 additions & 0 deletions src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ pub struct EncodableVersion {
pub downloads: i32,
pub features: serde_json::Value,
pub yanked: bool,
pub yank_message: Option<String>,
pub lib_links: Option<String>,
// NOTE: Used by shields.io, altering `license` requires a PR with shields.io
pub license: Option<String>,
Expand Down Expand Up @@ -586,6 +587,7 @@ impl EncodableVersion {
downloads,
features,
yanked,
yank_message,
links: lib_links,
license,
crate_size,
Expand Down Expand Up @@ -613,6 +615,7 @@ impl EncodableVersion {
downloads,
features,
yanked,
yank_message,
lib_links,
license,
links,
Expand Down Expand Up @@ -736,6 +739,7 @@ mod tests {
downloads: 0,
features: serde_json::from_str("{}").unwrap(),
yanked: false,
yank_message: None,
license: None,
lib_links: None,
links: EncodableVersionLinks {
Expand Down

0 comments on commit 3678583

Please sign in to comment.