Adds mock implementation of missing lifecycle mutations

What does this MR do and why?

This MR adds a mock implementation for the following mutations:

  1. delete lifecycle mutation
  2. attach work item type mutation with status mapping
  3. (update mutation) with status mapping

The mock implementation is needed for the 18.4 release to prevent multi-version-compatibility issues during roll out of SM updates.

The implementation performs no action and doesn't have any validation apart from required fields validation and namespace authorization.

References

  1. Change lifecycle (#557009 - closed)
  2. Delete lifecycle (#557013 - closed)
  3. BE: Change lifecycle (#557011 - closed)
  4. BE: Delete lifecycle (#557014 - closed)

Screenshots or screen recordings

LifecycleDelete

image

LifecycleAttachWorkItemType

image

How to set up and validate locally

LifecycleDelete

Click to expand
mutation ($input: LifecycleDeleteInput!) {
  lifecycleDelete(input: $input) {
    errors
    lifecycle {
      id
      name
    }
  }
}
{
  "input": {
    "namespacePath": "whocka",
    "id": "gid://gitlab/WorkItems::Statuses::Custom::Lifecycle/14"
  }
}

LifecycleAttachWorkItemType

Click to expand
mutation ($input: LifecycleAttachWorkItemTypeInput!) {
  lifecycleAttachWorkItemType(input: $input) {
    lifecycle {
      id
      name
    }
    errors
  }
}

In the real word using system defined data wouldn't make sense, but it's sufficient for this mock implementation.

{
  "input": {
    "namespacePath": "whocka",
    "workItemTypeId": "gid://gitlab/WorkItems::Type/1",
    "lifecycleId": "gid://gitlab/WorkItems::Statuses::SystemDefined::Lifecycle/1",
    "statusMappings": [
      {
        "oldStatusId": "gid://gitlab/WorkItems::Statuses::SystemDefined::Status/1",
        "newStatusId": "gid://gitlab/WorkItems::Statuses::SystemDefined::Status/2"
      }
    ]
  }
}

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.

Edited by Marc Saleiko

Merge request reports

Loading