crates.io icon indicating copy to clipboard operation
crates.io copied to clipboard

Add links information to the crates.io api response

Open slugclub opened this issue 5 years ago • 1 comments

The index files in rust-lang/crates.io-index have a links field which contains the name of the native library a package links with. However, this information is not exposed via the crates.io API.

For example, the bcc-sys package has a links field in its index file but that information is not available via the api.

Can you please add it?

slugclub avatar Aug 11 '20 23:08 slugclub

for future reference, this got implemented in https://github.com/rust-lang/crates.io/pull/1248, but was only added to the index there, but not to our database. we would need to add a new column to the versions table and save this data in the database too. we might also have to build a small script to backfill the links from the index into the database for already existing versions.

Turbo87 avatar Feb 11 '21 08:02 Turbo87

The links column in the database exists at this point and has already been backfilled.

The remaining issue is that the version model of the API already contains a links property with a bunch of related URLs (see e.g. https://crates.io/api/v1/crates/libz-sys/1.1.18). Changing the meaning of the existing links field would be a breaking change, so we will have to come up with a different name to correspond to the links field in the index.

@rust-lang/crates-io any suggestions? links_? Links? links2? the_real_links? cargo_links?

Turbo87 avatar Jun 25 '24 20:06 Turbo87

links_2_3_4, but I may have listened to too much Rammstein back in the day.

That's definitely an unfortunate name clash that we should fix if there's ever a v2 of the API.

More serious suggestion: links_to_library?

LawnGnome avatar Jun 25 '24 21:06 LawnGnome

More serious suggestion: links_to_library?

lib_links?

Turbo87 avatar Jun 27 '24 16:06 Turbo87

lib_links?

That works too.

LawnGnome avatar Jun 27 '24 17:06 LawnGnome

lib_links?

I favor this one.

eth3lbert avatar Jun 28 '24 08:06 eth3lbert