scalacenter / scaladex

The Scala Package Index
https://index.scala-lang.org
BSD 3-Clause "New" or "Revised" License
200 stars 76 forks source link

Group artifact names by latest version in artifacts page #1015

Open adpi2 opened 2 years ago

adpi2 commented 2 years ago

Motivation

In the artifacts page of a project, for example https://index.scala-lang.org/typelevel/cats/artifacts, there is drop-down button that lists all the artifact names of the project. They are sorted by alphabetical order and we cannot know which are still valid artifact names and which are deprecated.

For instance the cats artifact name is deprecated since version 0.9.0.

On good way to display this information would be to group the artifact names by latest version.

In the case of cats the list of artifact names would be displayed as:

2.7.0
  algebra
  algebra-laws
  alleycats-core
  alleycats-laws
  cats-core
  cats-free
  cats-js
  cats-jvm
  cats-kernel
  cats-kernel-laws
  cats-laws
  cats-native
  cats-testkit
2.1.1
  cats-macro
0.9.0
  cats

It becomes clear that cats-macro and cats are deprecated.

Identified Obstacles

We want the latest stable version (not the pre-release one) except if there is no stable version.

Also we don't want to run too many requests.

Implementation Guideline

  1. Add two SQL methods in ArtifactTable:
    • one that return the artifact names of a project with their latest stable version
    • one that return the artifact names of a project with their latest version number even if not stable
  2. In SqlDatabase add a method that merge the result of the two requests to return the latest version of all artifact name with a preference on the stable ones.
  3. Use this method in ProjectPages to display the artifact names grouped by version

Expectations

julienrf commented 2 years ago

Note that this idea assumes that all the artifacts of a project follow the same release cycles. This is not always the case (but that should be the most common case, IMHO).

adpi2 commented 2 years ago

In a repo where artifacts have different release cycles, I still think it is a good idea to group them by latest version. The ordering would not make much sense though.

kannupriyakalra commented 6 months ago

Based on the discussion with @adpi2, a new issue #1407 has been created as a follow-up task to issue #1024. Therefore, there is no need to work on issue #1015.