Skip to content
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

Reverse Dependency lookups #852

Open
AdamIsrael opened this issue Oct 15, 2018 · 4 comments
Open

Reverse Dependency lookups #852

AdamIsrael opened this issue Oct 15, 2018 · 4 comments

Comments

@AdamIsrael
Copy link

I'd like to propose a new feature: reverse dependency lookups.

Use-case:
A developer wants to find charms that implement a specific layer or interface.

As a charm developer, we write layers and interfaces to be reusable components. We have the layer index to see a list of these, but it's often useful to see how they're being implemented (because too many lack documentation).

If we have a reverse dependency API, we could offer a way to see how those components are being used. This is useful from a metrics perspective, to see by whom and how these components are being used. It also aids developers looking for functional examples, which is always a bonus.

@AdamIsrael
Copy link
Author

An additional use-case:
I've discovered an interface published in the layer index that has been implemented backwards (using requires instead of provides). I want to see what charms have implemented it (possibly having reversed the relationship endpoints), so that I can plan on fixing or replacing the interface to correct the error.

@johnsca
Copy link

johnsca commented Oct 15, 2018

Unfortunately, until juju/charm-tools#404 is done (and even then, only for updated charms pushed to the store after that becomes available), this information isn't readily available even on a per-charm basis. It can be reconstructed from the top-level includes, but that involves walking through and even fetching all of the included layers to collect them.

Once the linked issue is addressed, then we could easily find out for a single charm what layers were used by checking the build manifest, but we would still need to create a back-reference table for this info to be queried efficiently. Ideally, that back-reference table could be queried via the charmstore API and would be kept up to date by the charmstore as charms are pushed, but it might also be conceivable to have it be external and updated by the charm command instead.

@rogpeppe
Copy link
Contributor

@johnsca I just replied in juju/charm-tools#404 (comment)

@rogpeppe
Copy link
Contributor

Currently the charm store does not know anything about layers (they're considered an internal implementation detail of charms). However it's possible to search for implementations of a given relation interface by doing a search for "provides"; for example:

GET https://api.jujucharms.com/charmstore/v5/search?provides=http&limit=20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants