Skip to content

Commit ec6bb54

Browse files
committed
Expose versions.links column on the API
1 parent 4a54f2b commit ec6bb54

14 files changed

+22
-0
lines changed

src/tests/krate/publish/snapshots/all__krate__publish__links__crate_with_links_field-2.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ expression: response.json()
2727
"features": {},
2828
"has_lib": false,
2929
"id": "[id]",
30+
"lib_links": "git2",
3031
"license": "MIT",
3132
"links": {
3233
"authors": "/api/v1/crates/foo/1.0.0/authors",

src/tests/krate/publish/snapshots/all__krate__publish__manifest__boolean_readme-2.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ expression: response.json()
2727
"features": {},
2828
"has_lib": false,
2929
"id": "[id]",
30+
"lib_links": null,
3031
"license": "MIT",
3132
"links": {
3233
"authors": "/api/v1/crates/foo/1.0.0/authors",

src/tests/krate/publish/snapshots/all__krate__publish__manifest__lib_and_bin_crate-2.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ expression: response.json()
3030
"features": {},
3131
"has_lib": true,
3232
"id": "[id]",
33+
"lib_links": null,
3334
"license": "MIT",
3435
"links": {
3536
"authors": "/api/v1/crates/foo/1.0.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__read__show.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ expression: response.json()
5959
"features": {},
6060
"has_lib": null,
6161
"id": 1,
62+
"lib_links": null,
6263
"license": null,
6364
"links": {
6465
"authors": "/api/v1/crates/foo_show/1.0.0/authors",
@@ -84,6 +85,7 @@ expression: response.json()
8485
"features": {},
8586
"has_lib": null,
8687
"id": 3,
88+
"lib_links": null,
8789
"license": null,
8890
"links": {
8991
"authors": "/api/v1/crates/foo_show/0.5.1/authors",
@@ -115,6 +117,7 @@ expression: response.json()
115117
"features": {},
116118
"has_lib": null,
117119
"id": 2,
120+
"lib_links": null,
118121
"license": null,
119122
"links": {
120123
"authors": "/api/v1/crates/foo_show/0.5.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__prerelease_versions_not_included_in_reverse_dependencies.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ expression: response.json()
3333
"features": {},
3434
"has_lib": null,
3535
"id": 3,
36+
"lib_links": null,
3637
"license": null,
3738
"links": {
3839
"authors": "/api/v1/crates/c3/1.0.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__reverse_dependencies.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ expression: response.json()
3333
"features": {},
3434
"has_lib": null,
3535
"id": 3,
36+
"lib_links": null,
3637
"license": null,
3738
"links": {
3839
"authors": "/api/v1/crates/c2/1.1.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__reverse_dependencies_includes_published_by_user_when_present.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ expression: response.json()
4545
"features": {},
4646
"has_lib": null,
4747
"id": 3,
48+
"lib_links": null,
4849
"license": null,
4950
"links": {
5051
"authors": "/api/v1/crates/c3/3.0.0/authors",
@@ -76,6 +77,7 @@ expression: response.json()
7677
"features": {},
7778
"has_lib": null,
7879
"id": 2,
80+
"lib_links": null,
7981
"license": null,
8082
"links": {
8183
"authors": "/api/v1/crates/c2/2.0.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__reverse_dependencies_query_supports_u64_version_number_parts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ expression: response.json()
3333
"features": {},
3434
"has_lib": null,
3535
"id": 2,
36+
"lib_links": null,
3637
"license": null,
3738
"links": {
3839
"authors": "/api/v1/crates/c2/1.0.18446744073709551615/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__reverse_dependencies_when_old_version_doesnt_depend_but_new_does.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ expression: response.json()
3333
"features": {},
3434
"has_lib": null,
3535
"id": 3,
36+
"lib_links": null,
3637
"license": null,
3738
"links": {
3839
"authors": "/api/v1/crates/c2/2.0.0/authors",

src/tests/routes/crates/snapshots/all__routes__crates__reverse_dependencies__yanked_versions_not_included_in_reverse_dependencies.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ expression: response.json()
3333
"features": {},
3434
"has_lib": null,
3535
"id": 3,
36+
"lib_links": null,
3637
"license": null,
3738
"links": {
3839
"authors": "/api/v1/crates/c2/2.0.0/authors",

src/tests/routes/crates/versions/snapshots/all__routes__crates__versions__list__versions.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ expression: response.json()
1616
"features": {},
1717
"has_lib": null,
1818
"id": 2,
19+
"lib_links": null,
1920
"license": null,
2021
"links": {
2122
"authors": "/api/v1/crates/foo_versions/1.0.0/authors",
@@ -41,6 +42,7 @@ expression: response.json()
4142
"features": {},
4243
"has_lib": null,
4344
"id": 1,
45+
"lib_links": null,
4446
"license": null,
4547
"links": {
4648
"authors": "/api/v1/crates/foo_versions/0.5.1/authors",
@@ -72,6 +74,7 @@ expression: response.json()
7274
"features": {},
7375
"has_lib": null,
7476
"id": 3,
77+
"lib_links": null,
7578
"license": null,
7679
"links": {
7780
"authors": "/api/v1/crates/foo_versions/0.5.0/authors",

src/tests/routes/crates/versions/snapshots/all__routes__crates__versions__read__show_by_crate_name_and_semver_no_published_by.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ expression: json
1515
"features": {},
1616
"has_lib": null,
1717
"id": "[id]",
18+
"lib_links": null,
1819
"license": null,
1920
"links": {
2021
"authors": "/api/v1/crates/foo_vers_show_no_pb/1.0.0/authors",

src/tests/routes/crates/versions/snapshots/all__routes__crates__versions__read__show_by_crate_name_and_version.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ expression: json
1515
"features": {},
1616
"has_lib": null,
1717
"id": "[id]",
18+
"lib_links": null,
1819
"license": null,
1920
"links": {
2021
"authors": "/api/v1/crates/foo_vers_show/2.0.0/authors",

src/views.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ pub struct EncodableVersion {
558558
pub downloads: i32,
559559
pub features: serde_json::Value,
560560
pub yanked: bool,
561+
pub lib_links: Option<String>,
561562
// NOTE: Used by shields.io, altering `license` requires a PR with shields.io
562563
pub license: Option<String>,
563564
pub links: EncodableVersionLinks,
@@ -585,6 +586,7 @@ impl EncodableVersion {
585586
downloads,
586587
features,
587588
yanked,
589+
links: lib_links,
588590
license,
589591
crate_size,
590592
checksum,
@@ -611,6 +613,7 @@ impl EncodableVersion {
611613
downloads,
612614
features,
613615
yanked,
616+
lib_links,
614617
license,
615618
links,
616619
crate_size,
@@ -734,6 +737,7 @@ mod tests {
734737
features: serde_json::from_str("{}").unwrap(),
735738
yanked: false,
736739
license: None,
740+
lib_links: None,
737741
links: EncodableVersionLinks {
738742
dependencies: "".to_string(),
739743
version_downloads: "".to_string(),

0 commit comments

Comments
 (0)