Add verified namespace service
What does this MR do and why?
Adding a Verification namespace service. Once run by a Gitlab team member, it will add a verification level to all the catalog resources in the group tree.
Addressing issue #451507 (closed)
Once the service is run, it can return the below errors: Errors: Must be a root namespace Errors: Must be a valid verification level When both above errors are raised:
I have posted about the missing icon for Verified Creator Maintained. The frontend is not showing this verification level atm as we are still working out the process behind awarding such badge.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Gitlab Maintained
Ci::Catalog::VerifyNamespaceService.new(group,'gitlab_maintained').execute
I had 5 projects in a 3 level tree under a group (3 catalog resources that were released and those all show with the badge, one unreleased and one non catalog resource).
Gitlab Partner Maintained
Ci::Catalog::VerifyNamespaceService.new(group,'gitlab_partner_maintained').execute
The link in the popover takes us to this page https://docs.gitlab.com/ee/ci/components/index.html#verified-components\
Verified Creator Maintained
Verified Creator Maintained: also does not have an icon atm. I believe this file needs to be updated to add the icon for Verified Creator Maintained.Ci::Catalog::VerifyNamespaceService.new(group,'verified_creator_maintained').execute
The catalog resource is updated with the correct verification level:
How to set up and validate locally
- Select a group with subgroups that has projects with catalog resources.
group = Group.find(186)
- Open console and run the Ci::Catalog::VerifyNamespaceService service. Please note the allowed verification_level is 'gitlab_maintained', 'gitlab_partner_maintained', 'verified_creator_maintained' or 'unverified'.
Ci::Catalog::VerifyNamespaceService.new(group, verification_level).execute
- Check if catalog resources verification_level got updated:
Ci::Catalog::Resource.where(project_id: group.all_projects.pluck(:id))
- Check a new record for Verified Namespace was created:
Ci::Catalog::VerifiedNamespace.all
- You can also check in the UI.
eghttp://127.0.0.1:3000/explore/catalog/test-private-group-18.04/private-project-test-18.04
<local_host>/explore/catalog/<project full path>
to see the catalog resource details page.
<local_host>/explore/catalog
to see the ci catalog page.