Adds create lifecycle mutation
What does this MR do and why?
This code change adds a new feature to create custom work item lifecycles in GitLab. A lifecycle defines the different statuses that work items (like issues or tasks) can have as they progress through a workflow.
The main additions include:
-
New API endpoint: A GraphQL mutation called
lifecycleCreatethat allows users to create custom lifecycles with their own set of statuses and default settings. -
Feature flag support: Added a new feature flag check for
work_item_status_mvc2to control access to this experimental functionality. -
Service layer: Created a new
CreateServicethat handles the business logic for creating lifecycles, including validation, permission checks, and automatic conversion of system-defined lifecycles to custom ones. -
Enhanced base functionality: Improved the shared base service to better handle status management, tracking user actions, and ensuring proper data relationships.
-
Documentation: Updated the API documentation to describe the new mutation, its parameters, and return values.
References
- BE: Add mutation to create lifecycle (#548456 - closed)
- BE: Convert to custom statuses when create life... (#559001 - closed)
Screenshots or screen recordings
How to set up and validate locally
mutation LifecycleCreate($input: LifecycleCreateInput!) {
lifecycleCreate(input: $input) {
lifecycle {
id
name
statuses {
id
name
iconName
color
__typename
}
defaultOpenStatus {
id
name
__typename
}
defaultClosedStatus {
id
name
__typename
}
defaultDuplicateStatus {
id
name
__typename
}
workItemTypes {
id
name
iconName
__typename
}
__typename
}
errors
__typename
}
}
{
"input": {
"namespacePath": "jashkenas",
"name": "New lifecycle",
"statuses": [
{
"name": "New to do",
"category": "to_do",
"color": "#ffffff"
},
{
"name": "New Done",
"category": "done",
"color": "#ffffff"
},
{
"name": "New Duplicate",
"category": "canceled",
"color": "#ffffff"
}
],
"defaultOpenStatusIndex": 0,
"defaultClosedStatusIndex": 1,
"defaultDuplicateStatusIndex": 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.
