Skip to content

Adds Ci::Catalog::Resources::DestroyService

Laura Montemayor requested to merge remove-association-cr-project-toggle into master

What does this MR do and why?

Adds Ci::Catalog::Resources::DestroyService

  • also adds the mutation that uses service
  • adds a base mutation to catalog resource mutations for ease
  • moves some files into appropriate places 😬 (inside the correct folder)

Changelog: added

How to set up and validate locally

Screenshot 2023-11-09 at 14.26.41.png

=> project.catalog_resource
(...)
=> => #<Ci::Catalog::Resource:0x000000015763e810 id: 15, project_id: 38, created_at: Thu, 09 Nov 2023 13:26:21.114837000 UTC +00:00, state: "draft", latest_released_at: nil, name: "blank-project", description: nil>

With any project marked as a catalog resource (even a blank one just created), run the following migration:

mutation($id: ID!){
  catalogResourcesDestroy(input: {projectPath:$id}) {
    errors
  }
}

with:

{
  "id": "root/blank-project" 
}

See that the association gets destroyed:

[2] pry(main)> project.catalog_resource
(....)
=> nil 

No more badge:

Screenshot 2023-11-09 at 14.20.30.png

No more toggle:

Screenshot 2023-11-09 at 14.26.18.png

no more fear

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

#430099 (closed)

Edited by Laura Montemayor

Merge request reports

Loading