scaladex icon indicating copy to clipboard operation
scaladex copied to clipboard

depends-on search seems broken

Open Philippus opened this issue 4 years ago • 2 comments

The 'Artifact dependents' is always empty for me, i.e. https://index.scala-lang.org/search?q=depends-on%3Aakka-actor should give some results.

Philippus avatar Feb 27 '22 10:02 Philippus

Thanks for opening this issue!

We, the Scala Center team, reworked the architecture of the Scaladex backend, and along the way we decided to leave some features behind, included this one. I will be happy to bring it back, but I would like to suggest some changes in the definition of the feature itself.

1. Ambiguity of artifact name

The artifact name alone (akka-actor) is ambiguous because many organizations can use the same. Here probably there is only one organization using akka-actor.

But this table below shows that some artifact names are used by many organizations:

image

So the artifact name alone is not enough: we should also have the group_id:

depends-on:com.typesafe.akka:akka-actor

2. Searching for projects or artifacts

Here it seems you want to find all projects that have at least one artifact that depends on another artifact whose name is akka-actor. So the criteria is artifact_deps as defined below.

image

Alternatively it could be project_deps: find all projects that depends on another project (at least one artifact of project A depends on at least one artifact of project B).

To distinguish between the two we should call the parameters depends-on-artifact and depends-on-project. Of course depends-on-artifact is more precise but I would rather implement depends-on-project first as we are searching for projects.

Your example would become depends-on-project:akka/akka and it would give more results.

3. HTTP query parameter

I also suggest we use HTTP query parameters rather than the search query. They are easier to document and to type-check in the code.

Finally the request would be:

https://index.scala-lang.org/search?q=*&depends-on-project=akka/akka

Or

https://index.scala-lang.org/search?q=*&depends-on-artifact=com.typesafe.akka:akka-actor

adpi2 avatar Feb 28 '22 09:02 adpi2

If it is not supported anymore we can/should remove the "Artifact Dependents"-link on the detail page of projects.

Philippus avatar Feb 28 '22 09:02 Philippus