Skip to content

Draft: Add cascading package settings to GraphQL

Steve Abrams requested to merge 360267-package-forward-graphql into master

What does this MR do and why?

Adds GraphQL support for querying and updating the newest namespace package settings for package forwarding:

      mavenPackageRequestsForwarding
      lockMavenPackageRequestsForwarding
      npmPackageRequestsForwarding
      lockNpmPackageRequestsForwarding
      pypiPackageRequestsForwarding
      lockPypiPackageRequestsForwarding

These settings were added in !99274 (merged). They are implemented in the package logic in !99285 (merged). A separate MR will use this GraphQL update to expose these settings in the UI.

Screenshots or screen recordings

Screen_Shot_2022-10-07_at_10.27.53_PM

Screen_Shot_2022-10-07_at_10.31.44_PM

How to set up and validate locally

You will need the full path of a group and to be logged in with a user that has Owner access to that group.

In the graphql explorer (http://gdk.test:3000/-/graphql-explorer) query the settings:

query {
  namespace(fullPath: "<group_full_path>") {
    packageSettings {
      mavenPackageRequestsForwarding
      lockMavenPackageRequestsForwarding
      npmPackageRequestsForwarding
      lockNpmPackageRequestsForwarding
      pypiPackageRequestsForwarding
      lockPypiPackageRequestsForwarding
    }
  }
}

Update the settings:

mutation  updateNamespacePackageSettingsMutation ($namespacePackageSettings: UpdateNamespacePackageSettingsInput!) {
  updateNamespacePackageSettings(input:$namespacePackageSettings) {
    packageSettings {
      mavenPackageRequestsForwarding
      lockMavenPackageRequestsForwarding
      npmPackageRequestsForwarding
      lockNpmPackageRequestsForwarding
      pypiPackageRequestsForwarding
      lockPypiPackageRequestsForwarding
    }
  }
}

With these query variables:

{
  "namespacePackageSettings": {
    "namespacePath": "<group_full_path>",
    "mavenPackageRequestsForwarding": false,
    "lockMavenPackageRequestsForwarding": true,
    "npmPackageRequestsForwarding": false,
    "lockNpmPackageRequestsForwarding": true,
    "pypiPackageRequestsForwarding": false,
    "lockPypiPackageRequestsForwarding": true
  }
}

MR acceptance checklist

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

Related to #360267 (closed)

Edited by Steve Abrams

Merge request reports