Skip to content

Backend: Allow service object to create `VerifiedNamespace` record

Summary

Before we create the ability so that SREs can accept incoming partner requests from Partner Alliance or elsewhere, we need to do the following work in preparation.

Proposal

  • Implement a cascading mechanism to assign catalog_resources.verification_level

    • Service object that takes in namespace and verification level:

      namespace = Namespace.find_by_full_path('components')
      Ci::Catalog::VerifyNamespaceService
        .new(namespace: namespace, verification_level: :gitlab_maintained) # other options: `partner`, `verified_creator`
        .execute
      
  • Create an instance of the service to update the verification level of the new catalog resources that are created in the namespace ::Ci::Catalog::VerifiedNamespace.create!(namespace: namespace, verification_level: verification_level)

    More context here: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17746#note_1827585472

  • In ...Resources::CreateService, Set verification_level for the resource record

    • if exists - new resources inherit value from the verified namespace
      • if not - new records get the verification_level updated at the time we create the verified namespace record

Important Note 📣

This service should allow creating a new Verified Namespace as well as updating an exisiting Verified Namespace in case the person who runs the command wants to run it again.

Once implementation is complete in this issue, details will need to be shared with SRE in https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17746 as well as added to a badge request template in https://gitlab.com/gitlab-com/gl-infra/production/-/tree/master/.gitlab/issue_templates?ref_type=heads.

Confirm purpose and User Reception (how does this benefit the user?)

With this, we will make sure that every time a request is made, the badge is populated properly.

Implementation Table

Group Issue Link
backend 👈 You are here
Change Request https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17746

Links/References

Edited by Kasia Misirli