scalacenter / scaladex

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

Add default group ID in project settings #1409

Open adpi2 opened 1 month ago

adpi2 commented 1 month ago

Motivation

It's quite common that people use their personal group id to release alpha versions of their project. Those temporary artifacts are sometimes selected by Scaladex as the default artifact. They should not. To fix this issue we can introduce a defaultGroupId field in the Project.Settings.

Identified Obstacles

Use the defaultGroupId field to compute the default artifact in ProjectHeader, to compute the badges, and to sort the artifacts.

Implementation Guideline

  1. Add the defaultGroupId field in the Project.Settings
  2. Add the default_group_id column in the project-settings table by adding a SQL migration file here and adapt the SQL requests in ProjectSettingsTable.
  3. Add the drop down list in the edit-project.scala.html for the user to pick the default artifact.
  4. Add the defaultGroupId field in ProjectHeader and use it to compute the default artifact
  5. Check that it is also used to compute the badges

Expectations

The defaultGroupId should be used to compute the default artifact, the badges, and to sort the artifacts. There should be some unit tests.