Skip to content

Conversation

@huonw
Copy link
Contributor

@huonw huonw commented Nov 23, 2014

This adds an API endpoint .../:crate/reverse_dependencies and a web-page /crate/:crate/reverse_dependencies for displaying. It's modelled after the .../versions page, and is not currently linked from anywhere.

cratesio-revdep

Fixes #68.

src/krate.rs Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these left joins instead of inner joins? (I have not looked deeply at the schema so this may be a stupid question.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mindless copypaste. I've adjusted it now.

@alexcrichton
Copy link
Member

Looks great, thanks @huonw! Can you also add some tests for the endpoint? You should see some examples in src/test/krate.rs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can delete this whole file because its blank.

This /api/v1/crates/foo/reverse_dependencies gives the full dependency
information about each crate that depends on foo (i.e. crates with
`[dependencies] foo = "..."`).
This connects the web-app to the back-end API and allows it to display a
list of all the reverse dependencies of a crate as a
/reverse_dependencies subroute.

This uses the same format as the /versions route.
This includes making some changes to the test harness, e.g. allowing
dependencies to be added from multiple versions of the dependent crate.
@alexcrichton alexcrichton merged commit ea25ea8 into rust-lang:master Nov 24, 2014
@alexcrichton
Copy link
Member

Tidied up in e05572c

Added pagination in 01f1bf7 and 7aa1db0

Thanks @huonw!

@carols10cents
Copy link
Member

OMG awesome!!!! This is so cool :) ❤️ @huonw !!!

@huonw huonw deleted the rev-dep branch November 25, 2014 00:46
Turbo87 pushed a commit to Turbo87/crates.io that referenced this pull request Dec 7, 2022
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Turbo87 pushed a commit to Turbo87/crates.io that referenced this pull request Jan 4, 2023
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Reverse index of packages that depend on this package

4 participants