Skip to content

Remove deprecated canDestroy and canDelete GraphQL fields

Warning

The MR should be merged within the planned breaking changes window on GitLab.com 2024-05-06 09:00UTC to 2024-05-08 22:00UTC.

What does this MR do and why?

Following the Deprecation and removal process

the MR Removes the deprecated GraphQL field canDelete from the following types:

  • ContainerRepository
  • ContainerRepositoryDetails
  • ContainerRepositoryTag

and removes the deprecated GraphQL field canDestroy from the following types:

  • Package
  • PackageBase
  • PackageDetailsType

The fields were deprecated in the MRs:

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

The field GraphQL request
canDestroy Screenshot_2024-04-24_at_20.28.32
canDelete Screenshot_2024-04-24_at_20.32.57

How to set up and validate locally

canDestroy field from Package type

Run the following steps in rails console.

  1. Create a new package.

    def fixture_file_upload(*args, **kwargs)
      Rack::Test::UploadedFile.new(*args, **kwargs)
    end
    
    p = FactoryBot.create(:npm_package)
    
    p.id # We will need the package's ID in the next step
  2. Visit http://gdk.test:3000/-/graphql-explorer and create a graphql query. The response should contain the error and the message Field 'canDestroy' doesn't exist on type 'PackageDetailsType'.

    query {
      package(id: "gid://gitlab/Packages::Package/<package_id>") {
        canDestroy
      }
    }

canDelete field from ContainerRepositoryDetails type

  1. Get the ID of existing ContainerRepository in rails console.

    r = ContainerRepository.last 
    r.id
  2. Visit http://gdk.test:3000/-/graphql-explorer and create a graphql query. The response should contain the errors and the messages "Field 'canDelete' doesn't exist on type 'ContainerRepositoryDetails'" and "Field 'canDelete' doesn't exist on type 'ContainerRepositoryTag'"

    query {
      containerRepository(id: "gid://gitlab/ContainerRepository/<Container Repository ID>") {
        canDelete
        tags {
          edges {
            node {
              canDelete
            }
          }
        }
      }
    }

Related to #390754 (closed)

Edited by Dzmitry (Dima) Meshcharakou

Merge request reports

Loading