Skip to content

Backend: Create a service to convert project to Catalog Resource and create validator

Problem

As owner of a project containing components, I want to be able to set my project as catalog resource so that my components repository is listed in the private catalog under the project's root namespace.

Proposal

Create a service object Ci::Catalog::AddResourceService which takes in input a Project object and runs some prerequisite checks for a resource to be displayed in the catalog:

  • Ensure that the project has a non-empty README.md file in the root directory (on default_branch).
  • Ensure that the project has a description.
  • Eventually we will add more prerequisite checks here.

It's important to design these prerequisite checks as separate and reusable unit (taking a project and ref in input) because we will reuse those when creating new releases for catalog resources.

Context

Later the service will be consumed by an API endpoint Backend: Add API endpoint to publish a componen... (#387065 - closed).

Implementing this service will most likely unblock the frontend portion of CI Catalog Build CI Catalog index page (&9958 - closed)

Edited by Fabio Pitino