Skip to content

Support template-based ids in existing attribute related mutations

What does this MR do and why?

Support template-based ids in existing security attribute related mutations.

Changelog: fixed
EE: true

How to validate

  1. Enable the following feature flags:
Feature.enable(:security_categories_and_attributes)
Feature.enable(:security_context_labels)
  1. Use this GraphQL query for a root group where you are at least a maintainer, and which doesn’t yet have any categories or attributes, to add an attribute to a predefined category:
mutation createSecurityAttributes($categoryId: SecurityCategoryID!, $namespaceId: NamespaceID!, $attributes: [SecurityAttributeInput!]!) {
  securityAttributeCreate(
    input: {categoryId: $categoryId, attributes: $attributes, namespaceId: $namespaceId}
  ) {
    securityAttributes {
      id
      name
      description
      color
      editableState
      securityCategory {
        id
        name
      }
    }
    errors
  }
}

with:

{
  "categoryId": "gid://gitlab/Security::Category/application",
  "namespaceId": "gid://gitlab/Namespace/<NEW_NAMESPACE_ID>",
  "attributes": [
    {
      "name": "New attribute",
      "description": "Hi! I'm new here",
      "color": "#eee600"
    }
  ]
}

The return value should reflect the persisted category and attribute.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to Error when adding the first security attribute ... (#577206) • Gal Katz • 18.6

Edited by Gal Katz

Merge request reports

Loading