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

Group artifact names by latest version in artifacts page #1015

Open
adpi2 opened this issue Apr 26, 2022 · 3 comments
Open

Group artifact names by latest version in artifacts page #1015

adpi2 opened this issue Apr 26, 2022 · 3 comments

Comments

@adpi2
Copy link
Member

adpi2 commented Apr 26, 2022

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
  1. 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.
  2. Use this method in ProjectPages to display the artifact names grouped by version

Expectations

  • The group of artifacts should be sorted by version in descending order
  • The SqlDatabase method should be tested in SqlDatabaseTests
@julienrf
Copy link
Contributor

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
Copy link
Member Author

adpi2 commented Apr 28, 2022

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
Copy link
Collaborator

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.

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