[go: up one dir, main page]

Skip to content

Protected packages: Add minimum_access_level_for_delete to GRAPHQL API

What does this MR do and why?

Protected packages: Add minimum_access_level_for_delete to GRAPHQL API

The attribute minimum_access_level_for_delete that was introduced in the MR: !179739 (merged) .

This commit includes the attribute minimum_access_level_for_delete in the GRAPHQL API and also updates the documentation.

This MR is also relevant for integrating the GraphQL field minimumAccessLevelForDelete also in the frontend, see follow-up MR Protected packages: Add minimumAccessLevelForDe... (!180416 - merged).

Changelog: added

🛠️ with ❤️ at Siemens

References

Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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.

MR Checklist (@gerardo-navarro)

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Checkout the branch and start the rails server
  2. Play around with the GraphQL explorer: http://gdk.test:3000/-/graphql-explorer
  3. Execute a mutation for creating the package protection rule
mutation {
  createPackagesProtectionRule(input: {
    projectPath: "flightjs/Flight"
    packageNamePattern: "@my-new-scope/my-package-2-*"
    packageType: NPM
  	minimumAccessLevelForPush: MAINTAINER
    minimumAccessLevelForDelete: OWNER
  }) {
    packageProtectionRule {
      id
      packageNamePattern
      packageType
      minimumAccessLevelForPush
      minimumAccessLevelForDelete
    }
    errors
  }
}
  1. Update only the field minimumAccessLevelForDelete of the newly created package protection rule
mutation {
  updatePackagesProtectionRule(
    input: {
      id: "{{lastCreatedProtectionRuleId}}"
      minimumAccessLevelForDelete: null
    }
  ){
    packageProtectionRule {
      id
      packageNamePattern
      packageType
      minimumAccessLevelForPush
      minimumAccessLevelForDelete
    }
    errors
  }
}

Related to #416381 (closed)

Edited by Gerardo Navarro

Merge request reports

Loading