Backend: Replace catalog resource toggle with release parameter

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Some users have found that the project settings toggle (once-off operation) to mark the project as "catalog resource" can be confusing because they have to remember to toggle it in a settings page. Forgetting to do this means that no releases are displayed in the CI Catalog for the given resource.

Context

The use of the toggle was an MVC that allowed us to mark a project as catalog resource and automatically publish every release to the catalog. We were aware that in the future this UX needed to be refined.

Proposal

UPDATE THE DESIGN DOC WITH THE FINAL DECISION

Remove the toggle from project settings and instead add a checkbox to the Release creation page. The checkbox controls whether the given release is going to show in the catalog or not.

When the checkbox is enabled, in the backend we:

  • mark the project as catalog resource (if not done yet). Technically it means ensuring that a catalog_resources record exist for that project.
  • extract the components metadata for the given version and create catalog_resource_versions and catalog_resource_components records.

About the new checkbox parameter:

  • In the UI: when the project is marked as catalog resource, on subsequent releases we can default the checkbox to be enabled so that the user doesn't need to take actions all the time.
  • In the API: we need to support the new parameter and clients have to provide that all the time explicitly if they want to show a release on the catalog.
  • In the release keyword: we need to support the new parameter in the YAML syntax.

👍 Pros:

  • The user has control over which release to show on the catalog. For example they can choose not to publish a 1.0-alpha release.
  • The parameter is passed to Releases::CreateService and used as is, instead of checking whether the project is a catalog resource.
  • We remove the need to run basic catalog resource validations (description, readme) when toggling as well as when releasing new versions.

👎 Cons:

  • The user will have to provide this parameter/checkbox all the time especially if they want all versions to be always published.

Opportunities

Like GitHub Actions Marketplace we could allow users to delist a specific catalog resource entirely (hide all its versions) or to delist a specific version of the resource. This could be the checkbox parameter to be available for edit when editing a release or a button to delist the version.

For the catalog resource it could be a button to delist the resource from the catalog (this would be equivalent to the toggle today).

/cc @sunjungp

Edited by 🤖 GitLab Bot 🤖