url
stringlengths 24
122
| repo_url
stringlengths 60
156
| date_extracted
stringdate 2025-08-13 00:00:00
2025-08-13 00:00:00
| root
stringlengths 3
85
| breadcrumbs
listlengths 1
6
| filename
stringlengths 6
60
| stage
stringclasses 33
values | group
stringclasses 81
values | info
stringclasses 22
values | title
stringlengths 3
110
⌀ | description
stringlengths 11
359
⌀ | clean_text
stringlengths 47
3.32M
| rich_text
stringlengths 321
3.32M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://docs.gitlab.com/operations/alerts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/alerts.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
alerts.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Alerts
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Alerts are a critical entity in your incident management workflow. They represent a notable event that might indicate a service outage or disruption. GitLab provides a list view for triage and detail view for deeper investigation of what happened.
## Alert list
Users with at least the Developer role can access the Alert list at **Monitor > Alerts** in your project's sidebar. The Alert list displays alerts sorted by start time, but you can change the sort order by selecting the headers in the Alert list.
The alert list displays the following information:

- **Search**: The alert list supports a simple free text search on the title,
description, monitoring tool, and service fields.
- **Severity**: The current importance of a alert and how much attention it
should receive. For a listing of all statuses, read [Alert Management severity](#alert-severity).
- **Start time**: How long ago the alert fired. This field uses the standard
GitLab pattern of `X time ago`, but is supported by a granular date/time
tooltip depending on the user's locale.
- **Alert description**: The description of the alert, which attempts to
capture the most meaningful data.
- **Event count**: The number of times that an alert has fired.
- **Issue**: A link to the incident issue that has been created for the alert.
- **Status**: The current status of the alert:
- **Triggered**: Investigation has not started.
- **Acknowledged**: Someone is actively investigating the problem.
- **Resolved**: No further work is required.
- **Ignored**: No action is taken on the alert.
## Alert severity
Each level of alert contains a uniquely shaped and color-coded icon to help you identify the severity of a particular alert. These severity icons help you immediately identify which alerts you should prioritize investigating:

Alerts contain one of the following icons:
<!-- vale gitlab_base.SubstitutionWarning = NO -->
| Severity | Icon | Color (hexadecimal) |
|----------|-------------------------|---------------------|
| Critical | {{< icon name="severity-critical" >}} | `#8b2615` |
| High | {{< icon name="severity-high" >}} | `#c0341d` |
| Medium | {{< icon name="severity-medium" >}} | `#fca429` |
| Low | {{< icon name="severity-low" >}} | `#fdbc60` |
| Info | {{< icon name="severity-info" >}} | `#418cd8` |
| Unknown | {{< icon name="severity-unknown" >}} | `#bababa` |
<!-- vale gitlab_base.SubstitutionWarning = YES -->
## Alert details page
Go to the Alert details view by visiting the [Alert list](#alert-list) and selecting an alert from the list. You need at least the Developer role to access alerts. Select any alert in the list to examine its alert details page.
Alerts provide **Overview** and **Alert details** tabs to give you the right amount of information you need.
### Alert details tab
The **Alert details** tab has two sections. The top section provides a short list of critical details such as the severity, start time, number of events, and originating monitoring tool. The second section displays the full alert payload.
### Metrics tab
In many cases, alerts are associated to metrics. You can upload screenshots of metric charts in the **Metrics** tab.
To do so, either:
- Select **upload** and then select an image from your file browser.
- Drag a file from your file browser and drop it in the drop zone.
When you upload an image, you can add text to the image and link it to the original graph.

If you add a link, it is shown above the uploaded image.
### Activity feed tab
The **Activity feed** tab is a log of activity on the alert. When you take action on an alert, this is logged as a system note. This gives you a linear timeline of the alert's investigation and assignment history.
The following actions result in a system note:
- [Updating the status of an alert](#change-an-alerts-status)
- [Creating an incident based on an alert](manage_incidents.md#from-an-alert)
- [Assignment of an alert to a user](#assign-an-alert)
- [Escalation of an alert to on-call responders](paging.md#escalating-an-alert)

## Alert actions
There are different actions available in GitLab to help triage and respond to alerts.
### Change an alert's status
You can change the status of an alert.
The available statuses are:
- Triggered (default for new alerts)
- Acknowledged
- Resolved
Prerequisites:
- You must have at least the Developer role.
To change an alert's status:
- From the [alert list](#alert-list):
1. In the **Status** column, next to an alert, select the status dropdown list.
1. Select a status.
- From the [alert details page](#alert-details-page):
1. On the right sidebar, select **Edit**.
1. Select a status.
To stop email notifications for alert recurrences in projects with [email notifications enabled](paging.md#email-notifications-for-alerts), change the alert's status away from **Triggered**.
#### Resolve an alert by closing the linked incident
Prerequisites:
- You must have at least the Reporter role.
When you [close an incident](manage_incidents.md#close-an-incident) that is linked to an alert, GitLab [changes the alert's status](#change-an-alerts-status) to **Resolved**. You are then credited with the alert's status change.
#### As an on-call responder
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
On-call responders can respond to [alert pages](paging.md#escalating-an-alert) by changing the alert status.
Changing the status has the following effects:
- To **Acknowledged**: limits on-call pages based on the project's [escalation policy](escalation_policies.md).
- To **Resolved**: silences all on-call pages for the alert.
- From **Resolved** to **Triggered**: restarts the alert escalating.
In GitLab 15.1 and earlier, updating the status of an [alert with an associated incident](manage_incidents.md#from-an-alert) also updates the incident status. In [GitLab 15.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/356057), the incident status is independent and does not update when the alert status changes.
### Assign an alert
In large teams, where there is shared ownership of an alert, it can be difficult to track who is investigating and working on it. Assigning alerts eases collaboration and delegation by indicating which user is owning the alert. GitLab supports only a single assignee per alert.
To assign an alert:
1. Display the list of current alerts:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Alerts**.
1. Select your desired alert to display its details.

1. If the right sidebar is not expanded, select
**Expand sidebar** ({{< icon name="chevron-double-lg-right" >}}) to expand it.
1. On the right sidebar, locate the **Assignee**, and then select **Edit**.
From the list, select each user you want to assign to the alert.
GitLab creates a [to-do item](../../user/todos.md) for each user.
After completing their portion of investigating or fixing the alert, users can unassign themselves from the alert. To remove an assignee, select **Edit** next to the **Assignee** dropdown list and clear the user from the list of assignees, or select **Unassigned**.
### Create a to-do item from an alert
You can manually create a [to-do item](../../user/todos.md) for yourself from an alert, and view it later on your **To-Do List**.
To add a to-do item, on the right sidebar, select **Add a to-do item**.
### Trigger actions from alerts
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Turn on creating [incidents](incidents.md) automatically whenever an alert is triggered.
Prerequisites:
- You must have at least the Maintainer role for the project.
To configure the actions:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand the **Alerts** section, then select the **Alert settings** tab.
1. Select the **Create an incident** checkbox.
1. Optional. To customize the incident, from the **Incident template**, select a template to be
appended to the [incident summary](incidents.md#summary).
If the dropdown list is empty,
[create an issue template](../../user/project/description_templates.md#create-a-description-template) first.
1. Optional. To send [an email notification](paging.md#email-notifications-for-alerts), select the
**Send a single email notification to Owners and Maintainers for new alerts** checkbox.
1. Select **Save changes**.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Alerts
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Alerts are a critical entity in your incident management workflow. They represent a notable event that might indicate a service outage or disruption. GitLab provides a list view for triage and detail view for deeper investigation of what happened.
## Alert list
Users with at least the Developer role can access the Alert list at **Monitor > Alerts** in your project's sidebar. The Alert list displays alerts sorted by start time, but you can change the sort order by selecting the headers in the Alert list.
The alert list displays the following information:

- **Search**: The alert list supports a simple free text search on the title,
description, monitoring tool, and service fields.
- **Severity**: The current importance of a alert and how much attention it
should receive. For a listing of all statuses, read [Alert Management severity](#alert-severity).
- **Start time**: How long ago the alert fired. This field uses the standard
GitLab pattern of `X time ago`, but is supported by a granular date/time
tooltip depending on the user's locale.
- **Alert description**: The description of the alert, which attempts to
capture the most meaningful data.
- **Event count**: The number of times that an alert has fired.
- **Issue**: A link to the incident issue that has been created for the alert.
- **Status**: The current status of the alert:
- **Triggered**: Investigation has not started.
- **Acknowledged**: Someone is actively investigating the problem.
- **Resolved**: No further work is required.
- **Ignored**: No action is taken on the alert.
## Alert severity
Each level of alert contains a uniquely shaped and color-coded icon to help you identify the severity of a particular alert. These severity icons help you immediately identify which alerts you should prioritize investigating:

Alerts contain one of the following icons:
<!-- vale gitlab_base.SubstitutionWarning = NO -->
| Severity | Icon | Color (hexadecimal) |
|----------|-------------------------|---------------------|
| Critical | {{< icon name="severity-critical" >}} | `#8b2615` |
| High | {{< icon name="severity-high" >}} | `#c0341d` |
| Medium | {{< icon name="severity-medium" >}} | `#fca429` |
| Low | {{< icon name="severity-low" >}} | `#fdbc60` |
| Info | {{< icon name="severity-info" >}} | `#418cd8` |
| Unknown | {{< icon name="severity-unknown" >}} | `#bababa` |
<!-- vale gitlab_base.SubstitutionWarning = YES -->
## Alert details page
Go to the Alert details view by visiting the [Alert list](#alert-list) and selecting an alert from the list. You need at least the Developer role to access alerts. Select any alert in the list to examine its alert details page.
Alerts provide **Overview** and **Alert details** tabs to give you the right amount of information you need.
### Alert details tab
The **Alert details** tab has two sections. The top section provides a short list of critical details such as the severity, start time, number of events, and originating monitoring tool. The second section displays the full alert payload.
### Metrics tab
In many cases, alerts are associated to metrics. You can upload screenshots of metric charts in the **Metrics** tab.
To do so, either:
- Select **upload** and then select an image from your file browser.
- Drag a file from your file browser and drop it in the drop zone.
When you upload an image, you can add text to the image and link it to the original graph.

If you add a link, it is shown above the uploaded image.
### Activity feed tab
The **Activity feed** tab is a log of activity on the alert. When you take action on an alert, this is logged as a system note. This gives you a linear timeline of the alert's investigation and assignment history.
The following actions result in a system note:
- [Updating the status of an alert](#change-an-alerts-status)
- [Creating an incident based on an alert](manage_incidents.md#from-an-alert)
- [Assignment of an alert to a user](#assign-an-alert)
- [Escalation of an alert to on-call responders](paging.md#escalating-an-alert)

## Alert actions
There are different actions available in GitLab to help triage and respond to alerts.
### Change an alert's status
You can change the status of an alert.
The available statuses are:
- Triggered (default for new alerts)
- Acknowledged
- Resolved
Prerequisites:
- You must have at least the Developer role.
To change an alert's status:
- From the [alert list](#alert-list):
1. In the **Status** column, next to an alert, select the status dropdown list.
1. Select a status.
- From the [alert details page](#alert-details-page):
1. On the right sidebar, select **Edit**.
1. Select a status.
To stop email notifications for alert recurrences in projects with [email notifications enabled](paging.md#email-notifications-for-alerts), change the alert's status away from **Triggered**.
#### Resolve an alert by closing the linked incident
Prerequisites:
- You must have at least the Reporter role.
When you [close an incident](manage_incidents.md#close-an-incident) that is linked to an alert, GitLab [changes the alert's status](#change-an-alerts-status) to **Resolved**. You are then credited with the alert's status change.
#### As an on-call responder
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
On-call responders can respond to [alert pages](paging.md#escalating-an-alert) by changing the alert status.
Changing the status has the following effects:
- To **Acknowledged**: limits on-call pages based on the project's [escalation policy](escalation_policies.md).
- To **Resolved**: silences all on-call pages for the alert.
- From **Resolved** to **Triggered**: restarts the alert escalating.
In GitLab 15.1 and earlier, updating the status of an [alert with an associated incident](manage_incidents.md#from-an-alert) also updates the incident status. In [GitLab 15.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/356057), the incident status is independent and does not update when the alert status changes.
### Assign an alert
In large teams, where there is shared ownership of an alert, it can be difficult to track who is investigating and working on it. Assigning alerts eases collaboration and delegation by indicating which user is owning the alert. GitLab supports only a single assignee per alert.
To assign an alert:
1. Display the list of current alerts:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Alerts**.
1. Select your desired alert to display its details.

1. If the right sidebar is not expanded, select
**Expand sidebar** ({{< icon name="chevron-double-lg-right" >}}) to expand it.
1. On the right sidebar, locate the **Assignee**, and then select **Edit**.
From the list, select each user you want to assign to the alert.
GitLab creates a [to-do item](../../user/todos.md) for each user.
After completing their portion of investigating or fixing the alert, users can unassign themselves from the alert. To remove an assignee, select **Edit** next to the **Assignee** dropdown list and clear the user from the list of assignees, or select **Unassigned**.
### Create a to-do item from an alert
You can manually create a [to-do item](../../user/todos.md) for yourself from an alert, and view it later on your **To-Do List**.
To add a to-do item, on the right sidebar, select **Add a to-do item**.
### Trigger actions from alerts
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Turn on creating [incidents](incidents.md) automatically whenever an alert is triggered.
Prerequisites:
- You must have at least the Maintainer role for the project.
To configure the actions:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand the **Alerts** section, then select the **Alert settings** tab.
1. Select the **Create an incident** checkbox.
1. Optional. To customize the incident, from the **Incident template**, select a template to be
appended to the [incident summary](incidents.md#summary).
If the dropdown list is empty,
[create an issue template](../../user/project/description_templates.md#create-a-description-template) first.
1. Optional. To send [an email notification](paging.md#email-notifications-for-alerts), select the
**Send a single email notification to Owners and Maintainers for new alerts** checkbox.
1. Select **Save changes**.
|
https://docs.gitlab.com/operations/escalation_policies
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/escalation_policies.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
escalation_policies.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Escalation policies
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Escalation policies protect your company from missed critical alerts. Escalation policies contain
time-boxed steps that automatically page the next responder in the escalation step if the responder
in the previous step has not responded. You can create an escalation policy in the GitLab project
where you manage [on-call schedules](oncall_schedules.md).
## Add an escalation policy
Prerequisites:
- You must have at least the Maintainer role.
- You must have an [on-call schedule](oncall_schedules.md).
To create an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Add an escalation policy**.
1. Enter the policy's name and description, and
escalation rules to follow when a primary responder misses an alert.
1. Select **Add escalation policy**.

### Select the responder of an escalation rule
When configuring an escalation rule, you can designate who to page:
- **Email on-call user in schedule**: notifies the users who are on-call when the rule is triggered,
covering all rotations on the specified [on-call schedule](oncall_schedules.md).
- **Email user**: notifies the specified user directly.
When a notification is sent to a user through an on-call schedule or directly, a system note listing
the paged users is created on the alert.
The time specified for an escalation rule must be between 0 and 1440 minutes.
## Edit an escalation policy
To update an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Edit escalation policy** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
## Delete an escalation policy
To delete an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Delete escalation policy** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete escalation policy**.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Escalation policies
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Escalation policies protect your company from missed critical alerts. Escalation policies contain
time-boxed steps that automatically page the next responder in the escalation step if the responder
in the previous step has not responded. You can create an escalation policy in the GitLab project
where you manage [on-call schedules](oncall_schedules.md).
## Add an escalation policy
Prerequisites:
- You must have at least the Maintainer role.
- You must have an [on-call schedule](oncall_schedules.md).
To create an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Add an escalation policy**.
1. Enter the policy's name and description, and
escalation rules to follow when a primary responder misses an alert.
1. Select **Add escalation policy**.

### Select the responder of an escalation rule
When configuring an escalation rule, you can designate who to page:
- **Email on-call user in schedule**: notifies the users who are on-call when the rule is triggered,
covering all rotations on the specified [on-call schedule](oncall_schedules.md).
- **Email user**: notifies the specified user directly.
When a notification is sent to a user through an on-call schedule or directly, a system note listing
the paged users is created on the alert.
The time specified for an escalation rule must be between 0 and 1440 minutes.
## Edit an escalation policy
To update an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Edit escalation policy** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
## Delete an escalation policy
To delete an escalation policy:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Escalation Policies**.
1. Select **Delete escalation policy** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete escalation policy**.
|
https://docs.gitlab.com/operations/paging
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/paging.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
paging.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Paging and notifications
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When there is a new alert or incident, it is important for a responder to be notified
immediately so they can triage and respond to the problem. Responders can receive
notifications using the methods described on this page.
## Slack notifications
The GitLab for Slack app can be used to receive important incident notifications.
When [the GitLab for Slack app is configured](slack.md), incident responders are notified in Slack
every time a new incident is declared. To ensure you don't miss any important incident notifications
on your mobile device, enable notifications for Slack on your phone.
## Email notifications for alerts
Email notifications are available in projects for triggered alerts. Project
members with the **Owner** or **Maintainer** roles have the option to receive
a single email notification for new alerts.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Alerts**.
1. On the **Alert settings** tab, select the
**Send a single email notification to Owners and Maintainers for new alerts** checkbox.
1. Select **Save changes**.
[Update the alert's status](alerts.md#change-an-alerts-status) to manage email notifications for an alert.
## Paging
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In projects that have an [escalation policy](escalation_policies.md) configured, on-call responders
can be automatically paged about critical problems through email.
### Escalating an alert
When an alert is triggered, it begins escalating to the on-call responders immediately.
For each escalation rule in the project's escalation policy, the designated on-call
responders receive one email when the rule fires. You can respond to a page
or stop alert escalations by [updating the alert's status](alerts.md#change-an-alerts-status).
### Escalating an incident
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5716) in GitLab 14.9 [with a flag](../../administration/feature_flags/_index.md) named `incident_escalations`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/345769) in GitLab 14.10.
- [Feature flag `incident_escalations`](https://gitlab.com/gitlab-org/gitlab/-/issues/345769) removed in GitLab 15.1.
{{< /history >}}
For incidents, paging on-call responders is optional for each individual incident.
To begin escalating the incident, [set the incident's escalation policy](manage_incidents.md#change-escalation-policy).
For each escalation rule, the designated on-call responders receive one email when
the rule fires. Respond to a page or stop incident escalations by
[changing the incident's status](manage_incidents.md#change-status) or
changing the incident's escalation policy back to **No escalation policy**.
In GitLab 15.1 and earlier, [incidents created from alerts](manage_incidents.md#from-an-alert)
do not support independent escalation. In [GitLab 15.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/356057),
all incidents can be escalated independently.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Paging and notifications
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When there is a new alert or incident, it is important for a responder to be notified
immediately so they can triage and respond to the problem. Responders can receive
notifications using the methods described on this page.
## Slack notifications
The GitLab for Slack app can be used to receive important incident notifications.
When [the GitLab for Slack app is configured](slack.md), incident responders are notified in Slack
every time a new incident is declared. To ensure you don't miss any important incident notifications
on your mobile device, enable notifications for Slack on your phone.
## Email notifications for alerts
Email notifications are available in projects for triggered alerts. Project
members with the **Owner** or **Maintainer** roles have the option to receive
a single email notification for new alerts.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Alerts**.
1. On the **Alert settings** tab, select the
**Send a single email notification to Owners and Maintainers for new alerts** checkbox.
1. Select **Save changes**.
[Update the alert's status](alerts.md#change-an-alerts-status) to manage email notifications for an alert.
## Paging
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In projects that have an [escalation policy](escalation_policies.md) configured, on-call responders
can be automatically paged about critical problems through email.
### Escalating an alert
When an alert is triggered, it begins escalating to the on-call responders immediately.
For each escalation rule in the project's escalation policy, the designated on-call
responders receive one email when the rule fires. You can respond to a page
or stop alert escalations by [updating the alert's status](alerts.md#change-an-alerts-status).
### Escalating an incident
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5716) in GitLab 14.9 [with a flag](../../administration/feature_flags/_index.md) named `incident_escalations`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/345769) in GitLab 14.10.
- [Feature flag `incident_escalations`](https://gitlab.com/gitlab-org/gitlab/-/issues/345769) removed in GitLab 15.1.
{{< /history >}}
For incidents, paging on-call responders is optional for each individual incident.
To begin escalating the incident, [set the incident's escalation policy](manage_incidents.md#change-escalation-policy).
For each escalation rule, the designated on-call responders receive one email when
the rule fires. Respond to a page or stop incident escalations by
[changing the incident's status](manage_incidents.md#change-status) or
changing the incident's escalation policy back to **No escalation policy**.
In GitLab 15.1 and earlier, [incidents created from alerts](manage_incidents.md#from-an-alert)
do not support independent escalation. In [GitLab 15.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/356057),
all incidents can be escalated independently.
|
https://docs.gitlab.com/operations/slack
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/slack.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
slack.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Incident management for Slack
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344856) in GitLab 15.7 [with a flag](../../administration/feature_flags/_index.md) named `incident_declare_slash_command`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/378072) in GitLab 15.10 in [beta](../../policy/development_stages_support.md#beta).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
Many teams receive alerts and collaborate in real time during incidents in Slack.
Use the GitLab for Slack app to:
- Create GitLab incidents from Slack.
- Receive incident notifications.
Incident management for Slack is only available for GitLab.com. Some of the functionality
described might be available for
[the GitLab Self-Managed Slack app](../../user/project/integrations/slack_slash_commands.md).
To stay up to date, follow [epic 1211](https://gitlab.com/groups/gitlab-org/-/epics/1211).
## Manage an incident from Slack
Prerequisites:
1. Install the [GitLab for Slack app](../../user/project/integrations/gitlab_slack_application.md).
This way, you can use slash commands in Slack to create and update GitLab incidents.
1. Enable [Slack notifications](../../user/project/integrations/gitlab_slack_application.md#slack-notifications). Be sure to enable
notifications for `Incident` events, and to define a Slack channel to receive the relevant notifications.
1. Authorize GitLab to take actions on behalf of your Slack user.
Each user must do this before they can use any of the incident slash commands.
To start the authorization flow, try executing a non-incident [Slack slash command](../../user/project/integrations/gitlab_slack_application.md#slash-commands),
like `/gitlab <project-alias> issue show <id>`.
The `<project-alias>` you select must be a project that has the GitLab for Slack app set up. The select dialog has a hard limit of 100 projects.
For more information, see [issue 377548](https://gitlab.com/gitlab-org/gitlab/-/issues/377548).
After the GitLab for Slack app is configured, you can also use any of the existing [Slack slash commands](../../user/project/integrations/slack_slash_commands.md).
## Declare an incident
To declare a GitLab incident from Slack:
1. In Slack, in any channel or DM, enter the `/gitlab incident declare` slash command.
1. From the modal, select the relevant incident details, including:
- The incident title and description.
- The project where the incident should be created.
- The severity of the incident.
If there is an existing [incident template](alerts.md#trigger-actions-from-alerts) for your
project, that template is automatically applied to the description text box. The template is applied
only if the description text box is empty.
You can also include GitLab [quick actions](../../user/project/quick_actions.md) in the description text box.
For example, entering `/link https://example.slack.com/archives/123456789 Dedicated Slack channel`
adds a dedicated Slack channel to the incident you create. For a complete list of
quick actions for incidents, see [Use GitLab quick actions](#use-gitlab-quick-actions).
1. Optional. Add a link to an existing Zoom meeting.
1. Select **Create**.
If the incident is successfully created, Slack shows a confirmation notification.
### Use GitLab quick actions
Use [quick actions](../../user/project/quick_actions.md) in the description text box when creating
a GitLab incident from Slack. The following quick actions might be most relevant to you:
| Command | Description |
| ------------------------ | ----------------------------------------- |
| `/assign @user1 @user2` | Adds an assignee to the GitLab incident. |
| `/label ~label1 ~label2` | Adds labels to the GitLab incident. |
| `/link <URL> <text>` | Adds a link to a dedicated Slack channel, runbook, or any relevant resource to the `Related resources` section of an incident. |
| `/zoom <URL>` | Adds a Zoom meeting link to the incident. |
## Send GitLab incident notifications to Slack
If you have [enabled notifications](#manage-an-incident-from-slack) for incidents, you should receive
notifications to the selected Slack channel every time an incident is opened, closed, or updated.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Incident management for Slack
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344856) in GitLab 15.7 [with a flag](../../administration/feature_flags/_index.md) named `incident_declare_slash_command`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/378072) in GitLab 15.10 in [beta](../../policy/development_stages_support.md#beta).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
Many teams receive alerts and collaborate in real time during incidents in Slack.
Use the GitLab for Slack app to:
- Create GitLab incidents from Slack.
- Receive incident notifications.
Incident management for Slack is only available for GitLab.com. Some of the functionality
described might be available for
[the GitLab Self-Managed Slack app](../../user/project/integrations/slack_slash_commands.md).
To stay up to date, follow [epic 1211](https://gitlab.com/groups/gitlab-org/-/epics/1211).
## Manage an incident from Slack
Prerequisites:
1. Install the [GitLab for Slack app](../../user/project/integrations/gitlab_slack_application.md).
This way, you can use slash commands in Slack to create and update GitLab incidents.
1. Enable [Slack notifications](../../user/project/integrations/gitlab_slack_application.md#slack-notifications). Be sure to enable
notifications for `Incident` events, and to define a Slack channel to receive the relevant notifications.
1. Authorize GitLab to take actions on behalf of your Slack user.
Each user must do this before they can use any of the incident slash commands.
To start the authorization flow, try executing a non-incident [Slack slash command](../../user/project/integrations/gitlab_slack_application.md#slash-commands),
like `/gitlab <project-alias> issue show <id>`.
The `<project-alias>` you select must be a project that has the GitLab for Slack app set up. The select dialog has a hard limit of 100 projects.
For more information, see [issue 377548](https://gitlab.com/gitlab-org/gitlab/-/issues/377548).
After the GitLab for Slack app is configured, you can also use any of the existing [Slack slash commands](../../user/project/integrations/slack_slash_commands.md).
## Declare an incident
To declare a GitLab incident from Slack:
1. In Slack, in any channel or DM, enter the `/gitlab incident declare` slash command.
1. From the modal, select the relevant incident details, including:
- The incident title and description.
- The project where the incident should be created.
- The severity of the incident.
If there is an existing [incident template](alerts.md#trigger-actions-from-alerts) for your
project, that template is automatically applied to the description text box. The template is applied
only if the description text box is empty.
You can also include GitLab [quick actions](../../user/project/quick_actions.md) in the description text box.
For example, entering `/link https://example.slack.com/archives/123456789 Dedicated Slack channel`
adds a dedicated Slack channel to the incident you create. For a complete list of
quick actions for incidents, see [Use GitLab quick actions](#use-gitlab-quick-actions).
1. Optional. Add a link to an existing Zoom meeting.
1. Select **Create**.
If the incident is successfully created, Slack shows a confirmation notification.
### Use GitLab quick actions
Use [quick actions](../../user/project/quick_actions.md) in the description text box when creating
a GitLab incident from Slack. The following quick actions might be most relevant to you:
| Command | Description |
| ------------------------ | ----------------------------------------- |
| `/assign @user1 @user2` | Adds an assignee to the GitLab incident. |
| `/label ~label1 ~label2` | Adds labels to the GitLab incident. |
| `/link <URL> <text>` | Adds a link to a dedicated Slack channel, runbook, or any relevant resource to the `Related resources` section of an incident. |
| `/zoom <URL>` | Adds a Zoom meeting link to the incident. |
## Send GitLab incident notifications to Slack
If you have [enabled notifications](#manage-an-incident-from-slack) for incidents, you should receive
notifications to the selected Slack channel every time an incident is opened, closed, or updated.
|
https://docs.gitlab.com/operations/linked_resources
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/linked_resources.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
linked_resources.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Linked resources in incidents
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230852) in GitLab 15.3 [with a flag](../../administration/feature_flags/_index.md) named `incident_resource_links_widget`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.3.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.5. Feature flag `incident_resource_links_widget` removed.
{{< /history >}}
To help your team members find the important links without having to search through many comments,
you can add linked resources to an incident issue.
Resources you might want link to:
- The incident Slack channel
- Zoom meeting
- Resources for resolving the incidents
## View linked resources of an incident
Linked resources for an incident are listed under the **Summary** tab.

To view the linked resources of an incident:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
## Add a linked resource
Add a linked resource manually from an incident.
Prerequisites:
- You must have at least the Reporter role for the project.
To add a linked resource:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select the plus icon ({{< icon name="plus-square" >}}).
1. Complete the required fields.
1. Select **Add**.
### Using a quick action
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374964) in GitLab 15.5.
{{< /history >}}
To add multiple links to an incident, use the `/link`
[quick action](../../user/project/quick_actions.md):
```plaintext
/link https://example.link.us/j/123456789
```
You can also submit a short description with the link.
The description shows instead of the URL in the **Linked resources** section of the incident:
```plaintext
/link https://example.link.us/j/123456789 multiple alerts firing
```
### Link Zoom meetings from an incident
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230853) in GitLab 15.4.
{{< /history >}}
Use the `/zoom` [quick action](../../user/project/quick_actions.md) to add multiple Zoom links to an incident:
```plaintext
/zoom https://example.zoom.us/j/123456789
```
You can also submit a short optional description with the link. The description shows instead of the URL in the **Linked resources** section of the incident issue:
```plaintext
/zoom https://example.zoom.us/j/123456789 Low on memory incident
```
## Remove a linked resource
You can also remove a linked resource.
Prerequisites:
- You must have at least the Reporter role for the project.
To remove a linked resource:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select **Remove** ({{< icon name="close" >}}).
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Linked resources in incidents
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230852) in GitLab 15.3 [with a flag](../../administration/feature_flags/_index.md) named `incident_resource_links_widget`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.3.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.5. Feature flag `incident_resource_links_widget` removed.
{{< /history >}}
To help your team members find the important links without having to search through many comments,
you can add linked resources to an incident issue.
Resources you might want link to:
- The incident Slack channel
- Zoom meeting
- Resources for resolving the incidents
## View linked resources of an incident
Linked resources for an incident are listed under the **Summary** tab.

To view the linked resources of an incident:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
## Add a linked resource
Add a linked resource manually from an incident.
Prerequisites:
- You must have at least the Reporter role for the project.
To add a linked resource:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select the plus icon ({{< icon name="plus-square" >}}).
1. Complete the required fields.
1. Select **Add**.
### Using a quick action
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374964) in GitLab 15.5.
{{< /history >}}
To add multiple links to an incident, use the `/link`
[quick action](../../user/project/quick_actions.md):
```plaintext
/link https://example.link.us/j/123456789
```
You can also submit a short description with the link.
The description shows instead of the URL in the **Linked resources** section of the incident:
```plaintext
/link https://example.link.us/j/123456789 multiple alerts firing
```
### Link Zoom meetings from an incident
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230853) in GitLab 15.4.
{{< /history >}}
Use the `/zoom` [quick action](../../user/project/quick_actions.md) to add multiple Zoom links to an incident:
```plaintext
/zoom https://example.zoom.us/j/123456789
```
You can also submit a short optional description with the link. The description shows instead of the URL in the **Linked resources** section of the incident issue:
```plaintext
/zoom https://example.zoom.us/j/123456789 Low on memory incident
```
## Remove a linked resource
You can also remove a linked resource.
Prerequisites:
- You must have at least the Reporter role for the project.
To remove a linked resource:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select **Remove** ({{< icon name="close" >}}).
|
https://docs.gitlab.com/operations/status_page
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/status_page.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
status_page.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Status Page
|
Static status page websites for communicating incident information to users.
|
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With a GitLab Status Page, you can create and deploy a static website to communicate
efficiently to users during an incident. The Status Page landing page displays an
overview of recent incidents:

Selecting an incident displays a detail page with more information about a particular incident:

- Status on the incident, including when the incident was last updated.
- The incident title, including any emoji.
- The description of the incident, including emoji.
- Any file attachments provided in the incident description, or comments with a
valid image extension.
- A chronological ordered list of updates to the incident.
## Set up a Status Page
To configure a GitLab Status Page you must:
1. [Configure GitLab](#configure-gitlab-with-cloud-provider-information) with your
cloud provider information.
1. [Configure your AWS account](#configure-your-aws-account).
1. [Create a Status Page project](#create-a-status-page-project) on GitLab.
1. [Sync incidents to the Status Page](#sync-incidents-to-the-status-page).
### Configure GitLab with cloud provider information
Only AWS S3 is supported as a deploy target.
Prerequisites:
- You must have at least the Maintainer role.
To provide GitLab with the AWS account information needed to push content to your Status Page:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Status page**.
1. Select the **Active** checkbox.
1. In the **Status Page URL** box, provide the URL for your external status page.
1. In the **S3 Bucket name** box, type the name of your S3 bucket. For more information, see
[Bucket configuration documentation](https://docs.aws.amazon.com/AmazonS3/latest/dev/HostingWebsiteOnS3Setup.html).
1. In the **AWS region** box, type the region for your bucket. For more information, see the
[AWS documentation](https://github.com/aws/aws-sdk-ruby#configuration).
1. Enter your **AWS access key ID** and **AWS Secret access key**.
1. Select **Save changes**.
### Configure your AWS account
1. Within your AWS account, create two new IAM policies, using the following files
as examples:
- [Create bucket](https://gitlab.com/gitlab-org/status-page/-/blob/master/deploy/etc/s3_create_policy.json).
- [Update bucket contents](https://gitlab.com/gitlab-org/status-page/-/blob/master/deploy/etc/s3_update_bucket_policy.json) (Remember replace `S3_BUCKET_NAME` with your bucket name).
1. Create a new AWS access key with the permissions policies created in the first step.
### Create a status page project
After configuring your AWS account, you must add the Status Page project and configure
the necessary CI/CD variables to deploy the Status Page to AWS S3:
1. Fork the [Status Page](https://gitlab.com/gitlab-org/status-page) project.
You can do this through [Repository Mirroring](https://gitlab.com/gitlab-org/status-page#repository-mirroring),
which ensures you get the up-to-date Status Page features.
1. On the left sidebar, select **Settings > CI/CD**.
1. Expand **Variables**.
1. Add the following variables from your Amazon Console:
- `S3_BUCKET_NAME` - The name of the Amazon S3 bucket.
If no bucket with the provided name exists, the first pipeline run creates
one and configures it for
[static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/HostingWebsiteOnS3Setup.html).
- `AWS_DEFAULT_REGION` - The AWS region.
- `AWS_ACCESS_KEY_ID` - The AWS access key ID.
- `AWS_SECRET_ACCESS_KEY` - The AWS secret.
1. On the left sidebar, select **Build > Pipelines**.
1. To deploy the Status Page to S3, select **New pipeline**.
{{< alert type="warning" >}}
Consider limiting who can access issues in this project, as any user who can view
the incident can potentially [publish comments to your GitLab Status Page](#publish-comments-on-incidents).
{{< /alert >}}
### Sync incidents to the Status Page
After creating the CI/CD variables, configure the Project you want to use for
Incidents:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Status page**.
1. Fill in your cloud provider's credentials and make sure to select the **Active** checkbox.
1. Select **Save changes**.
## How to use your GitLab Status Page
After configuring your GitLab instance, relevant updates trigger a background job
that pushes JSON-formatted data about the incident to your external cloud provider.
Your status page website periodically fetches this JSON-formatted data. It formats
and displays it to users, providing information about ongoing incidents without
extra effort from your team:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TB
accTitle: Understand your status page
accDescr: How GitLab fetches, formats, and displays incident data
subgraph GitLab Instance
issues(issue updates) -- trigger --> middleware(Background job: JSON generation)
end
subgraph Cloud Provider
middleware --saves data --> c1(Cloud Bucket stores JSON file)
end
subgraph Status Page
d(Static Site on CDN) -- fetches data --> c1
end
```
### Publish an incident
To publish an incident:
1. Create an incident in the project you enabled the GitLab Status Page settings in.
1. A [project or group owner](../../user/permissions.md) must use the
`/publish` [quick action](../../user/project/quick_actions.md) to publish the
incident to the GitLab Status Page. [Confidential incidents](../../user/project/issues/confidential_issues.md) can't be published.
A background worker publishes the incident onto the Status Page using the credentials
you provided during setup. As part of publication, GitLab:
- Anonymizes user and group mentions with `Incident Responder`.
- Removes titles of non-public [GitLab references](../../user/markdown.md#gitlab-specific-references).
- Publishes any files attached to incident descriptions, up to 5000 per incident.
After publication, you can access the incident's details page by selecting the
**Published on status page** button displayed under the Incident's title.

### Update an incident
To publish an update to the Incident, update the incident's description.
{{< alert type="warning" >}}
When referenced incidents are changed (such as title or confidentiality) the incident
they were referenced in is not updated.
{{< /alert >}}
### Publish comments on incidents
To publish comments to the Status Page Incident:
- Create a comment on the incident.
- When you're ready to publish the comment, mark the comment for publication by
adding a microphone [emoji reaction](../../user/emoji_reactions.md)
reaction (`:microphone:` 🎤) to the comment.
- Any files attached to the comment (up to 5000 per incident) are also published.
{{< alert type="warning" >}}
Anyone with access to view the incident can add an emoji reaction to a comment, so
consider limiting access to issues to team members only.
{{< /alert >}}
### Update the incident status
To change the incident status from `open` to `closed`, close the incident
within GitLab. Closing the incident triggers a background worker to update the
GitLab Status Page website.
If you
[make a published incident confidential](../../user/project/issues/confidential_issues.md#make-an-issue-confidential),
GitLab unpublishes it from your GitLab Status Page website.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Static status page websites for communicating incident information to
users.
title: Status Page
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With a GitLab Status Page, you can create and deploy a static website to communicate
efficiently to users during an incident. The Status Page landing page displays an
overview of recent incidents:

Selecting an incident displays a detail page with more information about a particular incident:

- Status on the incident, including when the incident was last updated.
- The incident title, including any emoji.
- The description of the incident, including emoji.
- Any file attachments provided in the incident description, or comments with a
valid image extension.
- A chronological ordered list of updates to the incident.
## Set up a Status Page
To configure a GitLab Status Page you must:
1. [Configure GitLab](#configure-gitlab-with-cloud-provider-information) with your
cloud provider information.
1. [Configure your AWS account](#configure-your-aws-account).
1. [Create a Status Page project](#create-a-status-page-project) on GitLab.
1. [Sync incidents to the Status Page](#sync-incidents-to-the-status-page).
### Configure GitLab with cloud provider information
Only AWS S3 is supported as a deploy target.
Prerequisites:
- You must have at least the Maintainer role.
To provide GitLab with the AWS account information needed to push content to your Status Page:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Status page**.
1. Select the **Active** checkbox.
1. In the **Status Page URL** box, provide the URL for your external status page.
1. In the **S3 Bucket name** box, type the name of your S3 bucket. For more information, see
[Bucket configuration documentation](https://docs.aws.amazon.com/AmazonS3/latest/dev/HostingWebsiteOnS3Setup.html).
1. In the **AWS region** box, type the region for your bucket. For more information, see the
[AWS documentation](https://github.com/aws/aws-sdk-ruby#configuration).
1. Enter your **AWS access key ID** and **AWS Secret access key**.
1. Select **Save changes**.
### Configure your AWS account
1. Within your AWS account, create two new IAM policies, using the following files
as examples:
- [Create bucket](https://gitlab.com/gitlab-org/status-page/-/blob/master/deploy/etc/s3_create_policy.json).
- [Update bucket contents](https://gitlab.com/gitlab-org/status-page/-/blob/master/deploy/etc/s3_update_bucket_policy.json) (Remember replace `S3_BUCKET_NAME` with your bucket name).
1. Create a new AWS access key with the permissions policies created in the first step.
### Create a status page project
After configuring your AWS account, you must add the Status Page project and configure
the necessary CI/CD variables to deploy the Status Page to AWS S3:
1. Fork the [Status Page](https://gitlab.com/gitlab-org/status-page) project.
You can do this through [Repository Mirroring](https://gitlab.com/gitlab-org/status-page#repository-mirroring),
which ensures you get the up-to-date Status Page features.
1. On the left sidebar, select **Settings > CI/CD**.
1. Expand **Variables**.
1. Add the following variables from your Amazon Console:
- `S3_BUCKET_NAME` - The name of the Amazon S3 bucket.
If no bucket with the provided name exists, the first pipeline run creates
one and configures it for
[static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/HostingWebsiteOnS3Setup.html).
- `AWS_DEFAULT_REGION` - The AWS region.
- `AWS_ACCESS_KEY_ID` - The AWS access key ID.
- `AWS_SECRET_ACCESS_KEY` - The AWS secret.
1. On the left sidebar, select **Build > Pipelines**.
1. To deploy the Status Page to S3, select **New pipeline**.
{{< alert type="warning" >}}
Consider limiting who can access issues in this project, as any user who can view
the incident can potentially [publish comments to your GitLab Status Page](#publish-comments-on-incidents).
{{< /alert >}}
### Sync incidents to the Status Page
After creating the CI/CD variables, configure the Project you want to use for
Incidents:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Monitor**.
1. Expand **Status page**.
1. Fill in your cloud provider's credentials and make sure to select the **Active** checkbox.
1. Select **Save changes**.
## How to use your GitLab Status Page
After configuring your GitLab instance, relevant updates trigger a background job
that pushes JSON-formatted data about the incident to your external cloud provider.
Your status page website periodically fetches this JSON-formatted data. It formats
and displays it to users, providing information about ongoing incidents without
extra effort from your team:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TB
accTitle: Understand your status page
accDescr: How GitLab fetches, formats, and displays incident data
subgraph GitLab Instance
issues(issue updates) -- trigger --> middleware(Background job: JSON generation)
end
subgraph Cloud Provider
middleware --saves data --> c1(Cloud Bucket stores JSON file)
end
subgraph Status Page
d(Static Site on CDN) -- fetches data --> c1
end
```
### Publish an incident
To publish an incident:
1. Create an incident in the project you enabled the GitLab Status Page settings in.
1. A [project or group owner](../../user/permissions.md) must use the
`/publish` [quick action](../../user/project/quick_actions.md) to publish the
incident to the GitLab Status Page. [Confidential incidents](../../user/project/issues/confidential_issues.md) can't be published.
A background worker publishes the incident onto the Status Page using the credentials
you provided during setup. As part of publication, GitLab:
- Anonymizes user and group mentions with `Incident Responder`.
- Removes titles of non-public [GitLab references](../../user/markdown.md#gitlab-specific-references).
- Publishes any files attached to incident descriptions, up to 5000 per incident.
After publication, you can access the incident's details page by selecting the
**Published on status page** button displayed under the Incident's title.

### Update an incident
To publish an update to the Incident, update the incident's description.
{{< alert type="warning" >}}
When referenced incidents are changed (such as title or confidentiality) the incident
they were referenced in is not updated.
{{< /alert >}}
### Publish comments on incidents
To publish comments to the Status Page Incident:
- Create a comment on the incident.
- When you're ready to publish the comment, mark the comment for publication by
adding a microphone [emoji reaction](../../user/emoji_reactions.md)
reaction (`:microphone:` 🎤) to the comment.
- Any files attached to the comment (up to 5000 per incident) are also published.
{{< alert type="warning" >}}
Anyone with access to view the incident can add an emoji reaction to a comment, so
consider limiting access to issues to team members only.
{{< /alert >}}
### Update the incident status
To change the incident status from `open` to `closed`, close the incident
within GitLab. Closing the incident triggers a background worker to update the
GitLab Status Page website.
If you
[make a published incident confidential](../../user/project/issues/confidential_issues.md#make-an-issue-confidential),
GitLab unpublishes it from your GitLab Status Page website.
|
https://docs.gitlab.com/operations/integrations
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/integrations.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
integrations.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Integrations
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab can accept alerts from any source via a webhook receiver. [Alert notifications](alerts.md)
can [trigger paging](paging.md#paging) for on-call rotations or be used to [create incidents](manage_incidents.md#from-an-alert).
## Integrations list
With at least the Maintainer role, you can view the list of configured
alerting integrations by navigating to **Settings > Monitor**
in your project's sidebar menu, and expanding the **Alerts** section. The list displays
the integration name, type, and status (enabled or disabled):

## Configuration
GitLab can receive alerts via an HTTP endpoint that you configure.
### Single Alerting Endpoint
Enabling an alerting endpoint in a GitLab projects activates it to
receive alert payloads in JSON format. You can always
[customize the payload](#customize-the-alert-payload-outside-of-gitlab) to your liking.
1. Sign in to GitLab as a user with the Maintainer role
for a project.
1. Go to **Settings > Monitor** in your project.
1. Expand the **Alerts** section, and in the **Select integration type** dropdown list,
select **Prometheus** for alerts from Prometheus, or **HTTP Endpoint** for any other monitoring tool.
1. Toggle the **Active** alert setting. The URL and Authorization Key for the webhook configuration
are available in the **View credentials** tab after you save the integration. You must also input
the URL and Authorization Key in your external service.
### Alerting Endpoints
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In [GitLab Premium](https://about.gitlab.com/pricing/), you can create multiple
unique alerting endpoints to receive alerts from any external source in JSON format,
and you can [customize the payload](#customize-the-alert-payload-outside-of-gitlab).
1. Sign in to GitLab as a user with the Maintainer role
for a project.
1. Go to **Settings > Monitor** in your project.
1. Expand the **Alerts** section.
1. For each endpoint you want to create:
1. Select **Add new integration**.
1. In the **Select integration type** dropdown list, select **Prometheus** for alerts from Prometheus, or **HTTP Endpoint** for any other monitoring tool. See details
1. Name the integration.
1. Toggle the **Active** alert setting. The **URL** and **Authorization Key** for the webhook
configuration are available in the **View credentials** tab after you save the integration.
You must also input the URL and Authorization Key in your external service.
1. Optional. To map fields from your monitoring tool's alert to GitLab fields, enter a sample
payload and select **Parse payload for custom mapping**. Valid JSON is required. If you update
a sample payload, you must also remap the fields. For Prometheus integrations, enter a single alert from the payload's `alerts` key instead of the entire payload.
1. Optional. If you provided a valid sample payload, select each value in
**Payload alert key** to [map to a **GitLab alert key**](#map-fields-in-custom-alerts).
1. To save your integration, select **Save Integration**. If desired, you can send a test alert
from your integration's **Send test alert** tab after the integration is created.
The new HTTP Endpoint displays in the [integrations list](#integrations-list).
You can edit the integration by selecting the {{< icon name="settings" >}} settings icon on the right
side of the integrations list.
#### Map fields in custom alerts
You can integrate your monitoring tool's alert format with GitLab alerts. To show the
correct information in the [Alert list](alerts.md#alert-list) and the
[Alert Details page](alerts.md#alert-details-page), map your alert's fields to
GitLab fields when you [create an HTTP endpoint](#alerting-endpoints):

### Add integration credentials to Alertmanager (Prometheus integrations only)
To send Prometheus alert notifications to GitLab, copy the URL and authorization key from
your [Prometheus integration](#single-alerting-endpoint) into the
[`webhook_configs`](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config)
section of the Prometheus Alertmanager configuration:
```yaml
receivers:
- name: gitlab
webhook_configs:
- http_config:
authorization:
type: Bearer
credentials: 1234567890abdcdefg
send_resolved: true
url: http://IP_ADDRESS:PORT/root/manual_prometheus/prometheus/alerts/notify.json
# Rest of configuration omitted
# ...
```
## Customize the alert payload outside of GitLab
### Expected HTTP request attributes
For HTTP Endpoints without [custom mappings](#map-fields-in-custom-alerts), you can customize the payload by sending the following
parameters. All fields are optional. If the incoming alert does not contain a value for the `Title` field, a default value of `New: Alert` is applied.
| Property | Type | Description |
| ------------------------- | --------------- | ----------- |
| `title` | String | The title of the alert.|
| `description` | String | A high-level summary of the problem. |
| `start_time` | DateTime | The time of the alert. If none is provided, a current time is used. |
| `end_time` | DateTime | The resolution time of the alert. If provided, the alert is resolved. |
| `service` | String | The affected service. |
| `monitoring_tool` | String | The name of the associated monitoring tool. |
| `hosts` | String or Array | One or more hosts, as to where this incident occurred. |
| `severity` | String | The severity of the alert. Case-insensitive. Can be one of: `critical`, `high`, `medium`, `low`, `info`, `unknown`. Defaults to `critical` if missing or value is not in this list. |
| `fingerprint` | String or Array | The unique identifier of the alert. This can be used to group occurrences of the same alert. When the `generic_alert_fingerprinting` feature is enabled, the fingerprint is generated automatically based on the payload (excluding the `start_time`, `end_time`, and `hosts` parameters). |
| `gitlab_environment_name` | String | The name of the associated GitLab [environment](../../ci/environments/_index.md). Required to [display alerts on a dashboard](../../user/operations_dashboard/_index.md#adding-a-project-to-the-dashboard). |
You can also add custom fields to the alert's payload. The values of extra
parameters aren't limited to primitive types (such as strings or numbers), but
can be a nested JSON object. For example:
```json
{ "foo": { "bar": { "baz": 42 } } }
```
{{< alert type="note" >}}
Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
{{< /alert >}}
#### Example request body
Example payload:
```json
{
"title": "Incident title",
"description": "Short description of the incident",
"start_time": "2019-09-12T06:00:55Z",
"service": "service affected",
"monitoring_tool": "value",
"hosts": "value",
"severity": "high",
"fingerprint": "d19381d4e8ebca87b55cda6e8eee7385",
"foo": {
"bar": {
"baz": 42
}
}
}
```
### Expected Prometheus request attributes
Alerts are expected to be formatted for a Prometheus [webhook receiver](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config).
Top-level required attributes:
- `alerts`
- `commonAnnotations`
- `commonLabels`
- `externalURL`
- `groupKey`
- `groupLabels`
- `receiver`
- `status`
- `version`
From `alerts` in the Prometheus payload, a GitLab alert is created for each item in the array.
You can alter the nested parameters listed below to configure the GitLab alert.
| Attribute | Type | Required | Description |
| -------------------------------------------------------------------------- | -------- | -------- | ------------------------------------ |
| One of `annotations/title`, `annotations/summary`, or `labels/alertname` | String | Yes | The title of the alert. |
| `startsAt` | DateTime | Yes | The start time of the alert. |
| `annotations/description` | String | No | A high-level summary of the problem. |
| `annotations/gitlab_incident_markdown` | String | No | [GitLab Flavored Markdown](../../user/markdown.md) to be appended to any incident created from the alert. |
| `annotations/runbook` | String | No | Link to documentation or instructions for how to manage this alert. |
| `endsAt` | DateTime | No | The resolution time of the alert. |
| `g0.expr` query parameter in `generatorUrl` | String | No | Query of associated metric. |
| `labels/gitlab_environment_name` | String | No | The name of the associated GitLab [environment](../../ci/environments/_index.md). Required to [display alerts on a dashboard](../../user/operations_dashboard/_index.md#adding-a-project-to-the-dashboard). |
| `labels/severity` | String | No | Severity of the alert. Should be one of the [Prometheus severity options](#prometheus-severity-options). Defaults to `critical` if missing or value is not in this list. |
| `status` | String | No | Status of the alert in Prometheus. If value is 'resolved', the alert is resolved. |
| One of `annotations/gitlab_y_label`, `annotations/title`, `annotations/summary`, or `labels/alertname` | String | No | The Y-Axis label to be used when embedding the metrics for this alert in [GitLab Flavored Markdown](../../user/markdown.md). |
Additional attributes included under `annotations` are available on
the [alert details page](alerts.md#alert-details-page). Any other attributes are ignored.
Attributes aren't limited to primitive types (such as strings or numbers), but
can be a nested JSON object. For example:
```json
{
"target": {
"user": {
"id": 42
}
}
}
```
{{< alert type="note" >}}
Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
{{< /alert >}}
#### Prometheus severity options
Alerts from Prometheus can provide any of the case-insensitive follow values for [alert severity](alerts.md#alert-severity):
- **Critical**: `critical`, `s1`, `p1`, `emergency`, `fatal`
- **High**: `high`, `s2`, `p2`, `major`, `page`
- **Medium**: `medium`, `s3`, `p3`, `error`, `alert`
- **Low**: `low`, `s4`, `p4`, `warn`, `warning`
- **Info**: `info`, `s5`, `p5`, `debug`, `information`, `notice`
The severity defaults to `critical` if the value is missing or not in this list.
#### Example Prometheus alert
Example alerting rule:
```yaml
groups:
- name: example
rules:
- alert: ServiceDown
expr: up == 0
for: 5m
labels:
severity: high
annotations:
title: "Example title"
runbook: "http://example.com/my-alert-runbook"
description: "Service has been down for more than 5 minutes."
gitlab_y_label: "y-axis label"
foo:
bar:
baz: 42
```
Example request payload:
```json
{
"version" : "4",
"groupKey": null,
"status": "firing",
"receiver": "",
"groupLabels": {},
"commonLabels": {},
"commonAnnotations": {},
"externalURL": "",
"alerts": [{
"startsAt": "2022-010-30T11:22:40Z",
"generatorURL": "http://host?g0.expr=up",
"endsAt": null,
"status": "firing",
"labels": {
"gitlab_environment_name": "production",
"severity": "high"
},
"annotations": {
"title": "Example title",
"runbook": "http://example.com/my-alert-runbook",
"description": "Service has been down for more than 5 minutes.",
"gitlab_y_label": "y-axis label",
"foo": {
"bar": {
"baz": 42
}
}
}
}]
}
```
{{< alert type="note" >}}
When [triggering a test alert](#triggering-test-alerts), enter the whole payload as shown in the example.
When [configuring custom mappings](#map-fields-in-custom-alerts), enter only the first item from the `alerts` array as the sample payload.
{{< /alert >}}
## Authorization
The following authorization methods are accepted:
- Bearer authorization header
- Basic authentication
The `<authorization_key>` and `<url>` values can be found when configuring an alert integration.
### Bearer authorization header
The authorization key can be used as the Bearer token:
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Authorization: Bearer <authorization_key>" \
--header "Content-Type: application/json" \
<url>
```
### Basic authentication
The authorization key can be used as the `password`. The `username` is left blank:
- username: `<blank>`
- password: `<authorization_key>`
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Authorization: Basic <base_64_encoded_credentials>" \
--header "Content-Type: application/json" \
<url>
```
Basic authentication can also be used with credentials directly in the URL:
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Content-Type: application/json" \
<username:password@url>
```
{{< alert type="warning" >}}
Using your authorization key in the URL is insecure, as it's visible in server logs. We recommend
using one of the header options described previously if your tooling supports it.
{{< /alert >}}
## Response body
The JSON response body contains a list of any alerts created within the request:
```json
[
{
"iid": 1,
"title": "Incident title"
},
{
"iid": 2,
"title": "Second Incident title"
}
]
```
Successful responses return a `200` response code.
## Triggering test alerts
After a [project maintainer or owner](../../user/permissions.md)
configures an integration, you can trigger a test
alert to confirm your integration works properly.
1. Sign in as a user with at least the Developer role.
1. Go to **Settings > Monitor** in your project.
1. Select **Alerts** to expand the section.
1. Select the {{< icon name="settings" >}} settings icon on the right side of the integration in [the list](#integrations-list).
1. Select the **Send test alert** tab to open it.
1. Enter a test payload in the payload field (valid JSON is required).
1. Select **Send**.
GitLab displays an error or success message, depending on the outcome of your test.
## Automatic grouping of identical alerts
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab groups alerts based on their payload. When an incoming alert contains the same payload as another alert
(excluding the `start_time` and `hosts` attributes), GitLab groups these alerts
together and displays a counter on the [Alert Management List](incidents.md)
and details pages.
If the existing alert is already `resolved`, GitLab creates a new alert instead.

## Recovery alerts
The alert in GitLab is automatically resolved when an HTTP Endpoint
receives a payload with the end time of the alert set. For HTTP Endpoints
without [custom mappings](#map-fields-in-custom-alerts), the expected
field is `end_time`. With custom mappings, you can select the expected field.
GitLab determines which alert to resolve based on the `fingerprint` value that can be provided as
part of the payload.
For more information on alert properties and mappings, see
[Customize the alert payload outside of GitLab](#customize-the-alert-payload-outside-of-gitlab).
You can also configure the associated [incident to be closed automatically](manage_incidents.md#automatically-close-incidents-via-recovery-alerts) when the alert resolves.
## Link to your Opsgenie Alerts
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.2.
{{< /history >}}
{{< alert type="warning" >}}
We are building deeper integration with Opsgenie and other alerting tools through
[HTTP endpoint integrations](#single-alerting-endpoint) so you can see alerts in
the GitLab interface.
{{< /alert >}}
You can monitor alerts using a GitLab integration with [Opsgenie](https://www.atlassian.com/software/opsgenie).
If you enable the Opsgenie integration, you can't have other GitLab alert
services
active at the same time.
To enable Opsgenie integration:
1. Sign in as a user with at least the Maintainer role.
1. Go to **Monitor > Alerts**.
1. In the **Integrations** select box, select **Opsgenie**.
1. Select the **Active** toggle.
1. In the **API URL** field, enter the base URL for your Opsgenie integration,
such as `https://app.opsgenie.com/alert/list`.
1. Select **Save changes**.
After you enable the integration, go to the **Alerts** page at
**Monitor > Alerts**, and then select **View alerts in Opsgenie**.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Integrations
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab can accept alerts from any source via a webhook receiver. [Alert notifications](alerts.md)
can [trigger paging](paging.md#paging) for on-call rotations or be used to [create incidents](manage_incidents.md#from-an-alert).
## Integrations list
With at least the Maintainer role, you can view the list of configured
alerting integrations by navigating to **Settings > Monitor**
in your project's sidebar menu, and expanding the **Alerts** section. The list displays
the integration name, type, and status (enabled or disabled):

## Configuration
GitLab can receive alerts via an HTTP endpoint that you configure.
### Single Alerting Endpoint
Enabling an alerting endpoint in a GitLab projects activates it to
receive alert payloads in JSON format. You can always
[customize the payload](#customize-the-alert-payload-outside-of-gitlab) to your liking.
1. Sign in to GitLab as a user with the Maintainer role
for a project.
1. Go to **Settings > Monitor** in your project.
1. Expand the **Alerts** section, and in the **Select integration type** dropdown list,
select **Prometheus** for alerts from Prometheus, or **HTTP Endpoint** for any other monitoring tool.
1. Toggle the **Active** alert setting. The URL and Authorization Key for the webhook configuration
are available in the **View credentials** tab after you save the integration. You must also input
the URL and Authorization Key in your external service.
### Alerting Endpoints
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
In [GitLab Premium](https://about.gitlab.com/pricing/), you can create multiple
unique alerting endpoints to receive alerts from any external source in JSON format,
and you can [customize the payload](#customize-the-alert-payload-outside-of-gitlab).
1. Sign in to GitLab as a user with the Maintainer role
for a project.
1. Go to **Settings > Monitor** in your project.
1. Expand the **Alerts** section.
1. For each endpoint you want to create:
1. Select **Add new integration**.
1. In the **Select integration type** dropdown list, select **Prometheus** for alerts from Prometheus, or **HTTP Endpoint** for any other monitoring tool. See details
1. Name the integration.
1. Toggle the **Active** alert setting. The **URL** and **Authorization Key** for the webhook
configuration are available in the **View credentials** tab after you save the integration.
You must also input the URL and Authorization Key in your external service.
1. Optional. To map fields from your monitoring tool's alert to GitLab fields, enter a sample
payload and select **Parse payload for custom mapping**. Valid JSON is required. If you update
a sample payload, you must also remap the fields. For Prometheus integrations, enter a single alert from the payload's `alerts` key instead of the entire payload.
1. Optional. If you provided a valid sample payload, select each value in
**Payload alert key** to [map to a **GitLab alert key**](#map-fields-in-custom-alerts).
1. To save your integration, select **Save Integration**. If desired, you can send a test alert
from your integration's **Send test alert** tab after the integration is created.
The new HTTP Endpoint displays in the [integrations list](#integrations-list).
You can edit the integration by selecting the {{< icon name="settings" >}} settings icon on the right
side of the integrations list.
#### Map fields in custom alerts
You can integrate your monitoring tool's alert format with GitLab alerts. To show the
correct information in the [Alert list](alerts.md#alert-list) and the
[Alert Details page](alerts.md#alert-details-page), map your alert's fields to
GitLab fields when you [create an HTTP endpoint](#alerting-endpoints):

### Add integration credentials to Alertmanager (Prometheus integrations only)
To send Prometheus alert notifications to GitLab, copy the URL and authorization key from
your [Prometheus integration](#single-alerting-endpoint) into the
[`webhook_configs`](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config)
section of the Prometheus Alertmanager configuration:
```yaml
receivers:
- name: gitlab
webhook_configs:
- http_config:
authorization:
type: Bearer
credentials: 1234567890abdcdefg
send_resolved: true
url: http://IP_ADDRESS:PORT/root/manual_prometheus/prometheus/alerts/notify.json
# Rest of configuration omitted
# ...
```
## Customize the alert payload outside of GitLab
### Expected HTTP request attributes
For HTTP Endpoints without [custom mappings](#map-fields-in-custom-alerts), you can customize the payload by sending the following
parameters. All fields are optional. If the incoming alert does not contain a value for the `Title` field, a default value of `New: Alert` is applied.
| Property | Type | Description |
| ------------------------- | --------------- | ----------- |
| `title` | String | The title of the alert.|
| `description` | String | A high-level summary of the problem. |
| `start_time` | DateTime | The time of the alert. If none is provided, a current time is used. |
| `end_time` | DateTime | The resolution time of the alert. If provided, the alert is resolved. |
| `service` | String | The affected service. |
| `monitoring_tool` | String | The name of the associated monitoring tool. |
| `hosts` | String or Array | One or more hosts, as to where this incident occurred. |
| `severity` | String | The severity of the alert. Case-insensitive. Can be one of: `critical`, `high`, `medium`, `low`, `info`, `unknown`. Defaults to `critical` if missing or value is not in this list. |
| `fingerprint` | String or Array | The unique identifier of the alert. This can be used to group occurrences of the same alert. When the `generic_alert_fingerprinting` feature is enabled, the fingerprint is generated automatically based on the payload (excluding the `start_time`, `end_time`, and `hosts` parameters). |
| `gitlab_environment_name` | String | The name of the associated GitLab [environment](../../ci/environments/_index.md). Required to [display alerts on a dashboard](../../user/operations_dashboard/_index.md#adding-a-project-to-the-dashboard). |
You can also add custom fields to the alert's payload. The values of extra
parameters aren't limited to primitive types (such as strings or numbers), but
can be a nested JSON object. For example:
```json
{ "foo": { "bar": { "baz": 42 } } }
```
{{< alert type="note" >}}
Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
{{< /alert >}}
#### Example request body
Example payload:
```json
{
"title": "Incident title",
"description": "Short description of the incident",
"start_time": "2019-09-12T06:00:55Z",
"service": "service affected",
"monitoring_tool": "value",
"hosts": "value",
"severity": "high",
"fingerprint": "d19381d4e8ebca87b55cda6e8eee7385",
"foo": {
"bar": {
"baz": 42
}
}
}
```
### Expected Prometheus request attributes
Alerts are expected to be formatted for a Prometheus [webhook receiver](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config).
Top-level required attributes:
- `alerts`
- `commonAnnotations`
- `commonLabels`
- `externalURL`
- `groupKey`
- `groupLabels`
- `receiver`
- `status`
- `version`
From `alerts` in the Prometheus payload, a GitLab alert is created for each item in the array.
You can alter the nested parameters listed below to configure the GitLab alert.
| Attribute | Type | Required | Description |
| -------------------------------------------------------------------------- | -------- | -------- | ------------------------------------ |
| One of `annotations/title`, `annotations/summary`, or `labels/alertname` | String | Yes | The title of the alert. |
| `startsAt` | DateTime | Yes | The start time of the alert. |
| `annotations/description` | String | No | A high-level summary of the problem. |
| `annotations/gitlab_incident_markdown` | String | No | [GitLab Flavored Markdown](../../user/markdown.md) to be appended to any incident created from the alert. |
| `annotations/runbook` | String | No | Link to documentation or instructions for how to manage this alert. |
| `endsAt` | DateTime | No | The resolution time of the alert. |
| `g0.expr` query parameter in `generatorUrl` | String | No | Query of associated metric. |
| `labels/gitlab_environment_name` | String | No | The name of the associated GitLab [environment](../../ci/environments/_index.md). Required to [display alerts on a dashboard](../../user/operations_dashboard/_index.md#adding-a-project-to-the-dashboard). |
| `labels/severity` | String | No | Severity of the alert. Should be one of the [Prometheus severity options](#prometheus-severity-options). Defaults to `critical` if missing or value is not in this list. |
| `status` | String | No | Status of the alert in Prometheus. If value is 'resolved', the alert is resolved. |
| One of `annotations/gitlab_y_label`, `annotations/title`, `annotations/summary`, or `labels/alertname` | String | No | The Y-Axis label to be used when embedding the metrics for this alert in [GitLab Flavored Markdown](../../user/markdown.md). |
Additional attributes included under `annotations` are available on
the [alert details page](alerts.md#alert-details-page). Any other attributes are ignored.
Attributes aren't limited to primitive types (such as strings or numbers), but
can be a nested JSON object. For example:
```json
{
"target": {
"user": {
"id": 42
}
}
}
```
{{< alert type="note" >}}
Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
{{< /alert >}}
#### Prometheus severity options
Alerts from Prometheus can provide any of the case-insensitive follow values for [alert severity](alerts.md#alert-severity):
- **Critical**: `critical`, `s1`, `p1`, `emergency`, `fatal`
- **High**: `high`, `s2`, `p2`, `major`, `page`
- **Medium**: `medium`, `s3`, `p3`, `error`, `alert`
- **Low**: `low`, `s4`, `p4`, `warn`, `warning`
- **Info**: `info`, `s5`, `p5`, `debug`, `information`, `notice`
The severity defaults to `critical` if the value is missing or not in this list.
#### Example Prometheus alert
Example alerting rule:
```yaml
groups:
- name: example
rules:
- alert: ServiceDown
expr: up == 0
for: 5m
labels:
severity: high
annotations:
title: "Example title"
runbook: "http://example.com/my-alert-runbook"
description: "Service has been down for more than 5 minutes."
gitlab_y_label: "y-axis label"
foo:
bar:
baz: 42
```
Example request payload:
```json
{
"version" : "4",
"groupKey": null,
"status": "firing",
"receiver": "",
"groupLabels": {},
"commonLabels": {},
"commonAnnotations": {},
"externalURL": "",
"alerts": [{
"startsAt": "2022-010-30T11:22:40Z",
"generatorURL": "http://host?g0.expr=up",
"endsAt": null,
"status": "firing",
"labels": {
"gitlab_environment_name": "production",
"severity": "high"
},
"annotations": {
"title": "Example title",
"runbook": "http://example.com/my-alert-runbook",
"description": "Service has been down for more than 5 minutes.",
"gitlab_y_label": "y-axis label",
"foo": {
"bar": {
"baz": 42
}
}
}
}]
}
```
{{< alert type="note" >}}
When [triggering a test alert](#triggering-test-alerts), enter the whole payload as shown in the example.
When [configuring custom mappings](#map-fields-in-custom-alerts), enter only the first item from the `alerts` array as the sample payload.
{{< /alert >}}
## Authorization
The following authorization methods are accepted:
- Bearer authorization header
- Basic authentication
The `<authorization_key>` and `<url>` values can be found when configuring an alert integration.
### Bearer authorization header
The authorization key can be used as the Bearer token:
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Authorization: Bearer <authorization_key>" \
--header "Content-Type: application/json" \
<url>
```
### Basic authentication
The authorization key can be used as the `password`. The `username` is left blank:
- username: `<blank>`
- password: `<authorization_key>`
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Authorization: Basic <base_64_encoded_credentials>" \
--header "Content-Type: application/json" \
<url>
```
Basic authentication can also be used with credentials directly in the URL:
```shell
curl --request POST \
--data '{"title": "Incident title"}' \
--header "Content-Type: application/json" \
<username:password@url>
```
{{< alert type="warning" >}}
Using your authorization key in the URL is insecure, as it's visible in server logs. We recommend
using one of the header options described previously if your tooling supports it.
{{< /alert >}}
## Response body
The JSON response body contains a list of any alerts created within the request:
```json
[
{
"iid": 1,
"title": "Incident title"
},
{
"iid": 2,
"title": "Second Incident title"
}
]
```
Successful responses return a `200` response code.
## Triggering test alerts
After a [project maintainer or owner](../../user/permissions.md)
configures an integration, you can trigger a test
alert to confirm your integration works properly.
1. Sign in as a user with at least the Developer role.
1. Go to **Settings > Monitor** in your project.
1. Select **Alerts** to expand the section.
1. Select the {{< icon name="settings" >}} settings icon on the right side of the integration in [the list](#integrations-list).
1. Select the **Send test alert** tab to open it.
1. Enter a test payload in the payload field (valid JSON is required).
1. Select **Send**.
GitLab displays an error or success message, depending on the outcome of your test.
## Automatic grouping of identical alerts
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab groups alerts based on their payload. When an incoming alert contains the same payload as another alert
(excluding the `start_time` and `hosts` attributes), GitLab groups these alerts
together and displays a counter on the [Alert Management List](incidents.md)
and details pages.
If the existing alert is already `resolved`, GitLab creates a new alert instead.

## Recovery alerts
The alert in GitLab is automatically resolved when an HTTP Endpoint
receives a payload with the end time of the alert set. For HTTP Endpoints
without [custom mappings](#map-fields-in-custom-alerts), the expected
field is `end_time`. With custom mappings, you can select the expected field.
GitLab determines which alert to resolve based on the `fingerprint` value that can be provided as
part of the payload.
For more information on alert properties and mappings, see
[Customize the alert payload outside of GitLab](#customize-the-alert-payload-outside-of-gitlab).
You can also configure the associated [incident to be closed automatically](manage_incidents.md#automatically-close-incidents-via-recovery-alerts) when the alert resolves.
## Link to your Opsgenie Alerts
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.2.
{{< /history >}}
{{< alert type="warning" >}}
We are building deeper integration with Opsgenie and other alerting tools through
[HTTP endpoint integrations](#single-alerting-endpoint) so you can see alerts in
the GitLab interface.
{{< /alert >}}
You can monitor alerts using a GitLab integration with [Opsgenie](https://www.atlassian.com/software/opsgenie).
If you enable the Opsgenie integration, you can't have other GitLab alert
services
active at the same time.
To enable Opsgenie integration:
1. Sign in as a user with at least the Maintainer role.
1. Go to **Monitor > Alerts**.
1. In the **Integrations** select box, select **Opsgenie**.
1. Select the **Active** toggle.
1. In the **API URL** field, enter the base URL for your Opsgenie integration,
such as `https://app.opsgenie.com/alert/list`.
1. Select **Save changes**.
After you enable the integration, go to the **Alerts** page at
**Monitor > Alerts**, and then select **View alerts in Opsgenie**.
|
https://docs.gitlab.com/operations/oncall_schedules
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/operations/oncall_schedules.md
|
2025-08-13
|
doc/operations/incident_management
|
[
"doc",
"operations",
"incident_management"
] |
oncall_schedules.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
On-call Schedule Management
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Use on-call schedule management to create schedules for responders to rotate on-call
responsibilities. Maintain the availability of your software services by putting your teams on-call.
With [escalation policies](escalation_policies.md) and on-call schedules, your team is notified immediately
when things go wrong so they can quickly respond to service outages and disruptions.
To use on-call schedules:
1. [Create a schedule](#schedules).
1. [Add a rotation to the schedule](#rotations).
## Schedules
Set up an on-call schedule for your team to add rotations to.
Prerequisites:
- You must have at least the Maintainer role.
To create an on-call schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Add a schedule**.
1. Enter the schedule's name and description and select a time zone.
1. Select **Add schedule**.
You now have an empty schedule with no rotations. This renders as an empty state, prompting you to
create [rotations](#rotations) for your schedule.

### Edit a schedule
To update a schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Edit schedule** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
If you change the schedule's time zone, GitLab automatically updates the rotation's restricted time
interval (if one is set) to the corresponding times in the new time zone.
### Delete a schedule
To delete a schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Delete escalation policy** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete schedule**.
## Rotations
Add rotations to an existing schedule to put your team members on-call.
To create a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select the **Add a rotation** link.
1. Enter the following information:
- **Name**: Your rotation's name.
- **Participants**: The people you want in the rotation.
- **Rotation length**: The rotation's duration.
- **Starts on**: The date and time the rotation begins.
- **Enable end date**: With the toggle on, you can select the date and time your rotation
ends.
- **Restrict to time intervals**: With the toggle on, you can restrict your rotation to the
time period you select.
### Edit a rotation
To edit a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Edit rotation** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
### Delete a rotation
To delete a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Delete rotation** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete rotation**.
## View schedule rotations
You can view the on-call schedules of a single day or two weeks. To switch between these time
periods, select the **1 day** or **2 weeks** buttons on the schedule. Two weeks is the default view.
Hover over any rotation shift participants in the schedule to view their individual shift details.

## Page an on-call responder
See [Paging](paging.md#paging) for more details.
## Removal or deletion of on-call user
If an on-call user is removed from the project or group, or their account is deleted, the
confirmation modal displays the list of that user's on-call schedules. If the user's removal or
deletion is confirmed, GitLab recalculates the on-call rotation and sends an email to the project
owners and the rotation's participants.
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: On-call Schedule Management
breadcrumbs:
- doc
- operations
- incident_management
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Use on-call schedule management to create schedules for responders to rotate on-call
responsibilities. Maintain the availability of your software services by putting your teams on-call.
With [escalation policies](escalation_policies.md) and on-call schedules, your team is notified immediately
when things go wrong so they can quickly respond to service outages and disruptions.
To use on-call schedules:
1. [Create a schedule](#schedules).
1. [Add a rotation to the schedule](#rotations).
## Schedules
Set up an on-call schedule for your team to add rotations to.
Prerequisites:
- You must have at least the Maintainer role.
To create an on-call schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Add a schedule**.
1. Enter the schedule's name and description and select a time zone.
1. Select **Add schedule**.
You now have an empty schedule with no rotations. This renders as an empty state, prompting you to
create [rotations](#rotations) for your schedule.

### Edit a schedule
To update a schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Edit schedule** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
If you change the schedule's time zone, GitLab automatically updates the rotation's restricted time
interval (if one is set) to the corresponding times in the new time zone.
### Delete a schedule
To delete a schedule:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select **Delete escalation policy** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete schedule**.
## Rotations
Add rotations to an existing schedule to put your team members on-call.
To create a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. Select the **Add a rotation** link.
1. Enter the following information:
- **Name**: Your rotation's name.
- **Participants**: The people you want in the rotation.
- **Rotation length**: The rotation's duration.
- **Starts on**: The date and time the rotation begins.
- **Enable end date**: With the toggle on, you can select the date and time your rotation
ends.
- **Restrict to time intervals**: With the toggle on, you can restrict your rotation to the
time period you select.
### Edit a rotation
To edit a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Edit rotation** ({{< icon name="pencil" >}}).
1. Edit the information.
1. Select **Save changes**.
### Delete a rotation
To delete a rotation:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Delete rotation** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete rotation**.
## View schedule rotations
You can view the on-call schedules of a single day or two weeks. To switch between these time
periods, select the **1 day** or **2 weeks** buttons on the schedule. Two weeks is the default view.
Hover over any rotation shift participants in the schedule to view their individual shift details.

## Page an on-call responder
See [Paging](paging.md#paging) for more details.
## Removal or deletion of on-call user
If an on-call user is removed from the project or group, or their account is deleted, the
confirmation modal displays the list of that user's on-call schedules. If the user's removal or
deletion is confirmed, GitLab recalculates the on-call rotation and sends an email to the project
owners and the rotation's participants.
|
https://docs.gitlab.com/feature_flags
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/feature_flags.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
feature_flags.md
| null | null | null | null | null |
<!-- markdownlint-disable -->
This document was moved to [another location](../administration/feature_flags/list.md).
<!-- This redirect file can be deleted after <2025-09-16>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
---
redirect_to: ../administration/feature_flags/list.md
remove_date: '2025-09-16'
breadcrumbs:
- doc
- user
---
<!-- markdownlint-disable -->
This document was moved to [another location](../administration/feature_flags/list.md).
<!-- This redirect file can be deleted after <2025-09-16>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
https://docs.gitlab.com/emoji_reactions
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/emoji_reactions.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
emoji_reactions.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Emoji reactions
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409884) from "award emoji" to "emoji reactions" in GitLab 16.0.
- Reacting with emoji on work items (such as tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393599) in GitLab 16.0.
- Reacting with emoji on design discussion comments [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29756) in GitLab 16.2.
{{< /history >}}
When you're collaborating online, you get fewer opportunities for high-fives
and thumbs-ups. React with emoji on:
- [Issues](project/issues/_index.md).
- [Tasks](tasks.md).
- [Merge requests](project/merge_requests/_index.md) and [snippets](snippets.md).
- [Epics](group/epics/_index.md).
- [Objectives and key results](okrs.md).
- Anywhere else you can have a comment thread.

Emoji reactions make it much easier to give and receive feedback without a long
comment thread.
"Thumbs up" and "thumbs down" emoji are used to calculate an issue or merge request's position when
[sorting by popularity](project/issues/sorting_issue_lists.md#sorting-by-popularity).
For information on the relevant API, see [Emoji reactions API](../api/emoji_reactions.md).
## Emoji reactions for comments
Emoji reactions can also be applied to individual comments when you want to
celebrate an accomplishment or agree with an opinion.
To add an emoji reaction:
1. In the upper-right corner of the comment, select the smile ({{< icon name="slight-smile" >}}).
1. Select an emoji from the emoji picker.
To remove an emoji reaction, select the emoji again.
## Custom emoji
{{< history >}}
- [Introduced for GraphQL API](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911) in GitLab 13.6 [with a flag](../administration/feature_flags/_index.md) named `custom_emoji`. Disabled by default.
- Enabled on GitLab.com in GitLab 14.0.
- UI to add emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/333095) in GitLab 16.2.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138969) in GitLab 16.7.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/) in GitLab 16.9. Feature flag `custom_emoji` removed.
{{< /history >}}
Custom emoji show in the emoji picker everywhere you can react with emoji.
To add an emoji reaction to a comment or description:
1. Select **Add reaction** ({{< icon name="slight-smile" >}}).
1. Select the GitLab logo ({{< icon name="tanuki" >}}) or scroll down to the **Custom** section.
1. Select an emoji from the emoji picker.

To use them in a text box, type the filename between two colons.
For example, `:thank-you:`.
### Upload custom emoji to a group
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128355) in GitLab 16.5.
{{< /history >}}
Upload your custom emoji to a group to use them in all its subgroups and projects.
Prerequisites:
- You must at least have the developer role for the group.
To upload custom emoji:
1. On a description or a comment, select **Add reaction** ({{< icon name="slight-smile" >}}).
1. At the bottom of the emoji picker, select **Create new emoji**.
1. Enter a name and URL for the custom emoji.
1. Select **Save**.
You can also upload custom emoji to a GitLab instance with the GraphQL API.
For more information, see [Use custom emoji with GraphQL](../api/graphql/custom_emoji.md).
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Emoji reactions
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409884) from "award emoji" to "emoji reactions" in GitLab 16.0.
- Reacting with emoji on work items (such as tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393599) in GitLab 16.0.
- Reacting with emoji on design discussion comments [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29756) in GitLab 16.2.
{{< /history >}}
When you're collaborating online, you get fewer opportunities for high-fives
and thumbs-ups. React with emoji on:
- [Issues](project/issues/_index.md).
- [Tasks](tasks.md).
- [Merge requests](project/merge_requests/_index.md) and [snippets](snippets.md).
- [Epics](group/epics/_index.md).
- [Objectives and key results](okrs.md).
- Anywhere else you can have a comment thread.

Emoji reactions make it much easier to give and receive feedback without a long
comment thread.
"Thumbs up" and "thumbs down" emoji are used to calculate an issue or merge request's position when
[sorting by popularity](project/issues/sorting_issue_lists.md#sorting-by-popularity).
For information on the relevant API, see [Emoji reactions API](../api/emoji_reactions.md).
## Emoji reactions for comments
Emoji reactions can also be applied to individual comments when you want to
celebrate an accomplishment or agree with an opinion.
To add an emoji reaction:
1. In the upper-right corner of the comment, select the smile ({{< icon name="slight-smile" >}}).
1. Select an emoji from the emoji picker.
To remove an emoji reaction, select the emoji again.
## Custom emoji
{{< history >}}
- [Introduced for GraphQL API](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911) in GitLab 13.6 [with a flag](../administration/feature_flags/_index.md) named `custom_emoji`. Disabled by default.
- Enabled on GitLab.com in GitLab 14.0.
- UI to add emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/333095) in GitLab 16.2.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138969) in GitLab 16.7.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/) in GitLab 16.9. Feature flag `custom_emoji` removed.
{{< /history >}}
Custom emoji show in the emoji picker everywhere you can react with emoji.
To add an emoji reaction to a comment or description:
1. Select **Add reaction** ({{< icon name="slight-smile" >}}).
1. Select the GitLab logo ({{< icon name="tanuki" >}}) or scroll down to the **Custom** section.
1. Select an emoji from the emoji picker.

To use them in a text box, type the filename between two colons.
For example, `:thank-you:`.
### Upload custom emoji to a group
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128355) in GitLab 16.5.
{{< /history >}}
Upload your custom emoji to a group to use them in all its subgroups and projects.
Prerequisites:
- You must at least have the developer role for the group.
To upload custom emoji:
1. On a description or a comment, select **Add reaction** ({{< icon name="slight-smile" >}}).
1. At the bottom of the emoji picker, select **Create new emoji**.
1. Enter a name and URL for the custom emoji.
1. Select **Save**.
You can also upload custom emoji to a GitLab instance with the GraphQL API.
For more information, see [Use custom emoji with GraphQL](../api/graphql/custom_emoji.md).
|
https://docs.gitlab.com/permissions
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/permissions.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
permissions.md
|
Software Supply Chain Security
|
Authorization
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Roles and permissions
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you add a user to a project or group, you assign them a role.
The role determines which actions they can take in GitLab.
If you add a user to both a project's group and the
project itself, the higher role is used.
GitLab [administrators](../administration/_index.md) have all permissions.
<!-- Keep these tables sorted according the following rules in order:
1. By minimum role.
2. By the object being accessed (for example, issue, security dashboard, or pipeline)
3. By the action: view, create, change, edit, manage, run, delete, all others
4. Alphabetically.
List only one action (for example, view, create, or delete) per line.
It's okay to list multiple related objects per line (for example, "View pipelines and pipeline details").
-->
## Roles
{{< history >}}
- Planner role [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/482733) in GitLab 17.7.
{{< /history >}}
You can assign users a default role or a [custom role](custom_roles/_index.md).
The available default roles are:
- Guest (This role applies to [private and internal projects](public_access.md) only.)
- Planner
- Reporter
- Developer
- Maintainer
- Owner
- Minimal Access (available for the top-level group only)
A user assigned the Guest role has the least permissions,
and the Owner has the most.
By default, all users can create top-level groups and change their
usernames. A GitLab administrator can [change this behavior](../administration/user_settings.md)
for the GitLab instance.
## Group members permissions
Any user can remove themselves from a group, unless they are the only Owner of
the group.
The following table lists group permissions available for each role:
### Analytics group permissions
Group permission for [analytics](analytics/_index.md) features including value streams, product analytics, and insights:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [insights](project/insights/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [insights](project/insights/_index.md) charts | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [issue analytics](group/issues_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View contribution analytics | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View value stream analytics | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [productivity analytics](analytics/productivity_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [group DevOps adoption](group/devops_adoption/_index.md) | | | ✓ | ✓ | ✓ | ✓ |
| View metrics dashboard annotations | | | ✓ | ✓ | ✓ | ✓ |
| Manage metrics dashboard annotations | | | | ✓ | ✓ | ✓ |
### Application security group permissions
Group permissions for [Application Security](application_security/secure_your_application.md) features including dependency management, security analyzers, security policies, and vulnerability management.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [vulnerability report](application_security/vulnerability_report/_index.md) | | | | ✓ | ✓ | ✓ |
| View [security dashboard](application_security/security_dashboard/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Assign [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
### CI/CD group permissions
Group permissions for [CI/CD](../ci/_index.md) features including runners, variables, and protected environments:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View group runners | | | | | ✓ | ✓ |
| Manage group-level Kubernetes cluster | | | | | ✓ | ✓ |
| Manage group runners | | | | | | ✓ |
| Manage group level CI/CD variables | | | | | | ✓ |
| Manage group protected environments | | | | | | ✓ |
### Compliance group permissions
Group permissions for [compliance](compliance/_index.md) features including compliance center, audit events, compliance frameworks, and licenses.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [audit events](compliance/audit_events.md) <sup>1</sup> | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [compliance center](compliance/compliance_center/_index.md) | | | | | | ✓ |
| Manage [compliance frameworks](compliance/compliance_frameworks/_index.md) | | | | | | ✓ |
| Assign [compliance frameworks](compliance/compliance_frameworks/_index.md) to projects | | | | | | ✓ |
| Manage [audit streams](compliance/audit_event_streaming.md) | | | | | | ✓ |
**Footnotes**
1. Users can view only events based on their individual actions. For more details, see the [prerequisites](compliance/audit_events.md#prerequisites).
### GitLab Duo group permissions
Group permissions for [GitLab Duo](gitlab_duo/_index.md):
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------------------------------------------------------------------------- | :--------: | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Use GitLab Duo features <sup>1</sup> | | | | ✓ | ✓ | ✓ | ✓ |
| Configure [GitLab Duo feature availability](gitlab_duo/turn_on_off.md#for-a-group-or-subgroup) | | | | | | ✓ | ✓ |
| Configure [GitLab Duo Self Hosted](../administration/gitlab_duo_self_hosted/configure_duo_features.md) | | | | | | | ✓ |
| Enable [beta and experimental features](gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) | | | | | | | ✓ |
| Purchase [GitLab Duo seats](../subscriptions/subscription-add-ons.md#purchase-additional-gitlab-duo-seats) | | | | | | | ✓ |
**Footnotes**
1. If the user has GitLab Duo Pro or Enterprise, the
[user must be assigned a seat to gain access to that GitLab Duo add-on](../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
If the user has GitLab Duo Core, there are no other requirements.
### Groups group permissions
Group permissions for [group features](group/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Browse group | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) projects in group | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View group [audit events](compliance/audit_events.md) <sup>1</sup> | | | | ✓ | ✓ | ✓ |
| Create project in group <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| Create subgroup <sup>3</sup> | | | | | ✓ | ✓ |
| Change custom settings for [project integrations](project/integrations/_index.md) | | | | | | ✓ |
| Edit [epic](group/epics/_index.md) comments (posted by any user) | | ✓ | | | ✓ | ✓ |
| Fork project into a group | | | | | ✓ | ✓ |
| View [Billing](../subscriptions/manage_subscription.md#view-subscription) <sup>4</sup> | | | | | | ✓ |
| View group [Usage quotas](storage_usage_quotas.md) page <sup>4</sup> | | | | | | ✓ |
| [Migrate group](group/import/_index.md) | | | | | | ✓ |
| Delete group | | | | | | ✓ |
| Manage [subscriptions, storage, and compute minutes](../subscriptions/gitlab_com/_index.md) | | | | | | ✓ |
| Manage [group access tokens](group/settings/group_access_tokens.md) | | | | | | ✓ |
| Change group visibility level | | | | | | ✓ |
| Edit group settings | | | | | | ✓ |
| Configure project templates | | | | | | ✓ |
| Configure [SAML SSO](group/saml_sso/_index.md) <sup>4</sup> | | | | | | ✓ |
| Disable notification emails | | | | | | ✓ |
| Import [project](project/settings/import_export.md) | | | | | ✓ | ✓ |
**Footnotes**
1. Developers and Maintainers can only view events based on their individual actions. For more
information, see the [prerequisites](compliance/audit_events.md#prerequisites).
1. Developers, Maintainers and Owners: Only if the project creation role is set
[for the instance](../administration/settings/visibility_and_access_controls.md#define-which-roles-can-create-projects)
or [for the group](group/_index.md#specify-who-can-add-projects-to-a-group).
<br>Developers: Developers can push commits to the default branch of a new project only
if the [default branch protection](group/manage.md#change-the-default-branch-protection-of-a-group)
is set to "Partially protected" or "Not protected".
1. Maintainers: Only if users with the Maintainer role [can create subgroups](group/subgroups/_index.md#change-who-can-create-subgroups).
1. Does not apply to subgroups.
### Project planning group permissions
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View epic | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) epics <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add issues to an [epic](group/epics/_index.md) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add [child epics](group/epics/manage_epics.md#multi-level-child-epics) <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal notes | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create epics | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Update epic details | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [epic boards](group/epics/epic_boards.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete epics | | ✓ | | | | ✓ |
**Footnotes**
1. You must have permission to [view the epic](group/epics/manage_epics.md#who-can-view-an-epic).
1. You must have permission to [view the epic](group/epics/manage_epics.md#who-can-view-an-epic) and edit the issue.
1. You must have permission to [view](group/epics/manage_epics.md#who-can-view-an-epic) the parent and child epics.
Group permissions for [wikis](project/wiki/group.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View group wiki <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) group wikis <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Edit group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Delete group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
**Footnotes**
1. Guests: In addition, if your group is public or internal, all users who can see the group can also see group wiki pages.
1. Guests: In addition, if your group is public or internal, all users who can see the group can also search group wiki pages.
### Packages and registries group permissions
Group permissions for [container registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull container registry images <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull container images with the dependency proxy | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete container registry images | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Guests can only view events based on their individual actions.
Group permissions for [package registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull packages | | | ✓ | ✓ | ✓ | ✓ |
| Publish packages | | | | ✓ | ✓ | ✓ |
| Delete packages | | | | | ✓ | ✓ |
| Manage package settings | | | | | | ✓ |
| Manage dependency proxy cleanup policies | | | | | | ✓ |
| Enable dependency proxy | | | | | | ✓ |
| Disable dependency proxy | | | | | | ✓ |
| Purge the group dependency proxy | | | | | | ✓ |
| Enable package request forwarding | | | | | | ✓ |
| Disable package request forwarding | | | | | | ✓ |
### Repository group permissions
Group permissions for [repository](project/repository/_index.md) features including merge requests, push rules, and deploy tokens.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Manage [deploy tokens](project/deploy_tokens/_index.md) | | | | | | ✓ |
| Manage [merge request settings](group/manage.md#group-merge-request-approval-settings) | | | | | | ✓ |
| Manage [push rules](group/access_and_permissions.md#group-push-rules) | | | | | | ✓ |
### User management group permissions
Group permissions for user management:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View 2FA status of members | | | | | | ✓ |
| Filter members by 2FA status | | | | | | ✓ |
| Manage group members | | | | | | ✓ |
| Manage group-level custom roles | | | | | | ✓ |
| Share (invite) groups to groups | | | | | | ✓ |
### Workspace group permissions
Groups permissions for workspaces:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View workspace cluster agents mapped to a group | | | | | ✓ | ✓ |
| Map or unmap workspace cluster agents to and from a group | | | | | | ✓ |
## Project members permissions
A user's role determines what permissions they have on a project. The Owner role provides all permissions but is
available only:
- For group and project Owners.
- For Administrators.
Personal [namespace](namespace/_index.md) owners:
- Are displayed as having the Maintainer role on projects in the namespace, but have the same permissions as a user with the Owner role.
- For new projects in the namespace, are displayed as having the Owner role.
For more information about how to manage project members, see
[members of a project](project/members/_index.md).
The following tables list the project permissions available for each role.
### Analytics
Project permissions for [analytics](analytics/_index.md) features including value streams, usage trends, product analytics, and insights.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [issue analytics](group/issues_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [value stream analytics](group/value_stream_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [CI/CD analytics](analytics/ci_cd_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [code review analytics](analytics/code_review_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [DORA metrics](analytics/ci_cd_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [merge request analytics](analytics/merge_request_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [repository analytics](analytics/repository_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [Value Streams Dashboard & AI impact analytics](analytics/value_streams_dashboard.md) | | | ✓ | ✓ | ✓ | ✓ |
### Application security
Project permissions for [application security](application_security/secure_your_application.md) features including dependency management, security analyzers, security policies, and vulnerability management.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [security dashboard](application_security/security_dashboard/_index.md) | | | | ✓ | ✓ | ✓ |
| View [vulnerability report](application_security/vulnerability_report/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [vulnerability manually](application_security/vulnerability_report/_index.md#manually-add-a-vulnerability) | | | | | ✓ | ✓ |
| Create [issue](application_security/vulnerabilities/_index.md#create-a-gitlab-issue-for-a-vulnerability) from vulnerability finding | | | | ✓ | ✓ | ✓ |
| Create [on-demand DAST scans](application_security/dast/on-demand_scan.md) | | | | ✓ | ✓ | ✓ |
| Run [on-demand DAST scans](application_security/dast/on-demand_scan.md) | | | | ✓ | ✓ | ✓ |
| Create [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Change [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Delete [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [CVE ID request](application_security/cve_id_request.md) | | | | | ✓ | ✓ |
| Change vulnerability status <sup>1</sup> | | | | | ✓ | ✓ |
| Create [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Assign [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Manage [security configurations](application_security/detect/security_configuration.md) | | | | | | ✓ |
**Footnotes**
1. The `admin_vulnerability` permission was [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/412693) from the Developer role in GitLab 17.0.
### CI/CD
[GitLab CI/CD](../ci/_index.md) permissions for some roles can be modified by these settings:
- [Project-based pipeline visibility](../ci/pipelines/settings.md#change-which-users-can-view-your-pipelines):
When set to public, gives access to certain CI/CD features to Guest project members.
- [Pipeline visibility](../ci/pipelines/settings.md#change-pipeline-visibility-for-non-project-members-in-public-projects):
When set to **Everyone with Access**, gives access to certain CI/CD "view" features to non-project members.
Project Owners can perform any listed action, and can delete pipelines:
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer |
| ----------------------------------------------------------------------------------------------------------- | :--------: | :---: | :-----: | :------: | :-------: | :--------: |
| View existing artifacts <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View list of jobs <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View artifacts <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Download artifacts <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [environments](../ci/environments/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View job logs and job details page <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View pipelines and pipeline details pages <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View pipelines tab in MR <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [vulnerabilities in a pipeline](application_security/detect/security_scanning_results.md) <sup>4</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Run deployment job for a protected environment <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| View [agents for Kubernetes](clusters/agent/_index.md) | | | | | ✓ | ✓ |
| View project [Secure Files](../api/secure_files.md) | | | | | ✓ | ✓ |
| Download project [Secure Files](../api/secure_files.md) | | | | | ✓ | ✓ |
| View a job with [debug logging](../ci/variables/variables_troubleshooting.md#enable-debug-logging) | | | | | ✓ | ✓ |
| Create [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Delete [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Stop [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Run, rerun, or retry CI/CD pipeline or job | | | | | ✓ | ✓ |
| Run, rerun, or retry CI/CD pipeline or job for a protected branch <sup>6</sup> | | | | | ✓ | ✓ |
| Delete job logs or job artifacts <sup>7</sup> | | | | | ✓ | ✓ |
| Enable [review apps](../ci/review_apps/_index.md) | | | | | ✓ | ✓ |
| Cancel jobs <sup>8</sup> | | | | | ✓ | ✓ |
| Read [Terraform](infrastructure/_index.md) state | | | | | ✓ | ✓ |
| Run [interactive web terminals](../ci/interactive_web_terminal/_index.md) | | | | | ✓ | ✓ |
| Use pipeline editor | | | | | ✓ | ✓ |
| Manage [agents for Kubernetes](clusters/agent/_index.md) | | | | | | ✓ |
| Manage CI/CD settings | | | | | | ✓ |
| Manage job triggers | | | | | | ✓ |
| Manage project CI/CD variables | | | | | | ✓ |
| Manage project protected environments | | | | | | ✓ |
| Manage project [Secure Files](../api/secure_files.md) | | | | | | ✓ |
| Manage [Terraform](infrastructure/_index.md) state | | | | | | ✓ |
| Add project runners to project | | | | | | ✓ |
| Clear runner caches manually | | | | | | ✓ |
| Enable instance runners in project | | | | | | ✓ |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. Non-members and guests: Only if the project is public.
2. Non-members: Only if the project is public and **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
<br>Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
3. Non-members: Only if the project is public, **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**,
and [`artifacts:public: false`](../ci/yaml/_index.md#artifactspublic) is not set on the job.
<br>Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD** and
`artifacts:public: false` is not set on the job.<br>Reporters: Only if `artifacts:public: false`
is not set on the job.
4. Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
5. Reporters: Only if the user is [part of a group with access to the protected environment](../ci/environments/protected_environments.md#deployment-only-access-to-protected-environments).
<br>Developers and maintainers: Only if the user is [allowed to deploy to the protected branch](../ci/environments/protected_environments.md#protecting-environments).
6. Developers and maintainers: Only if the user is [allowed to merge or push to the protected branch](../ci/pipelines/_index.md#pipeline-security-on-protected-branches).
7. Developers: Only if the job was triggered by the user and runs for a non-protected branch.
8. Cancellation permissions can be [restricted in the pipeline settings](../ci/pipelines/settings.md#restrict-roles-that-can-cancel-pipelines-or-jobs).
<!-- markdownlint-enable MD029 -->
This table shows granted privileges for jobs triggered by specific roles.
Project Owners can do any listed action, but no users can push source and LFS together.
Guest users and members with the Reporter role cannot do any of these actions.
| Action | Developer | Maintainer |
| --------------------------------------------------------- | :-------: | :--------: |
| Clone source and LFS from current project | ✓ | ✓ |
| Clone source and LFS from public projects | ✓ | ✓ |
| Clone source and LFS from internal projects <sup>1</sup> | ✓ | ✓ |
| Clone source and LFS from private projects <sup>2</sup> | ✓ | ✓ |
| Pull container images from current project | ✓ | ✓ |
| Pull container images from public projects | ✓ | ✓ |
| Pull container images from internal projects <sup>1</sup> | ✓ | ✓ |
| Pull container images from private projects <sup>2</sup> | ✓ | ✓ |
| Push container images to current project <sup>3</sup> | ✓ | ✓ |
**Footnotes**
1. Developers and Maintainers: Only if the triggering user is not an external user.
1. Only if the triggering user is a member of the project. See also [Usage of private Docker images with `if-not-present` pull policy](https://docs.gitlab.com/runner/security/#usage-of-private-docker-images-with-if-not-present-pull-policy).
1. You cannot push container images to other projects.
### Compliance
Project permissions for [compliance](compliance/_index.md) features including compliance center, audit events, compliance frameworks, and licenses.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [allowed and denied licenses in MR](compliance/license_scanning_of_cyclonedx_files/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [audit events](compliance/audit_events.md) <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| Manage [audit streams](compliance/audit_event_streaming.md) | | | | | | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must have at least the Reporter role, even if the project is internal. Users with the Guest
role on GitLab.com are able to perform this action only on public projects because internal
visibility is not available.
1. Users can only view events based on their individual actions. For more details, see the [prerequisites](compliance/audit_events.md#prerequisites).
### GitLab Duo
Project permissions for [GitLab Duo](gitlab_duo/_index.md):
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------ | :--------: | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Use GitLab Duo features <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Configure [GitLab Duo feature availability](gitlab_duo/turn_on_off.md#for-a-project) | | | | | | ✓ | ✓ |
**Footnotes**
1. Code Suggestions requires a [user being assigned a seat to gain access to a GitLab Duo add-on](../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
### Machine learning model registry and experiment
Project permissions for [model registry](project/ml/model_registry/_index.md) and [model experiments](project/ml/experiment_tracking/_index.md).
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [models and versions](project/ml/model_registry/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [model experiments](project/ml/experiment_tracking/_index.md) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create models, versions, and artifacts <sup>3</sup> | | | | ✓ | ✓ | ✓ |
| Edit models, versions, and artifacts | | | | ✓ | ✓ | ✓ |
| Delete models, versions, and artifacts | | | | ✓ | ✓ | ✓ |
| Create experiments and candidates | | | | ✓ | ✓ | ✓ |
| Edit experiments and candidates | | | | ✓ | ✓ | ✓ |
| Delete experiments and candidates | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Non-members can only view models and versions in public projects with the **Everyone with access**
visibility level. Non-members can't view internal projects, even if they're logged in.
1. Non-members can only view model experiments in public projects with the **Everyone with access**
visibility level. Non-members can't view internal projects, even if they're logged in.
1. You can also upload and download artifacts with the package registry API, which uses
a different set of permissions.
### Monitoring
Project permissions for monitoring including [error tracking](../operations/error_tracking.md) and [incident management](../operations/incident_management/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View an [incident](../operations/incident_management/incidents.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Assign an [incident management](../operations/incident_management/_index.md) alert | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Participate in on-call rotation for [Incident Management](../operations/incident_management/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [alerts](../operations/incident_management/alerts.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [error tracking](../operations/error_tracking.md) list | | | ✓ | ✓ | ✓ | ✓ |
| View [escalation policies](../operations/incident_management/escalation_policies.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [on-call schedules](../operations/incident_management/oncall_schedules.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [incident](../operations/incident_management/incidents.md) | | | ✓ | ✓ | ✓ | ✓ |
| Change [alert status](../operations/incident_management/alerts.md#change-an-alerts-status) | | | ✓ | ✓ | ✓ | ✓ |
| Change [incident severity](../operations/incident_management/manage_incidents.md#change-severity) | | | ✓ | ✓ | ✓ | ✓ |
| Change [incident escalation status](../operations/incident_management/manage_incidents.md#change-status) | | | | ✓ | ✓ | ✓ |
| Change [incident escalation policy](../operations/incident_management/manage_incidents.md#change-escalation-policy) | | | | ✓ | ✓ | ✓ |
| Manage [error tracking](../operations/error_tracking.md) | | | | | ✓ | ✓ |
| Manage [escalation policies](../operations/incident_management/escalation_policies.md) | | | | | ✓ | ✓ |
| Manage [on-call schedules](../operations/incident_management/oncall_schedules.md) | | | | | ✓ | ✓ |
### Project planning
Project permissions for [issues](project/issues/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View issues | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) issues and comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create issues | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [confidential issues](project/issues/confidential_issues.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) confidential issues and comments | | | ✓ | ✓ | ✓ | ✓ |
| Edit issues, including metadata, item locking, and resolving threads <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal notes | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Close and reopen issues <sup>2</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [design management](project/issues/design_management.md) files | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [issue boards](project/issue_board.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [milestones](project/milestones/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) milestones | | | ✓ | ✓ | ✓ | ✓ |
| Archive or reopen [requirements](project/requirements/_index.md) <sup>3</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create or edit [requirements](project/requirements/_index.md) <sup>4</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Import or export [requirements](project/requirements/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Archive [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Move [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Reopen [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Import](project/issues/csv_import.md) issues from a CSV file | | ✓ | | ✓ | ✓ | ✓ |
| [Export](project/issues/csv_export.md) issues to a CSV file | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete issues | | ✓ | | | | ✓ |
| Manage [Feature flags](../operations/feature_flags.md) | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Metadata includes labels, assignees, milestones, epics, weight, confidentiality, time tracking,
and more. Guest users can only set metadata when creating an issue. They cannot change the
metadata on existing issues. Guest users can modify the title and description of issues that
they authored or are assigned to.
1. Guest users can close and reopen issues that they authored or are assigned to.
1. Guest users can archive and reopen issues that they authored or are assigned to.
1. Guest users can modify the title and description that they authored or are assigned to.
Project permissions for [tasks](tasks.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit tasks, including metadata, item locking, and resolving threads <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a linked item | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Convert to another item type | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Remove from issue | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete tasks <sup>2</sup> | | ✓ | | | | ✓ |
**Footnotes**
1. Guest users can modify the title and description that they authored or are assigned to.
1. Users who don't have the Planner or Owner role can delete the tasks they authored.
Project permissions for [OKRs](okrs.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit OKRs, including metadata, item locking, and resolving threads | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a child OKR | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a linked item | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Convert to another item type | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit OKRs | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Change confidentiality in OKR | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
Project permissions for [wikis](project/wiki/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) wikis | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Edit wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Delete wiki pages | | ✓ | | ✓ | ✓ | ✓ |
### Packages and registry
Project permissions for [container registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull container registry images <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Push container registry images | | | | ✓ | ✓ | ✓ |
| Delete container registry images | | | | ✓ | ✓ | ✓ |
| Manage cleanup policies | | | | | ✓ | ✓ |
| Create [tag protection](packages/container_registry/protected_container_tags.md) rules | | | | | ✓ | ✓ |
| Create [immutable tag protection](packages/container_registry/immutable_container_tags.md) rules | | | | | | ✓ |
**Footnotes**:
1. Viewing the container registry and pulling images is controlled by [container registry visibility permissions](packages/container_registry/_index.md#container-registry-visibility-permissions).
Project permissions for [package registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull packages <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Publish packages | | | | ✓ | ✓ | ✓ |
| Delete packages | | | | | ✓ | ✓ |
| Delete files associated with a package | | | | | ✓ | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects
because internal visibility is not available.
### Projects
Project permissions for [project features](project/organize_work_with_projects.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Download project <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Reposition comments on images (posted by any user) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [insights](project/insights/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [requirements](project/requirements/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [time tracking](project/time_tracking.md) reports <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [snippets](snippets.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) [snippets](snippets.md) and comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [project traffic statistics](../api/project_statistics.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [snippets](snippets.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [releases](project/releases/_index.md) <sup>3</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [releases](project/releases/_index.md) <sup>4</sup> | | | | | ✓ | ✓ |
| Configure [webhooks](project/integrations/webhooks.md) | | | | | ✓ | ✓ |
| Manage [project access tokens](project/settings/project_access_tokens.md) <sup>5</sup> | | | | | ✓ | ✓ |
| [Export project](project/settings/import_export.md) | | | | | ✓ | ✓ |
| Rename project | | | | | ✓ | ✓ |
| Edit project badges | | | | | ✓ | ✓ |
| Edit project settings | | | | | ✓ | ✓ |
| Change [project features visibility](public_access.md) level <sup>6</sup> | | | | | ✓ | ✓ |
| Change custom settings for [project integrations](project/integrations/_index.md) | | | | | ✓ | ✓ |
| Edit comments posted by other users | | | | | ✓ | ✓ |
| Add [deploy keys](project/deploy_keys/_index.md) | | | | | ✓ | ✓ |
| Manage [project operations](../operations/_index.md) | | | | | ✓ | ✓ |
| View [Usage quotas](storage_usage_quotas.md) page | | | | | ✓ | ✓ |
| Globally delete [snippets](snippets.md) | | | | | ✓ | ✓ |
| Globally edit [snippets](snippets.md) | | | | | ✓ | ✓ |
| Archive project | | | | | | ✓ |
| Change project visibility level | | | | | | ✓ |
| Delete project | | | | | | ✓ |
| Disable notification emails | | | | | | ✓ |
| Transfer project | | | | | | ✓ |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on
public and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects
because internal visibility is not available.
2. Applies only to comments on [Design Management](project/issues/design_management.md) designs.
3. Guest users can access GitLab [**Releases**](project/releases/_index.md) for downloading
assets but are not allowed to download the source code nor see
[repository information like commits and release evidence](project/releases/_index.md#view-a-release-and-download-assets).
4. If the [tag is protected](project/protected_tags.md), this depends on the access given to
Developers and Maintainers.
5. For GitLab Self-Managed, project access tokens are available in all tiers. For GitLab.com,
project access tokens are supported in the Premium and Ultimate tier (excluding [trial licenses](https://about.gitlab.com/free-trial/)).
6. A Maintainer or Owner can't change project features visibility level if
[project visibility](public_access.md) is set to private.
<!-- markdownlint-enable MD029 -->
Project permissions for [GitLab Pages](project/pages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View GitLab Pages protected by [access control](project/pages/pages_access_control.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage GitLab Pages | | | | | ✓ | ✓ |
| Manage GitLab Pages domain and certificates | | | | | ✓ | ✓ |
| Remove GitLab Pages | | | | | ✓ | ✓ |
### Repository
Project permissions for [repository](project/repository/_index.md) features including source code, branches, push rules, and more:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View project code <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) project code <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) commits and comments <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull project code <sup>4</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View commit status | | | ✓ | ✓ | ✓ | ✓ |
| Create commit status <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| Update commit status <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| Create [Git tags](project/repository/tags/_index.md) | | | | ✓ | ✓ | ✓ |
| Delete [Git tags](project/repository/tags/_index.md) | | | | ✓ | ✓ | ✓ |
| Create new [branches](project/repository/branches/_index.md) | | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | | ✓ | ✓ | ✓ |
| Force push to non-protected branches | | | | ✓ | ✓ | ✓ |
| Delete non-protected branches | | | | ✓ | ✓ | ✓ |
| Manage [protected branches](project/repository/branches/protected.md) | | | | | ✓ | ✓ |
| Push to protected branches <sup>5</sup> | | | | | ✓ | ✓ |
| Delete protected branches | | | | | ✓ | ✓ |
| Manage [protected tags](project/protected_tags.md) | | | | | ✓ | ✓ |
| Manage [push rules](project/repository/push_rules.md) | | | | | ✓ | ✓ |
| Remove fork relationship | | | | | | ✓ |
| Force push to protected branches <sup>6</sup> | | | | | | |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can view private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
2. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can search private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
3. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available.
4. If the [branch is protected](project/repository/branches/protected.md), this depends on the
access given to Developers and Maintainers.
5. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can view private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
6. Not allowed for Guest, Reporter, Developer, Maintainer, or Owner. See [protected branches](project/repository/branches/protected.md#allow-force-push).
<!-- markdownlint-enable MD029 -->
### Merge requests
Project permissions for [merge requests](project/merge_requests/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| [View](project/merge_requests/_index.md#view-merge-requests) a merge request <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) merge requests and comments <sup>1</sup> | ✓ | | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Comment and add suggestions | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create [snippets](snippets.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [merge request](project/merge_requests/creating_merge_requests.md) <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| Update merge request details <sup>3</sup> | | | | ✓ | ✓ | ✓ |
| Manage [merge request settings](project/merge_requests/approvals/settings.md) | | | | | ✓ | ✓ |
| Manage [merge request approval rules](project/merge_requests/approvals/rules.md) | | | | | ✓ | ✓ |
| Delete merge request | | | | | | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available.
1. In projects that accept contributions from external members, users can create, edit, and close their
own merge requests. For **private** projects, this excludes the Guest role as those users
[cannot clone private projects](public_access.md#private-projects-and-groups). For **internal**
projects, includes users with read-only access to the project, as
[they can clone internal projects](public_access.md#internal-projects-and-groups).
1. For information on eligible approvers for merge requests, see [eligible approvers](project/merge_requests/approvals/rules.md#eligible-approvers).
### User management
Project permissions for [user management](project/members/_index.md).
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View 2FA status of members | | | | | ✓ | ✓ |
| Manage [project members](project/members/_index.md) <sup>1</sup> | | | | | ✓ | ✓ |
| Share (invite) projects with groups <sup>2</sup> | | | | | ✓ | ✓ |
**Footnotes**
1. Maintainers cannot create, demote, or remove Owners, and they cannot promote users to the Owner role.
They also cannot approve Owner role access requests.
1. When [Share Group Lock](project/members/sharing_projects_groups.md#prevent-a-project-from-being-shared-with-groups)
is enabled the project can't be shared with other groups. It does not affect group with group sharing.
## Subgroup permissions
When you add a member to a subgroup, they inherit the membership and
permission level from the parent groups. This model allows access to
nested groups if you have membership in one of its parents.
For more information, see
[subgroup memberships](group/subgroups/_index.md#subgroup-membership).
## Users with Minimal Access
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Support for inviting users with Minimal Access role [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106438) in GitLab 15.9.
{{< /history >}}
Users with the Minimal Access role do not:
- Automatically have access to projects and subgroups in that top-level group.
- Count as licensed seats on GitLab Self-Managed Ultimate subscriptions or any GitLab.com subscriptions, provided the user has no other role anywhere in the instance or in the GitLab.com namespace.
Owners must explicitly add these users to the specific subgroups and
projects.
You can use the Minimal Access role with [SAML SSO for GitLab.com groups](group/saml_sso/_index.md)
to control access to groups and projects in the group hierarchy. You can set the default role to
Minimal Access for members automatically added to the top-level group through SSO.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > SAML SSO**.
1. From the **Default membership role** dropdown list, select **Minimal Access**.
1. Select **Save changes**.
### Minimal access users receive 404 errors
Because of an [outstanding issue](https://gitlab.com/gitlab-org/gitlab/-/issues/267996), when a user with the Minimal Access role:
- Signs in with standard web authentication, they receive a `404` error when accessing the parent group.
- Signs in with Group SSO, they receive a `404` error immediately because they are redirected to the parent group page.
To work around the issue, give these users the Guest role or higher to any project or subgroup in the parent group. Guest users consume a license seat in the Premium tier but do not in the Ultimate tier.
## Related topics
- [Custom roles](custom_roles/_index.md)
- [Members](project/members/_index.md)
- Customize permissions on [protected branches](project/repository/branches/protected.md)
- [LDAP user permissions](group/access_and_permissions.md#manage-group-memberships-with-ldap)
- [Value stream analytics permissions](group/value_stream_analytics/_index.md#access-permissions)
- [Project aliases](project/working_with_projects.md#project-aliases)
- [Auditor users](../administration/auditor_users.md)
- [Confidential issues](project/issues/confidential_issues.md)
- [Container registry permissions](packages/container_registry/_index.md#container-registry-visibility-permissions)
- [Release permissions](project/releases/_index.md#release-permissions)
- [Read-only namespaces](read_only_namespaces.md)
|
---
stage: Software Supply Chain Security
group: Authorization
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Roles and permissions
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
When you add a user to a project or group, you assign them a role.
The role determines which actions they can take in GitLab.
If you add a user to both a project's group and the
project itself, the higher role is used.
GitLab [administrators](../administration/_index.md) have all permissions.
<!-- Keep these tables sorted according the following rules in order:
1. By minimum role.
2. By the object being accessed (for example, issue, security dashboard, or pipeline)
3. By the action: view, create, change, edit, manage, run, delete, all others
4. Alphabetically.
List only one action (for example, view, create, or delete) per line.
It's okay to list multiple related objects per line (for example, "View pipelines and pipeline details").
-->
## Roles
{{< history >}}
- Planner role [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/482733) in GitLab 17.7.
{{< /history >}}
You can assign users a default role or a [custom role](custom_roles/_index.md).
The available default roles are:
- Guest (This role applies to [private and internal projects](public_access.md) only.)
- Planner
- Reporter
- Developer
- Maintainer
- Owner
- Minimal Access (available for the top-level group only)
A user assigned the Guest role has the least permissions,
and the Owner has the most.
By default, all users can create top-level groups and change their
usernames. A GitLab administrator can [change this behavior](../administration/user_settings.md)
for the GitLab instance.
## Group members permissions
Any user can remove themselves from a group, unless they are the only Owner of
the group.
The following table lists group permissions available for each role:
### Analytics group permissions
Group permission for [analytics](analytics/_index.md) features including value streams, product analytics, and insights:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [insights](project/insights/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [insights](project/insights/_index.md) charts | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [issue analytics](group/issues_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View contribution analytics | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View value stream analytics | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [productivity analytics](analytics/productivity_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [group DevOps adoption](group/devops_adoption/_index.md) | | | ✓ | ✓ | ✓ | ✓ |
| View metrics dashboard annotations | | | ✓ | ✓ | ✓ | ✓ |
| Manage metrics dashboard annotations | | | | ✓ | ✓ | ✓ |
### Application security group permissions
Group permissions for [Application Security](application_security/secure_your_application.md) features including dependency management, security analyzers, security policies, and vulnerability management.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [vulnerability report](application_security/vulnerability_report/_index.md) | | | | ✓ | ✓ | ✓ |
| View [security dashboard](application_security/security_dashboard/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Assign [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
### CI/CD group permissions
Group permissions for [CI/CD](../ci/_index.md) features including runners, variables, and protected environments:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View group runners | | | | | ✓ | ✓ |
| Manage group-level Kubernetes cluster | | | | | ✓ | ✓ |
| Manage group runners | | | | | | ✓ |
| Manage group level CI/CD variables | | | | | | ✓ |
| Manage group protected environments | | | | | | ✓ |
### Compliance group permissions
Group permissions for [compliance](compliance/_index.md) features including compliance center, audit events, compliance frameworks, and licenses.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [audit events](compliance/audit_events.md) <sup>1</sup> | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [compliance center](compliance/compliance_center/_index.md) | | | | | | ✓ |
| Manage [compliance frameworks](compliance/compliance_frameworks/_index.md) | | | | | | ✓ |
| Assign [compliance frameworks](compliance/compliance_frameworks/_index.md) to projects | | | | | | ✓ |
| Manage [audit streams](compliance/audit_event_streaming.md) | | | | | | ✓ |
**Footnotes**
1. Users can view only events based on their individual actions. For more details, see the [prerequisites](compliance/audit_events.md#prerequisites).
### GitLab Duo group permissions
Group permissions for [GitLab Duo](gitlab_duo/_index.md):
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------------------------------------------------------------------------- | :--------: | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Use GitLab Duo features <sup>1</sup> | | | | ✓ | ✓ | ✓ | ✓ |
| Configure [GitLab Duo feature availability](gitlab_duo/turn_on_off.md#for-a-group-or-subgroup) | | | | | | ✓ | ✓ |
| Configure [GitLab Duo Self Hosted](../administration/gitlab_duo_self_hosted/configure_duo_features.md) | | | | | | | ✓ |
| Enable [beta and experimental features](gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) | | | | | | | ✓ |
| Purchase [GitLab Duo seats](../subscriptions/subscription-add-ons.md#purchase-additional-gitlab-duo-seats) | | | | | | | ✓ |
**Footnotes**
1. If the user has GitLab Duo Pro or Enterprise, the
[user must be assigned a seat to gain access to that GitLab Duo add-on](../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
If the user has GitLab Duo Core, there are no other requirements.
### Groups group permissions
Group permissions for [group features](group/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Browse group | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) projects in group | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View group [audit events](compliance/audit_events.md) <sup>1</sup> | | | | ✓ | ✓ | ✓ |
| Create project in group <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| Create subgroup <sup>3</sup> | | | | | ✓ | ✓ |
| Change custom settings for [project integrations](project/integrations/_index.md) | | | | | | ✓ |
| Edit [epic](group/epics/_index.md) comments (posted by any user) | | ✓ | | | ✓ | ✓ |
| Fork project into a group | | | | | ✓ | ✓ |
| View [Billing](../subscriptions/manage_subscription.md#view-subscription) <sup>4</sup> | | | | | | ✓ |
| View group [Usage quotas](storage_usage_quotas.md) page <sup>4</sup> | | | | | | ✓ |
| [Migrate group](group/import/_index.md) | | | | | | ✓ |
| Delete group | | | | | | ✓ |
| Manage [subscriptions, storage, and compute minutes](../subscriptions/gitlab_com/_index.md) | | | | | | ✓ |
| Manage [group access tokens](group/settings/group_access_tokens.md) | | | | | | ✓ |
| Change group visibility level | | | | | | ✓ |
| Edit group settings | | | | | | ✓ |
| Configure project templates | | | | | | ✓ |
| Configure [SAML SSO](group/saml_sso/_index.md) <sup>4</sup> | | | | | | ✓ |
| Disable notification emails | | | | | | ✓ |
| Import [project](project/settings/import_export.md) | | | | | ✓ | ✓ |
**Footnotes**
1. Developers and Maintainers can only view events based on their individual actions. For more
information, see the [prerequisites](compliance/audit_events.md#prerequisites).
1. Developers, Maintainers and Owners: Only if the project creation role is set
[for the instance](../administration/settings/visibility_and_access_controls.md#define-which-roles-can-create-projects)
or [for the group](group/_index.md#specify-who-can-add-projects-to-a-group).
<br>Developers: Developers can push commits to the default branch of a new project only
if the [default branch protection](group/manage.md#change-the-default-branch-protection-of-a-group)
is set to "Partially protected" or "Not protected".
1. Maintainers: Only if users with the Maintainer role [can create subgroups](group/subgroups/_index.md#change-who-can-create-subgroups).
1. Does not apply to subgroups.
### Project planning group permissions
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View epic | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) epics <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add issues to an [epic](group/epics/_index.md) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add [child epics](group/epics/manage_epics.md#multi-level-child-epics) <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal notes | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create epics | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Update epic details | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [epic boards](group/epics/epic_boards.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete epics | | ✓ | | | | ✓ |
**Footnotes**
1. You must have permission to [view the epic](group/epics/manage_epics.md#who-can-view-an-epic).
1. You must have permission to [view the epic](group/epics/manage_epics.md#who-can-view-an-epic) and edit the issue.
1. You must have permission to [view](group/epics/manage_epics.md#who-can-view-an-epic) the parent and child epics.
Group permissions for [wikis](project/wiki/group.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View group wiki <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) group wikis <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Edit group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Delete group wiki pages | | ✓ | | ✓ | ✓ | ✓ |
**Footnotes**
1. Guests: In addition, if your group is public or internal, all users who can see the group can also see group wiki pages.
1. Guests: In addition, if your group is public or internal, all users who can see the group can also search group wiki pages.
### Packages and registries group permissions
Group permissions for [container registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull container registry images <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull container images with the dependency proxy | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete container registry images | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Guests can only view events based on their individual actions.
Group permissions for [package registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull packages | | | ✓ | ✓ | ✓ | ✓ |
| Publish packages | | | | ✓ | ✓ | ✓ |
| Delete packages | | | | | ✓ | ✓ |
| Manage package settings | | | | | | ✓ |
| Manage dependency proxy cleanup policies | | | | | | ✓ |
| Enable dependency proxy | | | | | | ✓ |
| Disable dependency proxy | | | | | | ✓ |
| Purge the group dependency proxy | | | | | | ✓ |
| Enable package request forwarding | | | | | | ✓ |
| Disable package request forwarding | | | | | | ✓ |
### Repository group permissions
Group permissions for [repository](project/repository/_index.md) features including merge requests, push rules, and deploy tokens.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Manage [deploy tokens](project/deploy_tokens/_index.md) | | | | | | ✓ |
| Manage [merge request settings](group/manage.md#group-merge-request-approval-settings) | | | | | | ✓ |
| Manage [push rules](group/access_and_permissions.md#group-push-rules) | | | | | | ✓ |
### User management group permissions
Group permissions for user management:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View 2FA status of members | | | | | | ✓ |
| Filter members by 2FA status | | | | | | ✓ |
| Manage group members | | | | | | ✓ |
| Manage group-level custom roles | | | | | | ✓ |
| Share (invite) groups to groups | | | | | | ✓ |
### Workspace group permissions
Groups permissions for workspaces:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View workspace cluster agents mapped to a group | | | | | ✓ | ✓ |
| Map or unmap workspace cluster agents to and from a group | | | | | | ✓ |
## Project members permissions
A user's role determines what permissions they have on a project. The Owner role provides all permissions but is
available only:
- For group and project Owners.
- For Administrators.
Personal [namespace](namespace/_index.md) owners:
- Are displayed as having the Maintainer role on projects in the namespace, but have the same permissions as a user with the Owner role.
- For new projects in the namespace, are displayed as having the Owner role.
For more information about how to manage project members, see
[members of a project](project/members/_index.md).
The following tables list the project permissions available for each role.
### Analytics
Project permissions for [analytics](analytics/_index.md) features including value streams, usage trends, product analytics, and insights.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [issue analytics](group/issues_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [value stream analytics](group/value_stream_analytics/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [CI/CD analytics](analytics/ci_cd_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [code review analytics](analytics/code_review_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [DORA metrics](analytics/ci_cd_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [merge request analytics](analytics/merge_request_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [repository analytics](analytics/repository_analytics.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [Value Streams Dashboard & AI impact analytics](analytics/value_streams_dashboard.md) | | | ✓ | ✓ | ✓ | ✓ |
### Application security
Project permissions for [application security](application_security/secure_your_application.md) features including dependency management, security analyzers, security policies, and vulnerability management.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| View [security dashboard](application_security/security_dashboard/_index.md) | | | | ✓ | ✓ | ✓ |
| View [vulnerability report](application_security/vulnerability_report/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [vulnerability manually](application_security/vulnerability_report/_index.md#manually-add-a-vulnerability) | | | | | ✓ | ✓ |
| Create [issue](application_security/vulnerabilities/_index.md#create-a-gitlab-issue-for-a-vulnerability) from vulnerability finding | | | | ✓ | ✓ | ✓ |
| Create [on-demand DAST scans](application_security/dast/on-demand_scan.md) | | | | ✓ | ✓ | ✓ |
| Run [on-demand DAST scans](application_security/dast/on-demand_scan.md) | | | | ✓ | ✓ | ✓ |
| Create [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Change [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Delete [individual security policies](application_security/policies/_index.md) | | | | ✓ | ✓ | ✓ |
| Create [CVE ID request](application_security/cve_id_request.md) | | | | | ✓ | ✓ |
| Change vulnerability status <sup>1</sup> | | | | | ✓ | ✓ |
| Create [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Assign [security policy project](application_security/policies/_index.md) | | | | | | ✓ |
| Manage [security configurations](application_security/detect/security_configuration.md) | | | | | | ✓ |
**Footnotes**
1. The `admin_vulnerability` permission was [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/412693) from the Developer role in GitLab 17.0.
### CI/CD
[GitLab CI/CD](../ci/_index.md) permissions for some roles can be modified by these settings:
- [Project-based pipeline visibility](../ci/pipelines/settings.md#change-which-users-can-view-your-pipelines):
When set to public, gives access to certain CI/CD features to Guest project members.
- [Pipeline visibility](../ci/pipelines/settings.md#change-pipeline-visibility-for-non-project-members-in-public-projects):
When set to **Everyone with Access**, gives access to certain CI/CD "view" features to non-project members.
Project Owners can perform any listed action, and can delete pipelines:
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer |
| ----------------------------------------------------------------------------------------------------------- | :--------: | :---: | :-----: | :------: | :-------: | :--------: |
| View existing artifacts <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View list of jobs <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View artifacts <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Download artifacts <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [environments](../ci/environments/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View job logs and job details page <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View pipelines and pipeline details pages <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View pipelines tab in MR <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [vulnerabilities in a pipeline](application_security/detect/security_scanning_results.md) <sup>4</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Run deployment job for a protected environment <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| View [agents for Kubernetes](clusters/agent/_index.md) | | | | | ✓ | ✓ |
| View project [Secure Files](../api/secure_files.md) | | | | | ✓ | ✓ |
| Download project [Secure Files](../api/secure_files.md) | | | | | ✓ | ✓ |
| View a job with [debug logging](../ci/variables/variables_troubleshooting.md#enable-debug-logging) | | | | | ✓ | ✓ |
| Create [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Delete [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Stop [environments](../ci/environments/_index.md) | | | | | ✓ | ✓ |
| Run, rerun, or retry CI/CD pipeline or job | | | | | ✓ | ✓ |
| Run, rerun, or retry CI/CD pipeline or job for a protected branch <sup>6</sup> | | | | | ✓ | ✓ |
| Delete job logs or job artifacts <sup>7</sup> | | | | | ✓ | ✓ |
| Enable [review apps](../ci/review_apps/_index.md) | | | | | ✓ | ✓ |
| Cancel jobs <sup>8</sup> | | | | | ✓ | ✓ |
| Read [Terraform](infrastructure/_index.md) state | | | | | ✓ | ✓ |
| Run [interactive web terminals](../ci/interactive_web_terminal/_index.md) | | | | | ✓ | ✓ |
| Use pipeline editor | | | | | ✓ | ✓ |
| Manage [agents for Kubernetes](clusters/agent/_index.md) | | | | | | ✓ |
| Manage CI/CD settings | | | | | | ✓ |
| Manage job triggers | | | | | | ✓ |
| Manage project CI/CD variables | | | | | | ✓ |
| Manage project protected environments | | | | | | ✓ |
| Manage project [Secure Files](../api/secure_files.md) | | | | | | ✓ |
| Manage [Terraform](infrastructure/_index.md) state | | | | | | ✓ |
| Add project runners to project | | | | | | ✓ |
| Clear runner caches manually | | | | | | ✓ |
| Enable instance runners in project | | | | | | ✓ |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. Non-members and guests: Only if the project is public.
2. Non-members: Only if the project is public and **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
<br>Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
3. Non-members: Only if the project is public, **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**,
and [`artifacts:public: false`](../ci/yaml/_index.md#artifactspublic) is not set on the job.
<br>Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD** and
`artifacts:public: false` is not set on the job.<br>Reporters: Only if `artifacts:public: false`
is not set on the job.
4. Guests: Only if **Project-based pipeline visibility** is enabled in **Project Settings > CI/CD**.
5. Reporters: Only if the user is [part of a group with access to the protected environment](../ci/environments/protected_environments.md#deployment-only-access-to-protected-environments).
<br>Developers and maintainers: Only if the user is [allowed to deploy to the protected branch](../ci/environments/protected_environments.md#protecting-environments).
6. Developers and maintainers: Only if the user is [allowed to merge or push to the protected branch](../ci/pipelines/_index.md#pipeline-security-on-protected-branches).
7. Developers: Only if the job was triggered by the user and runs for a non-protected branch.
8. Cancellation permissions can be [restricted in the pipeline settings](../ci/pipelines/settings.md#restrict-roles-that-can-cancel-pipelines-or-jobs).
<!-- markdownlint-enable MD029 -->
This table shows granted privileges for jobs triggered by specific roles.
Project Owners can do any listed action, but no users can push source and LFS together.
Guest users and members with the Reporter role cannot do any of these actions.
| Action | Developer | Maintainer |
| --------------------------------------------------------- | :-------: | :--------: |
| Clone source and LFS from current project | ✓ | ✓ |
| Clone source and LFS from public projects | ✓ | ✓ |
| Clone source and LFS from internal projects <sup>1</sup> | ✓ | ✓ |
| Clone source and LFS from private projects <sup>2</sup> | ✓ | ✓ |
| Pull container images from current project | ✓ | ✓ |
| Pull container images from public projects | ✓ | ✓ |
| Pull container images from internal projects <sup>1</sup> | ✓ | ✓ |
| Pull container images from private projects <sup>2</sup> | ✓ | ✓ |
| Push container images to current project <sup>3</sup> | ✓ | ✓ |
**Footnotes**
1. Developers and Maintainers: Only if the triggering user is not an external user.
1. Only if the triggering user is a member of the project. See also [Usage of private Docker images with `if-not-present` pull policy](https://docs.gitlab.com/runner/security/#usage-of-private-docker-images-with-if-not-present-pull-policy).
1. You cannot push container images to other projects.
### Compliance
Project permissions for [compliance](compliance/_index.md) features including compliance center, audit events, compliance frameworks, and licenses.
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [allowed and denied licenses in MR](compliance/license_scanning_of_cyclonedx_files/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [audit events](compliance/audit_events.md) <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| View licenses in [dependency list](application_security/dependency_list/_index.md) | | | | ✓ | ✓ | ✓ |
| Manage [audit streams](compliance/audit_event_streaming.md) | | | | | | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must have at least the Reporter role, even if the project is internal. Users with the Guest
role on GitLab.com are able to perform this action only on public projects because internal
visibility is not available.
1. Users can only view events based on their individual actions. For more details, see the [prerequisites](compliance/audit_events.md#prerequisites).
### GitLab Duo
Project permissions for [GitLab Duo](gitlab_duo/_index.md):
| Action | Non-member | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------ | :--------: | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Use GitLab Duo features <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Configure [GitLab Duo feature availability](gitlab_duo/turn_on_off.md#for-a-project) | | | | | | ✓ | ✓ |
**Footnotes**
1. Code Suggestions requires a [user being assigned a seat to gain access to a GitLab Duo add-on](../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
### Machine learning model registry and experiment
Project permissions for [model registry](project/ml/model_registry/_index.md) and [model experiments](project/ml/experiment_tracking/_index.md).
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View [models and versions](project/ml/model_registry/_index.md) <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [model experiments](project/ml/experiment_tracking/_index.md) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create models, versions, and artifacts <sup>3</sup> | | | | ✓ | ✓ | ✓ |
| Edit models, versions, and artifacts | | | | ✓ | ✓ | ✓ |
| Delete models, versions, and artifacts | | | | ✓ | ✓ | ✓ |
| Create experiments and candidates | | | | ✓ | ✓ | ✓ |
| Edit experiments and candidates | | | | ✓ | ✓ | ✓ |
| Delete experiments and candidates | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Non-members can only view models and versions in public projects with the **Everyone with access**
visibility level. Non-members can't view internal projects, even if they're logged in.
1. Non-members can only view model experiments in public projects with the **Everyone with access**
visibility level. Non-members can't view internal projects, even if they're logged in.
1. You can also upload and download artifacts with the package registry API, which uses
a different set of permissions.
### Monitoring
Project permissions for monitoring including [error tracking](../operations/error_tracking.md) and [incident management](../operations/incident_management/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View an [incident](../operations/incident_management/incidents.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Assign an [incident management](../operations/incident_management/_index.md) alert | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Participate in on-call rotation for [Incident Management](../operations/incident_management/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [alerts](../operations/incident_management/alerts.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [error tracking](../operations/error_tracking.md) list | | | ✓ | ✓ | ✓ | ✓ |
| View [escalation policies](../operations/incident_management/escalation_policies.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [on-call schedules](../operations/incident_management/oncall_schedules.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [incident](../operations/incident_management/incidents.md) | | | ✓ | ✓ | ✓ | ✓ |
| Change [alert status](../operations/incident_management/alerts.md#change-an-alerts-status) | | | ✓ | ✓ | ✓ | ✓ |
| Change [incident severity](../operations/incident_management/manage_incidents.md#change-severity) | | | ✓ | ✓ | ✓ | ✓ |
| Change [incident escalation status](../operations/incident_management/manage_incidents.md#change-status) | | | | ✓ | ✓ | ✓ |
| Change [incident escalation policy](../operations/incident_management/manage_incidents.md#change-escalation-policy) | | | | ✓ | ✓ | ✓ |
| Manage [error tracking](../operations/error_tracking.md) | | | | | ✓ | ✓ |
| Manage [escalation policies](../operations/incident_management/escalation_policies.md) | | | | | ✓ | ✓ |
| Manage [on-call schedules](../operations/incident_management/oncall_schedules.md) | | | | | ✓ | ✓ |
### Project planning
Project permissions for [issues](project/issues/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View issues | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) issues and comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create issues | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [confidential issues](project/issues/confidential_issues.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) confidential issues and comments | | | ✓ | ✓ | ✓ | ✓ |
| Edit issues, including metadata, item locking, and resolving threads <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal notes | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Close and reopen issues <sup>2</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [design management](project/issues/design_management.md) files | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [issue boards](project/issue_board.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [milestones](project/milestones/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) milestones | | | ✓ | ✓ | ✓ | ✓ |
| Archive or reopen [requirements](project/requirements/_index.md) <sup>3</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create or edit [requirements](project/requirements/_index.md) <sup>4</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Import or export [requirements](project/requirements/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Archive [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Move [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Reopen [test cases](../ci/test_cases/_index.md) | | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Import](project/issues/csv_import.md) issues from a CSV file | | ✓ | | ✓ | ✓ | ✓ |
| [Export](project/issues/csv_export.md) issues to a CSV file | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete issues | | ✓ | | | | ✓ |
| Manage [Feature flags](../operations/feature_flags.md) | | | | ✓ | ✓ | ✓ |
**Footnotes**
1. Metadata includes labels, assignees, milestones, epics, weight, confidentiality, time tracking,
and more. Guest users can only set metadata when creating an issue. They cannot change the
metadata on existing issues. Guest users can modify the title and description of issues that
they authored or are assigned to.
1. Guest users can close and reopen issues that they authored or are assigned to.
1. Guest users can archive and reopen issues that they authored or are assigned to.
1. Guest users can modify the title and description that they authored or are assigned to.
Project permissions for [tasks](tasks.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create tasks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit tasks, including metadata, item locking, and resolving threads <sup>1</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a linked item | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Convert to another item type | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Remove from issue | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Delete tasks <sup>2</sup> | | ✓ | | | | ✓ |
**Footnotes**
1. Guest users can modify the title and description that they authored or are assigned to.
1. Users who don't have the Planner or Owner role can delete the tasks they authored.
Project permissions for [OKRs](okrs.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create OKRs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit OKRs, including metadata, item locking, and resolving threads | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a child OKR | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add a linked item | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Convert to another item type | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit OKRs | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Change confidentiality in OKR | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
Project permissions for [wikis](project/wiki/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) wikis | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Edit wiki pages | | ✓ | | ✓ | ✓ | ✓ |
| Delete wiki pages | | ✓ | | ✓ | ✓ | ✓ |
### Packages and registry
Project permissions for [container registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ------------------------------------------------------------------------------------------------ | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull container registry images <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Push container registry images | | | | ✓ | ✓ | ✓ |
| Delete container registry images | | | | ✓ | ✓ | ✓ |
| Manage cleanup policies | | | | | ✓ | ✓ |
| Create [tag protection](packages/container_registry/protected_container_tags.md) rules | | | | | ✓ | ✓ |
| Create [immutable tag protection](packages/container_registry/immutable_container_tags.md) rules | | | | | | ✓ |
**Footnotes**:
1. Viewing the container registry and pulling images is controlled by [container registry visibility permissions](packages/container_registry/_index.md#container-registry-visibility-permissions).
Project permissions for [package registry](packages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Pull packages <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Publish packages | | | | ✓ | ✓ | ✓ |
| Delete packages | | | | | ✓ | ✓ |
| Delete files associated with a package | | | | | ✓ | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects
because internal visibility is not available.
### Projects
Project permissions for [project features](project/organize_work_with_projects.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| Download project <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Reposition comments on images (posted by any user) <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [insights](project/insights/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [requirements](project/requirements/_index.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [time tracking](project/time_tracking.md) reports <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [snippets](snippets.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) [snippets](snippets.md) and comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [project traffic statistics](../api/project_statistics.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [snippets](snippets.md) | | | ✓ | ✓ | ✓ | ✓ |
| View [releases](project/releases/_index.md) <sup>3</sup> | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage [releases](project/releases/_index.md) <sup>4</sup> | | | | | ✓ | ✓ |
| Configure [webhooks](project/integrations/webhooks.md) | | | | | ✓ | ✓ |
| Manage [project access tokens](project/settings/project_access_tokens.md) <sup>5</sup> | | | | | ✓ | ✓ |
| [Export project](project/settings/import_export.md) | | | | | ✓ | ✓ |
| Rename project | | | | | ✓ | ✓ |
| Edit project badges | | | | | ✓ | ✓ |
| Edit project settings | | | | | ✓ | ✓ |
| Change [project features visibility](public_access.md) level <sup>6</sup> | | | | | ✓ | ✓ |
| Change custom settings for [project integrations](project/integrations/_index.md) | | | | | ✓ | ✓ |
| Edit comments posted by other users | | | | | ✓ | ✓ |
| Add [deploy keys](project/deploy_keys/_index.md) | | | | | ✓ | ✓ |
| Manage [project operations](../operations/_index.md) | | | | | ✓ | ✓ |
| View [Usage quotas](storage_usage_quotas.md) page | | | | | ✓ | ✓ |
| Globally delete [snippets](snippets.md) | | | | | ✓ | ✓ |
| Globally edit [snippets](snippets.md) | | | | | ✓ | ✓ |
| Archive project | | | | | | ✓ |
| Change project visibility level | | | | | | ✓ |
| Delete project | | | | | | ✓ |
| Disable notification emails | | | | | | ✓ |
| Transfer project | | | | | | ✓ |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on
public and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects
because internal visibility is not available.
2. Applies only to comments on [Design Management](project/issues/design_management.md) designs.
3. Guest users can access GitLab [**Releases**](project/releases/_index.md) for downloading
assets but are not allowed to download the source code nor see
[repository information like commits and release evidence](project/releases/_index.md#view-a-release-and-download-assets).
4. If the [tag is protected](project/protected_tags.md), this depends on the access given to
Developers and Maintainers.
5. For GitLab Self-Managed, project access tokens are available in all tiers. For GitLab.com,
project access tokens are supported in the Premium and Ultimate tier (excluding [trial licenses](https://about.gitlab.com/free-trial/)).
6. A Maintainer or Owner can't change project features visibility level if
[project visibility](public_access.md) is set to private.
<!-- markdownlint-enable MD029 -->
Project permissions for [GitLab Pages](project/pages/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| -------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View GitLab Pages protected by [access control](project/pages/pages_access_control.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Manage GitLab Pages | | | | | ✓ | ✓ |
| Manage GitLab Pages domain and certificates | | | | | ✓ | ✓ |
| Remove GitLab Pages | | | | | ✓ | ✓ |
### Repository
Project permissions for [repository](project/repository/_index.md) features including source code, branches, push rules, and more:
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| --------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View project code <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) project code <sup>2</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) commits and comments <sup>3</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull project code <sup>4</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| View commit status | | | ✓ | ✓ | ✓ | ✓ |
| Create commit status <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| Update commit status <sup>5</sup> | | | | ✓ | ✓ | ✓ |
| Create [Git tags](project/repository/tags/_index.md) | | | | ✓ | ✓ | ✓ |
| Delete [Git tags](project/repository/tags/_index.md) | | | | ✓ | ✓ | ✓ |
| Create new [branches](project/repository/branches/_index.md) | | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | | ✓ | ✓ | ✓ |
| Force push to non-protected branches | | | | ✓ | ✓ | ✓ |
| Delete non-protected branches | | | | ✓ | ✓ | ✓ |
| Manage [protected branches](project/repository/branches/protected.md) | | | | | ✓ | ✓ |
| Push to protected branches <sup>5</sup> | | | | | ✓ | ✓ |
| Delete protected branches | | | | | ✓ | ✓ |
| Manage [protected tags](project/protected_tags.md) | | | | | ✓ | ✓ |
| Manage [push rules](project/repository/push_rules.md) | | | | | ✓ | ✓ |
| Remove fork relationship | | | | | | ✓ |
| Force push to protected branches <sup>6</sup> | | | | | | |
**Footnotes**
<!-- Disable ordered list rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md029---ordered-list-item-prefix -->
<!-- markdownlint-disable MD029 -->
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal.
Users with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can view private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
2. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can search private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
3. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available.
4. If the [branch is protected](project/repository/branches/protected.md), this depends on the
access given to Developers and Maintainers.
5. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available. In GitLab 15.9 and later, users with the Guest role and an
Ultimate license can view private repository content if an administrator (on GitLab Self-Managed
or GitLab Dedicated) or group owner (on GitLab.com) gives those users permission. The administrator
or group owner can create a [custom role](custom_roles/_index.md) through the API or UI and assign
that role to the users.
6. Not allowed for Guest, Reporter, Developer, Maintainer, or Owner. See [protected branches](project/repository/branches/protected.md#allow-force-push).
<!-- markdownlint-enable MD029 -->
### Merge requests
Project permissions for [merge requests](project/merge_requests/_index.md):
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ----------------------------------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| [View](project/merge_requests/_index.md#view-merge-requests) a merge request <sup>1</sup> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| [Search](search/_index.md) merge requests and comments <sup>1</sup> | ✓ | | ✓ | ✓ | ✓ | ✓ |
| Add internal note | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Comment and add suggestions | | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create [snippets](snippets.md) | | | ✓ | ✓ | ✓ | ✓ |
| Create [merge request](project/merge_requests/creating_merge_requests.md) <sup>2</sup> | | | | ✓ | ✓ | ✓ |
| Update merge request details <sup>3</sup> | | | | ✓ | ✓ | ✓ |
| Manage [merge request settings](project/merge_requests/approvals/settings.md) | | | | | ✓ | ✓ |
| Manage [merge request approval rules](project/merge_requests/approvals/rules.md) | | | | | ✓ | ✓ |
| Delete merge request | | | | | | ✓ |
**Footnotes**
1. On GitLab Self-Managed, users with the Guest role are able to perform this action only on public
and internal projects (not on private projects). [External users](../administration/external_users.md)
must be given explicit access (at least the **Reporter** role) even if the project is internal. Users
with the Guest role on GitLab.com are only able to perform this action on public projects because
internal visibility is not available.
1. In projects that accept contributions from external members, users can create, edit, and close their
own merge requests. For **private** projects, this excludes the Guest role as those users
[cannot clone private projects](public_access.md#private-projects-and-groups). For **internal**
projects, includes users with read-only access to the project, as
[they can clone internal projects](public_access.md#internal-projects-and-groups).
1. For information on eligible approvers for merge requests, see [eligible approvers](project/merge_requests/approvals/rules.md#eligible-approvers).
### User management
Project permissions for [user management](project/members/_index.md).
| Action | Guest | Planner | Reporter | Developer | Maintainer | Owner |
| ---------------------------------------------------------------- | :---: | :-----: | :------: | :-------: | :--------: | :---: |
| View 2FA status of members | | | | | ✓ | ✓ |
| Manage [project members](project/members/_index.md) <sup>1</sup> | | | | | ✓ | ✓ |
| Share (invite) projects with groups <sup>2</sup> | | | | | ✓ | ✓ |
**Footnotes**
1. Maintainers cannot create, demote, or remove Owners, and they cannot promote users to the Owner role.
They also cannot approve Owner role access requests.
1. When [Share Group Lock](project/members/sharing_projects_groups.md#prevent-a-project-from-being-shared-with-groups)
is enabled the project can't be shared with other groups. It does not affect group with group sharing.
## Subgroup permissions
When you add a member to a subgroup, they inherit the membership and
permission level from the parent groups. This model allows access to
nested groups if you have membership in one of its parents.
For more information, see
[subgroup memberships](group/subgroups/_index.md#subgroup-membership).
## Users with Minimal Access
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Support for inviting users with Minimal Access role [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106438) in GitLab 15.9.
{{< /history >}}
Users with the Minimal Access role do not:
- Automatically have access to projects and subgroups in that top-level group.
- Count as licensed seats on GitLab Self-Managed Ultimate subscriptions or any GitLab.com subscriptions, provided the user has no other role anywhere in the instance or in the GitLab.com namespace.
Owners must explicitly add these users to the specific subgroups and
projects.
You can use the Minimal Access role with [SAML SSO for GitLab.com groups](group/saml_sso/_index.md)
to control access to groups and projects in the group hierarchy. You can set the default role to
Minimal Access for members automatically added to the top-level group through SSO.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > SAML SSO**.
1. From the **Default membership role** dropdown list, select **Minimal Access**.
1. Select **Save changes**.
### Minimal access users receive 404 errors
Because of an [outstanding issue](https://gitlab.com/gitlab-org/gitlab/-/issues/267996), when a user with the Minimal Access role:
- Signs in with standard web authentication, they receive a `404` error when accessing the parent group.
- Signs in with Group SSO, they receive a `404` error immediately because they are redirected to the parent group page.
To work around the issue, give these users the Guest role or higher to any project or subgroup in the parent group. Guest users consume a license seat in the Premium tier but do not in the Ultimate tier.
## Related topics
- [Custom roles](custom_roles/_index.md)
- [Members](project/members/_index.md)
- Customize permissions on [protected branches](project/repository/branches/protected.md)
- [LDAP user permissions](group/access_and_permissions.md#manage-group-memberships-with-ldap)
- [Value stream analytics permissions](group/value_stream_analytics/_index.md#access-permissions)
- [Project aliases](project/working_with_projects.md#project-aliases)
- [Auditor users](../administration/auditor_users.md)
- [Confidential issues](project/issues/confidential_issues.md)
- [Container registry permissions](packages/container_registry/_index.md#container-registry-visibility-permissions)
- [Release permissions](project/releases/_index.md#release-permissions)
- [Read-only namespaces](read_only_namespaces.md)
|
https://docs.gitlab.com/tasks
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/tasks.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
tasks.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Tasks
|
Task labels, confidential tasks, linked items, and task weights.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 14.5 [with a flag](../administration/feature_flags/_index.md) named `work_items`. Disabled by default.
- Creating, editing, and deleting tasks [introduced](https://gitlab.com/groups/gitlab-org/-/epics/7169) in GitLab 15.0.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.3.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
A task in GitLab is a planning item that can be created in an issue.
Use tasks to break down user stories captured in [issues](project/issues/_index.md) into
smaller, trackable items.
When planning an issue, you need a way to capture and break down technical
requirements or steps necessary to complete it. An issue with related tasks is better defined,
and so you can provide a more accurate issue weight and completion criteria.
For the latest updates, check the [Tasks roadmap](https://gitlab.com/groups/gitlab-org/-/epics/7103).
Tasks are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
in GitLab.
For the roadmap of migrating issues and [epics](group/epics/_index.md)
to work items and adding custom work item types, see
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
[Plan direction page](https://about.gitlab.com/direction/plan/).
## View tasks
View tasks in issues, in the **Child items** section.
You can also [filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = task`.
If you select a task from an issue, it opens in a dialog window.
If you select a task to open in a new browser tab, or select it from the issue list,
the task opens in a full-page view.
## Create a task
{{< history >}}
- Option to select the project where tasks are created [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project, or the project must be public.
To create a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select **Add**.
1. Select **New task**.
1. Enter the task title.
1. Select the [project](project/organize_work_with_projects.md) to create the new task in.
1. Select **Create task**.
### From a task list item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, hover over a task list item and select the options menu ({{< icon name="ellipsis_v" >}}).
1. Select **Convert to task**.
The task list item is removed from the issue description and a task is created in the tasks widget from its contents.
Any nested task list items are moved up a nested level.
## Add existing tasks to an issue
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381868) in GitLab 15.6.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project, or the project must be public.
To add a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select **Add**.
1. Select **Existing task**.
1. Search tasks by title.
1. Select one or multiple tasks to add to the issue.
1. Select **Add task**.
## Edit a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
The task window opens.
1. Optional. To edit the title, select it and make your changes.
1. Optional. To edit the description, select the edit icon ({{< icon name="pencil" >}}), make your changes, and
select **Save**.
1. Select the close icon ({{< icon name="close" >}}).
### Using the rich text editor
{{< history >}}
- Rich text editing in the dialog view [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/363007) in GitLab 15.6 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc`. Disabled by default.
- Rich text editing in the full page view [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104533) in GitLab 15.7.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/10378) in GitLab 16.2. Feature flag `work_items_mvc` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Use a rich text editor to edit a task's description.
Prerequisites:
- You must have at least the Planner role for the project.
To edit the description of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Description**, select the edit icon ({{< icon name="pencil" >}}). The description text box appears.
1. Above the text box, select **Rich text**.
1. Make your changes, and select **Save**.
## Promote a task to an issue
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To promote a task to an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
The task window opens.
1. Unlink the parent issue and promote the task: In the task window, use these two
[quick actions](project/quick_actions.md) in separate comments:
```plaintext
/remove_parent
```
```plaintext
/promote_to issue
```
The task is converted to an issue and gets a new URL with `/issues/`.
The previous URL with `/work_items/` still works.
## Convert a task into another item type
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) in GitLab 17.8 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) [to the flag](../administration/feature_flags/_index.md) named `okrs_mvc`. For current flag state, see the top of this page.
{{< /history >}}
Convert a task into another item type, such as:
- Issue
- Objective
- Key result
{{< alert type="warning" >}}
Changing the type might result in data loss if the target type does not support all fields from the original type.
{{< /alert >}}
Prerequisites:
- The task you want to convert must not have a parent item assigned.
To convert a task into another item type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the issue list, find your task.
1. Optional. If the task has a parent issue assigned, remove it.
Add a comment to the task with the `/remove_parent` quick action.
1. In the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}), then select **Change type**.
1. Select the desired item type.
1. If all conditions are met, select **Change type**.
Alternatively, you can use the `/type` [quick action](project/quick_actions.md#work-items), followed
by `issue`, `objective` or `key result` in a comment.
## Remove a task from an issue
{{< history >}}
- Minimum required role [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/404799) from Reporter to Guest in GitLab 17.0.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
You can remove a task from an issue. The task is not deleted, but the two are no longer connected.
It's not possible to connect them again.
To remove a task from an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the options menu ({{< icon name="ellipsis_v" >}})
next to the task you want to remove.
1. Select **Remove task**.
## Delete a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Owner to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must either:
- Be the author of the task and have at least the Guest role for the project.
- Have the Planner or Owner role for the project.
To delete a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
1. In the task window, in the options menu ({{< icon name="ellipsis_v" >}}), select **Delete task**.
1. Select **OK**.
## Reorder tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385887) in GitLab 16.0.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
By default, tasks are ordered by creation date.
To reorder them, drag them around.
## Change status
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
You can assign a status to tasks to track their progress through your workflow. Status provides more granular tracking than the basic open/closed states, allowing you to use specific stages like **In progress**, **Done**, or **Won't do**.
<!-- vale gitlab_base.FutureTense = YES -->
For more information about status, including how to configure custom statuses, see [Status](work_items/status.md).
Prerequisites:
- You must have at least the Planner role for the project, be the author of the task, or be assigned to the task.
To change the status of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your task to view it.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. From the dropdown list, select the status.
The task's status updates immediately.
You can also set the status by using the `/status` [quick action](project/quick_actions.md#issues-merge-requests-and-epics).
## Assign users to a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To show who is responsible for a task, you can assign users to it.
Users on GitLab Free can assign one user per task.
Users on GitLab Premium and Ultimate can assign multiple users to a single task.
See also [multiple assignees for issues](project/issues/multiple_assignees_for_issues.md).
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Assignees**, select **Add assignees**.
1. From the dropdown list, select the users to add as an assignee.
1. Select any area outside the dropdown list.
## Assign labels to a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339756) in GitLab 15.5.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To add [labels](project/labels.md) to a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit. The task window opens.
1. Next to **Labels**, select **Add labels**.
1. From the dropdown list, select the labels to add.
1. Select any area outside the dropdown list.
## Set a start and due date
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/365399) in GitLab 15.4 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/365399) in GitLab 15.5. Feature flag `work_items_mvc_2` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can set a [start and due date](project/issues/due_dates.md) on a task.
Prerequisites:
- You must have at least the Planner role for the project.
You can set start and due dates on a task to show when work should begin and end.
To set a due date:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. If the task already has a due date next to **Due date**, select it. Otherwise, select **Add due date**.
1. In the date picker, select the desired due date.
To set a start date:
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. If the task already has a start date next to **Start date**, select it. Otherwise, select **Add start date**.
1. In the date picker, select the desired due date.
The due date must be the same or later than the start date.
If you select a start date to be later than the due date, the due date is then changed to the same day.
## Add a task to a milestone
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) to feature flag named `work_items_mvc` in GitLab 15.7. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.7. Feature flag `work_items_mvc` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can add a task to a [milestone](project/milestones/_index.md).
You can see the milestone title when you view a task.
If you create a task for an issue that already belongs to a milestone,
the new task inherits the milestone.
Prerequisites:
- You must have at least the Planner role for the project.
To add a task to a milestone:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Milestone**, select **Add to milestone**.
If a task already belongs to a milestone, the dropdown list shows the current milestone.
1. From the dropdown list, select the milestone to be associated with the task.
## Set task weight
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362550) in GitLab 15.3.
- Edit button [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429137) in GitLab 16.7.
{{< /history >}}
Prerequisites:
- You must have at least the Reporter role for the project.
You can set weight on each task to show how much work it needs.
This value is visible only when you view a task.
To set issue weight of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Weight**, select **Edit**.
1. Enter a whole, positive number.
1. Select **Apply** or press <kbd>Enter</kbd>.
## Add a task to an iteration
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) to feature flag named `work_items_mvc` in GitLab 15.7. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) in GitLab 15.7. Feature flag `work_items_mvc` removed.
{{< /history >}}
You can add a task to an [iteration](group/iterations/_index.md).
You can see the iteration title and period only when you view a task.
Prerequisites:
- You must have at least the Reporter role for the project.
To add a task to an iteration:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Iteration**, select **Add to iteration**.
1. From the dropdown list, select the iteration to be associated with the task.
## Estimate and track spent time
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/438577) in GitLab 17.0.
{{< /history >}}
You can estimate and track the time you spend on a task.
For more information, see [Time tracking](project/time_tracking.md).
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If a task description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
To change whether descriptions are truncated:
1. On a task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Task attributes are shown in a sidebar to the right of the description when space allows.
To hide the sidebar and increase space for the description:
1. On a task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## View task system notes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.7 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) to feature flag named `work_items_mvc` in GitLab 15.8. Disabled by default.
- Changing activity sort order [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.8.
- Filtering activity [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389971) in GitLab 15.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.10. Feature flag `work_items_mvc` removed.
{{< /history >}}
You can view all the system notes related to the task. By default they are sorted by **Oldest first**.
You can always change the sorting order to **Newest first**, which is remembered across sessions.
You can also filter activity by **Comments only** and **History only** in addition to the default **All activity** which is remembered across sessions.
## Comments and threads
You can add [comments](discussions/_index.md) and reply to threads in tasks.
## Copy task reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
To refer to a task elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the task reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy Reference**.
You can now paste the reference into another description or comment.
For more information about task references, see [GitLab-Flavored Markdown](markdown.md#gitlab-specific-references).
## Copy task email address
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
You can create a comment in a task by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the task's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy task email address**.
## Set an issue as a parent
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11198) in GitLab 16.5.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
- The issue and task must belong to the same project.
To set an issue as a parent of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Parent**, from the dropdown list, select the parent to add.
1. Select any area outside the dropdown list.
To remove the parent item of the task,
next to **Parent**, select the dropdown list and then select **Unassign**.
## Confidential tasks
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8410) in GitLab 15.3.
{{< /history >}}
Confidential tasks are tasks visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-tasks).
You can use confidential tasks to keep security vulnerabilities private or prevent surprises from
leaking out.
### Make a task confidential
By default, tasks are public.
You can make a task confidential when you create or edit it.
Prerequisites:
- You must have at least the Reporter role for the project.
- If the task has a parent issue which is non-confidential, and you want to make the issue confidential,
you must first make all the child tasks confidential.
A [confidential issue](project/issues/confidential_issues.md) can have only confidential children.
#### In a new task
When you create a new task, a checkbox right below the text area is available to mark the
task as confidential.
Check that box and select **Create task**.
#### In an existing task
To change the confidentiality of an existing task:
1. [Open the task](#view-tasks).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Turn on confidentiality**.
### Who can see confidential tasks
When a task is made confidential, only users with at least the Reporter role for the project have
access to the task.
Users with Guest or [Minimal](permissions.md#users-with-minimal-access) roles can't access
the task even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential tasks, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential task if they are assigned to the task.
When a Guest user or non-member is unassigned from a confidential task, they can no longer view it.
Confidential tasks are hidden in search results for users without the necessary permissions.
### Confidential task indicators
Confidential tasks are visually different from regular tasks in a few ways.
Wherever tasks are listed, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to the tasks that are marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-tasks),
you cannot see confidential tasks at all.
Likewise, while inside the task, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the breadcrumbs.
Every change from regular to confidential and vice versa, is indicated by a
system note in the task's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Lock discussion
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can prevent public comments in a task.
When you do, only project members can add and edit comments.
Prerequisites:
- You must have at least the Reporter role.
To lock a task:
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Lock discussion**.
A system note is added to the page details.
If a task is closed with a locked discussion, then you cannot reopen it until the discussion is unlocked.
## Two-column layout
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415077) in GitLab 16.2 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default. This feature is in [beta](../policy/development_stages_support.md).
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/446064) to feature flag named `work_items_beta` in GitLab 16.10. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
When enabled, tasks use a two-column layout, similar to issues.
The description and threads are on the left, and attributes, such as labels
or assignees, on the right.
This feature is in [beta](../policy/development_stages_support.md).
If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/442090).

## Linked items in tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags/_index.md) named `linked_work_items`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7.
- Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked items are a bi-directional relationship and appear in a block below
the emoji reactions section. You can link an objective, key result, or a task in the same project with each other.
The relationship only shows up in the UI if the user can see both items.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the project.
To link an item to a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the **Linked items** section of a task,
select **Add**.
1. Select the relationship between the two items. Either:
- **relates to**
- **blocks**
- **is blocked by**
1. Enter the search text of the item, URL, or its reference ID.
1. When you have added all the items to be linked, select **Add** below the search box.
When you have finished adding all linked items, you can see
them categorized so their relationships can be better understood visually.

### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the **Linked items** section of a task, next to each item, select the vertical
ellipsis ({{< icon name="ellipsis_v" >}}) and then select **Remove**.
Due to the bi-directional relationship, the relationship no longer appears in either item.
### Add a merge request and automatically close tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440851) in GitLab 17.3.
{{< /history >}}
You can set a task to close when a merge request merges.
Prerequisites:
- You must have at least a Developer role for the project containing the merge request.
- You must have at least a Reporter role for the project containing the task.
1. Edit your merge request.
1. In the **Description** box, find and add the task.
- Use the [closing pattern](project/issues/managing_issues.md#closing-issues-automatically) that you would for adding a merge request to an issue.
- If your task is in the same project as your merge request, you can search for your task by typing <kbd>#</kbd> followed by the task's ID or title.
- If your task is in a different project, with a task open, copy the URL from the browser or
copy the task's reference by selecting the vertical ellipsis ({{< icon name="ellipsis_v" >}}) in the upper-right corner, then **Copy Reference**.
The merge requests are now visible in the main body, in the **Development** section.
You must use the exact closing pattern to add the merge request to the task. Other text will not work.
If [automatic issue closing](project/issues/managing_issues.md#disable-automatic-issue-closing) is enabled in your project settings, the task will be automatically closed when either:
- The added merge request is merged.
- A commit referencing a task with the closing pattern is committed to your project's default branch.
## Related topics
- [Create a merge request from a task](project/merge_requests/creating_merge_requests.md#from-a-task)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
gitlab_dedicated: true
title: Tasks
description: Task labels, confidential tasks, linked items, and task weights.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 14.5 [with a flag](../administration/feature_flags/_index.md) named `work_items`. Disabled by default.
- Creating, editing, and deleting tasks [introduced](https://gitlab.com/groups/gitlab-org/-/epics/7169) in GitLab 15.0.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.3.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
A task in GitLab is a planning item that can be created in an issue.
Use tasks to break down user stories captured in [issues](project/issues/_index.md) into
smaller, trackable items.
When planning an issue, you need a way to capture and break down technical
requirements or steps necessary to complete it. An issue with related tasks is better defined,
and so you can provide a more accurate issue weight and completion criteria.
For the latest updates, check the [Tasks roadmap](https://gitlab.com/groups/gitlab-org/-/epics/7103).
Tasks are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
in GitLab.
For the roadmap of migrating issues and [epics](group/epics/_index.md)
to work items and adding custom work item types, see
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
[Plan direction page](https://about.gitlab.com/direction/plan/).
## View tasks
View tasks in issues, in the **Child items** section.
You can also [filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = task`.
If you select a task from an issue, it opens in a dialog window.
If you select a task to open in a new browser tab, or select it from the issue list,
the task opens in a full-page view.
## Create a task
{{< history >}}
- Option to select the project where tasks are created [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project, or the project must be public.
To create a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select **Add**.
1. Select **New task**.
1. Enter the task title.
1. Select the [project](project/organize_work_with_projects.md) to create the new task in.
1. Select **Create task**.
### From a task list item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, hover over a task list item and select the options menu ({{< icon name="ellipsis_v" >}}).
1. Select **Convert to task**.
The task list item is removed from the issue description and a task is created in the tasks widget from its contents.
Any nested task list items are moved up a nested level.
## Add existing tasks to an issue
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381868) in GitLab 15.6.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project, or the project must be public.
To add a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select **Add**.
1. Select **Existing task**.
1. Search tasks by title.
1. Select one or multiple tasks to add to the issue.
1. Select **Add task**.
## Edit a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
The task window opens.
1. Optional. To edit the title, select it and make your changes.
1. Optional. To edit the description, select the edit icon ({{< icon name="pencil" >}}), make your changes, and
select **Save**.
1. Select the close icon ({{< icon name="close" >}}).
### Using the rich text editor
{{< history >}}
- Rich text editing in the dialog view [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/363007) in GitLab 15.6 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc`. Disabled by default.
- Rich text editing in the full page view [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104533) in GitLab 15.7.
- [Generally available](https://gitlab.com/groups/gitlab-org/-/epics/10378) in GitLab 16.2. Feature flag `work_items_mvc` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Use a rich text editor to edit a task's description.
Prerequisites:
- You must have at least the Planner role for the project.
To edit the description of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Description**, select the edit icon ({{< icon name="pencil" >}}). The description text box appears.
1. Above the text box, select **Rich text**.
1. Make your changes, and select **Save**.
## Promote a task to an issue
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To promote a task to an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
The task window opens.
1. Unlink the parent issue and promote the task: In the task window, use these two
[quick actions](project/quick_actions.md) in separate comments:
```plaintext
/remove_parent
```
```plaintext
/promote_to issue
```
The task is converted to an issue and gets a new URL with `/issues/`.
The previous URL with `/work_items/` still works.
## Convert a task into another item type
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) in GitLab 17.8 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) [to the flag](../administration/feature_flags/_index.md) named `okrs_mvc`. For current flag state, see the top of this page.
{{< /history >}}
Convert a task into another item type, such as:
- Issue
- Objective
- Key result
{{< alert type="warning" >}}
Changing the type might result in data loss if the target type does not support all fields from the original type.
{{< /alert >}}
Prerequisites:
- The task you want to convert must not have a parent item assigned.
To convert a task into another item type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the issue list, find your task.
1. Optional. If the task has a parent issue assigned, remove it.
Add a comment to the task with the `/remove_parent` quick action.
1. In the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}), then select **Change type**.
1. Select the desired item type.
1. If all conditions are met, select **Change type**.
Alternatively, you can use the `/type` [quick action](project/quick_actions.md#work-items), followed
by `issue`, `objective` or `key result` in a comment.
## Remove a task from an issue
{{< history >}}
- Minimum required role [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/404799) from Reporter to Guest in GitLab 17.0.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
You can remove a task from an issue. The task is not deleted, but the two are no longer connected.
It's not possible to connect them again.
To remove a task from an issue:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the options menu ({{< icon name="ellipsis_v" >}})
next to the task you want to remove.
1. Select **Remove task**.
## Delete a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Owner to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must either:
- Be the author of the task and have at least the Guest role for the project.
- Have the Planner or Owner role for the project.
To delete a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the task you want to edit.
1. In the task window, in the options menu ({{< icon name="ellipsis_v" >}}), select **Delete task**.
1. Select **OK**.
## Reorder tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385887) in GitLab 16.0.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
By default, tasks are ordered by creation date.
To reorder them, drag them around.
## Change status
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
You can assign a status to tasks to track their progress through your workflow. Status provides more granular tracking than the basic open/closed states, allowing you to use specific stages like **In progress**, **Done**, or **Won't do**.
<!-- vale gitlab_base.FutureTense = YES -->
For more information about status, including how to configure custom statuses, see [Status](work_items/status.md).
Prerequisites:
- You must have at least the Planner role for the project, be the author of the task, or be assigned to the task.
To change the status of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your task to view it.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. From the dropdown list, select the status.
The task's status updates immediately.
You can also set the status by using the `/status` [quick action](project/quick_actions.md#issues-merge-requests-and-epics).
## Assign users to a task
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To show who is responsible for a task, you can assign users to it.
Users on GitLab Free can assign one user per task.
Users on GitLab Premium and Ultimate can assign multiple users to a single task.
See also [multiple assignees for issues](project/issues/multiple_assignees_for_issues.md).
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Assignees**, select **Add assignees**.
1. From the dropdown list, select the users to add as an assignee.
1. Select any area outside the dropdown list.
## Assign labels to a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339756) in GitLab 15.5.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To add [labels](project/labels.md) to a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit. The task window opens.
1. Next to **Labels**, select **Add labels**.
1. From the dropdown list, select the labels to add.
1. Select any area outside the dropdown list.
## Set a start and due date
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/365399) in GitLab 15.4 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/365399) in GitLab 15.5. Feature flag `work_items_mvc_2` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can set a [start and due date](project/issues/due_dates.md) on a task.
Prerequisites:
- You must have at least the Planner role for the project.
You can set start and due dates on a task to show when work should begin and end.
To set a due date:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. If the task already has a due date next to **Due date**, select it. Otherwise, select **Add due date**.
1. In the date picker, select the desired due date.
To set a start date:
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. If the task already has a start date next to **Start date**, select it. Otherwise, select **Add start date**.
1. In the date picker, select the desired due date.
The due date must be the same or later than the start date.
If you select a start date to be later than the due date, the due date is then changed to the same day.
## Add a task to a milestone
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) to feature flag named `work_items_mvc` in GitLab 15.7. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.7. Feature flag `work_items_mvc` removed.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can add a task to a [milestone](project/milestones/_index.md).
You can see the milestone title when you view a task.
If you create a task for an issue that already belongs to a milestone,
the new task inherits the milestone.
Prerequisites:
- You must have at least the Planner role for the project.
To add a task to a milestone:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Milestone**, select **Add to milestone**.
If a task already belongs to a milestone, the dropdown list shows the current milestone.
1. From the dropdown list, select the milestone to be associated with the task.
## Set task weight
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362550) in GitLab 15.3.
- Edit button [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429137) in GitLab 16.7.
{{< /history >}}
Prerequisites:
- You must have at least the Reporter role for the project.
You can set weight on each task to show how much work it needs.
This value is visible only when you view a task.
To set issue weight of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Weight**, select **Edit**.
1. Enter a whole, positive number.
1. Select **Apply** or press <kbd>Enter</kbd>.
## Add a task to an iteration
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) to feature flag named `work_items_mvc` in GitLab 15.7. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/367456) in GitLab 15.7. Feature flag `work_items_mvc` removed.
{{< /history >}}
You can add a task to an [iteration](group/iterations/_index.md).
You can see the iteration title and period only when you view a task.
Prerequisites:
- You must have at least the Reporter role for the project.
To add a task to an iteration:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Iteration**, select **Add to iteration**.
1. From the dropdown list, select the iteration to be associated with the task.
## Estimate and track spent time
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/438577) in GitLab 17.0.
{{< /history >}}
You can estimate and track the time you spend on a task.
For more information, see [Time tracking](project/time_tracking.md).
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If a task description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
To change whether descriptions are truncated:
1. On a task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Task attributes are shown in a sidebar to the right of the description when space allows.
To hide the sidebar and increase space for the description:
1. On a task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## View task system notes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.7 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) to feature flag named `work_items_mvc` in GitLab 15.8. Disabled by default.
- Changing activity sort order [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.8.
- Filtering activity [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389971) in GitLab 15.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.10. Feature flag `work_items_mvc` removed.
{{< /history >}}
You can view all the system notes related to the task. By default they are sorted by **Oldest first**.
You can always change the sorting order to **Newest first**, which is remembered across sessions.
You can also filter activity by **Comments only** and **History only** in addition to the default **All activity** which is remembered across sessions.
## Comments and threads
You can add [comments](discussions/_index.md) and reply to threads in tasks.
## Copy task reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
To refer to a task elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the task reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy Reference**.
You can now paste the reference into another description or comment.
For more information about task references, see [GitLab-Flavored Markdown](markdown.md#gitlab-specific-references).
## Copy task email address
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
You can create a comment in a task by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the task's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy task email address**.
## Set an issue as a parent
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11198) in GitLab 16.5.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
- The issue and task must belong to the same project.
To set an issue as a parent of a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select the title of the task you want to edit.
The task window opens.
1. Next to **Parent**, from the dropdown list, select the parent to add.
1. Select any area outside the dropdown list.
To remove the parent item of the task,
next to **Parent**, select the dropdown list and then select **Unassign**.
## Confidential tasks
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8410) in GitLab 15.3.
{{< /history >}}
Confidential tasks are tasks visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-tasks).
You can use confidential tasks to keep security vulnerabilities private or prevent surprises from
leaking out.
### Make a task confidential
By default, tasks are public.
You can make a task confidential when you create or edit it.
Prerequisites:
- You must have at least the Reporter role for the project.
- If the task has a parent issue which is non-confidential, and you want to make the issue confidential,
you must first make all the child tasks confidential.
A [confidential issue](project/issues/confidential_issues.md) can have only confidential children.
#### In a new task
When you create a new task, a checkbox right below the text area is available to mark the
task as confidential.
Check that box and select **Create task**.
#### In an existing task
To change the confidentiality of an existing task:
1. [Open the task](#view-tasks).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Turn on confidentiality**.
### Who can see confidential tasks
When a task is made confidential, only users with at least the Reporter role for the project have
access to the task.
Users with Guest or [Minimal](permissions.md#users-with-minimal-access) roles can't access
the task even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential tasks, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential task if they are assigned to the task.
When a Guest user or non-member is unassigned from a confidential task, they can no longer view it.
Confidential tasks are hidden in search results for users without the necessary permissions.
### Confidential task indicators
Confidential tasks are visually different from regular tasks in a few ways.
Wherever tasks are listed, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to the tasks that are marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-tasks),
you cannot see confidential tasks at all.
Likewise, while inside the task, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the breadcrumbs.
Every change from regular to confidential and vice versa, is indicated by a
system note in the task's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Lock discussion
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can prevent public comments in a task.
When you do, only project members can add and edit comments.
Prerequisites:
- You must have at least the Reporter role.
To lock a task:
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Lock discussion**.
A system note is added to the page details.
If a task is closed with a locked discussion, then you cannot reopen it until the discussion is unlocked.
## Two-column layout
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415077) in GitLab 16.2 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default. This feature is in [beta](../policy/development_stages_support.md).
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/446064) to feature flag named `work_items_beta` in GitLab 16.10. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
When enabled, tasks use a two-column layout, similar to issues.
The description and threads are on the left, and attributes, such as labels
or assignees, on the right.
This feature is in [beta](../policy/development_stages_support.md).
If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/442090).

## Linked items in tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags/_index.md) named `linked_work_items`. Disabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7.
- Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked items are a bi-directional relationship and appear in a block below
the emoji reactions section. You can link an objective, key result, or a task in the same project with each other.
The relationship only shows up in the UI if the user can see both items.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the project.
To link an item to a task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the **Linked items** section of a task,
select **Add**.
1. Select the relationship between the two items. Either:
- **relates to**
- **blocks**
- **is blocked by**
1. Enter the search text of the item, URL, or its reference ID.
1. When you have added all the items to be linked, select **Add** below the search box.
When you have finished adding all linked items, you can see
them categorized so their relationships can be better understood visually.

### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue description, in the **Child items** section, select your task.
1. In the **Linked items** section of a task, next to each item, select the vertical
ellipsis ({{< icon name="ellipsis_v" >}}) and then select **Remove**.
Due to the bi-directional relationship, the relationship no longer appears in either item.
### Add a merge request and automatically close tasks
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440851) in GitLab 17.3.
{{< /history >}}
You can set a task to close when a merge request merges.
Prerequisites:
- You must have at least a Developer role for the project containing the merge request.
- You must have at least a Reporter role for the project containing the task.
1. Edit your merge request.
1. In the **Description** box, find and add the task.
- Use the [closing pattern](project/issues/managing_issues.md#closing-issues-automatically) that you would for adding a merge request to an issue.
- If your task is in the same project as your merge request, you can search for your task by typing <kbd>#</kbd> followed by the task's ID or title.
- If your task is in a different project, with a task open, copy the URL from the browser or
copy the task's reference by selecting the vertical ellipsis ({{< icon name="ellipsis_v" >}}) in the upper-right corner, then **Copy Reference**.
The merge requests are now visible in the main body, in the **Development** section.
You must use the exact closing pattern to add the merge request to the task. Other text will not work.
If [automatic issue closing](project/issues/managing_issues.md#disable-automatic-issue-closing) is enabled in your project settings, the task will be automatically closed when either:
- The added merge request is merged.
- A commit referencing a task with the closing pattern is committed to your project's default branch.
## Related topics
- [Create a merge request from a task](project/merge_requests/creating_merge_requests.md#from-a-task)
|
https://docs.gitlab.com/asciidoc
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/asciidoc.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
asciidoc.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
AsciiDoc
|
Use AsciiDoc files in your GitLab project, and understand AsciiDoc syntax.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab uses the [Asciidoctor](https://asciidoctor.org) gem to convert AsciiDoc content to HTML5.
Consult the [Asciidoctor User Manual](https://asciidoctor.org/docs/user-manual/) for a complete Asciidoctor reference.
You can use AsciiDoc in the following areas:
- Wiki pages
- AsciiDoc documents (`.adoc` or `.asciidoc`) inside repositories
## Paragraphs
```plaintext
A normal paragraph.
Line breaks are not preserved.
```
Line comments, which are lines that start with `//`, are skipped:
```plaintext
// this is a comment
```
A blank line separates paragraphs.
A paragraph with the `[%hardbreaks]` option preserves line breaks:
```plaintext
[%hardbreaks]
This paragraph carries the `hardbreaks` option.
Notice how line breaks are now preserved.
```
An indented (literal) paragraph disables text formatting,
preserves spaces and line breaks, and is displayed in a
fixed-width font:
```plaintext
This literal paragraph is indented with one space.
As a consequence, *text formatting*, spaces,
and lines breaks will be preserved.
```
Admonition paragraphs grab the reader's attention:
- `NOTE: This is a brief reference, read the full documentation at https://asciidoctor.org/docs/.`
- `TIP: Lists can be indented. Leading whitespace is not significant.`
## Text formatting
- Constrained (applied at word boundaries):
```plaintext
*strong importance* (aka bold)
_stress emphasis_ (aka italic)
`monospaced` (aka typewriter text)
"`double`" and '`single`' typographic quotes
+passthrough text+ (substitutions disabled)
`+literal text+` (monospaced with substitutions disabled)
```
- Unconstrained (applied anywhere):
```plaintext
**C**reate+**R**ead+**U**pdate+**D**elete
fan__freakin__tastic
``mono``culture
```
- Replacements:
```plaintext
A long time ago in a galaxy far, far away...
(C) 1976 Arty Artisan
I believe I shall--no, actually I won't.
```
- Macros:
```plaintext
// where c=specialchars, q=quotes, a=attributes, r=replacements, m=macros, p=post_replacements
The European icon:flag[role=blue] is blue & contains pass:[************] arranged in a icon:circle-o[role=yellow].
The pass:c[->] operator is often referred to as the stabby lambda.
Since `pass:[++]` has strong priority in AsciiDoc, you can rewrite pass:c,a,r[C++ => C{pp}].
// activate stem support by adding `:stem:` to the document header
stem:[sqrt(4) = 2]
```
## Links
```plaintext
https://example.org/page[A webpage]
link:../path/to/file.txt[A local file]
xref:document.adoc[A sibling document]
mailto:hello@example.org[Email to say hello!]
```
## Anchors
```plaintext
[[idname,reference text]]
// or written using normal block attributes as `[#idname,reftext=reference text]`
A paragraph (or any block) with an anchor (aka ID) and reftext.
See <<idname>> or <<idname,optional text of internal link>>.
xref:document.adoc#idname[Jumps to anchor in another document].
This paragraph has a footnote.footnote:[This is the text of the footnote.]
```
## Lists
### Unordered
```plaintext
* level 1
** level 2
*** level 3
**** level 4
***** level 5
* back at level 1
+
Attach a block or paragraph to a list item using a list continuation (which you can enclose in an open block).
.Some Authors
[circle]
- Edgar Allen Poe
- Sheri S. Tepper
- Bill Bryson
```
### Ordered
```plaintext
. Step 1
. Step 2
.. Step 2a
.. Step 2b
. Step 3
.Remember your Roman numerals?
[upperroman]
. is one
. is two
. is three
```
### Checklist
```plaintext
* [x] checked
* [ ] not checked
```
### Callout
```plaintext
// enable callout bubbles by adding `:icons: font` to the document header
[,ruby]
----
puts 'Hello, World!' # <1>
----
<1> Prints `Hello, World!` to the console.
```
### Description
```plaintext
first term:: description of first term
second term::
description of second term
```
## Headers
```plaintext
= Document Title
Author Name <author@example.org>
v1.0, 2019-01-01
```
## Sections
```plaintext
= Document Title (Level 0)
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
```
## Includes
{{< alert type="note" >}}
[Wiki pages](project/wiki/_index.md#create-a-new-wiki-page) created with the AsciiDoc
format are saved with the file extension `.asciidoc`. When working with AsciiDoc wiki
pages, change the filename from `.adoc` to `.asciidoc`.
{{< /alert >}}
```plaintext
include::basics.adoc[]
```
```plaintext
// you can also include other files from you repository
[,language]
----
include::my_code_file.language[]
----
```
To guarantee good system performance and prevent malicious documents from causing
problems, GitLab enforces a maximum limit on the number of include directives
processed in any one document. By default, a document can have up to 32 include directives, which is
inclusive of transitive dependencies. To customize the number of processed includes directives, change
the application setting `asciidoc_max_includes` with the
[application settings API](../api/settings.md#available-settings).
{{< alert type="note" >}}
The current maximum allowed value for `asciidoc_max_includes` is 64. If the value is
too high, it might cause performance issues in some situations.
{{< /alert >}}
To use includes from separate pages or external URLs, enable the `allow-uri-read`
in [application settings](../administration/wikis/_index.md#allow-uri-includes-for-asciidoc).
```plaintext
// define application setting allow-uri-read to true to allow content to be read from URI
include::https://example.org/installation.adoc[]
```
## Attributes
### User-defined
```plaintext
// define attributes in the document header
:name: value
```
```plaintext
:url-gem: https://rubygems.org/gems/asciidoctor
You can download and install Asciidoctor {asciidoctor-version} from {url-gem}.
C{pp} is not required, only Ruby.
Use a leading backslash to output a word enclosed in curly braces, like \{name}.
```
### Environment
GitLab sets the following environment attributes:
| Attribute | Description |
| :-------------- | :--------------------------------------------------------------------------------------------------------------------- |
| `docname` | Root name of the source document (no leading path or file extension). |
| `outfilesuffix` | File extension corresponding to the backend output (defaults to `.adoc` to make inter-document cross references work). |
## Blocks
```plaintext
--
open - a general-purpose content wrapper; useful for enclosing content to attach to a list item
--
```
```plaintext
// recognized types include CAUTION, IMPORTANT, NOTE, TIP, and WARNING
// enable admonition icons by setting `:icons: font` in the document header
[NOTE]
====
admonition - a notice for the reader, ranging in severity from a tip to an alert
====
```
```plaintext
====
example - a demonstration of the concept being documented
====
```
```plaintext
.Toggle Me
[%collapsible]
====
collapsible - these details are revealed by clicking the title
====
```
```plaintext
****
sidebar - auxiliary content that can be read independently of the main content
****
```
```plaintext
....
literal - an exhibit that features program output
....
```
```plaintext
----
listing - an exhibit that features program input, source code, or the contents of a file
----
```
```plaintext
[,language]
----
source - a listing that is embellished with (colorized) syntax highlighting
----
```
````plaintext
\```language
fenced code - a shorthand syntax for the source block
\```
````
```plaintext
[,attribution,citetitle]
____
quote - a quotation or excerpt; attribution with title of source are optional
____
```
```plaintext
[verse,attribution,citetitle]
____
verse - a literary excerpt, often a poem; attribution with title of source are optional
____
```
```plaintext
++++
pass - content passed directly to the output document; often raw HTML
++++
```
```plaintext
// activate stem support by adding `:stem:` to the document header
[stem]
++++
x = y^2
++++
```
```plaintext
////
comment - content which is not included in the output document
////
```
## Tables
```plaintext
.Table Attributes
[cols=>1h;2d,width=50%,frame=topbot]
|===
| Attribute Name | Values
| options
| header,footer,autowidth
| cols
| colspec[;colspec;...]
| grid
| all \| cols \| rows \| none
| frame
| all \| sides \| topbot \| none
| stripes
| all \| even \| odd \| none
| width
| (0%..100%)
| format
| psv {vbar} csv {vbar} dsv
|===
```
## Colors
It's possible to have color written in `HEX`, `RGB`, or `HSL` format rendered with a color indicator.
Supported formats (named colors are not supported):
- `HEX`: `` `#RGB[A]` `` or `` `#RRGGBB[AA]` ``
- `RGB`: `` `RGB[A](R, G, B[, A])` ``
- `HSL`: `` `HSL[A](H, S, L[, A])` ``
Color written inside backticks is followed by a color "chip":
```plaintext
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
```
## Equations and formulas
If you need to include Science, Technology, Engineering, and Math (STEM)
expressions, set the `stem` attribute in the document's header to `latexmath`.
Equations and formulas are rendered using [KaTeX](https://katex.org/):
```plaintext
:stem: latexmath
latexmath:[C = \alpha + \beta Y^{\gamma} + \epsilon]
[stem]
++++
sqrt(4) = 2
++++
A matrix can be written as stem:[[[a,b\],[c,d\]\]((n),(k))].
```
## Diagrams and flowcharts
It's possible to generate diagrams and flowcharts from text in GitLab using
[Mermaid](https://mermaidjs.github.io/) or [PlantUML](https://plantuml.com).
### Mermaid
Visit the [official page](https://mermaidjs.github.io/) for more details.
If you're new to using Mermaid or need help identifying issues in your Mermaid code,
the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) is a helpful tool
for creating and resolving issues in Mermaid diagrams.
To generate a diagram or flowchart, enter your text in a `mermaid` block:
```plaintext
[mermaid]
----
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
----
```
### Kroki
Kroki supports more than a dozen diagram libraries.
To make Kroki available in GitLab, a GitLab administrator needs to enable it first.
Read more in the [Kroki integration](../administration/integration/kroki.md) page.
After Kroki is enabled, you can create diagrams in AsciiDoc and Markdown documents.
Here's an example using a GraphViz diagram:
- AsciiDoc:
```plaintext
[graphviz]
....
digraph G {
Hello->World
}
....
```
- Markdown:
````markdown
```graphviz
digraph G {
Hello->World
}
```
````
### PlantUML
PlantUML integration is enabled on GitLab.com. To make PlantUML available in GitLab Self-Managed
installation of GitLab, a GitLab administrator [must enable it](../administration/integration/plantuml.md).
After PlantUML is enabled, enter your text in a `plantuml` block:
```plaintext
[plantuml]
----
Bob -> Alice : hello
----
```
To include PlantUML diagrams stored in separate files:
```plaintext
[plantuml, format="png", id="myDiagram", width="200px"]
----
include::diagram.puml[]
----
```
## Multimedia
```plaintext
image::screenshot.png[block image,800,450]
Press image:reload.svg[reload,16,opts=interactive] to reload the page.
video::movie.mp4[width=640,start=60,end=140,options=autoplay]
```
GitLab does not support embedding YouTube and Vimeo videos in AsciiDoc content.
Use a standard AsciiDoc link:
```plaintext
https://www.youtube.com/watch?v=BlaZ65-b7y0[Link text for the video]
```
## Breaks
```plaintext
// thematic break (aka horizontal rule)
---
```
```plaintext
// page break
<<<
```
## Table of contents
```plaintext
= Document Title (Level 0)
:toc:
:toclevels: 3
:toc-title: Contents
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
```
The `:toc-class:`, `:toc: left`, and `:toc: right` attributes are not supported.
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use AsciiDoc files in your GitLab project, and understand AsciiDoc syntax.
title: AsciiDoc
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab uses the [Asciidoctor](https://asciidoctor.org) gem to convert AsciiDoc content to HTML5.
Consult the [Asciidoctor User Manual](https://asciidoctor.org/docs/user-manual/) for a complete Asciidoctor reference.
You can use AsciiDoc in the following areas:
- Wiki pages
- AsciiDoc documents (`.adoc` or `.asciidoc`) inside repositories
## Paragraphs
```plaintext
A normal paragraph.
Line breaks are not preserved.
```
Line comments, which are lines that start with `//`, are skipped:
```plaintext
// this is a comment
```
A blank line separates paragraphs.
A paragraph with the `[%hardbreaks]` option preserves line breaks:
```plaintext
[%hardbreaks]
This paragraph carries the `hardbreaks` option.
Notice how line breaks are now preserved.
```
An indented (literal) paragraph disables text formatting,
preserves spaces and line breaks, and is displayed in a
fixed-width font:
```plaintext
This literal paragraph is indented with one space.
As a consequence, *text formatting*, spaces,
and lines breaks will be preserved.
```
Admonition paragraphs grab the reader's attention:
- `NOTE: This is a brief reference, read the full documentation at https://asciidoctor.org/docs/.`
- `TIP: Lists can be indented. Leading whitespace is not significant.`
## Text formatting
- Constrained (applied at word boundaries):
```plaintext
*strong importance* (aka bold)
_stress emphasis_ (aka italic)
`monospaced` (aka typewriter text)
"`double`" and '`single`' typographic quotes
+passthrough text+ (substitutions disabled)
`+literal text+` (monospaced with substitutions disabled)
```
- Unconstrained (applied anywhere):
```plaintext
**C**reate+**R**ead+**U**pdate+**D**elete
fan__freakin__tastic
``mono``culture
```
- Replacements:
```plaintext
A long time ago in a galaxy far, far away...
(C) 1976 Arty Artisan
I believe I shall--no, actually I won't.
```
- Macros:
```plaintext
// where c=specialchars, q=quotes, a=attributes, r=replacements, m=macros, p=post_replacements
The European icon:flag[role=blue] is blue & contains pass:[************] arranged in a icon:circle-o[role=yellow].
The pass:c[->] operator is often referred to as the stabby lambda.
Since `pass:[++]` has strong priority in AsciiDoc, you can rewrite pass:c,a,r[C++ => C{pp}].
// activate stem support by adding `:stem:` to the document header
stem:[sqrt(4) = 2]
```
## Links
```plaintext
https://example.org/page[A webpage]
link:../path/to/file.txt[A local file]
xref:document.adoc[A sibling document]
mailto:hello@example.org[Email to say hello!]
```
## Anchors
```plaintext
[[idname,reference text]]
// or written using normal block attributes as `[#idname,reftext=reference text]`
A paragraph (or any block) with an anchor (aka ID) and reftext.
See <<idname>> or <<idname,optional text of internal link>>.
xref:document.adoc#idname[Jumps to anchor in another document].
This paragraph has a footnote.footnote:[This is the text of the footnote.]
```
## Lists
### Unordered
```plaintext
* level 1
** level 2
*** level 3
**** level 4
***** level 5
* back at level 1
+
Attach a block or paragraph to a list item using a list continuation (which you can enclose in an open block).
.Some Authors
[circle]
- Edgar Allen Poe
- Sheri S. Tepper
- Bill Bryson
```
### Ordered
```plaintext
. Step 1
. Step 2
.. Step 2a
.. Step 2b
. Step 3
.Remember your Roman numerals?
[upperroman]
. is one
. is two
. is three
```
### Checklist
```plaintext
* [x] checked
* [ ] not checked
```
### Callout
```plaintext
// enable callout bubbles by adding `:icons: font` to the document header
[,ruby]
----
puts 'Hello, World!' # <1>
----
<1> Prints `Hello, World!` to the console.
```
### Description
```plaintext
first term:: description of first term
second term::
description of second term
```
## Headers
```plaintext
= Document Title
Author Name <author@example.org>
v1.0, 2019-01-01
```
## Sections
```plaintext
= Document Title (Level 0)
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
```
## Includes
{{< alert type="note" >}}
[Wiki pages](project/wiki/_index.md#create-a-new-wiki-page) created with the AsciiDoc
format are saved with the file extension `.asciidoc`. When working with AsciiDoc wiki
pages, change the filename from `.adoc` to `.asciidoc`.
{{< /alert >}}
```plaintext
include::basics.adoc[]
```
```plaintext
// you can also include other files from you repository
[,language]
----
include::my_code_file.language[]
----
```
To guarantee good system performance and prevent malicious documents from causing
problems, GitLab enforces a maximum limit on the number of include directives
processed in any one document. By default, a document can have up to 32 include directives, which is
inclusive of transitive dependencies. To customize the number of processed includes directives, change
the application setting `asciidoc_max_includes` with the
[application settings API](../api/settings.md#available-settings).
{{< alert type="note" >}}
The current maximum allowed value for `asciidoc_max_includes` is 64. If the value is
too high, it might cause performance issues in some situations.
{{< /alert >}}
To use includes from separate pages or external URLs, enable the `allow-uri-read`
in [application settings](../administration/wikis/_index.md#allow-uri-includes-for-asciidoc).
```plaintext
// define application setting allow-uri-read to true to allow content to be read from URI
include::https://example.org/installation.adoc[]
```
## Attributes
### User-defined
```plaintext
// define attributes in the document header
:name: value
```
```plaintext
:url-gem: https://rubygems.org/gems/asciidoctor
You can download and install Asciidoctor {asciidoctor-version} from {url-gem}.
C{pp} is not required, only Ruby.
Use a leading backslash to output a word enclosed in curly braces, like \{name}.
```
### Environment
GitLab sets the following environment attributes:
| Attribute | Description |
| :-------------- | :--------------------------------------------------------------------------------------------------------------------- |
| `docname` | Root name of the source document (no leading path or file extension). |
| `outfilesuffix` | File extension corresponding to the backend output (defaults to `.adoc` to make inter-document cross references work). |
## Blocks
```plaintext
--
open - a general-purpose content wrapper; useful for enclosing content to attach to a list item
--
```
```plaintext
// recognized types include CAUTION, IMPORTANT, NOTE, TIP, and WARNING
// enable admonition icons by setting `:icons: font` in the document header
[NOTE]
====
admonition - a notice for the reader, ranging in severity from a tip to an alert
====
```
```plaintext
====
example - a demonstration of the concept being documented
====
```
```plaintext
.Toggle Me
[%collapsible]
====
collapsible - these details are revealed by clicking the title
====
```
```plaintext
****
sidebar - auxiliary content that can be read independently of the main content
****
```
```plaintext
....
literal - an exhibit that features program output
....
```
```plaintext
----
listing - an exhibit that features program input, source code, or the contents of a file
----
```
```plaintext
[,language]
----
source - a listing that is embellished with (colorized) syntax highlighting
----
```
````plaintext
\```language
fenced code - a shorthand syntax for the source block
\```
````
```plaintext
[,attribution,citetitle]
____
quote - a quotation or excerpt; attribution with title of source are optional
____
```
```plaintext
[verse,attribution,citetitle]
____
verse - a literary excerpt, often a poem; attribution with title of source are optional
____
```
```plaintext
++++
pass - content passed directly to the output document; often raw HTML
++++
```
```plaintext
// activate stem support by adding `:stem:` to the document header
[stem]
++++
x = y^2
++++
```
```plaintext
////
comment - content which is not included in the output document
////
```
## Tables
```plaintext
.Table Attributes
[cols=>1h;2d,width=50%,frame=topbot]
|===
| Attribute Name | Values
| options
| header,footer,autowidth
| cols
| colspec[;colspec;...]
| grid
| all \| cols \| rows \| none
| frame
| all \| sides \| topbot \| none
| stripes
| all \| even \| odd \| none
| width
| (0%..100%)
| format
| psv {vbar} csv {vbar} dsv
|===
```
## Colors
It's possible to have color written in `HEX`, `RGB`, or `HSL` format rendered with a color indicator.
Supported formats (named colors are not supported):
- `HEX`: `` `#RGB[A]` `` or `` `#RRGGBB[AA]` ``
- `RGB`: `` `RGB[A](R, G, B[, A])` ``
- `HSL`: `` `HSL[A](H, S, L[, A])` ``
Color written inside backticks is followed by a color "chip":
```plaintext
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
```
## Equations and formulas
If you need to include Science, Technology, Engineering, and Math (STEM)
expressions, set the `stem` attribute in the document's header to `latexmath`.
Equations and formulas are rendered using [KaTeX](https://katex.org/):
```plaintext
:stem: latexmath
latexmath:[C = \alpha + \beta Y^{\gamma} + \epsilon]
[stem]
++++
sqrt(4) = 2
++++
A matrix can be written as stem:[[[a,b\],[c,d\]\]((n),(k))].
```
## Diagrams and flowcharts
It's possible to generate diagrams and flowcharts from text in GitLab using
[Mermaid](https://mermaidjs.github.io/) or [PlantUML](https://plantuml.com).
### Mermaid
Visit the [official page](https://mermaidjs.github.io/) for more details.
If you're new to using Mermaid or need help identifying issues in your Mermaid code,
the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) is a helpful tool
for creating and resolving issues in Mermaid diagrams.
To generate a diagram or flowchart, enter your text in a `mermaid` block:
```plaintext
[mermaid]
----
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
----
```
### Kroki
Kroki supports more than a dozen diagram libraries.
To make Kroki available in GitLab, a GitLab administrator needs to enable it first.
Read more in the [Kroki integration](../administration/integration/kroki.md) page.
After Kroki is enabled, you can create diagrams in AsciiDoc and Markdown documents.
Here's an example using a GraphViz diagram:
- AsciiDoc:
```plaintext
[graphviz]
....
digraph G {
Hello->World
}
....
```
- Markdown:
````markdown
```graphviz
digraph G {
Hello->World
}
```
````
### PlantUML
PlantUML integration is enabled on GitLab.com. To make PlantUML available in GitLab Self-Managed
installation of GitLab, a GitLab administrator [must enable it](../administration/integration/plantuml.md).
After PlantUML is enabled, enter your text in a `plantuml` block:
```plaintext
[plantuml]
----
Bob -> Alice : hello
----
```
To include PlantUML diagrams stored in separate files:
```plaintext
[plantuml, format="png", id="myDiagram", width="200px"]
----
include::diagram.puml[]
----
```
## Multimedia
```plaintext
image::screenshot.png[block image,800,450]
Press image:reload.svg[reload,16,opts=interactive] to reload the page.
video::movie.mp4[width=640,start=60,end=140,options=autoplay]
```
GitLab does not support embedding YouTube and Vimeo videos in AsciiDoc content.
Use a standard AsciiDoc link:
```plaintext
https://www.youtube.com/watch?v=BlaZ65-b7y0[Link text for the video]
```
## Breaks
```plaintext
// thematic break (aka horizontal rule)
---
```
```plaintext
// page break
<<<
```
## Table of contents
```plaintext
= Document Title (Level 0)
:toc:
:toclevels: 3
:toc-title: Contents
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
```
The `:toc-class:`, `:toc: left`, and `:toc: right` attributes are not supported.
|
https://docs.gitlab.com/free_user_limit
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/free_user_limit.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
free_user_limit.md
|
Fulfillment
|
Seat Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Free user limit
| null |
{{< details >}}
- Tier: Free
- Offering: GitLab.com
{{< /details >}}
You can add up to five users to newly created top-level namespaces with
private visibility on GitLab.com.
If the namespace was created before December 28, 2022, this user limit was
applied on June 13, 2023.
Top-level private namespaces with more than five users are placed in a read-only
state. These namespaces cannot write new data to any of the following:
- Repositories
- Git Large File Storage (LFS)
- Packages
- Registries.
For the full list of restricted actions, see [read-only namespaces](read_only_namespaces.md).
User limits do not apply to users in the Free tier of:
- GitLab.com, for:
- Public top-level groups
- Personal namespaces, because they are public by default
- Paid tiers
- The following [community programs](https://about.gitlab.com/community/):
- GitLab for Open Source
- GitLab for Education
- GitLab for Startups
- [GitLab Self-Managed subscriptions](../subscriptions/self_managed/_index.md)
For more information, you can [talk to an expert](https://page.gitlab.com/usage_limits_help.html).
## Determine namespace user counts
Every unique user of a top-level namespace with private visibility counts towards
the five-user limit. This includes every user of a group, subgroup, and project
within a namespace.
For example, there are two groups, `example-1` and `example-2`.
The `example-1` group has:
- One group owner, `A`.
- One subgroup called `subgroup-1` with one member, `B`.
- `subgroup-1` inherits `A` as a member from `example-1`.
- One project in `subgroup-1` called `project-1` with two members, `C` and `D`.
- `project-1` inherits `A` and `B` as members from `subgroup-1`.
The namespace `example-1` has four unique members: `A`, `B`, `C`, and `D`, so
does not exceed the five-user limit.
The `example-2` group has:
- One group owner, `A`.
- One subgroup called `subgroup-2` with one member, `B`.
- `subgroup-2` inherits `A` as a member from `example-2`.
- One project in `subgroup-2` called `project-2a` with two members, `C` and `D`.
- `project-2a` inherits `A` and `B` as members from `subgroup-2`.
- One project in `subgroup-2` called `project-2b` with two members, `E` and `F`.
- `project-2b` inherits `A` and `B` as members from `subgroup-2`.
The namespace `example-2` has six unique members: `A`, `B`, `C`, `D`, `E`, and `F`,
so it exceeds the five-user limit.
## Manage members in your group namespace
To help manage your Free user limit,
you can view and manage the total number of members across all projects and groups
in your namespace.
Prerequisites:
- You must have the Owner role for the group.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Usage quotas**.
1. To view all members, select the **Seats** tab.
On this page, you can view and manage all members in your namespace. For example,
to remove a member, select **Remove user**.
## Include a group in an organization's subscription
If you have multiple groups in your organization, they might have a
combination of paid (Premium or Ultimate tier) and Free tier subscriptions.
When a group with a Free tier subscription exceeds the user limit, their
namespace becomes [read-only](read_only_namespaces.md).
To remove user limits on groups with Free tier subscriptions, include those groups
in your organization's subscription:
1. To check if a group is included in the subscription,
[view that group's subscription details](../subscriptions/manage_subscription.md#view-subscription).
If the group has a Free tier subscription, it is not included in your organization's
subscription.
1. To include a group in your paid Premium or Ultimate tier subscription,
[transfer that group](group/manage.md#transfer-a-group) to your
organization's top-level namespace.
If the five-user limit has been applied to your group even though you have
a paid subscription in the Premium or Ultimate tier, make sure that
[your subscription is linked](../subscriptions/manage_subscription.md#link-subscription-to-a-group)
to either of the following:
- The correct top-level namespace.
- Your [Customers Portal](../subscriptions/customers_portal.md) account.
### Impact of transferred groups on subscription costs
When you transfer a group to your organization's subscription, this might
increase your seat count. This could incur additional costs for your subscription.
For example, your company has Group A and Group B:
- Group A has a paid Premium or Ultimate tier subscription and has five users.
- Group B has a Free tier subscription and has eight users, four of which are
members of Group A.
- Group B is a read-only state because it exceeds the five-user limit.
- You transfer Group B to your company's subscription to remove the read-only state.
- Your company incurs an additional cost of four seats for the
four members of Group B that are not members of Group A.
Users that are not part of the top-level namespace require additional seats to
remain active. For more information, see
[buy seats for your subscription](../subscriptions/manage_users_and_seats.md#buy-more-seats).
## Increase the five-user limit
On the Free subscription tier on GitLab.com, you cannot increase the limit of five users on
top-level groups with private visibility.
For larger teams, you should upgrade to the paid Premium or Ultimate tiers. These tiers
do not limit users and have more features to increase team productivity. For more
information, see [Upgrade your subscription tier on GitLab Self-Managed](../subscriptions/manage_subscription.md#upgrade-subscription-tier).
To try the paid tiers before deciding to upgrade, start a
[free trial](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com/ee/user/free_user_limit.html)
for GitLab Ultimate.
## Manage members in personal projects outside a group namespace
Personal projects are not located in top-level group namespaces. You can manage
the users in each of your personal projects. You can have more than five
users in your personal projects.
You should [move your personal project to a group](../tutorials/move_personal_project_to_group/_index.md)
so that you can:
- Increase the amount of users to more than five.
- Purchase a paid tier subscription, additional compute minutes, or storage.
- Use [GitLab features](https://about.gitlab.com/pricing/feature-comparison/) in the group.
- Start a [free trial](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com/ee/user/free_user_limit.html) for GitLab Ultimate.
|
---
stage: Fulfillment
group: Seat Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Free user limit
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free
- Offering: GitLab.com
{{< /details >}}
You can add up to five users to newly created top-level namespaces with
private visibility on GitLab.com.
If the namespace was created before December 28, 2022, this user limit was
applied on June 13, 2023.
Top-level private namespaces with more than five users are placed in a read-only
state. These namespaces cannot write new data to any of the following:
- Repositories
- Git Large File Storage (LFS)
- Packages
- Registries.
For the full list of restricted actions, see [read-only namespaces](read_only_namespaces.md).
User limits do not apply to users in the Free tier of:
- GitLab.com, for:
- Public top-level groups
- Personal namespaces, because they are public by default
- Paid tiers
- The following [community programs](https://about.gitlab.com/community/):
- GitLab for Open Source
- GitLab for Education
- GitLab for Startups
- [GitLab Self-Managed subscriptions](../subscriptions/self_managed/_index.md)
For more information, you can [talk to an expert](https://page.gitlab.com/usage_limits_help.html).
## Determine namespace user counts
Every unique user of a top-level namespace with private visibility counts towards
the five-user limit. This includes every user of a group, subgroup, and project
within a namespace.
For example, there are two groups, `example-1` and `example-2`.
The `example-1` group has:
- One group owner, `A`.
- One subgroup called `subgroup-1` with one member, `B`.
- `subgroup-1` inherits `A` as a member from `example-1`.
- One project in `subgroup-1` called `project-1` with two members, `C` and `D`.
- `project-1` inherits `A` and `B` as members from `subgroup-1`.
The namespace `example-1` has four unique members: `A`, `B`, `C`, and `D`, so
does not exceed the five-user limit.
The `example-2` group has:
- One group owner, `A`.
- One subgroup called `subgroup-2` with one member, `B`.
- `subgroup-2` inherits `A` as a member from `example-2`.
- One project in `subgroup-2` called `project-2a` with two members, `C` and `D`.
- `project-2a` inherits `A` and `B` as members from `subgroup-2`.
- One project in `subgroup-2` called `project-2b` with two members, `E` and `F`.
- `project-2b` inherits `A` and `B` as members from `subgroup-2`.
The namespace `example-2` has six unique members: `A`, `B`, `C`, `D`, `E`, and `F`,
so it exceeds the five-user limit.
## Manage members in your group namespace
To help manage your Free user limit,
you can view and manage the total number of members across all projects and groups
in your namespace.
Prerequisites:
- You must have the Owner role for the group.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Usage quotas**.
1. To view all members, select the **Seats** tab.
On this page, you can view and manage all members in your namespace. For example,
to remove a member, select **Remove user**.
## Include a group in an organization's subscription
If you have multiple groups in your organization, they might have a
combination of paid (Premium or Ultimate tier) and Free tier subscriptions.
When a group with a Free tier subscription exceeds the user limit, their
namespace becomes [read-only](read_only_namespaces.md).
To remove user limits on groups with Free tier subscriptions, include those groups
in your organization's subscription:
1. To check if a group is included in the subscription,
[view that group's subscription details](../subscriptions/manage_subscription.md#view-subscription).
If the group has a Free tier subscription, it is not included in your organization's
subscription.
1. To include a group in your paid Premium or Ultimate tier subscription,
[transfer that group](group/manage.md#transfer-a-group) to your
organization's top-level namespace.
If the five-user limit has been applied to your group even though you have
a paid subscription in the Premium or Ultimate tier, make sure that
[your subscription is linked](../subscriptions/manage_subscription.md#link-subscription-to-a-group)
to either of the following:
- The correct top-level namespace.
- Your [Customers Portal](../subscriptions/customers_portal.md) account.
### Impact of transferred groups on subscription costs
When you transfer a group to your organization's subscription, this might
increase your seat count. This could incur additional costs for your subscription.
For example, your company has Group A and Group B:
- Group A has a paid Premium or Ultimate tier subscription and has five users.
- Group B has a Free tier subscription and has eight users, four of which are
members of Group A.
- Group B is a read-only state because it exceeds the five-user limit.
- You transfer Group B to your company's subscription to remove the read-only state.
- Your company incurs an additional cost of four seats for the
four members of Group B that are not members of Group A.
Users that are not part of the top-level namespace require additional seats to
remain active. For more information, see
[buy seats for your subscription](../subscriptions/manage_users_and_seats.md#buy-more-seats).
## Increase the five-user limit
On the Free subscription tier on GitLab.com, you cannot increase the limit of five users on
top-level groups with private visibility.
For larger teams, you should upgrade to the paid Premium or Ultimate tiers. These tiers
do not limit users and have more features to increase team productivity. For more
information, see [Upgrade your subscription tier on GitLab Self-Managed](../subscriptions/manage_subscription.md#upgrade-subscription-tier).
To try the paid tiers before deciding to upgrade, start a
[free trial](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com/ee/user/free_user_limit.html)
for GitLab Ultimate.
## Manage members in personal projects outside a group namespace
Personal projects are not located in top-level group namespaces. You can manage
the users in each of your personal projects. You can have more than five
users in your personal projects.
You should [move your personal project to a group](../tutorials/move_personal_project_to_group/_index.md)
so that you can:
- Increase the amount of users to more than five.
- Purchase a paid tier subscription, additional compute minutes, or storage.
- Use [GitLab features](https://about.gitlab.com/pricing/feature-comparison/) in the group.
- Start a [free trial](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com/ee/user/free_user_limit.html) for GitLab Ultimate.
|
https://docs.gitlab.com/okrs
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/okrs.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
okrs.md
|
Plan
|
Product Planning
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Objectives and key results (OKR)
|
Goal setting, performance tracking, child objectives, and health status.
|
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103355) in GitLab 15.6 [with a flag](../administration/feature_flags/_index.md) named `okrs_mvc`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
[Objectives and key results](https://en.wikipedia.org/wiki/OKR) (OKRs) are a framework for setting
and tracking goals that are aligned with your organization's overall strategy and vision.
The objective and the key result in GitLab share many features. In the documentation, the term
**OKRs** refers to both objectives and key results.
OKRs are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
in GitLab.
For the roadmap of migrating [issues](project/issues/_index.md) and [epics](group/epics/_index.md)
to work items and adding custom work item types, see
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
[Plan direction page](https://about.gitlab.com/direction/plan/).
## Designing effective OKRs
Use objectives and key results to align your workforce towards common goals and track the progress.
Set a big goal with an objective and use [child objectives and key results](#child-objectives-and-key-results)
to measure the big goal's completion.
**Objectives** are aspirational goals to be achieved and define **what you're aiming to do**.
They show how an individual's, team's, or department's work impacts overall direction of the
organization by connecting their work to overall company strategy.
**Key results** are measures of progress against aligned objectives. They express
**how you know if you have reached your goal** (objective).
By achieving a specific outcome (key result), you create progress for the linked objective.
To know if your OKR makes sense, you can use this sentence:
<!-- vale gitlab_base.FutureTense = NO -->
> I/we will accomplish (objective) by (date) through attaining and achieving the following metrics (key results).
<!-- vale gitlab_base.FutureTense = YES -->
To learn how to create better OKRs and how we use them at GitLab, see the
[Objectives and Key Results handbook page](https://handbook.gitlab.com/handbook/company/okrs/).
## Create an objective
To create an objective:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the upper-right corner, next to **New issue**, select the down arrow {{< icon name="chevron-lg-down" >}} and then select **New objective**.
1. Select **New objective** again.
1. Enter the objective title.
1. Select **Create objective**.
To create a key result, [add it as a child](#add-a-child-key-result) to an existing objective.
## View an objective
To view an objective:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = objective`.
1. Select the title of an objective from the list.
## View a key result
To view a key result:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = key_result`.
1. Select the title of a key result from the list.
Alternatively, you can access a key result from the **Child items** section in
its parent's objective.
## Edit title and description
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Optional. To edit the title, select it, make your changes, and select any area outside the title
text box.
1. Optional. To edit the description, select the edit icon ({{< icon name="pencil" >}}), make your changes, and
select **Save**.
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If an OKR description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
To change whether descriptions are truncated:
1. On an objective or key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **View options**.
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Attributes are shown in a sidebar to the right of the description when space allows.
To hide the sidebar and increase space for the description:
1. On an objective or key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **View options**.
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## View OKR system notes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.7 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) to feature flag named `work_items_mvc` in GitLab 15.8. Disabled by default.
- Feature flag [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144141) from `work_items_mvc` to `work_items_beta` in GitLab 16.10.
- Changing activity sort order [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.8.
- Filtering activity [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389971) in GitLab 15.10.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.10.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
You can view all the [system notes](project/system_notes.md) related to the OKR. By default they are sorted by **Oldest first**.
You can always change the sorting order to **Newest first**, which is remembered across sessions.
## Comments and threads
You can add [comments](discussions/_index.md) and reply to threads in OKRs.
## Assign users
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To show who is responsible for an OKR, you can assign users to it.
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Assignees**, select **Add assignees**.
1. From the dropdown list, select the users to add as an assignee.
1. Select any area outside the dropdown list.
## Assign labels
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
Use [labels](project/labels.md) to organize OKRs among teams.
To add labels to an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Labels**, select **Add labels**.
1. From the dropdown list, select the labels to add.
1. Select any area outside the dropdown list.
## Add an objective to a milestone
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can add an objective to a [milestone](project/milestones/_index.md).
You can see the milestone title when you view an objective.
Prerequisites:
- You must have at least the Planner role for the project.
To add an objective to a milestone:
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
1. Next to **Milestone**, select **Add to milestone**.
If an objective already belongs to a milestone, the dropdown list shows the current milestone.
1. From the dropdown list, select the milestone to be associated with the objective.
## Set progress
{{< history >}}
- Setting progress for key results [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/382433) in GitLab 15.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Show how much of the work needed to achieve an objective is finished.
You can set progress manually on objectives and key results.
When you enter progress for a child item, progress of all parent items in the hierarchy is updated
to the average of the child items' progress.
You can override progress at any level and enter a value manually, but when a child item's progress
value is updated, the automation updates all parents again to show the average.
Prerequisites:
- You must have at least the Planner role for the project.
To set progress of an objective or key result:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = objective` or `Type = key result` and select your item.
1. Next to **Progress**, select the text box.
1. Enter a number from 0 to 100.
## Set health status
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381899) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To better track the risk in meeting your goals, you can assign a [health status](project/issues/managing_issues.md#health-status)
to each objective and key result.
You can use health status to signal to others in your organization whether OKRs are progressing
as planned or need attention to stay on schedule.
Prerequisites:
- You must have at least the Planner role for the project.
To set health status of an OKR:
1. [Open the key result](okrs.md#view-a-key-result) that you want to edit.
1. Next to **Health status**, select the dropdown list and select the desired health status.
## Promote a key result to an objective
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386877) in GitLab 16.0.
- Quick action `/promote_to` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To promote a key result:
1. [Open the key result](#view-a-key-result).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Promote to objective**.
Alternatively, use the `/promote_to objective` [quick action](project/quick_actions.md).
## Convert an OKR to another item type
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) in GitLab 17.8 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) [to the flag](../administration/feature_flags/_index.md) named `okrs_mvc`. For current flag state, see the top of this page.
{{< /history >}}
Convert an objective or key result into another item type, such as:
- Issue
- Task
- Objective
- Key result
{{< alert type="warning" >}}
Changing the type might result in data loss if the target type does not support all fields from the original type.
{{< /alert >}}
Prerequisites:
- The OKR you want to convert must not have a parent item assigned.
- The OKR you want to convert must not have any child items.
To convert an OKR into another item type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue list, find your objective or key result and select it.
1. In the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}), then select **Change type**.
1. Select the desired item type.
1. If all conditions are met, select **Change type**.
Alternatively, you can use the `/type` [quick action](project/quick_actions.md#work-items), followed
by `issue`, `task`, `objective` or `key result` in a comment.
## Copy objective or key result reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
To refer to an objective or key result elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the objective or key result reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your objective or key result to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy Reference**.
You can now paste the reference into another description or comment.
Read more about objective or key result references in [GitLab-Flavored Markdown](markdown.md#gitlab-specific-references).
## Copy objective or key result email address
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
You can create a comment in an objective or key result by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the objective's or key result's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy objective email address** or **Copy key result email address**.
## Close an OKR
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an OKR is achieved, you can close it.
The OKR is marked as closed but is not deleted.
Prerequisites:
- You must have at least the Planner role for the project.
To close an OKR:
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
1. Next to **Status**, select **Closed**.
You can reopen a closed OKR the same way.
## Child objectives and key results
In GitLab, objectives are similar to key results.
In your workflow, use key results to measure the goal described in the objective.
You can add child objectives to a total of 9 levels. An objective can have up to 100 child OKRs.
Key results are children of objectives and cannot have children items themselves.
Child objectives and key results are available in the **Child items** section
below an objective's description.
### Add a child objective
{{< history >}}
- Ability to select which project to create the objective in [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
To add a new objective to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **New objective**.
1. Enter a title for the new objective.
1. Select a [project](project/organize_work_with_projects.md) to create the new objective in.
1. Select **Create objective**.
To add an existing objective to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **Existing objective**.
1. Search for the desired objective by entering part of its title, then selecting the
desired match.
To add multiple objectives, repeat this step.
1. Select **Add objective**.
### Add a child key result
{{< history >}}
- Ability to select which project to create the key result in [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
To add a new key result to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **New key result**.
1. Enter a title for the new key result.
1. Select a [project](project/organize_work_with_projects.md) to create the new key result in.
1. Select **Create key result**.
To add an existing key result to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **Existing key result**.
1. Search for the desired OKR by entering part of its title, then selecting the
desired match.
To add multiple objectives, repeat this step.
1. Select **Add key result**.
### Reorder objective and key result children
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385887) in GitLab 16.0.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
By default, child OKRs are ordered by creation date.
To reorder them, drag them around.
### Schedule OKR check-in reminders
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422761) in GitLab 16.4 [with a flag](../administration/feature_flags/_index.md) named `okr_checkin_reminders`. Disabled by default.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
Schedule check-in reminders to remind your team to provide status updates on the key results you care
about.
Reminders are sent to all assignees of descendant objects and key results as email notifications
and to-do items.
Users can't unsubscribe from the email notifications, but check-in reminders can be turned off.
Reminders are sent on Tuesdays.
Prerequisites:
- You must have at least the Planner role for the project.
- There must be at least one objective with at least one key result in the project.
- You can schedule reminders only for top-level objectives.
Scheduling a check-in reminder for child objectives has no effect.
The setting from the top-level objective is inherited to all child objectives.
To schedule a recurring reminder for an objective, in a new comment use the `/checkin_reminder <cadence>`
[quick action](project/quick_actions.md#work-items).
The options for `<cadence>` are:
- `weekly`
- `twice-monthly`
- `monthly`
- `never` (default)
For example, to schedule a weekly check-in reminder, enter:
```plaintext
/checkin_reminder weekly
```
To turn off a check-in reminder, enter:
```plaintext
/checkin_reminder never
```
## Set an objective as a parent
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11198) in GitLab 16.6.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
- The parent objective and child OKR must belong to the same project.
To set an objective as a parent of an OKR:
1. [Open the objective](#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Parent**, from the dropdown list, select the parent to add.
1. Select any area outside the dropdown list.
To remove the parent of the objective or key result,
next to **Parent**, select the dropdown list and then select **Unassign**.
## Confidential OKRs
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8410) in GitLab 15.3.
{{< /history >}}
Confidential OKRs are OKRs visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-okrs).
You can use confidential OKRs to keep security vulnerabilities private or prevent surprises from
leaking out.
### Make an OKR confidential
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
By default, OKRs are public.
You can make an OKR confidential when you create or edit it.
#### In a new OKR
When you create a new objective, a checkbox right below the text area is available to mark the
OKR as confidential.
Select that checkbox and then select **Create objective** or **Create key result** to create the OKR.
#### In an existing OKR
Prerequisites:
- You must have at least the Planner role for the project.
- A **confidential objective** can have only confidential
[child objectives or key results](#child-objectives-and-key-results):
- To make an objective confidential: If it has any child objectives or key results, you must first
make all of them confidential or remove them.
- To make an objective non-confidential: If it has any child objectives or key results, you must
first make all of them non-confidential or remove them.
- To add child objectives or key results to a confidential objective, you must first make them
confidential.
To change the confidentiality of an existing OKR:
1. [Open the objective](#view-an-objective) or [key result](#view-a-key-result).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Turn on confidentiality** or **Turn off confidentiality**.
### Who can see confidential OKRs
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an OKR is made confidential, only users with at least the Planner role for the project have
access to the OKR.
Users with Guest or [Minimal](permissions.md#users-with-minimal-access) roles can't access
the OKR even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential OKRs, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential OKR if they are assigned to the OKR.
When a Guest user or non-member is unassigned from a confidential OKR, they can no longer view it.
Confidential OKRs are hidden in search results for users without the necessary permissions.
### Confidential OKR indicators
Confidential OKRs are visually different from regular OKRs in a few ways.
Wherever OKRs are listed, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to the OKRs that are marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-okrs),
you cannot see confidential OKRs at all.
Likewise, while inside the OKR, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the breadcrumbs.
Every change from regular to confidential and vice versa, is indicated by a
system note in the OKR's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Lock discussion
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can prevent public comments in an OKR.
When you do, only project members can add and edit comments.
Prerequisites:
- You must have at least the Planner role.
To lock an OKR:
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Lock discussion**.
A system note is added to the page details.
If an OKR is closed with a locked discussion, then you cannot reopen it until the discussion is unlocked.
## Two-column layout
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415077) in GitLab 16.2 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default. This feature is in [beta](../policy/development_stages_support.md).
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/446064) to feature flag named `work_items_beta` in GitLab 16.10. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available per group, an administrator can [enable the feature flag](../administration/feature_flags/_index.md) named `work_items_beta`.
On GitLab.com and GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
When enabled, OKRs use a two-column layout, similar to issues.
The description and threads are on the left, and attributes, such as labels
or assignees, on the right.
This feature is in [beta](../policy/development_stages_support.md).
If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/442090).

## Linked items in OKRs
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags/_index.md) named `linked_work_items`. Enabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7.
- Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked items are a bi-directional relationship and appear in a block below
the Child objectives and key results. You can link an objective, key result, or a task in the same project with each other.
The relationship only shows up in the UI if the user can see both items.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the project.
To link an item to an objective or key result:
1. In the **Linked items** section of an objective or key result,
select **Add**.
1. Select the relationship between the two items. Either:
- **Relates to**
- **Blocks**
- **Is blocked by**
1. Enter the search text of the item, URL, or its reference ID.
1. When you have added all the items to be linked, select **Add** below the search box.
When you have finished adding all linked items, you can see
them categorized so their relationships can be better understood visually.

### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the project.
In the **Linked items** section of an objective or key result,
next to each item, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and then select **Remove**.
Due to the bi-directional relationship, the relationship no longer appears in either item.
|
---
stage: Plan
group: Product Planning
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Goal setting, performance tracking, child objectives, and health status.
title: Objectives and key results (OKR)
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103355) in GitLab 15.6 [with a flag](../administration/feature_flags/_index.md) named `okrs_mvc`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
[Objectives and key results](https://en.wikipedia.org/wiki/OKR) (OKRs) are a framework for setting
and tracking goals that are aligned with your organization's overall strategy and vision.
The objective and the key result in GitLab share many features. In the documentation, the term
**OKRs** refers to both objectives and key results.
OKRs are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
in GitLab.
For the roadmap of migrating [issues](project/issues/_index.md) and [epics](group/epics/_index.md)
to work items and adding custom work item types, see
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
[Plan direction page](https://about.gitlab.com/direction/plan/).
## Designing effective OKRs
Use objectives and key results to align your workforce towards common goals and track the progress.
Set a big goal with an objective and use [child objectives and key results](#child-objectives-and-key-results)
to measure the big goal's completion.
**Objectives** are aspirational goals to be achieved and define **what you're aiming to do**.
They show how an individual's, team's, or department's work impacts overall direction of the
organization by connecting their work to overall company strategy.
**Key results** are measures of progress against aligned objectives. They express
**how you know if you have reached your goal** (objective).
By achieving a specific outcome (key result), you create progress for the linked objective.
To know if your OKR makes sense, you can use this sentence:
<!-- vale gitlab_base.FutureTense = NO -->
> I/we will accomplish (objective) by (date) through attaining and achieving the following metrics (key results).
<!-- vale gitlab_base.FutureTense = YES -->
To learn how to create better OKRs and how we use them at GitLab, see the
[Objectives and Key Results handbook page](https://handbook.gitlab.com/handbook/company/okrs/).
## Create an objective
To create an objective:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. In the upper-right corner, next to **New issue**, select the down arrow {{< icon name="chevron-lg-down" >}} and then select **New objective**.
1. Select **New objective** again.
1. Enter the objective title.
1. Select **Create objective**.
To create a key result, [add it as a child](#add-a-child-key-result) to an existing objective.
## View an objective
To view an objective:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = objective`.
1. Select the title of an objective from the list.
## View a key result
To view a key result:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = key_result`.
1. Select the title of a key result from the list.
Alternatively, you can access a key result from the **Child items** section in
its parent's objective.
## Edit title and description
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To edit an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Optional. To edit the title, select it, make your changes, and select any area outside the title
text box.
1. Optional. To edit the description, select the edit icon ({{< icon name="pencil" >}}), make your changes, and
select **Save**.
## Prevent truncating descriptions with "Read more"
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
If an OKR description is long, GitLab displays only part of it.
To see the whole description, you must select **Read more**.
This truncation makes it easier to find other elements on the page without scrolling through lengthy text.
To change whether descriptions are truncated:
1. On an objective or key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **View options**.
1. Toggle **Truncate descriptions** according to your preference.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
## Hide the right sidebar
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181184) in GitLab 17.10.
{{< /history >}}
Attributes are shown in a sidebar to the right of the description when space allows.
To hide the sidebar and increase space for the description:
1. On an objective or key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **View options**.
1. Select **Hide sidebar**.
This setting is remembered and affects all issues, tasks, epics, objectives, and key results.
To show the sidebar again:
- Repeat the previous steps and select **Show sidebar**.
## View OKR system notes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.7 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) to feature flag named `work_items_mvc` in GitLab 15.8. Disabled by default.
- Feature flag [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144141) from `work_items_mvc` to `work_items_beta` in GitLab 16.10.
- Changing activity sort order [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378949) in GitLab 15.8.
- Filtering activity [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389971) in GitLab 15.10.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/334812) in GitLab 15.10.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
You can view all the [system notes](project/system_notes.md) related to the OKR. By default they are sorted by **Oldest first**.
You can always change the sorting order to **Newest first**, which is remembered across sessions.
## Comments and threads
You can add [comments](discussions/_index.md) and reply to threads in OKRs.
## Assign users
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To show who is responsible for an OKR, you can assign users to it.
Prerequisites:
- You must have at least the Planner role for the project.
To change the assignee on an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Assignees**, select **Add assignees**.
1. From the dropdown list, select the users to add as an assignee.
1. Select any area outside the dropdown list.
## Assign labels
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
Use [labels](project/labels.md) to organize OKRs among teams.
To add labels to an OKR:
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Labels**, select **Add labels**.
1. From the dropdown list, select the labels to add.
1. Select any area outside the dropdown list.
## Add an objective to a milestone
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can add an objective to a [milestone](project/milestones/_index.md).
You can see the milestone title when you view an objective.
Prerequisites:
- You must have at least the Planner role for the project.
To add an objective to a milestone:
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
1. Next to **Milestone**, select **Add to milestone**.
If an objective already belongs to a milestone, the dropdown list shows the current milestone.
1. From the dropdown list, select the milestone to be associated with the objective.
## Set progress
{{< history >}}
- Setting progress for key results [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/382433) in GitLab 15.8.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Show how much of the work needed to achieve an objective is finished.
You can set progress manually on objectives and key results.
When you enter progress for a child item, progress of all parent items in the hierarchy is updated
to the average of the child items' progress.
You can override progress at any level and enter a value manually, but when a child item's progress
value is updated, the automation updates all parents again to show the average.
Prerequisites:
- You must have at least the Planner role for the project.
To set progress of an objective or key result:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**.
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
for `Type = objective` or `Type = key result` and select your item.
1. Next to **Progress**, select the text box.
1. Enter a number from 0 to 100.
## Set health status
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381899) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
To better track the risk in meeting your goals, you can assign a [health status](project/issues/managing_issues.md#health-status)
to each objective and key result.
You can use health status to signal to others in your organization whether OKRs are progressing
as planned or need attention to stay on schedule.
Prerequisites:
- You must have at least the Planner role for the project.
To set health status of an OKR:
1. [Open the key result](okrs.md#view-a-key-result) that you want to edit.
1. Next to **Health status**, select the dropdown list and select the desired health status.
## Promote a key result to an objective
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386877) in GitLab 16.0.
- Quick action `/promote_to` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
To promote a key result:
1. [Open the key result](#view-a-key-result).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Promote to objective**.
Alternatively, use the `/promote_to objective` [quick action](project/quick_actions.md).
## Convert an OKR to another item type
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) in GitLab 17.8 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/385131) [to the flag](../administration/feature_flags/_index.md) named `okrs_mvc`. For current flag state, see the top of this page.
{{< /history >}}
Convert an objective or key result into another item type, such as:
- Issue
- Task
- Objective
- Key result
{{< alert type="warning" >}}
Changing the type might result in data loss if the target type does not support all fields from the original type.
{{< /alert >}}
Prerequisites:
- The OKR you want to convert must not have a parent item assigned.
- The OKR you want to convert must not have any child items.
To convert an OKR into another item type:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the issue list, find your objective or key result and select it.
1. In the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}), then select **Change type**.
1. Select the desired item type.
1. If all conditions are met, select **Change type**.
Alternatively, you can use the `/type` [quick action](project/quick_actions.md#work-items), followed
by `issue`, `task`, `objective` or `key result` in a comment.
## Copy objective or key result reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
To refer to an objective or key result elsewhere in GitLab, you can use its full URL or a short reference, which looks like
`namespace/project-name#123`, where `namespace` is either a group or a username.
To copy the objective or key result reference to your clipboard:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your objective or key result to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy Reference**.
You can now paste the reference into another description or comment.
Read more about objective or key result references in [GitLab-Flavored Markdown](markdown.md#gitlab-specific-references).
## Copy objective or key result email address
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/396553) in GitLab 16.1.
{{< /history >}}
You can create a comment in an objective or key result by sending an email.
Sending an email to this address creates a comment that contains the email body.
For more information about creating comments by sending an email and the necessary configuration, see
[Reply to a comment by sending email](discussions/_index.md#reply-to-a-comment-by-sending-email).
To copy the objective's or key result's email address:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues**, then select your issue to view it.
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then select **Copy objective email address** or **Copy key result email address**.
## Close an OKR
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an OKR is achieved, you can close it.
The OKR is marked as closed but is not deleted.
Prerequisites:
- You must have at least the Planner role for the project.
To close an OKR:
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
1. Next to **Status**, select **Closed**.
You can reopen a closed OKR the same way.
## Child objectives and key results
In GitLab, objectives are similar to key results.
In your workflow, use key results to measure the goal described in the objective.
You can add child objectives to a total of 9 levels. An objective can have up to 100 child OKRs.
Key results are children of objectives and cannot have children items themselves.
Child objectives and key results are available in the **Child items** section
below an objective's description.
### Add a child objective
{{< history >}}
- Ability to select which project to create the objective in [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
To add a new objective to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **New objective**.
1. Enter a title for the new objective.
1. Select a [project](project/organize_work_with_projects.md) to create the new objective in.
1. Select **Create objective**.
To add an existing objective to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **Existing objective**.
1. Search for the desired objective by entering part of its title, then selecting the
desired match.
To add multiple objectives, repeat this step.
1. Select **Add objective**.
### Add a child key result
{{< history >}}
- Ability to select which project to create the key result in [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436255) in GitLab 17.1.
{{< /history >}}
Prerequisites:
- You must have at least the Guest role for the project.
To add a new key result to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **New key result**.
1. Enter a title for the new key result.
1. Select a [project](project/organize_work_with_projects.md) to create the new key result in.
1. Select **Create key result**.
To add an existing key result to an objective:
1. In an objective, in the **Child items** section, select **Add** and then
select **Existing key result**.
1. Search for the desired OKR by entering part of its title, then selecting the
desired match.
To add multiple objectives, repeat this step.
1. Select **Add key result**.
### Reorder objective and key result children
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385887) in GitLab 16.0.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
By default, child OKRs are ordered by creation date.
To reorder them, drag them around.
### Schedule OKR check-in reminders
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422761) in GitLab 16.4 [with a flag](../administration/feature_flags/_index.md) named `okr_checkin_reminders`. Disabled by default.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
Schedule check-in reminders to remind your team to provide status updates on the key results you care
about.
Reminders are sent to all assignees of descendant objects and key results as email notifications
and to-do items.
Users can't unsubscribe from the email notifications, but check-in reminders can be turned off.
Reminders are sent on Tuesdays.
Prerequisites:
- You must have at least the Planner role for the project.
- There must be at least one objective with at least one key result in the project.
- You can schedule reminders only for top-level objectives.
Scheduling a check-in reminder for child objectives has no effect.
The setting from the top-level objective is inherited to all child objectives.
To schedule a recurring reminder for an objective, in a new comment use the `/checkin_reminder <cadence>`
[quick action](project/quick_actions.md#work-items).
The options for `<cadence>` are:
- `weekly`
- `twice-monthly`
- `monthly`
- `never` (default)
For example, to schedule a weekly check-in reminder, enter:
```plaintext
/checkin_reminder weekly
```
To turn off a check-in reminder, enter:
```plaintext
/checkin_reminder never
```
## Set an objective as a parent
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11198) in GitLab 16.6.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project.
- The parent objective and child OKR must belong to the same project.
To set an objective as a parent of an OKR:
1. [Open the objective](#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
1. Next to **Parent**, from the dropdown list, select the parent to add.
1. Select any area outside the dropdown list.
To remove the parent of the objective or key result,
next to **Parent**, select the dropdown list and then select **Unassign**.
## Confidential OKRs
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8410) in GitLab 15.3.
{{< /history >}}
Confidential OKRs are OKRs visible only to members of a project with
[sufficient permissions](#who-can-see-confidential-okrs).
You can use confidential OKRs to keep security vulnerabilities private or prevent surprises from
leaking out.
### Make an OKR confidential
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
By default, OKRs are public.
You can make an OKR confidential when you create or edit it.
#### In a new OKR
When you create a new objective, a checkbox right below the text area is available to mark the
OKR as confidential.
Select that checkbox and then select **Create objective** or **Create key result** to create the OKR.
#### In an existing OKR
Prerequisites:
- You must have at least the Planner role for the project.
- A **confidential objective** can have only confidential
[child objectives or key results](#child-objectives-and-key-results):
- To make an objective confidential: If it has any child objectives or key results, you must first
make all of them confidential or remove them.
- To make an objective non-confidential: If it has any child objectives or key results, you must
first make all of them non-confidential or remove them.
- To add child objectives or key results to a confidential objective, you must first make them
confidential.
To change the confidentiality of an existing OKR:
1. [Open the objective](#view-an-objective) or [key result](#view-a-key-result).
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Turn on confidentiality** or **Turn off confidentiality**.
### Who can see confidential OKRs
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
When an OKR is made confidential, only users with at least the Planner role for the project have
access to the OKR.
Users with Guest or [Minimal](permissions.md#users-with-minimal-access) roles can't access
the OKR even if they were actively participating before the change.
However, a user with the **Guest role** can create confidential OKRs, but can only view the ones
that they created themselves.
Users with the Guest role or non-members can read the confidential OKR if they are assigned to the OKR.
When a Guest user or non-member is unassigned from a confidential OKR, they can no longer view it.
Confidential OKRs are hidden in search results for users without the necessary permissions.
### Confidential OKR indicators
Confidential OKRs are visually different from regular OKRs in a few ways.
Wherever OKRs are listed, you can see the confidential ({{< icon name="eye-slash" >}}) icon
next to the OKRs that are marked as confidential.
If you don't have [enough permissions](#who-can-see-confidential-okrs),
you cannot see confidential OKRs at all.
Likewise, while inside the OKR, you can see the confidential ({{< icon name="eye-slash" >}}) icon right next to
the breadcrumbs.
Every change from regular to confidential and vice versa, is indicated by a
system note in the OKR's comments, for example:
- {{< icon name="eye-slash" >}} Jo Garcia made the issue confidential 5 minutes ago
- {{< icon name="eye" >}} Jo Garcia made the issue visible to everyone just now
## Lock discussion
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags/_index.md) named `work_items_beta`. Disabled by default.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) the minimum user role from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can prevent public comments in an OKR.
When you do, only project members can add and edit comments.
Prerequisites:
- You must have at least the Planner role.
To lock an OKR:
1. In the upper-right corner, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}).
1. Select **Lock discussion**.
A system note is added to the page details.
If an OKR is closed with a locked discussion, then you cannot reopen it until the discussion is unlocked.
## Two-column layout
{{< details >}}
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415077) in GitLab 16.2 [with a flag](../administration/feature_flags/_index.md) named `work_items_mvc_2`. Disabled by default. This feature is in [beta](../policy/development_stages_support.md).
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/446064) to feature flag named `work_items_beta` in GitLab 16.10. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available per group, an administrator can [enable the feature flag](../administration/feature_flags/_index.md) named `work_items_beta`.
On GitLab.com and GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
When enabled, OKRs use a two-column layout, similar to issues.
The description and threads are on the left, and attributes, such as labels
or assignees, on the right.
This feature is in [beta](../policy/development_stages_support.md).
If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/442090).

## Linked items in OKRs
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags/_index.md) named `linked_work_items`. Enabled by default.
- [Enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7.
- Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/10267) minimum required role from Reporter (if true) to Guest in GitLab 17.0.
{{< /history >}}
Linked items are a bi-directional relationship and appear in a block below
the Child objectives and key results. You can link an objective, key result, or a task in the same project with each other.
The relationship only shows up in the UI if the user can see both items.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the project.
To link an item to an objective or key result:
1. In the **Linked items** section of an objective or key result,
select **Add**.
1. Select the relationship between the two items. Either:
- **Relates to**
- **Blocks**
- **Is blocked by**
1. Enter the search text of the item, URL, or its reference ID.
1. When you have added all the items to be linked, select **Add** below the search box.
When you have finished adding all linked items, you can see
them categorized so their relationships can be better understood visually.

### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the project.
In the **Linked items** section of an objective or key result,
next to each item, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) and then select **Remove**.
Due to the bi-directional relationship, the relationship no longer appears in either item.
|
https://docs.gitlab.com/report_abuse
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/report_abuse.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
report_abuse.md
|
Software Supply Chain Security
|
Authorization
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Report abuse
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can report abuse from other GitLab users to GitLab administrators.
A GitLab administrator [can then choose](../administration/review_abuse_reports.md) to:
- Remove the user, which deletes them from the instance.
- Block the user, which denies them access to the instance.
- Or remove the report, which retains the user's access to the instance.
You can report a user through their:
- [Profile](#report-abuse-from-the-users-profile-page)
- [Comments](#report-abuse-from-a-users-comment)
- [Issues](#report-abuse-from-an-issue)
- [Tasks](#report-abuse-from-a-task)
- [Objective](#report-abuse-from-an-objective)
- [Key result](#report-abuse-from-a-key-result)
- [Merge requests](#report-abuse-from-a-merge-request)
- [Snippets](snippets.md#mark-snippet-as-spam)
## Report abuse from the user's profile page
{{< history >}}
- Report abuse from overflow menu [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.4 [with a flag](../administration/feature_flags/_index.md) named `user_profile_overflow_menu_vue`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.4.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.6. Feature flag `user_profile_overflow_menu_vue` removed.
{{< /history >}}
To report abuse from a user's profile page:
1. Anywhere in GitLab, select the name of the user.
1. In the upper-right corner of the user's profile select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a user's comment
{{< history >}}
- Reporting abuse from comments in epics [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389992) in GitLab 15.10.
{{< /history >}}
To report abuse from a user's comment:
1. In the comment, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
{{< alert type="note" >}}
A URL to the reported user's comment is pre-filled in the abuse report's
**Message** field.
{{< /alert >}}
## Report abuse from an issue
1. On the issue, in the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from an objective
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the objective, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a key result
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a merge request
1. On the merge request, in the upper-right corner, select **Merge request actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting this user.
1. Complete an abuse report.
1. Select **Send report**.
## Related topics
- [Abuse reports administration documentation](../administration/review_abuse_reports.md)
|
---
stage: Software Supply Chain Security
group: Authorization
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Report abuse
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can report abuse from other GitLab users to GitLab administrators.
A GitLab administrator [can then choose](../administration/review_abuse_reports.md) to:
- Remove the user, which deletes them from the instance.
- Block the user, which denies them access to the instance.
- Or remove the report, which retains the user's access to the instance.
You can report a user through their:
- [Profile](#report-abuse-from-the-users-profile-page)
- [Comments](#report-abuse-from-a-users-comment)
- [Issues](#report-abuse-from-an-issue)
- [Tasks](#report-abuse-from-a-task)
- [Objective](#report-abuse-from-an-objective)
- [Key result](#report-abuse-from-a-key-result)
- [Merge requests](#report-abuse-from-a-merge-request)
- [Snippets](snippets.md#mark-snippet-as-spam)
## Report abuse from the user's profile page
{{< history >}}
- Report abuse from overflow menu [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.4 [with a flag](../administration/feature_flags/_index.md) named `user_profile_overflow_menu_vue`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.4.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/414773) in GitLab 16.6. Feature flag `user_profile_overflow_menu_vue` removed.
{{< /history >}}
To report abuse from a user's profile page:
1. Anywhere in GitLab, select the name of the user.
1. In the upper-right corner of the user's profile select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), then **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a user's comment
{{< history >}}
- Reporting abuse from comments in epics [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/389992) in GitLab 15.10.
{{< /history >}}
To report abuse from a user's comment:
1. In the comment, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
{{< alert type="note" >}}
A URL to the reported user's comment is pre-filled in the abuse report's
**Message** field.
{{< /alert >}}
## Report abuse from an issue
1. On the issue, in the upper-right corner, select **Issue actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a task
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the task, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from an objective
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the objective, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a key result
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/461848) in GitLab 17.3.
{{< /history >}}
1. On the key result, in the upper-right corner, select **More actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting the user.
1. Complete an abuse report.
1. Select **Send report**.
## Report abuse from a merge request
1. On the merge request, in the upper-right corner, select **Merge request actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Report abuse**.
1. Select a reason for reporting this user.
1. Complete an abuse report.
1. Select **Send report**.
## Related topics
- [Abuse reports administration documentation](../administration/review_abuse_reports.md)
|
https://docs.gitlab.com/storage_usage_quotas
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/storage_usage_quotas.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
storage_usage_quotas.md
|
Fulfillment
|
Utilization
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Storage
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
## Free limit
{{< details >}}
- Tier: Free
{{< /details >}}
Each project in a Free tier namespace on GitLab.com has 10 GiB of free storage for its Git repository and Large File Storage (LFS).
When a project's repository and LFS exceed 10 GiB, the project is set to a read-only state.
You cannot push changes to a read-only project.
To increase storage of the project's repository and LFS to more than 10 GiB,
you must purchase more storage.
Only the project's repository and LFS are included in the storage limit.
The container registry, package registry, and build artifacts are not included in the limit.
## View storage
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can view the following statistics for storage usage in projects and namespaces:
- Storage usage that exceeds the GitLab.com storage limit or [GitLab Self-Managed storage limits](../administration/settings/account_and_limit_settings.md#repository-size-limit).
- Available purchased storage for GitLab.com.
Prerequisites:
- To view storage usage for a project, you must have at least the Maintainer role for the project or Owner role for the namespace.
- To view storage usage for a group namespace, you must have the Owner role for the namespace.
To view storage:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab to see namespace storage usage.
1. To view storage usage for a project, in the table at the bottom, select a project. Storage usage is updated every 90 minutes.
If your namespace shows `'Not applicable.'`, push a commit to any project in the
namespace to recalculate the storage.
Storage and network usage is calculated with the binary measurement system (1024 unit multiples).
Storage usage is displayed in kibibytes (KiB), mebibytes (MiB),
or gibibytes (GiB). 1 KiB is 2<sup>10</sup> bytes (1024 bytes),
1 MiB is 2<sup>20</sup> bytes (1024 kibibytes), and 1 GiB is 2<sup>30</sup> bytes (1024 mebibytes).
## View project fork storage usage
A cost factor is applied to the storage consumed by project forks so that forks consume less namespace storage than their actual size. The cost factors for forks storage reduction applies only to namespace storage. It does not apply to project repository storage limits.
To view the amount of namespace storage the fork has used:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab. The **Total** column displays the amount of namespace storage used by the fork as a portion of the actual size of the fork on disk.
The cost factor applies to the project repository, LFS objects, job artifacts, packages, snippets, and the wiki.
The cost factor does not apply to private forks in namespaces on the Free plan.
## Excess storage usage
{{< details >}}
- Tier: Free
{{< /details >}}
Excess storage usage is the amount that exceeds the 10 GiB free storage of a project's repository and LFS. If no purchased storage is available,
the project is set to a read-only state. You cannot push changes to a read-only project.
To remove the read-only state, you must purchase more storage for the namespace.
After the purchase has completed, the read-only state is removed and projects are automatically
restored. The amount of available purchased storage must always
be greater than zero.
The **Storage** tab of the **Usage quotas** page displays the following:
- Purchased storage available is running low.
- Projects that are at risk of becoming read-only if purchased storage available is zero.
- Projects that are read-only because purchased storage available is zero. Read-only projects are
marked with an information icon ({{< icon name="information-o" >}}) beside their name.
The total storage includes the free and excess storage purchased.
The remaining excess storage is expressed as a percentage and calculated as:
100 % - ((excess storage used - excess storage purchased) × 100).
### Excess storage example
The following example describes an excess storage scenario for projects in a namespace:
| Repository | Storage used | Excess storage | Quota | Status |
|------------|--------------|----------------|--------|----------------------|
| Red | 10 GiB | 0 GiB | 10 GiB | Read-only {{< icon name="lock" >}} |
| Blue | 8 GiB | 0 GiB | 10 GiB | Not read-only |
| Green | 10 GiB | 0 GiB | 10 GiB | Read-only {{< icon name="lock" >}} |
| Yellow | 2 GiB | 0 GiB | 10 GiB | Not read-only |
| **Totals** | **30 GiB** | **0 GiB** | - | - |
The Red and Green projects are read-only because their repositories and LFS have reached the quota. In this
example, no additional storage has yet been purchased.
To remove the read-only state from the Red and Green projects, 50 GiB additional storage is purchased.
If some projects' repositories and LFS grow past the 10 GiB quota, the available purchased storage decreases.
| Repository | Storage used | Excess storage | Quota | Status |
|------------|--------------|----------------|---------|-------------------|
| Red | 15 GiB | 5 GiB | 10 GiB | Not read-only |
| Blue | 14 GiB | 4 GiB | 10 GiB | Not read-only |
| Green | 11 GiB | 1 GiB | 10 GiB | Not read-only |
| Yellow | 5 GiB | 0 GiB | 10 GiB | Not read-only |
| **Totals** | **45 GiB** | **10 GiB** | - | - |
In this example:
- Available purchased storage is 40 GiB: 50 GiB (purchased storage) - 10 GiB (total excess storage used). Consequently, the projects are no longer read-only.
- Excess storage usage is 20%: 10 GiB / 50 GiB × 100.
- Remaining purchased storage is 80%.
## Manage storage usage
To manage your storage, if you are a namespace Owner of a Free GitLab.com namespace,
you can purchase more storage for the namespace.
In the Premium and Ultimate tier, depending on your role, you can also
[reduce repository size](project/repository/repository_size.md#methods-to-reduce-repository-size).
To automate storage usage analysis and management, see [storage management automation](storage_management_automation.md).
In addition to managing your storage usage you can consider these options for increased consumables:
- If you are eligible, apply for a [community program subscription](../subscriptions/community_programs.md):
- GitLab for Education
- GitLab for Open Source
- GitLab for Startups
- Consider a [GitLab Self-Managed subscription](../subscriptions/self_managed/_index.md), which does not have storage limits.
- [Talk to an expert](https://page.gitlab.com/usage_limits_help.html) for more information about your options.
## Purchase more storage
{{< details >}}
- Tier: Free
{{< /details >}}
{{< alert type="note" >}}
To exceed the free tier 10 GiB limit on your Free GitLab.com namespace, you can purchase more storage for your personal or group namespace.
{{< /alert >}}
Prerequisites:
- You must have the Owner role.
{{< alert type="note" >}}
Storage subscriptions **renew automatically each year**.
You can [disable automatic subscription renewal](../subscriptions/manage_subscription.md#turn-on-or-turn-off-automatic-subscription-renewal).
{{< /alert >}}
### For your personal namespace
1. Sign in to GitLab.com.
1. From either your personal homepage or the group's page, go to **Settings > Usage quotas**.
1. Select the **Storage** tab.
1. For each read-only project, total by how much its **Usage** exceeds the free quota and purchased
storage. You must purchase the storage increment that exceeds this total.
1. Select **Buy storage**. You are taken to the Customers Portal.
1. In the **Subscription details** section, select the name of the user from the dropdown list.
1. Enter the desired quantity of storage packs.
1. In the **Customer information** section, verify your address.
1. In the **Billing information** section, select the payment method from the dropdown list.
1. Select the **Privacy Statement** and **Terms of Service** checkboxes.
1. Select **Buy storage**.
The **Purchased storage available** total is incremented by the amount purchased. The read-only
state for all projects is removed, and their excess usage is deducted from the additional storage.
### For your group namespace
If you're using GitLab.com, you can purchase additional storage so your
pipelines aren't blocked after you have used all your storage from your
main quota. You can find pricing for additional storage on the
[GitLab Pricing page](https://about.gitlab.com/pricing/#storage).
To purchase additional storage for your group on GitLab.com:
1. Sign in to GitLab.com.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab.
1. Select **Buy storage**. You are taken to the Customers Portal.
1. In the **Subscription details** section, enter the desired quantity of storage packs.
1. In the **Customer information** section, verify your address.
1. In the **Billing information** section, select a payment method from the dropdown list.
1. Select the **Privacy Statement** and **Terms of Service** checkboxes.
1. Select **Buy storage**.
After your payment is processed, the extra storage is available for your group namespace.
To confirm the available storage, follow the first three steps listed previously.
The **Purchased storage available** total is incremented by the amount purchased. All locked
projects are unlocked and their excess usage is deducted from the additional storage.
## Fixed project limit
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
When a project's repository and LFS exceeds 500 GiB, the project is placed in a read-only state.
In this case, the owners of the group and top-level namespace receive in-app and email notifications warning them to manage their storage usage.
You can work with your account and support teams to manage your usage.
The 500 GiB fixed project limit is in place to ensure overall platform stability.
## Expired storage
Expired storage can exist on a subscription when storage is mistakenly not de-provisioned at the end of your subscription period.
If you experience an unexpected drop in purchased storage, expired storage could have been removed from your account.
For more information and solutions, contact support.
|
---
stage: Fulfillment
group: Utilization
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Storage
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
## Free limit
{{< details >}}
- Tier: Free
{{< /details >}}
Each project in a Free tier namespace on GitLab.com has 10 GiB of free storage for its Git repository and Large File Storage (LFS).
When a project's repository and LFS exceed 10 GiB, the project is set to a read-only state.
You cannot push changes to a read-only project.
To increase storage of the project's repository and LFS to more than 10 GiB,
you must purchase more storage.
Only the project's repository and LFS are included in the storage limit.
The container registry, package registry, and build artifacts are not included in the limit.
## View storage
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can view the following statistics for storage usage in projects and namespaces:
- Storage usage that exceeds the GitLab.com storage limit or [GitLab Self-Managed storage limits](../administration/settings/account_and_limit_settings.md#repository-size-limit).
- Available purchased storage for GitLab.com.
Prerequisites:
- To view storage usage for a project, you must have at least the Maintainer role for the project or Owner role for the namespace.
- To view storage usage for a group namespace, you must have the Owner role for the namespace.
To view storage:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab to see namespace storage usage.
1. To view storage usage for a project, in the table at the bottom, select a project. Storage usage is updated every 90 minutes.
If your namespace shows `'Not applicable.'`, push a commit to any project in the
namespace to recalculate the storage.
Storage and network usage is calculated with the binary measurement system (1024 unit multiples).
Storage usage is displayed in kibibytes (KiB), mebibytes (MiB),
or gibibytes (GiB). 1 KiB is 2<sup>10</sup> bytes (1024 bytes),
1 MiB is 2<sup>20</sup> bytes (1024 kibibytes), and 1 GiB is 2<sup>30</sup> bytes (1024 mebibytes).
## View project fork storage usage
A cost factor is applied to the storage consumed by project forks so that forks consume less namespace storage than their actual size. The cost factors for forks storage reduction applies only to namespace storage. It does not apply to project repository storage limits.
To view the amount of namespace storage the fork has used:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab. The **Total** column displays the amount of namespace storage used by the fork as a portion of the actual size of the fork on disk.
The cost factor applies to the project repository, LFS objects, job artifacts, packages, snippets, and the wiki.
The cost factor does not apply to private forks in namespaces on the Free plan.
## Excess storage usage
{{< details >}}
- Tier: Free
{{< /details >}}
Excess storage usage is the amount that exceeds the 10 GiB free storage of a project's repository and LFS. If no purchased storage is available,
the project is set to a read-only state. You cannot push changes to a read-only project.
To remove the read-only state, you must purchase more storage for the namespace.
After the purchase has completed, the read-only state is removed and projects are automatically
restored. The amount of available purchased storage must always
be greater than zero.
The **Storage** tab of the **Usage quotas** page displays the following:
- Purchased storage available is running low.
- Projects that are at risk of becoming read-only if purchased storage available is zero.
- Projects that are read-only because purchased storage available is zero. Read-only projects are
marked with an information icon ({{< icon name="information-o" >}}) beside their name.
The total storage includes the free and excess storage purchased.
The remaining excess storage is expressed as a percentage and calculated as:
100 % - ((excess storage used - excess storage purchased) × 100).
### Excess storage example
The following example describes an excess storage scenario for projects in a namespace:
| Repository | Storage used | Excess storage | Quota | Status |
|------------|--------------|----------------|--------|----------------------|
| Red | 10 GiB | 0 GiB | 10 GiB | Read-only {{< icon name="lock" >}} |
| Blue | 8 GiB | 0 GiB | 10 GiB | Not read-only |
| Green | 10 GiB | 0 GiB | 10 GiB | Read-only {{< icon name="lock" >}} |
| Yellow | 2 GiB | 0 GiB | 10 GiB | Not read-only |
| **Totals** | **30 GiB** | **0 GiB** | - | - |
The Red and Green projects are read-only because their repositories and LFS have reached the quota. In this
example, no additional storage has yet been purchased.
To remove the read-only state from the Red and Green projects, 50 GiB additional storage is purchased.
If some projects' repositories and LFS grow past the 10 GiB quota, the available purchased storage decreases.
| Repository | Storage used | Excess storage | Quota | Status |
|------------|--------------|----------------|---------|-------------------|
| Red | 15 GiB | 5 GiB | 10 GiB | Not read-only |
| Blue | 14 GiB | 4 GiB | 10 GiB | Not read-only |
| Green | 11 GiB | 1 GiB | 10 GiB | Not read-only |
| Yellow | 5 GiB | 0 GiB | 10 GiB | Not read-only |
| **Totals** | **45 GiB** | **10 GiB** | - | - |
In this example:
- Available purchased storage is 40 GiB: 50 GiB (purchased storage) - 10 GiB (total excess storage used). Consequently, the projects are no longer read-only.
- Excess storage usage is 20%: 10 GiB / 50 GiB × 100.
- Remaining purchased storage is 80%.
## Manage storage usage
To manage your storage, if you are a namespace Owner of a Free GitLab.com namespace,
you can purchase more storage for the namespace.
In the Premium and Ultimate tier, depending on your role, you can also
[reduce repository size](project/repository/repository_size.md#methods-to-reduce-repository-size).
To automate storage usage analysis and management, see [storage management automation](storage_management_automation.md).
In addition to managing your storage usage you can consider these options for increased consumables:
- If you are eligible, apply for a [community program subscription](../subscriptions/community_programs.md):
- GitLab for Education
- GitLab for Open Source
- GitLab for Startups
- Consider a [GitLab Self-Managed subscription](../subscriptions/self_managed/_index.md), which does not have storage limits.
- [Talk to an expert](https://page.gitlab.com/usage_limits_help.html) for more information about your options.
## Purchase more storage
{{< details >}}
- Tier: Free
{{< /details >}}
{{< alert type="note" >}}
To exceed the free tier 10 GiB limit on your Free GitLab.com namespace, you can purchase more storage for your personal or group namespace.
{{< /alert >}}
Prerequisites:
- You must have the Owner role.
{{< alert type="note" >}}
Storage subscriptions **renew automatically each year**.
You can [disable automatic subscription renewal](../subscriptions/manage_subscription.md#turn-on-or-turn-off-automatic-subscription-renewal).
{{< /alert >}}
### For your personal namespace
1. Sign in to GitLab.com.
1. From either your personal homepage or the group's page, go to **Settings > Usage quotas**.
1. Select the **Storage** tab.
1. For each read-only project, total by how much its **Usage** exceeds the free quota and purchased
storage. You must purchase the storage increment that exceeds this total.
1. Select **Buy storage**. You are taken to the Customers Portal.
1. In the **Subscription details** section, select the name of the user from the dropdown list.
1. Enter the desired quantity of storage packs.
1. In the **Customer information** section, verify your address.
1. In the **Billing information** section, select the payment method from the dropdown list.
1. Select the **Privacy Statement** and **Terms of Service** checkboxes.
1. Select **Buy storage**.
The **Purchased storage available** total is incremented by the amount purchased. The read-only
state for all projects is removed, and their excess usage is deducted from the additional storage.
### For your group namespace
If you're using GitLab.com, you can purchase additional storage so your
pipelines aren't blocked after you have used all your storage from your
main quota. You can find pricing for additional storage on the
[GitLab Pricing page](https://about.gitlab.com/pricing/#storage).
To purchase additional storage for your group on GitLab.com:
1. Sign in to GitLab.com.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Usage quotas**.
1. Select the **Storage** tab.
1. Select **Buy storage**. You are taken to the Customers Portal.
1. In the **Subscription details** section, enter the desired quantity of storage packs.
1. In the **Customer information** section, verify your address.
1. In the **Billing information** section, select a payment method from the dropdown list.
1. Select the **Privacy Statement** and **Terms of Service** checkboxes.
1. Select **Buy storage**.
After your payment is processed, the extra storage is available for your group namespace.
To confirm the available storage, follow the first three steps listed previously.
The **Purchased storage available** total is incremented by the amount purchased. All locked
projects are unlocked and their excess usage is deducted from the additional storage.
## Fixed project limit
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
When a project's repository and LFS exceeds 500 GiB, the project is placed in a read-only state.
In this case, the owners of the group and top-level namespace receive in-app and email notifications warning them to manage their storage usage.
You can work with your account and support teams to manage your usage.
The 500 GiB fixed project limit is in place to ensure overall platform stability.
## Expired storage
Expired storage can exist on a subscription when storage is mistakenly not de-provisioned at the end of your subscription period.
If you experience an unexpected drop in purchased storage, expired storage could have been removed from your account.
For more information and solutions, contact support.
|
https://docs.gitlab.com/read_only_namespaces
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/read_only_namespaces.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
read_only_namespaces.md
|
Growth
|
Acquisition
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Read-only namespaces and projects
| null |
## Read-only namespaces
{{< details >}}
- Tier: Free
- Offering: GitLab.com
{{< /details >}}
A namespace is placed in a read-only state when it exceeds the [free user limit](free_user_limit.md), and when the namespace visibility is private.
To remove the read-only state of a namespace and its projects, you can:
- [Reduce the number of members](free_user_limit.md#manage-members-in-your-group-namespace) in your namespace.
- [Start a free trial](https://gitlab.com/-/trial_registrations/new), which includes an unlimited number of members.
- [Purchase a paid tier](https://about.gitlab.com/pricing/).
### Restricted actions
When a namespace is in a read-only state, you cannot execute the actions listed in the following table.
If you try to execute a restricted action, you might get a `404` error.
| Feature | Action restricted |
|---------|-------------------|
| Container registry | Create, edit, and delete cleanup policies. <br> Push an image to the container registry. |
| Merge requests | Create and update a merge request. |
| Package registry | Publish a package. |
| CI/CD | Create, edit, administer, and run pipelines. <br> Create, edit, administer, and run builds. <br> Create and edit admin environments. <br> Create and edit admin deployments. <br> Create and edit admin clusters. <br> Create and edit admin releases. |
| Namespaces | **For exceeded free user limits**: Invite new users. |
## Read-only projects
{{< details >}}
- Tier: Free, Premium, Ultimate
{{< /details >}}
A project is placed in a read-only state when it exceeds the allocated storage limit on the:
- Free tier, when any project in the namespace is over the [free limit](storage_usage_quotas.md#free-limit).
- Premium and Ultimate tiers, when any project in the namespace is over the [fixed project limit](storage_usage_quotas.md#fixed-project-limit).
### Restricted actions
When a project is read-only due to storage limits, you can't push or add large files (LFS) to the project's repository.
A banner at the top of the project or namespace page indicates the read-only status.
|
---
stage: Growth
group: Acquisition
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Read-only namespaces and projects
breadcrumbs:
- doc
- user
---
## Read-only namespaces
{{< details >}}
- Tier: Free
- Offering: GitLab.com
{{< /details >}}
A namespace is placed in a read-only state when it exceeds the [free user limit](free_user_limit.md), and when the namespace visibility is private.
To remove the read-only state of a namespace and its projects, you can:
- [Reduce the number of members](free_user_limit.md#manage-members-in-your-group-namespace) in your namespace.
- [Start a free trial](https://gitlab.com/-/trial_registrations/new), which includes an unlimited number of members.
- [Purchase a paid tier](https://about.gitlab.com/pricing/).
### Restricted actions
When a namespace is in a read-only state, you cannot execute the actions listed in the following table.
If you try to execute a restricted action, you might get a `404` error.
| Feature | Action restricted |
|---------|-------------------|
| Container registry | Create, edit, and delete cleanup policies. <br> Push an image to the container registry. |
| Merge requests | Create and update a merge request. |
| Package registry | Publish a package. |
| CI/CD | Create, edit, administer, and run pipelines. <br> Create, edit, administer, and run builds. <br> Create and edit admin environments. <br> Create and edit admin deployments. <br> Create and edit admin clusters. <br> Create and edit admin releases. |
| Namespaces | **For exceeded free user limits**: Invite new users. |
## Read-only projects
{{< details >}}
- Tier: Free, Premium, Ultimate
{{< /details >}}
A project is placed in a read-only state when it exceeds the allocated storage limit on the:
- Free tier, when any project in the namespace is over the [free limit](storage_usage_quotas.md#free-limit).
- Premium and Ultimate tiers, when any project in the namespace is over the [fixed project limit](storage_usage_quotas.md#fixed-project-limit).
### Restricted actions
When a project is read-only due to storage limits, you can't push or add large files (LFS) to the project's repository.
A banner at the top of the project or namespace page indicates the read-only status.
|
https://docs.gitlab.com/ssh_troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/ssh_troubleshooting.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
ssh_troubleshooting.md
|
Software Supply Chain Security
|
Authentication
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting SSH
| null |
When working with SSH keys, you might encounter the following issues.
## TLS: server sent certificate containing RSA key larger than 8192 bits
In GitLab 16.3 and later, Go limits RSA keys to a maximum of 8192 bits.
To check the length of a key:
```shell
openssl rsa -in <your-key-file> -text -noout | grep "Key:"
```
Replace any key longer than 8192 bits with a shorter key.
## Password prompt with `git clone`
When you run `git clone`, you may be prompted for a password, like `git@gitlab.example.com's password:`.
This indicates that something is wrong with your SSH setup.
- Ensure that you generated your SSH key pair correctly and added the public SSH
key to your GitLab profile.
- Ensure that your SSH key format is compatible with your server OS configuration. For example, ED25519 key pairs might not work on [some FIPS systems](https://gitlab.com/gitlab-org/gitlab/-/issues/367429).
- Try to manually register your private SSH key by using `ssh-agent`.
- Try to debug the connection by running `ssh -Tv git@example.com`.
Replace `example.com` with your GitLab URL.
- Ensure you followed all the instructions in [Use SSH on Microsoft Windows](ssh.md#use-ssh-on-microsoft-windows).
- Ensure that you have [Verify GitLab SSH ownership and permissions](ssh.md#verify-gitlab-ssh-ownership-and-permissions). If you have several hosts ensure that permissions are correct in all hosts.
## `Could not resolve hostname` error
You may receive the following error when [verifying that you can connect](ssh.md#verify-that-you-can-connect):
```shell
ssh: Could not resolve hostname gitlab.example.com: nodename nor servname provided, or not known
```
If you receive this error, restart your terminal and try the command again.
### `Key enrollment failed: invalid format` error
You may receive the following error when [generating an SSH key pair for a FIDO2 hardware security key](ssh.md#generate-an-ssh-key-pair-for-a-fido2-hardware-security-key):
```shell
Key enrollment failed: invalid format
```
You can troubleshoot this by trying the following:
- Run the `ssh-keygen` command using `sudo`.
- Verify your FIDO2 hardware security key supports
the key type provided.
- Verify the version of OpenSSH is 8.2 or greater by
running `ssh -V`.
## Error: `SSH host keys are not available on this system.`
If GitLab does not have access to the host SSH keys, when you visit `gitlab.example/help/instance_configuration`, you see the following error message under the **SSH host key fingerprints** header instead of the instance SSH fingerprint:
```plaintext
SSH host keys are not available on this system. Please use ssh-keyscan command or contact your GitLab administrator for more information.
```
To resolve this error:
- On Helm chart (Kubernetes) deployments, update the `values.yaml` to set [`sshHostKeys.mount`](https://docs.gitlab.com/charts/charts/gitlab/webservice/) to `true` under the `webservice` section.
- On GitLab Self-Managed instances, check the `/etc/ssh` directory for the host keys.
|
---
stage: Software Supply Chain Security
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting SSH
breadcrumbs:
- doc
- user
---
When working with SSH keys, you might encounter the following issues.
## TLS: server sent certificate containing RSA key larger than 8192 bits
In GitLab 16.3 and later, Go limits RSA keys to a maximum of 8192 bits.
To check the length of a key:
```shell
openssl rsa -in <your-key-file> -text -noout | grep "Key:"
```
Replace any key longer than 8192 bits with a shorter key.
## Password prompt with `git clone`
When you run `git clone`, you may be prompted for a password, like `git@gitlab.example.com's password:`.
This indicates that something is wrong with your SSH setup.
- Ensure that you generated your SSH key pair correctly and added the public SSH
key to your GitLab profile.
- Ensure that your SSH key format is compatible with your server OS configuration. For example, ED25519 key pairs might not work on [some FIPS systems](https://gitlab.com/gitlab-org/gitlab/-/issues/367429).
- Try to manually register your private SSH key by using `ssh-agent`.
- Try to debug the connection by running `ssh -Tv git@example.com`.
Replace `example.com` with your GitLab URL.
- Ensure you followed all the instructions in [Use SSH on Microsoft Windows](ssh.md#use-ssh-on-microsoft-windows).
- Ensure that you have [Verify GitLab SSH ownership and permissions](ssh.md#verify-gitlab-ssh-ownership-and-permissions). If you have several hosts ensure that permissions are correct in all hosts.
## `Could not resolve hostname` error
You may receive the following error when [verifying that you can connect](ssh.md#verify-that-you-can-connect):
```shell
ssh: Could not resolve hostname gitlab.example.com: nodename nor servname provided, or not known
```
If you receive this error, restart your terminal and try the command again.
### `Key enrollment failed: invalid format` error
You may receive the following error when [generating an SSH key pair for a FIDO2 hardware security key](ssh.md#generate-an-ssh-key-pair-for-a-fido2-hardware-security-key):
```shell
Key enrollment failed: invalid format
```
You can troubleshoot this by trying the following:
- Run the `ssh-keygen` command using `sudo`.
- Verify your FIDO2 hardware security key supports
the key type provided.
- Verify the version of OpenSSH is 8.2 or greater by
running `ssh -V`.
## Error: `SSH host keys are not available on this system.`
If GitLab does not have access to the host SSH keys, when you visit `gitlab.example/help/instance_configuration`, you see the following error message under the **SSH host key fingerprints** header instead of the instance SSH fingerprint:
```plaintext
SSH host keys are not available on this system. Please use ssh-keyscan command or contact your GitLab administrator for more information.
```
To resolve this error:
- On Helm chart (Kubernetes) deployments, update the `values.yaml` to set [`sshHostKeys.mount`](https://docs.gitlab.com/charts/charts/gitlab/webservice/) to `true` under the `webservice` section.
- On GitLab Self-Managed instances, check the `/etc/ssh` directory for the host keys.
|
https://docs.gitlab.com/version
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/version.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
version.md
|
none
|
none
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Find the GitLab version
|
Version information.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Find the version of GitLab you're running.
## For GitLab Self-Managed and GitLab Dedicated
Prerequisites:
- You must be an authenticated user.
To find the version of GitLab:
- On the left sidebar, at the bottom, select **Help > Help**.
The version is displayed at the top of the page.
## For GitLab.com
- Go to <https://gitlab.com/help>.
The version is displayed at the top of the page. For example,
`GitLab Enterprise Edition 17.3.0-pre 1e04d6b7fa9` indicates a pre-release
version of GitLab 17.3.
|
---
stage: none
group: none
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Version information.
title: Find the GitLab version
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Find the version of GitLab you're running.
## For GitLab Self-Managed and GitLab Dedicated
Prerequisites:
- You must be an authenticated user.
To find the version of GitLab:
- On the left sidebar, at the bottom, select **Help > Help**.
The version is displayed at the top of the page.
## For GitLab.com
- Go to <https://gitlab.com/help>.
The version is displayed at the top of the page. For example,
`GitLab Enterprise Edition 17.3.0-pre 1e04d6b7fa9` indicates a pre-release
version of GitLab 17.3.
|
https://docs.gitlab.com/public_access
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/public_access.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
public_access.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Project and group visibility
|
Public, private, and internal.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Projects and groups in GitLab can be private, internal, or public.
The visibility level of the project or group does not affect whether members of the project or group can see each other.
Projects and groups are intended for collaborative work. This work is only possible if all members know about each other.
Project or group members can see all members of the project or group they belong to.
Project or group members can see the origin of membership (the original project or group) of all members for the projects and groups they have access to.
## Private projects and groups
For private projects, only members of the private project or group can:
- Clone the project.
- View the public access directory (`/public`).
Users with the Guest role cannot clone the project.
Private groups can have only private subgroups and projects.
{{< alert type="note" >}}
When you [share a private group with another group](project/members/sharing_projects_groups.md#invite-a-group-to-a-group),
users who don't have access to the private group can view a list of users who have access to the inviting group
through the endpoint `https://gitlab.com/groups/<inviting-group-name>/-/autocomplete_sources/members`.
However, the name and path of the private group are masked, and the users' membership source is not displayed.
{{< /alert >}}
## Internal projects and groups
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
For internal projects, any authenticated user, including users with the Guest role, can:
- Clone the project.
- View the public access directory (`/public`).
Only internal members can view internal content.
[External users](../administration/external_users.md) cannot clone the project.
Internal groups can have internal or private subgroups and projects.
## Public projects and groups
For public projects, any user, including unauthenticated users, can:
- Clone the project.
- View the public access directory (`/public`).
Public groups can have public, internal, or private subgroups and projects.
{{< alert type="note" >}}
If an administrator restricts the
[**Public** visibility level](../administration/settings/visibility_and_access_controls.md#restrict-visibility-levels),
then the public access directory (`/public`) is visible only to authenticated users.
{{< /alert >}}
## Change project visibility
You can change the visibility of a project.
Prerequisites:
- You must have the Owner role for a project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. From the **Project visibility** dropdown list, select an option.
The visibility setting for a project must be at least as restrictive
as the visibility of its parent group.
1. Select **Save changes**.
## Change the visibility of individual features in a project
You can change the visibility of individual features in a project.
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To enable or disable a feature, turn on or turn off the feature toggle.
1. Select **Save changes**.
## Change group visibility
You can change the visibility of all projects in a group.
Prerequisites:
- You must have the Owner role for a group.
- Projects and subgroups must already have visibility settings that are at least as
restrictive as the new setting of the parent group. For example, you cannot set a group
to private if a project or subgroup in that group is public.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Naming, visibility**.
1. For **Visibility level**, select an option.
The visibility setting for a project must be at least as restrictive
as the visibility of its parent group.
1. Select **Save changes**.
## Restrict use of public or internal projects
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators can restrict which visibility levels users can choose when they create a project or a snippet.
This setting can help prevent users from publicly exposing their repositories by accident.
For more information, see [Restrict visibility levels](../administration/settings/visibility_and_access_controls.md#restrict-visibility-levels).
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Project and group visibility
description: Public, private, and internal.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Projects and groups in GitLab can be private, internal, or public.
The visibility level of the project or group does not affect whether members of the project or group can see each other.
Projects and groups are intended for collaborative work. This work is only possible if all members know about each other.
Project or group members can see all members of the project or group they belong to.
Project or group members can see the origin of membership (the original project or group) of all members for the projects and groups they have access to.
## Private projects and groups
For private projects, only members of the private project or group can:
- Clone the project.
- View the public access directory (`/public`).
Users with the Guest role cannot clone the project.
Private groups can have only private subgroups and projects.
{{< alert type="note" >}}
When you [share a private group with another group](project/members/sharing_projects_groups.md#invite-a-group-to-a-group),
users who don't have access to the private group can view a list of users who have access to the inviting group
through the endpoint `https://gitlab.com/groups/<inviting-group-name>/-/autocomplete_sources/members`.
However, the name and path of the private group are masked, and the users' membership source is not displayed.
{{< /alert >}}
## Internal projects and groups
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
For internal projects, any authenticated user, including users with the Guest role, can:
- Clone the project.
- View the public access directory (`/public`).
Only internal members can view internal content.
[External users](../administration/external_users.md) cannot clone the project.
Internal groups can have internal or private subgroups and projects.
## Public projects and groups
For public projects, any user, including unauthenticated users, can:
- Clone the project.
- View the public access directory (`/public`).
Public groups can have public, internal, or private subgroups and projects.
{{< alert type="note" >}}
If an administrator restricts the
[**Public** visibility level](../administration/settings/visibility_and_access_controls.md#restrict-visibility-levels),
then the public access directory (`/public`) is visible only to authenticated users.
{{< /alert >}}
## Change project visibility
You can change the visibility of a project.
Prerequisites:
- You must have the Owner role for a project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. From the **Project visibility** dropdown list, select an option.
The visibility setting for a project must be at least as restrictive
as the visibility of its parent group.
1. Select **Save changes**.
## Change the visibility of individual features in a project
You can change the visibility of individual features in a project.
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To enable or disable a feature, turn on or turn off the feature toggle.
1. Select **Save changes**.
## Change group visibility
You can change the visibility of all projects in a group.
Prerequisites:
- You must have the Owner role for a group.
- Projects and subgroups must already have visibility settings that are at least as
restrictive as the new setting of the parent group. For example, you cannot set a group
to private if a project or subgroup in that group is public.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Naming, visibility**.
1. For **Visibility level**, select an option.
The visibility setting for a project must be at least as restrictive
as the visibility of its parent group.
1. Select **Save changes**.
## Restrict use of public or internal projects
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators can restrict which visibility levels users can choose when they create a project or a snippet.
This setting can help prevent users from publicly exposing their repositories by accident.
For more information, see [Restrict visibility levels](../administration/settings/visibility_and_access_controls.md#restrict-visibility-levels).
|
https://docs.gitlab.com/storage_management_automation
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/storage_management_automation.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
storage_management_automation.md
|
Fulfillment
|
Utilization
|
This page is maintained by Developer Relations, author @dnsmichi, see https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/content/#maintained-documentation
|
Automate storage management
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
This page describes how to automate storage analysis and cleanup to manage your storage usage
with the GitLab REST API.
You can also manage your storage usage by improving [pipeline efficiency](../ci/pipelines/pipeline_efficiency.md).
For more help with API automation, you can also use the [GitLab community forum and Discord](https://about.gitlab.com/community/).
{{< alert type="warning" >}}
The script examples in this page are for demonstration purposes only and should not
be used in production. You can use the examples to design and test your own scripts for storage automation.
{{< /alert >}}
## API requirements
To automate storage management, your GitLab.com SaaS or GitLab Self-Managed instance must have access to the [GitLab REST API](../api/api_resources.md).
### API authentication scope
Use the following scopes to [authenticate](../api/rest/authentication.md) with the API:
- Storage analysis:
- Read API access with the `read_api` scope.
- At least the Developer role on all projects.
- Storage clean up:
- Full API access with the `api` scope.
- At least the Maintainer role on all projects.
You can use command-line tools or a programming language to interact with the REST API.
### Command line tools
To send API requests, install either:
- curl with your preferred package manager.
- [GitLab CLI](../editor_extensions/gitlab_cli/_index.md) and use the `glab api` subcommand.
To format JSON responses, install `jq`. For more information, see [Tips for productive DevOps workflows: JSON formatting with jq and CI/CD linting automation](https://about.gitlab.com/blog/2021/04/21/devops-workflows-json-format-jq-ci-cd-lint/).
To use these tools with the REST API:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GITLAB_TOKEN=xxx
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/user" | jq
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
glab auth login
glab api groups/YOURGROUPNAME/projects
```
{{< /tab >}}
{{< /tabs >}}
#### Using the GitLab CLI
Some API endpoints require [pagination](../api/rest/_index.md#pagination) and subsequent page fetches to retrieve all results. The GitLab CLI provides the flag `--paginate`.
Requests that require a POST body formatted as JSON data can be written as `key=value` pairs passed to the `--raw-field` parameter.
For more information, see the [GitLab CLI endpoint documentation](../editor_extensions/gitlab_cli/_index.md#core-commands).
### API client libraries
The storage management and cleanup automation methods described in this page use:
- The [`python-gitlab`](https://python-gitlab.readthedocs.io/en/stable/) library, which provides
a feature-rich programming interface.
- The `get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py` script in the [GitLab API with Python](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-python/) project.
For more information about use cases for the `python-gitlab` library,
see [Efficient DevSecOps workflows: Hands-on `python-gitlab` API automation](https://about.gitlab.com/blog/2023/02/01/efficient-devsecops-workflows-hands-on-python-gitlab-api-automation/).
For more information about other API client libraries, see [Third-party clients](../api/rest/third_party_clients.md).
{{< alert type="note" >}}
Use [GitLab Duo Code Suggestions](project/repository/code_suggestions/_index.md) to write code more efficiently.
{{< /alert >}}
## Storage analysis
### Identify storage types
The [projects API endpoint](../api/projects.md#list-all-projects) provides statistics for projects
in your GitLab instance. To use the projects API endpoint, set the `statistics` key to boolean `true`.
This data provides insight into storage consumption of the project by the following storage types:
- `storage_size`: Overall storage
- `lfs_objects_size`: LFS objects storage
- `job_artifacts_size`: Job artifacts storage
- `packages_size`: Packages storage
- `repository_size`: Git repository storage
- `snippets_size`: Snippets storage
- `uploads_size`: Uploads storage
- `wiki_size`: Wiki storage
To identify storage types:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID?statistics=true" | jq --compact-output '.id,.statistics' | jq
48349590
{
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
export GL_PROJECT_ID=48349590
glab api --method GET projects/$GL_PROJECT_ID --field 'statistics=true' | jq --compact-output '.id,.statistics' | jq
48349590
{
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
project_obj = gl.projects.get(project.id, statistics=True)
print("Project {n} statistics: {s}".format(n=project_obj.name_with_namespace, s=json.dump(project_obj.statistics, indent=4)))
```
{{< /tab >}}
{{< /tabs >}}
To print statistics for the project to the terminal, export the `GL_GROUP_ID` environment variable and run the script:
```shell
export GL_TOKEN=xxx
export GL_GROUP_ID=56595735
pip3 install python-gitlab
python3 get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py
Project Developer Evangelism and Technical Marketing at GitLab / playground / Artifact generator group / Gen Job Artifacts 4 statistics: {
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
### Analyze storage in projects and groups
You can automate analysis of multiple projects and groups. For example, you can start at the top namespace level,
and recursively analyze all subgroups and projects. You can also analyze different storage types.
Here's an example of an algorithm to analyze multiple subgroups and projects:
1. Fetch the top-level namespace ID. You can copy the ID value from the [namespace/group overview](namespace/_index.md#types-of-namespaces).
1. Fetch all [subgroups](../api/groups.md#list-subgroups) from the top-level group, and save the IDs in a list.
1. Loop over all groups and fetch all [projects from each group](../api/groups.md#list-projects) and save the IDs in a list.
1. Identify the storage type to analyze, and collect the information from project attributes, like project statistics, and job artifacts.
1. Print an overview of all projects, grouped by group, and their storage information.
The shell approach with `glab` might be more suitable for smaller analyses. For larger analyses, you should use a script that
uses the API client libraries. This type of script can improve readability, data storage, flow control, testing, and reusability.
To ensure the script doesn't reach [API rate limits](../security/rate_limits.md), the following
example code is not optimized for parallel API requests.
To implement this algorithm:
{{< tabs >}}
{{< tab title="GitLab CLI" >}}
```shell
export GROUP_NAME="gitlab-da"
# Return subgroup IDs
glab api groups/$GROUP_NAME/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
12034712
67218622
67162711
67640130
16058698
12034604
# Loop over all subgroups to get subgroups, until the result set is empty. Example group: 12034712
glab api groups/12034712/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
56595735
70677315
67218606
70812167
# Lowest group level
glab api groups/56595735/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
# empty result, return and continue with analysis
# Fetch projects from all collected groups. Example group: 56595735
glab api groups/56595735/projects | jq --compact-output '.[]' | jq --compact-output '.id'
48349590
48349263
38520467
38520405
# Fetch storage types from a project (ID 48349590): Job artifacts in the `artifacts` key
glab api projects/48349590/jobs | jq --compact-output '.[]' | jq --compact-output '.id, .artifacts'
4828297946
[{"file_type":"archive","size":52444993,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":156,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3140,"filename":"job.log","file_format":null}]
4828297945
[{"file_type":"archive","size":20978113,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3147,"filename":"job.log","file_format":null}]
4828297944
[{"file_type":"archive","size":10489153,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":158,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3146,"filename":"job.log","file_format":null}]
4828297943
[{"file_type":"archive","size":5244673,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3145,"filename":"job.log","file_format":null}]
4828297940
[{"file_type":"archive","size":1049089,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3140,"filename":"job.log","file_format":null}]
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
#!/usr/bin/env python
import datetime
import gitlab
import os
import sys
GITLAB_SERVER = os.environ.get('GL_SERVER', 'https://gitlab.com')
GITLAB_TOKEN = os.environ.get('GL_TOKEN') # token requires developer permissions
PROJECT_ID = os.environ.get('GL_PROJECT_ID') #optional
GROUP_ID = os.environ.get('GL_GROUP_ID') #optional
if __name__ == "__main__":
if not GITLAB_TOKEN:
print("🤔 Please set the GL_TOKEN env variable.")
sys.exit(1)
gl = gitlab.Gitlab(GITLAB_SERVER, private_token=GITLAB_TOKEN, pagination="keyset", order_by="id", per_page=100)
# Collect all projects, or prefer projects from a group id, or a project id
projects = []
# Direct project ID
if PROJECT_ID:
projects.append(gl.projects.get(PROJECT_ID))
# Groups and projects inside
elif GROUP_ID:
group = gl.groups.get(GROUP_ID)
for project in group.projects.list(include_subgroups=True, get_all=True):
manageable_project = gl.projects.get(project.id , lazy=True)
projects.append(manageable_project)
for project in projects:
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
print("DEBUG: ID {i}: {a}".format(i=job.id, a=job.attributes['artifacts']))
```
{{< /tab >}}
{{< /tabs >}}
The script outputs the project job artifacts in a JSON formatted list:
```json
[
{
"file_type": "archive",
"size": 1049089,
"filename": "artifacts.zip",
"file_format": "zip"
},
{
"file_type": "metadata",
"size": 157,
"filename": "metadata.gz",
"file_format": "gzip"
},
{
"file_type": "trace",
"size": 3146,
"filename": "job.log",
"file_format": null
}
]
```
## Manage CI/CD pipeline storage
Job artifacts consume most of the pipeline storage, and job logs can also generate several hundreds of kilobytes.
You should delete the unnecessary job artifacts first and then clean up job logs after analysis.
{{< alert type="warning" >}}
Deleting job log and artifacts is a destructive action that cannot be reverted. Use with caution. Deleting certain files, including report artifacts, job logs, and metadata files, affects GitLab features that use these files as data sources.
{{< /alert >}}
### List job artifacts
To analyze pipeline storage, you can use the [Job API endpoint](../api/jobs.md#list-project-jobs) to retrieve a list of
job artifacts. The endpoint returns the job artifacts `file_type` key in the `artifacts` attribute.
The `file_type` key indicates the artifact type:
- `archive` is used for the generated job artifacts as a zip file.
- `metadata` is used for additional metadata in a Gzip file.
- `trace` is used for the `job.log` as a raw file.
Job artifacts provide a data structure that can be written as a cache file to
disk, which you can use to test the implementation.
Based on the example code for fetching all projects, you can extend the Python script to do more analysis.
The following example shows a response from a query for job artifacts in a project:
```json
[
{
"file_type": "archive",
"size": 1049089,
"filename": "artifacts.zip",
"file_format": "zip"
},
{
"file_type": "metadata",
"size": 157,
"filename": "metadata.gz",
"file_format": "gzip"
},
{
"file_type": "trace",
"size": 3146,
"filename": "job.log",
"file_format": null
}
]
```
Based on how you implement the script, you could either:
- Collect all job artifacts and print a summary table at the end of the script.
- Print the information immediately.
In the following example, job artifacts are collected in the `ci_job_artifacts` list. The script
loops over all projects, and fetches:
- The `project_obj` object variable that contains all attributes.
- The `artifacts` attribute from the `job` object.
You can use [keyset pagination](https://python-gitlab.readthedocs.io/en/stable/api-usage.html#pagination)
to iterate over large lists of pipelines and jobs.
```python
ci_job_artifacts = []
for project in projects:
project_obj = gl.projects.get(project.id)
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
artifacts = job.attributes['artifacts']
#print("DEBUG: ID {i}: {a}".format(i=job.id, a=json.dumps(artifacts, indent=4)))
if not artifacts:
continue
for a in artifacts:
data = {
"project_id": project_obj.id,
"project_web_url": project_obj.name,
"project_path_with_namespace": project_obj.path_with_namespace,
"job_id": job.id,
"artifact_filename": a['filename'],
"artifact_file_type": a['file_type'],
"artifact_size": a['size']
}
ci_job_artifacts.append(data)
print("\nDone collecting data.")
if len(ci_job_artifacts) > 0:
print("| Project | Job | Artifact name | Artifact type | Artifact size |\n|---------|-----|---------------|---------------|---------------|") # Start markdown friendly table
for artifact in ci_job_artifacts:
print('| [{project_name}]({project_web_url}) | {job_name} | {artifact_name} | {artifact_type} | {artifact_size} |'.format(project_name=artifact['project_path_with_namespace'], project_web_url=artifact['project_web_url'], job_name=artifact['job_id'], artifact_name=artifact['artifact_filename'], artifact_type=artifact['artifact_file_type'], artifact_size=render_size_mb(artifact['artifact_size'])))
else:
print("No artifacts found.")
```
At the end of the script, job artifacts are printed as a Markdown formatted table. You can copy the table
content to an issue comment or description, or populate a Markdown file in a GitLab repository.
```shell
$ python3 get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py
| Project | Job | Artifact name | Artifact type | Artifact size |
|---------|-----|---------------|---------------|---------------|
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | artifacts.zip | archive | 50.0154 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | metadata.gz | metadata | 0.0001 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | job.log | trace | 0.0030 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | artifacts.zip | archive | 20.0063 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | metadata.gz | metadata | 0.0001 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | job.log | trace | 0.0030 |
```
### Delete job artifacts in bulk
You can use a Python script to filter the types of job artifacts to delete in bulk.
Filter the API queries results to compare:
- The `created_at` value to calculate the artifact age.
- The `size` attribute to determine if artifacts meet the size threshold.
A typical request:
- Deletes job artifacts older than the specified number of days.
- Deletes job artifacts that exceed a specified amount of storage. For example, 100 MB.
In the following example, the script loops through job attributes and marks them for deletion.
When the collection loops remove the object locks, the script deletes the job artifacts marked for deletion.
```python
for project in projects:
project_obj = gl.projects.get(project.id)
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
artifacts = job.attributes['artifacts']
if not artifacts:
continue
# Advanced filtering: Age and Size
# Example: 90 days, 10 MB threshold (TODO: Make this configurable)
threshold_age = 90 * 24 * 60 * 60
threshold_size = 10 * 1024 * 1024
# job age, need to parse API format: 2023-08-08T22:41:08.270Z
created_at = datetime.datetime.strptime(job.created_at, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
age = (now - created_at).total_seconds()
# Shorter: Use a function
# age = calculate_age(job.created_at)
for a in artifacts:
# Analysis collection code removed for readability
# Advanced filtering: match job artifacts age and size against thresholds
if (float(age) > float(threshold_age)) or (float(a['size']) > float(threshold_size)):
# mark job for deletion (cannot delete inside the loop)
jobs_marked_delete_artifacts.append(job)
print("\nDone collecting data.")
# Advanced filtering: Delete all job artifacts marked to being deleted.
for job in jobs_marked_delete_artifacts:
# delete the artifact
print("DEBUG", job)
job.delete_artifacts()
# Print collection summary (removed for readability)
```
### Delete all job artifacts for a project
If you do not need the project's [job artifacts](../ci/jobs/job_artifacts.md), you can
use the following command to delete all job artifacts. This action cannot be reverted.
Artifact deletion can take several minutes or hours, depending on the number of artifacts to delete. Subsequent
analysis queries against the API might return the artifacts as a false-positive result.
To avoid confusion with results, do not immediately run additional API requests.
The [artifacts for the most recent successful jobs](../ci/jobs/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs) are kept by default.
To delete all job artifacts for a project:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GL_PROJECT_ID=48349590
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" --request DELETE "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID/artifacts"
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
glab api --method GET projects/$GL_PROJECT_ID/jobs | jq --compact-output '.[]' | jq --compact-output '.id, .artifacts'
glab api --method DELETE projects/$GL_PROJECT_ID/artifacts
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
project.artifacts.delete()
```
{{< /tab >}}
{{< /tabs >}}
### Delete job logs
When you delete a job log you also [erase the entire job](../api/jobs.md#erase-a-job).
Example with the GitLab CLI:
```shell
glab api --method GET projects/$GL_PROJECT_ID/jobs | jq --compact-output '.[]' | jq --compact-output '.id'
4836226184
4836226183
4836226181
4836226180
glab api --method POST projects/$GL_PROJECT_ID/jobs/4836226180/erase | jq --compact-output '.name,.status'
"generate-package: [1]"
"success"
```
In the `python-gitlab` API library, use [`job.erase()`](https://python-gitlab.readthedocs.io/en/stable/gl_objects/pipelines_and_jobs.html#jobs) instead of `job.delete_artifacts()`.
To avoid this API call from being blocked, set the script to sleep for a short amount of time between calls
that delete the job artifact:
```python
for job in jobs_marked_delete_artifacts:
# delete the artifacts and job log
print("DEBUG", job)
#job.delete_artifacts()
job.erase()
# Sleep for 1 second
time.sleep(1)
```
Support for creating a retention policy for job logs is proposed in [issue 374717](https://gitlab.com/gitlab-org/gitlab/-/issues/374717).
### Delete old pipelines
Pipelines do not add to the overall storage usage, but if required you can [automate their deletion](../ci/pipelines/settings.md#automatic-pipeline-cleanup).
To delete pipelines based on a specific date, specify the `created_at` key.
You can use the date to calculate the difference between the current date and
when the pipeline was created. If the age is larger than the threshold, the pipeline is deleted.
{{< alert type="note" >}}
The `created_at` key must be converted from a timestamp to Unix epoch time,
for example with `date -d '2023-08-08T18:59:47.581Z' +%s`.
{{< /alert >}}
Example with GitLab CLI:
```shell
export GL_PROJECT_ID=48349590
glab api --method GET projects/$GL_PROJECT_ID/pipelines | jq --compact-output '.[]' | jq --compact-output '.id,.created_at'
960031926
"2023-08-08T22:09:52.745Z"
959884072
"2023-08-08T18:59:47.581Z"
glab api --method DELETE projects/$GL_PROJECT_ID/pipelines/960031926
glab api --method GET projects/$GL_PROJECT_ID/pipelines | jq --compact-output '.[]' | jq --compact-output '.id,.created_at'
959884072
"2023-08-08T18:59:47.581Z"
```
In the following example that uses a Bash script:
- `jq` and the GitLab CLI are installed and authorized.
- The exported environment variable `GL_PROJECT_ID`. Defaults to the GitLab predefined variable `CI_PROJECT_ID`.
- The exported environment variable `CI_SERVER_HOST` that points to the GitLab instance URL.
{{< tabs >}}
{{< tab title="Using the API with glab" >}}
The full script `get_cicd_pipelines_compare_age_threshold_example.sh` is located in the [GitLab API with Linux Shell](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-linux-shell) project.
```shell
#!/bin/bash
# Required programs:
# - GitLab CLI (glab): https://docs.gitlab.com/ee/editor_extensions/gitlab_cli/
# - jq: https://jqlang.github.io/jq/
# Required variables:
# - PAT: Project Access Token with API scope and Owner role, or Personal Access Token with API scope
# - GL_PROJECT_ID: ID of the project where pipelines must be cleaned
# - AGE_THRESHOLD (optional): Maximum age in days of pipelines to keep (default: 90)
set -euo pipefail
# Constants
DEFAULT_AGE_THRESHOLD=90
SECONDS_PER_DAY=$((24 * 60 * 60))
# Functions
log_info() {
echo "[INFO] $1"
}
log_error() {
echo "[ERROR] $1" >&2
}
delete_pipeline() {
local project_id=$1
local pipeline_id=$2
if glab api --method DELETE "projects/$project_id/pipelines/$pipeline_id"; then
log_info "Deleted pipeline ID $pipeline_id"
else
log_error "Failed to delete pipeline ID $pipeline_id"
fi
}
# Main script
main() {
# Authenticate
if ! glab auth login --hostname "$CI_SERVER_HOST" --token "$PAT"; then
log_error "Authentication failed"
exit 1
fi
# Set variables
AGE_THRESHOLD=${AGE_THRESHOLD:-$DEFAULT_AGE_THRESHOLD}
AGE_THRESHOLD_IN_SECONDS=$((AGE_THRESHOLD * SECONDS_PER_DAY))
GL_PROJECT_ID=${GL_PROJECT_ID:-$CI_PROJECT_ID}
# Fetch pipelines
PIPELINES=$(glab api --method GET "projects/$GL_PROJECT_ID/pipelines")
if [ -z "$PIPELINES" ]; then
log_error "Failed to fetch pipelines or no pipelines found"
exit 1
fi
# Process pipelines
echo "$PIPELINES" | jq -r '.[] | [.id, .created_at] | @tsv' | while IFS=$'\t' read -r id created_at; do
CREATED_AT_TS=$(date -d "$created_at" +%s)
NOW=$(date +%s)
AGE=$((NOW - CREATED_AT_TS))
if [ "$AGE" -gt "$AGE_THRESHOLD_IN_SECONDS" ]; then
log_info "Pipeline ID $id created at $created_at is older than threshold $AGE_THRESHOLD days, deleting..."
delete_pipeline "$GL_PROJECT_ID" "$id"
else
log_info "Pipeline ID $id created at $created_at is not older than threshold $AGE_THRESHOLD days. Ignoring."
fi
done
}
main
```
{{< /tab >}}
{{< tab title="Using the glab CLI" >}}
The full script `cleanup-old-pipelines.sh` is located in the [GitLab API with Linux Shell](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-linux-shell) project.
```shell
#!/bin/bash
set -euo pipefail
# Required environment variables:
# PAT: Project Access Token with API scope and Owner role, or Personal Access Token with API scope.
# Optional environment variables:
# AGE_THRESHOLD: Maximum age (in days) of pipelines to keep. Default: 90 days.
# REPO: Repository to clean up. If not set, the current repository will be used.
# CI_SERVER_HOST: GitLab server hostname.
# Function to display error message and exit
error_exit() {
echo "Error: $1" >&2
exit 1
}
# Validate required environment variables
[[ -z "${PAT:-}" ]] && error_exit "PAT (Project Access Token or Personal Access Token) is not set."
[[ -z "${CI_SERVER_HOST:-}" ]] && error_exit "CI_SERVER_HOST is not set."
# Set and validate AGE_THRESHOLD
AGE_THRESHOLD=${AGE_THRESHOLD:-90}
[[ ! "$AGE_THRESHOLD" =~ ^[0-9]+$ ]] && error_exit "AGE_THRESHOLD must be a positive integer."
AGE_THRESHOLD_IN_HOURS=$((AGE_THRESHOLD * 24))
echo "Deleting pipelines older than $AGE_THRESHOLD days"
# Authenticate with GitLab
glab auth login --hostname "$CI_SERVER_HOST" --token "$PAT" || error_exit "Authentication failed"
# Delete old pipelines
delete_cmd="glab ci delete --older-than ${AGE_THRESHOLD_IN_HOURS}h"
if [[ -n "${REPO:-}" ]]; then
delete_cmd+=" --repo $REPO"
fi
$delete_cmd || error_exit "Pipeline deletion failed"
echo "Pipeline cleanup completed."
```
{{< /tab >}}
{{< tab title="Using the API with Python" >}}
You can also use the [`python-gitlab` API library](https://python-gitlab.readthedocs.io/en/stable/gl_objects/pipelines_and_jobs.html#project-pipelines) and
the `created_at` attribute to implement a similar algorithm that compares the job artifact age:
```python
# ...
for pipeline in project.pipelines.list(iterator=True):
pipeline_obj = project.pipelines.get(pipeline.id)
print("DEBUG: {p}".format(p=json.dumps(pipeline_obj.attributes, indent=4)))
created_at = datetime.datetime.strptime(pipeline.created_at, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
age = (now - created_at).total_seconds()
threshold_age = 90 * 24 * 60 * 60
if (float(age) > float(threshold_age)):
print("Deleting pipeline", pipeline.id)
pipeline_obj.delete()
```
{{< /tab >}}
{{< /tabs >}}
### List expiry settings for job artifacts
To manage artifact storage, you can update or configure when an artifact expires.
The expiry setting for artifacts are configured in each job configuration in the `.gitlab-ci.yml`.
If there are multiple projects, and based on how job definitions are organized in the CI/CD configuration, it might be difficult
to locate the expiry setting. You can use a script to search the entire CI/CD configuration. This includes access to objects that
are resolved after they inherit values, like `extends` or `!reference`.
The script retrieves merged CI/CD configuration files and searches for the artifacts key to:
- Identify jobs that do not have an expiry setting.
- Return expiry settings for jobs that have the artifact expiry configured.
The following process describes how the script searches for the artifact expiry setting:
1. To generate a merged CI/CD configuration, the script loops over all projects and calls
the [`ci_lint()`](https://python-gitlab.readthedocs.io/en/stable/gl_objects/ci_lint.html) method.
1. The `yaml_load` function loads the merged configuration into Python data structures for more analysis.
1. A dictionary that also has the key `script` identifies itself as a job definition, where the `artifacts`
key might exists.
1. If yes, the script parses the sub key `expire_in` and stores the details to print later in a Markdown table summary.
```python
ci_job_artifacts_expiry = {}
# Loop over projects, fetch .gitlab-ci.yml, run the linter to get the full translated config, and extract the `artifacts:` setting
# https://python-gitlab.readthedocs.io/en/stable/gl_objects/ci_lint.html
for project in projects:
project_obj = gl.projects.get(project.id)
project_name = project_obj.name
project_web_url = project_obj.web_url
try:
lint_result = project.ci_lint.get()
if lint_result.merged_yaml is None:
continue
ci_pipeline = yaml.safe_load(lint_result.merged_yaml)
#print("Project {p} Config\n{c}\n\n".format(p=project_name, c=json.dumps(ci_pipeline, indent=4)))
for k in ci_pipeline:
v = ci_pipeline[k]
# This is a job object with `script` attribute
if isinstance(v, dict) and 'script' in v:
print(".", end="", flush=True) # Get some feedback that it is still looping
artifacts = v['artifacts'] if 'artifacts' in v else {}
print("Project {p} job {j} artifacts {a}".format(p=project_name, j=k, a=json.dumps(artifacts, indent=4)))
expire_in = None
if 'expire_in' in artifacts:
expire_in = artifacts['expire_in']
store_key = project_web_url + '_' + k
ci_job_artifacts_expiry[store_key] = { 'project_web_url': project_web_url,
'project_name': project_name,
'job_name': k,
'artifacts_expiry': expire_in}
except Exception as e:
print(f"Exception searching artifacts on ci_pipelines: {e}".format(e=e))
if len(ci_job_artifacts_expiry) > 0:
print("| Project | Job | Artifact expiry |\n|---------|-----|-----------------|") #Start markdown friendly table
for k, details in ci_job_artifacts_expiry.items():
if details['job_name'][0] == '.':
continue # ignore job templates that start with a '.'
print(f'| [{ details["project_name"] }]({details["project_web_url"]}) | { details["job_name"] } | { details["artifacts_expiry"] if details["artifacts_expiry"] is not None else "❌ N/A" } |')
```
The script generates a Markdown summary table with:
- Project name and URL.
- Job name.
- The `artifacts:expire_in` setting, or `N/A` if there is no setting.
The script does not print job templates that:
- Start with a `.` character.
- Are not instantiated as runtime job objects that generate artifacts.
```shell
export GL_GROUP_ID=56595735
# Install script dependencies
python3 -m pip install 'python-gitlab[yaml]'
python3 get_all_cicd_config_artifacts_expiry.py
| Project | Job | Artifact expiry |
|---------|-----|-----------------|
| [Gen Job Artifacts 4](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4) | generator | 30 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job10 | 10 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job1 | 1 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job30 | 30 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | generator | 30 days |
| [Gen Job Artifacts 2](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-2) | generator | ❌ N/A |
| [Gen Job Artifacts 1](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-1) | generator | ❌ N/A |
```
The `get_all_cicd_config_artifacts_expiry.py` script is located in the [GitLab API with Python project](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-python/).
Alternatively, you can use [advanced search](search/advanced_search.md) with API requests. The following example uses the [scope: blobs](../api/search.md#scope-blobs) to searches for the string `artifacts` in all `*.yml` files:
```shell
# https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs
export GL_PROJECT_ID=48349263
glab api --method GET projects/$GL_PROJECT_ID/search --field "scope=blobs" --field "search=expire_in filename:*.yml"
```
For more information about the inventory approach, see [How GitLab can help mitigate deletion of open source container images on Docker Hub](https://about.gitlab.com/blog/2023/03/16/how-gitlab-can-help-mitigate-deletion-open-source-images-docker-hub/).
### Set default expiry for job artifacts
To set the default expiry for job artifacts in a project, specify the `expire_in` value in the `.gitlab-ci.yml` file:
```yaml
default:
artifacts:
expire_in: 1 week
```
## Manage Container Registries storage
Container registries are available [for projects](../api/container_registry.md#within-a-project) or [for groups](../api/container_registry.md#within-a-group). You can analyze both locations to implement a cleanup strategy.
### List container registries
To list Container Registries in a project:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GL_PROJECT_ID=48057080
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID/registry/repositories" | jq --compact-output '.[]' | jq --compact-output '.id,.location' | jq
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/registry/repositories/4435617?size=true" | jq --compact-output '.id,.location,.size'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
3401613
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
export GL_PROJECT_ID=48057080
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories | jq --compact-output '.[]' | jq --compact-output '.id,.location'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
glab api --method GET registry/repositories/4435617 --field='size=true' | jq --compact-output '.id,.location,.size'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
3401613
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories/4435617/tags | jq --compact-output '.[]' | jq --compact-output '.name'
"latest"
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories/4435617/tags/latest | jq --compact-output '.name,.created_at,.total_size'
"latest"
"2023-08-07T19:20:20.894+00:00"
3401613
```
{{< /tab >}}
{{< /tabs >}}
### Delete container images in bulk
When you [delete container image tags in bulk](../api/container_registry.md#delete-registry-repository-tags-in-bulk),
you can configure:
- The matching regular expressions for tag names and images to keep (`name_regex_keep`) or delete (`name_regex_delete`)
- The number of image tags to keep matching the tag name (`keep_n`)
- The number of days before an image tag can be deleted (`older_than`)
{{< alert type="warning" >}}
On GitLab.com, due to the scale of the container registry, the number of tags deleted by this API is limited.
If your container registry has a large number of tags to delete, only some of them are deleted. You might need
to call the API multiple times. To schedule tags for automatic deletion, use a [cleanup policy](#create-a-cleanup-policy-for-containers) instead.
{{< /alert >}}
The following example uses the [`python-gitlab` API library](https://python-gitlab.readthedocs.io/en/stable/gl_objects/repository_tags.html) to fetch a list of tags, and calls the `delete_in_bulk()` method with filter parameters.
```python
repositories = project.repositories.list(iterator=True, size=True)
if len(repositories) > 0:
repository = repositories.pop()
tags = repository.tags.list()
# Cleanup: Keep only the latest tag
repository.tags.delete_in_bulk(keep_n=1)
# Cleanup: Delete all tags older than 1 month
repository.tags.delete_in_bulk(older_than="1m")
# Cleanup: Delete all tags matching the regex `v.*`, and keep the latest 2 tags
repository.tags.delete_in_bulk(name_regex_delete="v.+", keep_n=2)
```
### Create a cleanup policy for containers
Use the project REST API endpoint to [create cleanup policies](packages/container_registry/reduce_container_registry_storage.md#use-the-cleanup-policy-api) for containers. After you set the cleanup policy, all container images that match your specifications are deleted automatically. You do not need additional API automation scripts.
To send the attributes as a body parameter:
- Use the `--input -` parameter to read from the standard input.
- Set the `Content-Type` header.
The following example uses the GitLab CLI to create a cleanup policy:
```shell
export GL_PROJECT_ID=48057080
echo '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":".*","name_regex_keep":".*-main"}}' | glab api --method PUT --header 'Content-Type: application/json;charset=UTF-8' projects/$GL_PROJECT_ID --input -
...
"container_expiration_policy": {
"cadence": "1month",
"enabled": true,
"keep_n": 1,
"older_than": "14d",
"name_regex": ".*",
"name_regex_keep": ".*-main",
"next_run_at": "2023-09-08T21:16:25.354Z"
},
```
### Optimize container images
You can optimize container images to reduce the image size and overall storage consumption in the container registry. Learn more in the [pipeline efficiency documentation](../ci/pipelines/pipeline_efficiency.md#optimize-docker-images).
## Manage package registry storage
Package registries are available [for projects](../api/packages.md#for-a-project) or [for groups](../api/packages.md#for-a-group).
### List packages and files
The following example shows fetching packages from a defined project ID using the GitLab CLI. The result set is an array of dictionary items that can be filtered with the `jq` command chain.
```shell
# https://gitlab.com/gitlab-da/playground/container-package-gen-group/generic-package-generator
export GL_PROJECT_ID=48377643
glab api --method GET projects/$GL_PROJECT_ID/packages | jq --compact-output '.[]' | jq --compact-output '.id,.name,.package_type'
16669383
"generator"
"generic"
16671352
"generator"
"generic"
16672235
"generator"
"generic"
16672237
"generator"
"generic"
```
Use the package ID to inspect the files and their size in the package.
```shell
glab api --method GET projects/$GL_PROJECT_ID/packages/16669383/package_files | jq --compact-output '.[]' |
jq --compact-output '.package_id,.file_name,.size'
16669383
"nighly.tar.gz"
10487563
```
A similar automation shell script is created in the [delete old pipelines](#delete-old-pipelines) section.
The following script example uses the `python-gitlab` library to fetch all packages in a loop,
and loops over its package files to print the `file_name` and `size` attributes.
```python
packages = project.packages.list(order_by="created_at")
for package in packages:
package_files = package.package_files.list()
for package_file in package_files:
print("Package name: {p} File name: {f} Size {s}".format(
p=package.name, f=package_file.file_name, s=render_size_mb(package_file.size)))
```
### Delete packages
[Deleting a file in a package](../api/packages.md#delete-a-package-file) can corrupt the package. You should delete the package when performing automated cleanup maintenance.
To delete a package, use the GitLab CLI to change the `--method`
parameter to `DELETE`:
```shell
glab api --method DELETE projects/$GL_PROJECT_ID/packages/16669383
```
To calculate the package size and compare it against a size threshold, you can use the `python-gitlab` library
to extend the code described in the [list packages and files](#list-packages-and-files) section.
The following code example also calculates the package age and deletes the package when the conditions match:
```python
packages = project.packages.list(order_by="created_at")
for package in packages:
package_size = 0.0
package_files = package.package_files.list()
for package_file in package_files:
print("Package name: {p} File name: {f} Size {s}".format(
p=package.name, f=package_file.file_name, s=render_size_mb(package_file.size)))
package_size =+ package_file.size
print("Package size: {s}\n\n".format(s=render_size_mb(package_size)))
threshold_size = 10 * 1024 * 1024
if (package_size > float(threshold_size)):
print("Package size {s} > threshold {t}, deleting package.".format(
s=render_size_mb(package_size), t=render_size_mb(threshold_size)))
package.delete()
threshold_age = 90 * 24 * 60 * 60
package_age = created_at = calculate_age(package.created_at)
if (float(package_age > float(threshold_age))):
print("Package age {a} > threshold {t}, deleting package.".format(
a=render_age_time(package_age), t=render_age_time(threshold_age)))
package.delete()
```
The code generates the following output that you can use for further analysis:
```shell
Package name: generator File name: nighly.tar.gz Size 10.0017
Package size: 10.0017
Package size 10.0017 > threshold 10.0000, deleting package.
Package name: generator File name: 1-nightly.tar.gz Size 1.0004
Package size: 1.0004
Package name: generator File name: 10-nightly.tar.gz Size 10.0018
Package name: generator File name: 20-nightly.tar.gz Size 20.0033
Package size: 20.0033
Package size 20.0033 > threshold 10.0000, deleting package.
```
### Dependency Proxy
Review the [cleanup policy](packages/dependency_proxy/reduce_dependency_proxy_storage.md#cleanup-policies) and how to [purge the cache using the API](packages/dependency_proxy/reduce_dependency_proxy_storage.md#use-the-api-to-clear-the-cache)
## Improve output readability
You might need to convert timestamp seconds into a duration format, or print raw bytes in a more
representative format. You can use the following helper functions to transform values for improved
readability:
```shell
# Current Unix timestamp
date +%s
# Convert `created_at` date time with timezone to Unix timestamp
date -d '2023-08-08T18:59:47.581Z' +%s
```
Example with Python that uses the `python-gitlab` API library:
```python
def render_size_mb(v):
return "%.4f" % (v / 1024 / 1024)
def render_age_time(v):
return str(datetime.timedelta(seconds = v))
# Convert `created_at` date time with timezone to Unix timestamp
def calculate_age(created_at_datetime):
created_at_ts = datetime.datetime.strptime(created_at_datetime, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
return (now - created_at_ts).total_seconds()
```
## Testing for storage management automation
To test storage management automation, you might need to generate test data, or populate
storage to verify that the analysis and deletion works as expected. The following sections
provide tools and tips about testing and generating storage blobs in a short amount of time.
### Generate job artifacts
Create a test project to generate fake artifact blobs using CI/CD job matrix builds. Add a CI/CD pipeline to generate artifacts on a daily basis
1. Create a new project.
1. Add the following snippet to `.gitlab-ci.yml` to include the job artifact generator configuration.
```yaml
include:
- remote: https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator/-/raw/main/.gitlab-ci.yml
```
1. [Configure pipeline schedules](../ci/pipelines/schedules.md#add-a-pipeline-schedule).
1. [Trigger the pipeline manually](../ci/pipelines/schedules.md#run-manually).
Alternatively, reduce the 86 MB daily generated MB to different values in the `MB_COUNT` variable.
```yaml
include:
- remote: https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator/-/raw/main/.gitlab-ci.yml
generator:
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20, 50]
```
For more information, see the [Job Artifact Generator README](https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator), with an [example group](https://gitlab.com/gitlab-da/playground/artifact-gen-group).
### Generate job artifacts with expiry
The project CI/CD configuration specifies job definitions in:
- The main `.gitlab-ci.yml` configuration file.
- The `artifacts:expire_in` setting.
- Project files and templates.
To test the analysis scripts, the [`gen-job-artifacts-expiry-included-jobs`](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) project provides an example configuration.
```yaml
# .gitlab-ci.yml
include:
- include_jobs.yml
default:
artifacts:
paths:
- '*.txt'
.gen-tmpl:
script:
- dd if=/dev/urandom of=${$MB_COUNT}.txt bs=1048576 count=${$MB_COUNT}
generator:
extends: [.gen-tmpl]
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20, 50]
artifacts:
untracked: false
when: on_success
expire_in: 30 days
# include_jobs.yml
.includeme:
script:
- dd if=/dev/urandom of=1.txt bs=1048576 count=1
included-job10:
script:
- echo "Servus"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 10 days
included-job1:
script:
- echo "Gruezi"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 1 days
included-job30:
script:
- echo "Grias di"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 30 days
```
### Generate container images
The example group [`container-package-gen-group`](https://gitlab.com/gitlab-da/playground/container-package-gen-group) provides projects that:
- Use a base image in Dockerfile to build a new image.
- Include the `Docker.gitlab-ci.yml` template to build images on GitLab.com SaaS.
- Configure pipeline schedules to generate new images daily.
Example projects available to fork:
- [`docker-alpine-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator)
- [`docker-python-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/docker-python-generator)
### Generate generic packages
The example project [`generic-package-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/generic-package-generator) provides projects that:
- Generate a random text blob, and create a tarball with the current Unix timestamp as release version.
- Upload the tarball into the generic package registry, using the Unix timestamp as release version.
To generate generic packages, you can use this standalone `.gitlab-ci.yml` configuration:
```yaml
generate-package:
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20]
before_script:
- apt update && apt -y install curl
script:
- dd if=/dev/urandom of="${MB_COUNT}.txt" bs=1048576 count=${MB_COUNT}
- tar czf "generated-$MB_COUNT-nighly-`date +%s`.tar.gz" "${MB_COUNT}.txt"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "generated-$MB_COUNT-nighly-`date +%s`.tar.gz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/generator/`date +%s`/${MB_COUNT}-nightly.tar.gz"'
artifacts:
paths:
- '*.tar.gz'
```
### Generate storage usage with forks
Use the following projects to test storage usage with [cost factors for forks](storage_usage_quotas.md#view-project-fork-storage-usage):
- Fork [`gitlab-org/gitlab`](https://gitlab.com/gitlab-org/gitlab) into a new namespace or group (includes LFS, Git repository).
- Fork [`gitlab-com/www-gitlab-com`](https://gitlab.com/gitlab-com/www-gitlab-com) into a new namespace or group.
## Community resources
The following resources are not officially supported. Ensure to test scripts and tutorials before running destructive cleanup commands that may not be reverted.
- Forum topic: [Storage management automation resources](https://forum.gitlab.com/t/storage-management-automation-resources/91184)
- Script: [GitLab Storage Analyzer](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-storage-analyzer), unofficial project by the [GitLab Developer Evangelism team](https://gitlab.com/gitlab-da/). You find similar code examples in this documentation how-to here.
|
---
stage: Fulfillment
group: Utilization
info: This page is maintained by Developer Relations, author @dnsmichi, see https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/content/#maintained-documentation
title: Automate storage management
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
This page describes how to automate storage analysis and cleanup to manage your storage usage
with the GitLab REST API.
You can also manage your storage usage by improving [pipeline efficiency](../ci/pipelines/pipeline_efficiency.md).
For more help with API automation, you can also use the [GitLab community forum and Discord](https://about.gitlab.com/community/).
{{< alert type="warning" >}}
The script examples in this page are for demonstration purposes only and should not
be used in production. You can use the examples to design and test your own scripts for storage automation.
{{< /alert >}}
## API requirements
To automate storage management, your GitLab.com SaaS or GitLab Self-Managed instance must have access to the [GitLab REST API](../api/api_resources.md).
### API authentication scope
Use the following scopes to [authenticate](../api/rest/authentication.md) with the API:
- Storage analysis:
- Read API access with the `read_api` scope.
- At least the Developer role on all projects.
- Storage clean up:
- Full API access with the `api` scope.
- At least the Maintainer role on all projects.
You can use command-line tools or a programming language to interact with the REST API.
### Command line tools
To send API requests, install either:
- curl with your preferred package manager.
- [GitLab CLI](../editor_extensions/gitlab_cli/_index.md) and use the `glab api` subcommand.
To format JSON responses, install `jq`. For more information, see [Tips for productive DevOps workflows: JSON formatting with jq and CI/CD linting automation](https://about.gitlab.com/blog/2021/04/21/devops-workflows-json-format-jq-ci-cd-lint/).
To use these tools with the REST API:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GITLAB_TOKEN=xxx
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/user" | jq
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
glab auth login
glab api groups/YOURGROUPNAME/projects
```
{{< /tab >}}
{{< /tabs >}}
#### Using the GitLab CLI
Some API endpoints require [pagination](../api/rest/_index.md#pagination) and subsequent page fetches to retrieve all results. The GitLab CLI provides the flag `--paginate`.
Requests that require a POST body formatted as JSON data can be written as `key=value` pairs passed to the `--raw-field` parameter.
For more information, see the [GitLab CLI endpoint documentation](../editor_extensions/gitlab_cli/_index.md#core-commands).
### API client libraries
The storage management and cleanup automation methods described in this page use:
- The [`python-gitlab`](https://python-gitlab.readthedocs.io/en/stable/) library, which provides
a feature-rich programming interface.
- The `get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py` script in the [GitLab API with Python](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-python/) project.
For more information about use cases for the `python-gitlab` library,
see [Efficient DevSecOps workflows: Hands-on `python-gitlab` API automation](https://about.gitlab.com/blog/2023/02/01/efficient-devsecops-workflows-hands-on-python-gitlab-api-automation/).
For more information about other API client libraries, see [Third-party clients](../api/rest/third_party_clients.md).
{{< alert type="note" >}}
Use [GitLab Duo Code Suggestions](project/repository/code_suggestions/_index.md) to write code more efficiently.
{{< /alert >}}
## Storage analysis
### Identify storage types
The [projects API endpoint](../api/projects.md#list-all-projects) provides statistics for projects
in your GitLab instance. To use the projects API endpoint, set the `statistics` key to boolean `true`.
This data provides insight into storage consumption of the project by the following storage types:
- `storage_size`: Overall storage
- `lfs_objects_size`: LFS objects storage
- `job_artifacts_size`: Job artifacts storage
- `packages_size`: Packages storage
- `repository_size`: Git repository storage
- `snippets_size`: Snippets storage
- `uploads_size`: Uploads storage
- `wiki_size`: Wiki storage
To identify storage types:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID?statistics=true" | jq --compact-output '.id,.statistics' | jq
48349590
{
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
export GL_PROJECT_ID=48349590
glab api --method GET projects/$GL_PROJECT_ID --field 'statistics=true' | jq --compact-output '.id,.statistics' | jq
48349590
{
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
project_obj = gl.projects.get(project.id, statistics=True)
print("Project {n} statistics: {s}".format(n=project_obj.name_with_namespace, s=json.dump(project_obj.statistics, indent=4)))
```
{{< /tab >}}
{{< /tabs >}}
To print statistics for the project to the terminal, export the `GL_GROUP_ID` environment variable and run the script:
```shell
export GL_TOKEN=xxx
export GL_GROUP_ID=56595735
pip3 install python-gitlab
python3 get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py
Project Developer Evangelism and Technical Marketing at GitLab / playground / Artifact generator group / Gen Job Artifacts 4 statistics: {
"commit_count": 2,
"storage_size": 90241770,
"repository_size": 3521,
"wiki_size": 0,
"lfs_objects_size": 0,
"job_artifacts_size": 90238249,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
}
```
### Analyze storage in projects and groups
You can automate analysis of multiple projects and groups. For example, you can start at the top namespace level,
and recursively analyze all subgroups and projects. You can also analyze different storage types.
Here's an example of an algorithm to analyze multiple subgroups and projects:
1. Fetch the top-level namespace ID. You can copy the ID value from the [namespace/group overview](namespace/_index.md#types-of-namespaces).
1. Fetch all [subgroups](../api/groups.md#list-subgroups) from the top-level group, and save the IDs in a list.
1. Loop over all groups and fetch all [projects from each group](../api/groups.md#list-projects) and save the IDs in a list.
1. Identify the storage type to analyze, and collect the information from project attributes, like project statistics, and job artifacts.
1. Print an overview of all projects, grouped by group, and their storage information.
The shell approach with `glab` might be more suitable for smaller analyses. For larger analyses, you should use a script that
uses the API client libraries. This type of script can improve readability, data storage, flow control, testing, and reusability.
To ensure the script doesn't reach [API rate limits](../security/rate_limits.md), the following
example code is not optimized for parallel API requests.
To implement this algorithm:
{{< tabs >}}
{{< tab title="GitLab CLI" >}}
```shell
export GROUP_NAME="gitlab-da"
# Return subgroup IDs
glab api groups/$GROUP_NAME/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
12034712
67218622
67162711
67640130
16058698
12034604
# Loop over all subgroups to get subgroups, until the result set is empty. Example group: 12034712
glab api groups/12034712/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
56595735
70677315
67218606
70812167
# Lowest group level
glab api groups/56595735/subgroups | jq --compact-output '.[]' | jq --compact-output '.id'
# empty result, return and continue with analysis
# Fetch projects from all collected groups. Example group: 56595735
glab api groups/56595735/projects | jq --compact-output '.[]' | jq --compact-output '.id'
48349590
48349263
38520467
38520405
# Fetch storage types from a project (ID 48349590): Job artifacts in the `artifacts` key
glab api projects/48349590/jobs | jq --compact-output '.[]' | jq --compact-output '.id, .artifacts'
4828297946
[{"file_type":"archive","size":52444993,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":156,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3140,"filename":"job.log","file_format":null}]
4828297945
[{"file_type":"archive","size":20978113,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3147,"filename":"job.log","file_format":null}]
4828297944
[{"file_type":"archive","size":10489153,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":158,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3146,"filename":"job.log","file_format":null}]
4828297943
[{"file_type":"archive","size":5244673,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3145,"filename":"job.log","file_format":null}]
4828297940
[{"file_type":"archive","size":1049089,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":157,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":3140,"filename":"job.log","file_format":null}]
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
#!/usr/bin/env python
import datetime
import gitlab
import os
import sys
GITLAB_SERVER = os.environ.get('GL_SERVER', 'https://gitlab.com')
GITLAB_TOKEN = os.environ.get('GL_TOKEN') # token requires developer permissions
PROJECT_ID = os.environ.get('GL_PROJECT_ID') #optional
GROUP_ID = os.environ.get('GL_GROUP_ID') #optional
if __name__ == "__main__":
if not GITLAB_TOKEN:
print("🤔 Please set the GL_TOKEN env variable.")
sys.exit(1)
gl = gitlab.Gitlab(GITLAB_SERVER, private_token=GITLAB_TOKEN, pagination="keyset", order_by="id", per_page=100)
# Collect all projects, or prefer projects from a group id, or a project id
projects = []
# Direct project ID
if PROJECT_ID:
projects.append(gl.projects.get(PROJECT_ID))
# Groups and projects inside
elif GROUP_ID:
group = gl.groups.get(GROUP_ID)
for project in group.projects.list(include_subgroups=True, get_all=True):
manageable_project = gl.projects.get(project.id , lazy=True)
projects.append(manageable_project)
for project in projects:
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
print("DEBUG: ID {i}: {a}".format(i=job.id, a=job.attributes['artifacts']))
```
{{< /tab >}}
{{< /tabs >}}
The script outputs the project job artifacts in a JSON formatted list:
```json
[
{
"file_type": "archive",
"size": 1049089,
"filename": "artifacts.zip",
"file_format": "zip"
},
{
"file_type": "metadata",
"size": 157,
"filename": "metadata.gz",
"file_format": "gzip"
},
{
"file_type": "trace",
"size": 3146,
"filename": "job.log",
"file_format": null
}
]
```
## Manage CI/CD pipeline storage
Job artifacts consume most of the pipeline storage, and job logs can also generate several hundreds of kilobytes.
You should delete the unnecessary job artifacts first and then clean up job logs after analysis.
{{< alert type="warning" >}}
Deleting job log and artifacts is a destructive action that cannot be reverted. Use with caution. Deleting certain files, including report artifacts, job logs, and metadata files, affects GitLab features that use these files as data sources.
{{< /alert >}}
### List job artifacts
To analyze pipeline storage, you can use the [Job API endpoint](../api/jobs.md#list-project-jobs) to retrieve a list of
job artifacts. The endpoint returns the job artifacts `file_type` key in the `artifacts` attribute.
The `file_type` key indicates the artifact type:
- `archive` is used for the generated job artifacts as a zip file.
- `metadata` is used for additional metadata in a Gzip file.
- `trace` is used for the `job.log` as a raw file.
Job artifacts provide a data structure that can be written as a cache file to
disk, which you can use to test the implementation.
Based on the example code for fetching all projects, you can extend the Python script to do more analysis.
The following example shows a response from a query for job artifacts in a project:
```json
[
{
"file_type": "archive",
"size": 1049089,
"filename": "artifacts.zip",
"file_format": "zip"
},
{
"file_type": "metadata",
"size": 157,
"filename": "metadata.gz",
"file_format": "gzip"
},
{
"file_type": "trace",
"size": 3146,
"filename": "job.log",
"file_format": null
}
]
```
Based on how you implement the script, you could either:
- Collect all job artifacts and print a summary table at the end of the script.
- Print the information immediately.
In the following example, job artifacts are collected in the `ci_job_artifacts` list. The script
loops over all projects, and fetches:
- The `project_obj` object variable that contains all attributes.
- The `artifacts` attribute from the `job` object.
You can use [keyset pagination](https://python-gitlab.readthedocs.io/en/stable/api-usage.html#pagination)
to iterate over large lists of pipelines and jobs.
```python
ci_job_artifacts = []
for project in projects:
project_obj = gl.projects.get(project.id)
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
artifacts = job.attributes['artifacts']
#print("DEBUG: ID {i}: {a}".format(i=job.id, a=json.dumps(artifacts, indent=4)))
if not artifacts:
continue
for a in artifacts:
data = {
"project_id": project_obj.id,
"project_web_url": project_obj.name,
"project_path_with_namespace": project_obj.path_with_namespace,
"job_id": job.id,
"artifact_filename": a['filename'],
"artifact_file_type": a['file_type'],
"artifact_size": a['size']
}
ci_job_artifacts.append(data)
print("\nDone collecting data.")
if len(ci_job_artifacts) > 0:
print("| Project | Job | Artifact name | Artifact type | Artifact size |\n|---------|-----|---------------|---------------|---------------|") # Start markdown friendly table
for artifact in ci_job_artifacts:
print('| [{project_name}]({project_web_url}) | {job_name} | {artifact_name} | {artifact_type} | {artifact_size} |'.format(project_name=artifact['project_path_with_namespace'], project_web_url=artifact['project_web_url'], job_name=artifact['job_id'], artifact_name=artifact['artifact_filename'], artifact_type=artifact['artifact_file_type'], artifact_size=render_size_mb(artifact['artifact_size'])))
else:
print("No artifacts found.")
```
At the end of the script, job artifacts are printed as a Markdown formatted table. You can copy the table
content to an issue comment or description, or populate a Markdown file in a GitLab repository.
```shell
$ python3 get_all_projects_top_level_namespace_storage_analysis_cleanup_example.py
| Project | Job | Artifact name | Artifact type | Artifact size |
|---------|-----|---------------|---------------|---------------|
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | artifacts.zip | archive | 50.0154 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | metadata.gz | metadata | 0.0001 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297946 | job.log | trace | 0.0030 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | artifacts.zip | archive | 20.0063 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | metadata.gz | metadata | 0.0001 |
| [gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4](Gen Job Artifacts 4) | 4828297945 | job.log | trace | 0.0030 |
```
### Delete job artifacts in bulk
You can use a Python script to filter the types of job artifacts to delete in bulk.
Filter the API queries results to compare:
- The `created_at` value to calculate the artifact age.
- The `size` attribute to determine if artifacts meet the size threshold.
A typical request:
- Deletes job artifacts older than the specified number of days.
- Deletes job artifacts that exceed a specified amount of storage. For example, 100 MB.
In the following example, the script loops through job attributes and marks them for deletion.
When the collection loops remove the object locks, the script deletes the job artifacts marked for deletion.
```python
for project in projects:
project_obj = gl.projects.get(project.id)
jobs = project.jobs.list(pagination="keyset", order_by="id", per_page=100, iterator=True)
for job in jobs:
artifacts = job.attributes['artifacts']
if not artifacts:
continue
# Advanced filtering: Age and Size
# Example: 90 days, 10 MB threshold (TODO: Make this configurable)
threshold_age = 90 * 24 * 60 * 60
threshold_size = 10 * 1024 * 1024
# job age, need to parse API format: 2023-08-08T22:41:08.270Z
created_at = datetime.datetime.strptime(job.created_at, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
age = (now - created_at).total_seconds()
# Shorter: Use a function
# age = calculate_age(job.created_at)
for a in artifacts:
# Analysis collection code removed for readability
# Advanced filtering: match job artifacts age and size against thresholds
if (float(age) > float(threshold_age)) or (float(a['size']) > float(threshold_size)):
# mark job for deletion (cannot delete inside the loop)
jobs_marked_delete_artifacts.append(job)
print("\nDone collecting data.")
# Advanced filtering: Delete all job artifacts marked to being deleted.
for job in jobs_marked_delete_artifacts:
# delete the artifact
print("DEBUG", job)
job.delete_artifacts()
# Print collection summary (removed for readability)
```
### Delete all job artifacts for a project
If you do not need the project's [job artifacts](../ci/jobs/job_artifacts.md), you can
use the following command to delete all job artifacts. This action cannot be reverted.
Artifact deletion can take several minutes or hours, depending on the number of artifacts to delete. Subsequent
analysis queries against the API might return the artifacts as a false-positive result.
To avoid confusion with results, do not immediately run additional API requests.
The [artifacts for the most recent successful jobs](../ci/jobs/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs) are kept by default.
To delete all job artifacts for a project:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GL_PROJECT_ID=48349590
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" --request DELETE "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID/artifacts"
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
glab api --method GET projects/$GL_PROJECT_ID/jobs | jq --compact-output '.[]' | jq --compact-output '.id, .artifacts'
glab api --method DELETE projects/$GL_PROJECT_ID/artifacts
```
{{< /tab >}}
{{< tab title="Python" >}}
```python
project.artifacts.delete()
```
{{< /tab >}}
{{< /tabs >}}
### Delete job logs
When you delete a job log you also [erase the entire job](../api/jobs.md#erase-a-job).
Example with the GitLab CLI:
```shell
glab api --method GET projects/$GL_PROJECT_ID/jobs | jq --compact-output '.[]' | jq --compact-output '.id'
4836226184
4836226183
4836226181
4836226180
glab api --method POST projects/$GL_PROJECT_ID/jobs/4836226180/erase | jq --compact-output '.name,.status'
"generate-package: [1]"
"success"
```
In the `python-gitlab` API library, use [`job.erase()`](https://python-gitlab.readthedocs.io/en/stable/gl_objects/pipelines_and_jobs.html#jobs) instead of `job.delete_artifacts()`.
To avoid this API call from being blocked, set the script to sleep for a short amount of time between calls
that delete the job artifact:
```python
for job in jobs_marked_delete_artifacts:
# delete the artifacts and job log
print("DEBUG", job)
#job.delete_artifacts()
job.erase()
# Sleep for 1 second
time.sleep(1)
```
Support for creating a retention policy for job logs is proposed in [issue 374717](https://gitlab.com/gitlab-org/gitlab/-/issues/374717).
### Delete old pipelines
Pipelines do not add to the overall storage usage, but if required you can [automate their deletion](../ci/pipelines/settings.md#automatic-pipeline-cleanup).
To delete pipelines based on a specific date, specify the `created_at` key.
You can use the date to calculate the difference between the current date and
when the pipeline was created. If the age is larger than the threshold, the pipeline is deleted.
{{< alert type="note" >}}
The `created_at` key must be converted from a timestamp to Unix epoch time,
for example with `date -d '2023-08-08T18:59:47.581Z' +%s`.
{{< /alert >}}
Example with GitLab CLI:
```shell
export GL_PROJECT_ID=48349590
glab api --method GET projects/$GL_PROJECT_ID/pipelines | jq --compact-output '.[]' | jq --compact-output '.id,.created_at'
960031926
"2023-08-08T22:09:52.745Z"
959884072
"2023-08-08T18:59:47.581Z"
glab api --method DELETE projects/$GL_PROJECT_ID/pipelines/960031926
glab api --method GET projects/$GL_PROJECT_ID/pipelines | jq --compact-output '.[]' | jq --compact-output '.id,.created_at'
959884072
"2023-08-08T18:59:47.581Z"
```
In the following example that uses a Bash script:
- `jq` and the GitLab CLI are installed and authorized.
- The exported environment variable `GL_PROJECT_ID`. Defaults to the GitLab predefined variable `CI_PROJECT_ID`.
- The exported environment variable `CI_SERVER_HOST` that points to the GitLab instance URL.
{{< tabs >}}
{{< tab title="Using the API with glab" >}}
The full script `get_cicd_pipelines_compare_age_threshold_example.sh` is located in the [GitLab API with Linux Shell](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-linux-shell) project.
```shell
#!/bin/bash
# Required programs:
# - GitLab CLI (glab): https://docs.gitlab.com/ee/editor_extensions/gitlab_cli/
# - jq: https://jqlang.github.io/jq/
# Required variables:
# - PAT: Project Access Token with API scope and Owner role, or Personal Access Token with API scope
# - GL_PROJECT_ID: ID of the project where pipelines must be cleaned
# - AGE_THRESHOLD (optional): Maximum age in days of pipelines to keep (default: 90)
set -euo pipefail
# Constants
DEFAULT_AGE_THRESHOLD=90
SECONDS_PER_DAY=$((24 * 60 * 60))
# Functions
log_info() {
echo "[INFO] $1"
}
log_error() {
echo "[ERROR] $1" >&2
}
delete_pipeline() {
local project_id=$1
local pipeline_id=$2
if glab api --method DELETE "projects/$project_id/pipelines/$pipeline_id"; then
log_info "Deleted pipeline ID $pipeline_id"
else
log_error "Failed to delete pipeline ID $pipeline_id"
fi
}
# Main script
main() {
# Authenticate
if ! glab auth login --hostname "$CI_SERVER_HOST" --token "$PAT"; then
log_error "Authentication failed"
exit 1
fi
# Set variables
AGE_THRESHOLD=${AGE_THRESHOLD:-$DEFAULT_AGE_THRESHOLD}
AGE_THRESHOLD_IN_SECONDS=$((AGE_THRESHOLD * SECONDS_PER_DAY))
GL_PROJECT_ID=${GL_PROJECT_ID:-$CI_PROJECT_ID}
# Fetch pipelines
PIPELINES=$(glab api --method GET "projects/$GL_PROJECT_ID/pipelines")
if [ -z "$PIPELINES" ]; then
log_error "Failed to fetch pipelines or no pipelines found"
exit 1
fi
# Process pipelines
echo "$PIPELINES" | jq -r '.[] | [.id, .created_at] | @tsv' | while IFS=$'\t' read -r id created_at; do
CREATED_AT_TS=$(date -d "$created_at" +%s)
NOW=$(date +%s)
AGE=$((NOW - CREATED_AT_TS))
if [ "$AGE" -gt "$AGE_THRESHOLD_IN_SECONDS" ]; then
log_info "Pipeline ID $id created at $created_at is older than threshold $AGE_THRESHOLD days, deleting..."
delete_pipeline "$GL_PROJECT_ID" "$id"
else
log_info "Pipeline ID $id created at $created_at is not older than threshold $AGE_THRESHOLD days. Ignoring."
fi
done
}
main
```
{{< /tab >}}
{{< tab title="Using the glab CLI" >}}
The full script `cleanup-old-pipelines.sh` is located in the [GitLab API with Linux Shell](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-linux-shell) project.
```shell
#!/bin/bash
set -euo pipefail
# Required environment variables:
# PAT: Project Access Token with API scope and Owner role, or Personal Access Token with API scope.
# Optional environment variables:
# AGE_THRESHOLD: Maximum age (in days) of pipelines to keep. Default: 90 days.
# REPO: Repository to clean up. If not set, the current repository will be used.
# CI_SERVER_HOST: GitLab server hostname.
# Function to display error message and exit
error_exit() {
echo "Error: $1" >&2
exit 1
}
# Validate required environment variables
[[ -z "${PAT:-}" ]] && error_exit "PAT (Project Access Token or Personal Access Token) is not set."
[[ -z "${CI_SERVER_HOST:-}" ]] && error_exit "CI_SERVER_HOST is not set."
# Set and validate AGE_THRESHOLD
AGE_THRESHOLD=${AGE_THRESHOLD:-90}
[[ ! "$AGE_THRESHOLD" =~ ^[0-9]+$ ]] && error_exit "AGE_THRESHOLD must be a positive integer."
AGE_THRESHOLD_IN_HOURS=$((AGE_THRESHOLD * 24))
echo "Deleting pipelines older than $AGE_THRESHOLD days"
# Authenticate with GitLab
glab auth login --hostname "$CI_SERVER_HOST" --token "$PAT" || error_exit "Authentication failed"
# Delete old pipelines
delete_cmd="glab ci delete --older-than ${AGE_THRESHOLD_IN_HOURS}h"
if [[ -n "${REPO:-}" ]]; then
delete_cmd+=" --repo $REPO"
fi
$delete_cmd || error_exit "Pipeline deletion failed"
echo "Pipeline cleanup completed."
```
{{< /tab >}}
{{< tab title="Using the API with Python" >}}
You can also use the [`python-gitlab` API library](https://python-gitlab.readthedocs.io/en/stable/gl_objects/pipelines_and_jobs.html#project-pipelines) and
the `created_at` attribute to implement a similar algorithm that compares the job artifact age:
```python
# ...
for pipeline in project.pipelines.list(iterator=True):
pipeline_obj = project.pipelines.get(pipeline.id)
print("DEBUG: {p}".format(p=json.dumps(pipeline_obj.attributes, indent=4)))
created_at = datetime.datetime.strptime(pipeline.created_at, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
age = (now - created_at).total_seconds()
threshold_age = 90 * 24 * 60 * 60
if (float(age) > float(threshold_age)):
print("Deleting pipeline", pipeline.id)
pipeline_obj.delete()
```
{{< /tab >}}
{{< /tabs >}}
### List expiry settings for job artifacts
To manage artifact storage, you can update or configure when an artifact expires.
The expiry setting for artifacts are configured in each job configuration in the `.gitlab-ci.yml`.
If there are multiple projects, and based on how job definitions are organized in the CI/CD configuration, it might be difficult
to locate the expiry setting. You can use a script to search the entire CI/CD configuration. This includes access to objects that
are resolved after they inherit values, like `extends` or `!reference`.
The script retrieves merged CI/CD configuration files and searches for the artifacts key to:
- Identify jobs that do not have an expiry setting.
- Return expiry settings for jobs that have the artifact expiry configured.
The following process describes how the script searches for the artifact expiry setting:
1. To generate a merged CI/CD configuration, the script loops over all projects and calls
the [`ci_lint()`](https://python-gitlab.readthedocs.io/en/stable/gl_objects/ci_lint.html) method.
1. The `yaml_load` function loads the merged configuration into Python data structures for more analysis.
1. A dictionary that also has the key `script` identifies itself as a job definition, where the `artifacts`
key might exists.
1. If yes, the script parses the sub key `expire_in` and stores the details to print later in a Markdown table summary.
```python
ci_job_artifacts_expiry = {}
# Loop over projects, fetch .gitlab-ci.yml, run the linter to get the full translated config, and extract the `artifacts:` setting
# https://python-gitlab.readthedocs.io/en/stable/gl_objects/ci_lint.html
for project in projects:
project_obj = gl.projects.get(project.id)
project_name = project_obj.name
project_web_url = project_obj.web_url
try:
lint_result = project.ci_lint.get()
if lint_result.merged_yaml is None:
continue
ci_pipeline = yaml.safe_load(lint_result.merged_yaml)
#print("Project {p} Config\n{c}\n\n".format(p=project_name, c=json.dumps(ci_pipeline, indent=4)))
for k in ci_pipeline:
v = ci_pipeline[k]
# This is a job object with `script` attribute
if isinstance(v, dict) and 'script' in v:
print(".", end="", flush=True) # Get some feedback that it is still looping
artifacts = v['artifacts'] if 'artifacts' in v else {}
print("Project {p} job {j} artifacts {a}".format(p=project_name, j=k, a=json.dumps(artifacts, indent=4)))
expire_in = None
if 'expire_in' in artifacts:
expire_in = artifacts['expire_in']
store_key = project_web_url + '_' + k
ci_job_artifacts_expiry[store_key] = { 'project_web_url': project_web_url,
'project_name': project_name,
'job_name': k,
'artifacts_expiry': expire_in}
except Exception as e:
print(f"Exception searching artifacts on ci_pipelines: {e}".format(e=e))
if len(ci_job_artifacts_expiry) > 0:
print("| Project | Job | Artifact expiry |\n|---------|-----|-----------------|") #Start markdown friendly table
for k, details in ci_job_artifacts_expiry.items():
if details['job_name'][0] == '.':
continue # ignore job templates that start with a '.'
print(f'| [{ details["project_name"] }]({details["project_web_url"]}) | { details["job_name"] } | { details["artifacts_expiry"] if details["artifacts_expiry"] is not None else "❌ N/A" } |')
```
The script generates a Markdown summary table with:
- Project name and URL.
- Job name.
- The `artifacts:expire_in` setting, or `N/A` if there is no setting.
The script does not print job templates that:
- Start with a `.` character.
- Are not instantiated as runtime job objects that generate artifacts.
```shell
export GL_GROUP_ID=56595735
# Install script dependencies
python3 -m pip install 'python-gitlab[yaml]'
python3 get_all_cicd_config_artifacts_expiry.py
| Project | Job | Artifact expiry |
|---------|-----|-----------------|
| [Gen Job Artifacts 4](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-4) | generator | 30 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job10 | 10 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job1 | 1 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | included-job30 | 30 days |
| [Gen Job Artifacts with expiry and included jobs](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) | generator | 30 days |
| [Gen Job Artifacts 2](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-2) | generator | ❌ N/A |
| [Gen Job Artifacts 1](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-1) | generator | ❌ N/A |
```
The `get_all_cicd_config_artifacts_expiry.py` script is located in the [GitLab API with Python project](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-api-python/).
Alternatively, you can use [advanced search](search/advanced_search.md) with API requests. The following example uses the [scope: blobs](../api/search.md#scope-blobs) to searches for the string `artifacts` in all `*.yml` files:
```shell
# https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs
export GL_PROJECT_ID=48349263
glab api --method GET projects/$GL_PROJECT_ID/search --field "scope=blobs" --field "search=expire_in filename:*.yml"
```
For more information about the inventory approach, see [How GitLab can help mitigate deletion of open source container images on Docker Hub](https://about.gitlab.com/blog/2023/03/16/how-gitlab-can-help-mitigate-deletion-open-source-images-docker-hub/).
### Set default expiry for job artifacts
To set the default expiry for job artifacts in a project, specify the `expire_in` value in the `.gitlab-ci.yml` file:
```yaml
default:
artifacts:
expire_in: 1 week
```
## Manage Container Registries storage
Container registries are available [for projects](../api/container_registry.md#within-a-project) or [for groups](../api/container_registry.md#within-a-group). You can analyze both locations to implement a cleanup strategy.
### List container registries
To list Container Registries in a project:
{{< tabs >}}
{{< tab title="curl" >}}
```shell
export GL_PROJECT_ID=48057080
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/projects/$GL_PROJECT_ID/registry/repositories" | jq --compact-output '.[]' | jq --compact-output '.id,.location' | jq
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
curl --silent --header "Authorization: Bearer $GITLAB_TOKEN" "https://gitlab.com/api/v4/registry/repositories/4435617?size=true" | jq --compact-output '.id,.location,.size'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
3401613
```
{{< /tab >}}
{{< tab title="GitLab CLI" >}}
```shell
export GL_PROJECT_ID=48057080
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories | jq --compact-output '.[]' | jq --compact-output '.id,.location'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
glab api --method GET registry/repositories/4435617 --field='size=true' | jq --compact-output '.id,.location,.size'
4435617
"registry.gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator"
3401613
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories/4435617/tags | jq --compact-output '.[]' | jq --compact-output '.name'
"latest"
glab api --method GET projects/$GL_PROJECT_ID/registry/repositories/4435617/tags/latest | jq --compact-output '.name,.created_at,.total_size'
"latest"
"2023-08-07T19:20:20.894+00:00"
3401613
```
{{< /tab >}}
{{< /tabs >}}
### Delete container images in bulk
When you [delete container image tags in bulk](../api/container_registry.md#delete-registry-repository-tags-in-bulk),
you can configure:
- The matching regular expressions for tag names and images to keep (`name_regex_keep`) or delete (`name_regex_delete`)
- The number of image tags to keep matching the tag name (`keep_n`)
- The number of days before an image tag can be deleted (`older_than`)
{{< alert type="warning" >}}
On GitLab.com, due to the scale of the container registry, the number of tags deleted by this API is limited.
If your container registry has a large number of tags to delete, only some of them are deleted. You might need
to call the API multiple times. To schedule tags for automatic deletion, use a [cleanup policy](#create-a-cleanup-policy-for-containers) instead.
{{< /alert >}}
The following example uses the [`python-gitlab` API library](https://python-gitlab.readthedocs.io/en/stable/gl_objects/repository_tags.html) to fetch a list of tags, and calls the `delete_in_bulk()` method with filter parameters.
```python
repositories = project.repositories.list(iterator=True, size=True)
if len(repositories) > 0:
repository = repositories.pop()
tags = repository.tags.list()
# Cleanup: Keep only the latest tag
repository.tags.delete_in_bulk(keep_n=1)
# Cleanup: Delete all tags older than 1 month
repository.tags.delete_in_bulk(older_than="1m")
# Cleanup: Delete all tags matching the regex `v.*`, and keep the latest 2 tags
repository.tags.delete_in_bulk(name_regex_delete="v.+", keep_n=2)
```
### Create a cleanup policy for containers
Use the project REST API endpoint to [create cleanup policies](packages/container_registry/reduce_container_registry_storage.md#use-the-cleanup-policy-api) for containers. After you set the cleanup policy, all container images that match your specifications are deleted automatically. You do not need additional API automation scripts.
To send the attributes as a body parameter:
- Use the `--input -` parameter to read from the standard input.
- Set the `Content-Type` header.
The following example uses the GitLab CLI to create a cleanup policy:
```shell
export GL_PROJECT_ID=48057080
echo '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":".*","name_regex_keep":".*-main"}}' | glab api --method PUT --header 'Content-Type: application/json;charset=UTF-8' projects/$GL_PROJECT_ID --input -
...
"container_expiration_policy": {
"cadence": "1month",
"enabled": true,
"keep_n": 1,
"older_than": "14d",
"name_regex": ".*",
"name_regex_keep": ".*-main",
"next_run_at": "2023-09-08T21:16:25.354Z"
},
```
### Optimize container images
You can optimize container images to reduce the image size and overall storage consumption in the container registry. Learn more in the [pipeline efficiency documentation](../ci/pipelines/pipeline_efficiency.md#optimize-docker-images).
## Manage package registry storage
Package registries are available [for projects](../api/packages.md#for-a-project) or [for groups](../api/packages.md#for-a-group).
### List packages and files
The following example shows fetching packages from a defined project ID using the GitLab CLI. The result set is an array of dictionary items that can be filtered with the `jq` command chain.
```shell
# https://gitlab.com/gitlab-da/playground/container-package-gen-group/generic-package-generator
export GL_PROJECT_ID=48377643
glab api --method GET projects/$GL_PROJECT_ID/packages | jq --compact-output '.[]' | jq --compact-output '.id,.name,.package_type'
16669383
"generator"
"generic"
16671352
"generator"
"generic"
16672235
"generator"
"generic"
16672237
"generator"
"generic"
```
Use the package ID to inspect the files and their size in the package.
```shell
glab api --method GET projects/$GL_PROJECT_ID/packages/16669383/package_files | jq --compact-output '.[]' |
jq --compact-output '.package_id,.file_name,.size'
16669383
"nighly.tar.gz"
10487563
```
A similar automation shell script is created in the [delete old pipelines](#delete-old-pipelines) section.
The following script example uses the `python-gitlab` library to fetch all packages in a loop,
and loops over its package files to print the `file_name` and `size` attributes.
```python
packages = project.packages.list(order_by="created_at")
for package in packages:
package_files = package.package_files.list()
for package_file in package_files:
print("Package name: {p} File name: {f} Size {s}".format(
p=package.name, f=package_file.file_name, s=render_size_mb(package_file.size)))
```
### Delete packages
[Deleting a file in a package](../api/packages.md#delete-a-package-file) can corrupt the package. You should delete the package when performing automated cleanup maintenance.
To delete a package, use the GitLab CLI to change the `--method`
parameter to `DELETE`:
```shell
glab api --method DELETE projects/$GL_PROJECT_ID/packages/16669383
```
To calculate the package size and compare it against a size threshold, you can use the `python-gitlab` library
to extend the code described in the [list packages and files](#list-packages-and-files) section.
The following code example also calculates the package age and deletes the package when the conditions match:
```python
packages = project.packages.list(order_by="created_at")
for package in packages:
package_size = 0.0
package_files = package.package_files.list()
for package_file in package_files:
print("Package name: {p} File name: {f} Size {s}".format(
p=package.name, f=package_file.file_name, s=render_size_mb(package_file.size)))
package_size =+ package_file.size
print("Package size: {s}\n\n".format(s=render_size_mb(package_size)))
threshold_size = 10 * 1024 * 1024
if (package_size > float(threshold_size)):
print("Package size {s} > threshold {t}, deleting package.".format(
s=render_size_mb(package_size), t=render_size_mb(threshold_size)))
package.delete()
threshold_age = 90 * 24 * 60 * 60
package_age = created_at = calculate_age(package.created_at)
if (float(package_age > float(threshold_age))):
print("Package age {a} > threshold {t}, deleting package.".format(
a=render_age_time(package_age), t=render_age_time(threshold_age)))
package.delete()
```
The code generates the following output that you can use for further analysis:
```shell
Package name: generator File name: nighly.tar.gz Size 10.0017
Package size: 10.0017
Package size 10.0017 > threshold 10.0000, deleting package.
Package name: generator File name: 1-nightly.tar.gz Size 1.0004
Package size: 1.0004
Package name: generator File name: 10-nightly.tar.gz Size 10.0018
Package name: generator File name: 20-nightly.tar.gz Size 20.0033
Package size: 20.0033
Package size 20.0033 > threshold 10.0000, deleting package.
```
### Dependency Proxy
Review the [cleanup policy](packages/dependency_proxy/reduce_dependency_proxy_storage.md#cleanup-policies) and how to [purge the cache using the API](packages/dependency_proxy/reduce_dependency_proxy_storage.md#use-the-api-to-clear-the-cache)
## Improve output readability
You might need to convert timestamp seconds into a duration format, or print raw bytes in a more
representative format. You can use the following helper functions to transform values for improved
readability:
```shell
# Current Unix timestamp
date +%s
# Convert `created_at` date time with timezone to Unix timestamp
date -d '2023-08-08T18:59:47.581Z' +%s
```
Example with Python that uses the `python-gitlab` API library:
```python
def render_size_mb(v):
return "%.4f" % (v / 1024 / 1024)
def render_age_time(v):
return str(datetime.timedelta(seconds = v))
# Convert `created_at` date time with timezone to Unix timestamp
def calculate_age(created_at_datetime):
created_at_ts = datetime.datetime.strptime(created_at_datetime, '%Y-%m-%dT%H:%M:%S.%fZ')
now = datetime.datetime.now()
return (now - created_at_ts).total_seconds()
```
## Testing for storage management automation
To test storage management automation, you might need to generate test data, or populate
storage to verify that the analysis and deletion works as expected. The following sections
provide tools and tips about testing and generating storage blobs in a short amount of time.
### Generate job artifacts
Create a test project to generate fake artifact blobs using CI/CD job matrix builds. Add a CI/CD pipeline to generate artifacts on a daily basis
1. Create a new project.
1. Add the following snippet to `.gitlab-ci.yml` to include the job artifact generator configuration.
```yaml
include:
- remote: https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator/-/raw/main/.gitlab-ci.yml
```
1. [Configure pipeline schedules](../ci/pipelines/schedules.md#add-a-pipeline-schedule).
1. [Trigger the pipeline manually](../ci/pipelines/schedules.md#run-manually).
Alternatively, reduce the 86 MB daily generated MB to different values in the `MB_COUNT` variable.
```yaml
include:
- remote: https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator/-/raw/main/.gitlab-ci.yml
generator:
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20, 50]
```
For more information, see the [Job Artifact Generator README](https://gitlab.com/gitlab-da/use-cases/efficiency/job-artifact-generator), with an [example group](https://gitlab.com/gitlab-da/playground/artifact-gen-group).
### Generate job artifacts with expiry
The project CI/CD configuration specifies job definitions in:
- The main `.gitlab-ci.yml` configuration file.
- The `artifacts:expire_in` setting.
- Project files and templates.
To test the analysis scripts, the [`gen-job-artifacts-expiry-included-jobs`](https://gitlab.com/gitlab-da/playground/artifact-gen-group/gen-job-artifacts-expiry-included-jobs) project provides an example configuration.
```yaml
# .gitlab-ci.yml
include:
- include_jobs.yml
default:
artifacts:
paths:
- '*.txt'
.gen-tmpl:
script:
- dd if=/dev/urandom of=${$MB_COUNT}.txt bs=1048576 count=${$MB_COUNT}
generator:
extends: [.gen-tmpl]
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20, 50]
artifacts:
untracked: false
when: on_success
expire_in: 30 days
# include_jobs.yml
.includeme:
script:
- dd if=/dev/urandom of=1.txt bs=1048576 count=1
included-job10:
script:
- echo "Servus"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 10 days
included-job1:
script:
- echo "Gruezi"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 1 days
included-job30:
script:
- echo "Grias di"
- !reference [.includeme, script]
artifacts:
untracked: false
when: on_success
expire_in: 30 days
```
### Generate container images
The example group [`container-package-gen-group`](https://gitlab.com/gitlab-da/playground/container-package-gen-group) provides projects that:
- Use a base image in Dockerfile to build a new image.
- Include the `Docker.gitlab-ci.yml` template to build images on GitLab.com SaaS.
- Configure pipeline schedules to generate new images daily.
Example projects available to fork:
- [`docker-alpine-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/docker-alpine-generator)
- [`docker-python-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/docker-python-generator)
### Generate generic packages
The example project [`generic-package-generator`](https://gitlab.com/gitlab-da/playground/container-package-gen-group/generic-package-generator) provides projects that:
- Generate a random text blob, and create a tarball with the current Unix timestamp as release version.
- Upload the tarball into the generic package registry, using the Unix timestamp as release version.
To generate generic packages, you can use this standalone `.gitlab-ci.yml` configuration:
```yaml
generate-package:
parallel:
matrix:
- MB_COUNT: [1, 5, 10, 20]
before_script:
- apt update && apt -y install curl
script:
- dd if=/dev/urandom of="${MB_COUNT}.txt" bs=1048576 count=${MB_COUNT}
- tar czf "generated-$MB_COUNT-nighly-`date +%s`.tar.gz" "${MB_COUNT}.txt"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "generated-$MB_COUNT-nighly-`date +%s`.tar.gz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/generator/`date +%s`/${MB_COUNT}-nightly.tar.gz"'
artifacts:
paths:
- '*.tar.gz'
```
### Generate storage usage with forks
Use the following projects to test storage usage with [cost factors for forks](storage_usage_quotas.md#view-project-fork-storage-usage):
- Fork [`gitlab-org/gitlab`](https://gitlab.com/gitlab-org/gitlab) into a new namespace or group (includes LFS, Git repository).
- Fork [`gitlab-com/www-gitlab-com`](https://gitlab.com/gitlab-com/www-gitlab-com) into a new namespace or group.
## Community resources
The following resources are not officially supported. Ensure to test scripts and tutorials before running destructive cleanup commands that may not be reverted.
- Forum topic: [Storage management automation resources](https://forum.gitlab.com/t/storage-management-automation-resources/91184)
- Script: [GitLab Storage Analyzer](https://gitlab.com/gitlab-da/use-cases/gitlab-api/gitlab-storage-analyzer), unofficial project by the [GitLab Developer Evangelism team](https://gitlab.com/gitlab-da/). You find similar code examples in this documentation how-to here.
|
https://docs.gitlab.com/markdown
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/markdown.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
markdown.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Flavored Markdown (GLFM)
|
Formatting, inline HTML, GitLab-specific references, diagrams, and flowcharts.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Flavored Markdown (GLFM) is a powerful markup language that formats text in the GitLab user interface.
GLFM:
- Creates rich content with support for code, diagrams, math equations, and multimedia.
- Links issues, merge requests, and other GitLab content with cross-references.
- Organizes information with task lists, tables, and collapsible sections.
- Supports syntax highlighting for over 100 programming languages.
- Ensures accessibility with semantic heading structures and image descriptions.
When you enter text in the GitLab UI, GitLab assumes the text is in GitLab Flavored Markdown.
You can use GitLab Flavored Markdown in:
- Comments
- Issues
- Epics
- Merge requests
- Milestones
- Snippets (the snippet must be named with a `.md` extension)
- Wiki pages
- Markdown documents inside repositories
- Releases
You can also use other rich text files in GitLab. You might have to install a dependency
to do so. For more information, see the [`gitlab-markup` gem project](https://gitlab.com/gitlab-org/gitlab-markup).
{{< alert type="note" >}}
This Markdown specification is valid for GitLab only. We do our best to render the Markdown faithfully here,
however the [GitLab documentation website](https://docs.gitlab.com) and the [GitLab handbook](https://handbook.gitlab.com)
use a different Markdown renderer.
{{< /alert >}}
To see exact examples of how GitLab renders any of these examples:
1. Copy the relevant raw Markdown example (not the rendered version of the example).
1. Paste the Markdown somewhere in GitLab that supports Markdown previews, for example
issue or merge request comments or descriptions, or a new Markdown file.
1. Select **Preview** to view the GitLab-rendered Markdown.
## Differences with standard Markdown
<!--
Use this topic to list features that are not present in standard Markdown.
Don't repeat this information in each individual topic, unless there's a specific
reason, like in "Newlines".
-->
GitLab Flavored Markdown consists of the following:
- Core Markdown features, based on the [CommonMark specification](https://spec.commonmark.org/current/).
- Extensions from [GitHub Flavored Markdown](https://github.github.com/gfm/).
- Extensions made specifically for GitLab.
All standard Markdown formatting should work as expected in GitLab. Some standard
functionality is extended with additional features, without affecting the standard usage.
The following features are not found in standard Markdown:
- [Alerts](#alerts)
- [Color chips written in `HEX`, `RGB` or `HSL`](#colors)
- [Description lists](#description-lists)
- [Diagrams and flowcharts](#diagrams-and-flowcharts)
- [Emoji](#emoji)
- [Footnotes](#footnotes)
- [Front matter](#front-matter)
- [GitLab-specific references](#gitlab-specific-references)
- [Includes](#includes)
- [Placeholders](#placeholders)
- [Inline diffs](#inline-diff)
- [Math equations and symbols written in LaTeX](#math-equations)
- [Strikethrough](#emphasis)
- [Table of Contents](#table-of-contents)
- [Tables](#tables)
- [Task lists](#task-lists)
- [Wiki-specific Markdown](project/wiki/markdown.md)
The following features are extended from standard Markdown:
| Standard Markdown | Extended Markdown in GitLab |
|---------------------------------------|-----------------------------|
| [Blockquotes](#blockquotes) | [Multiline blockquotes](#multiline-blockquote) |
| [Code blocks](#code-spans-and-blocks) | [Colored code and syntax highlighting](#syntax-highlighting) |
| [Headings](#headings) | [Linkable heading IDs](#heading-ids-and-links) |
| [Images](#images) | [Embedded videos](#videos) and [audio](#audio) |
| [Links](#links) | [Automatically linking URLs](#url-auto-linking) |
## Markdown and accessibility
When you use GitLab Flavored Markdown, you are creating digital content.
This content should be as accessible as possible to your audience.
The following list is not exhaustive, but it provides guidance for some of the GitLab Flavored Markdown styles to pay
particular attention to:
### Accessible headings
Use heading formatting to create a logical heading structure.
The structure of headings on a page should make sense, like a good table of contents.
Ensure that there is only one `h1` element on a page, that heading levels are not skipped, and that they are nested correctly.
### Accessible tables
To keep tables accessible and scannable, tables should not have any empty cells.
If there is no otherwise meaningful value for a cell, consider entering **N/A** for "not applicable" or **None**.
### Accessible images and videos
Describe the image or video in the `[alt text]`. Make the description accurate, succinct, and unique.
Don't use `image of` or `video of` in the description. For more information, see [WebAim Alternative Text](https://webaim.org/techniques/alttext/).
## Headings
Create headings from 1 to 6 by using `#`.
```markdown
# H1
## H2
### H3
#### H4
##### H5
###### H6
```
Alternatively, for H1 and H2, use an underline style:
```markdown
Alt-H1
======
Alt-H2
------
```
### Heading IDs and links
{{< history >}}
- Heading link generation [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/440733) in GitLab 17.0.
{{< /history >}}
All Markdown-rendered headings automatically
get IDs that can be linked to, except in comments.
On hover, a link to those IDs becomes visible to make it easier to copy the link to
the heading to use it somewhere else.
The IDs are generated from the content of the heading according to the following rules:
1. All text is converted to lowercase.
1. All non-word text (such as punctuation or HTML) is removed.
1. All spaces are converted to hyphens.
1. Two or more hyphens in a row are converted to one.
1. If a heading with the same ID has already been generated, a unique
incrementing number is appended, starting at 1.
Example:
```markdown
# This heading has spaces in it
## This heading has a :thumbsup: in it
# This heading has Unicode in it: 한글
## This heading has spaces in it
### This heading has spaces in it
## This heading has 3.5 in it (and parentheses)
## This heading has multiple spaces and --- hyphens
```
Would generate the following link IDs:
1. `this-heading-has-spaces-in-it`
1. `this-heading-has-a-thumbsup-in-it`
1. `this-heading-has-unicode-in-it-한글`
1. `this-heading-has-spaces-in-it-1`
1. `this-heading-has-spaces-in-it-2`
1. `this-heading-has-35-in-it-and-parentheses`
1. `this-heading-has--multiple-spaces-and-----hyphens`
## Line breaks
A line break is inserted (a new paragraph starts) if the previous text is
ended with two newlines. For example, when you press <kbd>Enter</kbd> twice in a row. If you only
use one newline (press <kbd>Enter</kbd> once), the next sentence remains part of the
same paragraph. Use this approach if you want to keep long lines from wrapping, and keep
them editable:
```markdown
Here's a line for us to start with.
This longer line is separated from the one above by two newlines, so it is a *separate paragraph*.
This line is also a separate paragraph, but...
These lines are only separated by single newlines,
so they *do not break* and just follow the previous lines
in the *same paragraph*.
```
When rendered, the example looks similar to:
> Here's a line for us to start with.
>
> This longer line is separated from the one above by two newlines, so it is a *separate paragraph*.
>
> This line is also a separate paragraph, but...
> These lines are only separated by single newlines,
> so they *do not break* and just follow the previous lines
> in the *same paragraph*.
### Newlines
GitLab Flavored Markdown adheres to the Markdown specification for handling
[paragraphs and line breaks](https://spec.commonmark.org/current/).
A paragraph is one or more consecutive lines of text, separated by one or
more blank lines (two newlines at the end of the first paragraph), as explained in [line breaks](#line-breaks).
Need more control over line breaks or soft returns? Add a single line break
by ending a line with a backslash, or two or more spaces. Two newlines in a row create a new
paragraph, with a blank line in between:
```markdown
First paragraph.
Another line in the same paragraph.
A third line in the same paragraph, but this time ending with two spaces.<space><space>
A new line directly under the first paragraph.
Second paragraph.
Another line, this time ending with a backslash.\
A new line due to the previous backslash.
```
When rendered, the example looks similar to:
> First paragraph.
> Another line in the same paragraph.
> A third line in the same paragraph, but this time ending with two spaces.<br>
> A new line directly under the first paragraph.
>
> Second paragraph.
> Another line, this time ending with a backslash.\
> A new line due to the previous backslash.
## Emphasis
You can emphasize text in multiple ways. Use italics, bold, strikethrough,
or combine these emphasis styles together.
Examples:
```markdown
Emphasis, or italics, with *asterisks* or _underscores_.
Strong emphasis, or bold, with double **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough with double tildes. ~~Scratch this.~~
```
When rendered, the example looks similar to:
> Emphasis, or italics, with *asterisks* or _underscores_.
>
> Strong emphasis, or bold, with double **asterisks** or **underscores**.
>
> Combined emphasis with **asterisks and _underscores_**.
>
> Strikethrough with double tildes. ~~Scratch this.~~
### Mid-word emphasis
Avoid italicizing a portion of a word, especially when you're
dealing with code and names that often appear with multiple underscores.
GitLab Flavored Markdown ignores multiple underlines in words,
to allow better rendering of Markdown documents discussing code:
```markdown
perform_complicated_task
do_this_and_do_that_and_another_thing
but_emphasis is_desired _here_
```
When rendered, the example looks similar to:
<!-- vale gitlab_base.Spelling = NO -->
> perform_complicated_task
>
> do_this_and_do_that_and_another_thing
>
> but_emphasis is_desired _here_
<!-- vale gitlab_base.Spelling = YES -->
If you wish to emphasize only a part of a word, it can still be done with asterisks:
```markdown
perform*complicated*task
do*this*and*do*that*and*another thing
```
When rendered, the example looks similar to:
> perform*complicated*task
>
> do*this*and*do*that*and*another thing
### Inline diff
With inline diff tags, you can display `{+ additions +}` or `[- deletions -]`.
The wrapping tags can be either curly braces or square brackets:
```markdown
- {+ addition 1 +}
- [+ addition 2 +]
- {- deletion 3 -}
- [- deletion 4 -]
```

---
However, you cannot mix the wrapping tags:
```markdown
- {+ addition +]
- [+ addition +}
- {- deletion -]
- [- deletion -}
```
Diff highlighting doesn't work with `` `inline code` ``. If your text includes backticks (`` ` ``), [escape](#escape-characters)
each backtick with a backslash ` \ `:
```markdown
- {+ Just regular text +}
- {+ Text with `backticks` inside +}
- {+ Text with escaped \`backticks\` inside +}
```

### Horizontal rule
Create a horizontal rule by using three or more hyphens, asterisks, or underscores:
```markdown
---
***
___
```
When rendered, all horizontal rules look similar to:
---
## Lists
You can create ordered and unordered lists.
For an ordered list, add the number you want the list
to start with, like `1.`, followed by a space, at the start of each line.
After the first number, it does not matter what number you use. Ordered lists are
numbered automatically by vertical order, so repeating `1.` for all items in the
same list is common. If you start with a number other than `1.`, it uses that as the first
number, and counts up from there.
Examples:
```markdown
1. First ordered list item
2. Another item
- Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
1. Ordered sub-list
1. Next ordered sub-list item
4. And another item.
```
<!--
The "2." and "4." in the previous example are changed to "1." in the following example,
to match the style standards on docs.gitlab.com.
See https://docs.gitlab.com/ee/development/documentation/styleguide/#lists
-->
When rendered, the example looks similar to:
> 1. First ordered list item
> 1. Another item
> - Unordered sub-list.
> 1. Actual numbers don't matter, just that it's a number
> 1. Ordered sub-list
> 1. Next ordered sub-list item
> 1. And another item.
For an unordered list, add a `-`, `*` or `+`, followed by a space, at the start of
each line. Don't mix the characters in the same list.
```markdown
Unordered lists can:
- use
- minuses
They can also:
* use
* asterisks
They can even:
+ use
+ pluses
```
<!--
The "*" and "+" in the previous example are changed to "-" in the following example,
to match the style standards on docs.gitlab.com.
See https://docs.gitlab.com/ee/development/documentation/styleguide/#lists
-->
When rendered, the example looks similar to:
> Unordered lists can:
>
> - use
> - minuses
>
> They can also:
>
> - use
> - asterisks
>
> They can even:
>
> - use
> - pluses
---
If a list item contains multiple paragraphs, each subsequent paragraph should be indented
to the same level as the start of the list item text.
Example:
```markdown
1. First ordered list item
Second paragraph of first item.
1. Another item
```
When rendered, the example looks similar to:
> 1. First ordered list item
>
> Second paragraph of first item.
>
> 1. Another item
If the first item's paragraph isn't indented with the proper number of spaces,
the paragraph appears outside the list.
Use the correct number of spaces to properly indent under the list item.
For example:
```markdown
1. First ordered list item
(Misaligned paragraph of first item.)
1. Another item
```
When rendered, the example looks similar to:
<!-- markdownlint-disable MD027 -->
> 1. First ordered list item
>
> (Misaligned paragraph of first item.)
>
> 1. Another item
<!-- markdownlint-enable MD027 -->
---
Ordered lists that are the first sub-item of an unordered list item must have a preceding blank line if they don't start with `1.`.
For example, with a blank line:
```markdown
- Unordered list item
5. First ordered list item
```
When rendered, the example looks similar to:
<!-- markdownlint-disable MD029 -->
> - Unordered list item
>
> 5. First ordered list item
<!-- markdownlint-disable MD029 -->
If the blank line is missing, the second list item renders as part of the first one:
```markdown
- Unordered list item
5. First ordered list item
```
When rendered, the example looks similar to:
> - Unordered list item
> 5. First ordered list item
---
CommonMark ignores blank lines between ordered and unordered list items, and considers them part of a single list. The items are rendered as a
_[loose](https://spec.commonmark.org/0.30/#loose)_ list. Each list item is enclosed in a paragraph tag and therefore has paragraph spacing and margins.
This makes the list look like there is extra spacing between each item.
For example:
```markdown
- First list item
- Second list item
- A different list
```
When rendered, the example looks similar to:
> - First list item
> - Second list item
>
> - A different list
CommonMark ignores the blank line and renders this as one list with paragraph spacing.
### Description lists
{{< history >}}
- Description lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26314) in GitLab 17.7.
{{< /history >}}
A description list is a list of terms with corresponding descriptions.
Each term can have multiple descriptions.
In HTML this is represented with `<dl>`, `<dt>`, and `<dd>` tags.
To create a description list, place the term on one line, with the description on the next line beginning with a colon.
```markdown
Fruits
: apple
: orange
Vegetables
: broccoli
: kale
: spinach
```
You can also have a blank line between the term and description.
```markdown
Fruits
: apple
: orange
```
{{< alert type="note" >}}
The rich text editor does not support inserting new description lists. To insert a new description list, use the
plain text editor. For more information, see [issue 535956](https://gitlab.com/gitlab-org/gitlab/-/issues/535956).
{{< /alert >}}
### Task lists
{{< history >}}
- Inapplicable checkboxes [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85982) in GitLab 15.3.
{{< /history >}}
You can add task lists anywhere Markdown is supported.
- In issues, merge requests, epics, and comments, you can select the boxes.
- In all other places, you cannot select the boxes. You must edit the Markdown manually
by adding or removing an `x` in the brackets.
Besides complete and incomplete, tasks can also be **inapplicable**. Selecting an inapplicable checkbox
in an issue, merge request, epic, or comment has no effect.
To create a task list, follow the format of an ordered or unordered list:
```markdown
- [x] Completed task
- [~] Inapplicable task
- [ ] Incomplete task
- [x] Sub-task 1
- [~] Sub-task 2
- [ ] Sub-task 3
1. [x] Completed task
1. [~] Inapplicable task
1. [ ] Incomplete task
1. [x] Sub-task 1
1. [~] Sub-task 2
1. [ ] Sub-task 3
```

To include task lists in tables, [use HTML list tags or HTML tables](#task-lists-in-tables).
## Links
You can create links in multiple ways:
```markdown
- This line shows an [inline-style link](https://www.google.com)
- This line shows a [link to a repository file in the same directory](permissions.md)
- This line shows a [relative link to a file one directory higher](../_index.md)
- This line shows a [link that also has title text](https://www.google.com "This link takes you to Google!")
```
When rendered, the examples look similar to:
> - This line shows an [inline-style link](https://www.google.com)
> - This line shows a [link to a repository file in the same directory](permissions.md)
> - This line shows a [relative link to a file one directory higher](../_index.md)
> - This line shows a [link that also has title text](https://www.google.com "This link takes you to Google!")
{{< alert type="note" >}}
You cannot use relative links to reference project files in a wiki
page, or a wiki page in a project file. This limitation exists because wikis are always
in separate Git repositories in GitLab. For example, `[I'm a reference-style link](style)`
points to `wikis/style` only when the link is inside a wiki Markdown file.
{{< /alert >}}
Use heading ID anchors to link to a specific section in a page:
```markdown
- This line links to [a section on a different Markdown page, using a "#" and the heading ID](permissions.md#project-members-permissions)
- This line links to [a different section on the same page, using a "#" and the heading ID](#heading-ids-and-links)
```
When rendered, the examples look similar to:
> - This line links to [a section on a different Markdown page, using a "#" and the heading ID](permissions.md#project-members-permissions)
> - This line links to [a different section on the same page, using a "#" and the heading ID](#heading-ids-and-links)
Using link references:
<!--
The following codeblock uses extra spaces to avoid the Vale ReferenceLinks test.
Do not remove the two-space nesting.
-->
```markdown
- This line shows a [reference-style link, see below][Arbitrary case-insensitive reference text]
- You can [use numbers for reference-style link definitions, see below][1]
- Or leave it empty and use the [link text itself][], see below.
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://www.mozilla.org/en-US/
[1]: https://slashdot.org
[link text itself]: https://about.gitlab.com/
```
<!--
The example below uses in-line links to pass the Vale ReferenceLinks test.
Do not change to reference style links.
-->
When rendered, the example look similar to:
> - This line is a [reference-style link, see below](https://www.mozilla.org/en-US/)
> - You can [use numbers for reference-style link definitions, see below](https://slashdot.org)
> - Or leave it empty and use the [link text itself](https://about.gitlab.com/), see below.
>
> Some text to show that the reference links can follow later.
### URL auto-linking
Almost any URL you put into your text is auto-linked:
```markdown
- https://www.google.com
- https://www.google.com
- ftp://ftp.us.debian.org/debian/
- smb://foo/bar/baz
- irc://irc.freenode.net/
- http://localhost:3000
```
When rendered, the example looks similar to:
> - <https://www.google.com>
> - <https://www.google.com>
> - <ftp://ftp.us.debian.org/debian/>
> - <a href="smb://foo/bar/baz/">smb://foo/bar/baz</a>
> - <a href="irc://irc.freenode.net">irc://irc.freenode.net</a>
> - <http://localhost:3000>
## GitLab-specific references
{{< history >}}
- Autocomplete for wiki pages [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/442229) in GitLab 16.11.
- Ability to reference labels from groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/455120) in GitLab 17.1.
- Ability to reference issues, epics, and work items with `[work_item:NUMBER]` syntax [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.2.
- Ability to reference issues, epics, and work items with `[work_item:123]` syntax [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- Ability to reference issues, epics, and work items with `[work_item:123]` syntax [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
GitLab Flavored Markdown renders GitLab-specific references. For example, you can reference
an issue, a commit, a team member, or even an entire project team. GitLab Flavored Markdown turns
that reference into a link so you can navigate between them. All references to projects should use the
**project slug** rather than the project name.
Additionally, GitLab Flavored Markdown recognizes certain cross-project references and also has a shorthand
version to reference other projects from the same namespace.
GitLab Flavored Markdown recognizes the following:
| References | Input | Cross-project reference | Shortcut inside the same namespace |
|--------------------------------------------------------------------------------------|-------------------------------------------------------|------------------------------------------------|------------------------------------|
| Specific user | `@user_name` | | |
| Specific group | `@group_name` | | |
| Entire team | [`@all`](discussions/_index.md#mentioning-all-members) | | |
| Project | `namespace/project>` | | |
| Issue | ``#123`` or `[issue:123]` | `namespace/project#123` or `[issue:namespace/project/123]` | `project#123` or `[issue:project/123]` |
| [Work item](work_items/_index.md) | `[work_item:123]` | `[work_item:namespace/project/123]` | `[work_item:project/123]` |
| Merge request | `!123` | `namespace/project!123` | `project!123` |
| Snippet | `$123` | `namespace/project$123` | `project$123` |
| [Epic](group/epics/_index.md) | `#123` or `&123` or `[work_item:123]` | `group1/subgroup#123` or `group1/subgroup&123` or `[work_item:group1/subgroup/123]` | |
| [Iteration](group/iterations/_index.md) | `*iteration:"iteration title"` | | |
| [Iteration cadence](group/iterations/_index.md) by ID<sup>1</sup> | `[cadence:123]` | | |
| [Iteration cadence](group/iterations/_index.md) by title (one word)<sup>1</sup> | `[cadence:plan]` | | |
| [Iteration cadence](group/iterations/_index.md) by title (multiple words)<sup>1</sup> | `[cadence:"plan a"]` | | |
| [Vulnerability](application_security/vulnerabilities/_index.md) | `[vulnerability:123]` | `[vulnerability:namespace/project/123]` | `[vulnerability:project/123]` |
| Feature flag | `[feature_flag:123]` | `[feature_flag:namespace/project/123]` | `[feature_flag:project/123]` |
| Label by ID <sup>2</sup> | `~123` | `namespace/project~123` | `project~123` |
| Label by name (one word) <sup>2</sup> | `~bug` | `namespace/project~bug` | `project~bug` |
| Label by name (multiple words) <sup>2</sup> | `~"feature request"` | `namespace/project~"feature request"` | `project~"feature request"` |
| Label by name (scoped) <sup>2</sup> | `~"priority::high"` | `namespace/project~"priority::high"` | `project~"priority::high"` |
| Project milestone by ID <sup>2</sup> | `%123` | `namespace/project%123` | `project%123` |
| Milestone by name (one word) <sup>2</sup> | `%v1.23` | `namespace/project%v1.23` | `project%v1.23` |
| Milestone by name (multiple words) <sup>2</sup> | `%"release candidate"` | `namespace/project%"release candidate"` | `project%"release candidate"` |
| Commit (specific) | `9ba12248` | `namespace/project@9ba12248` | `project@9ba12248` |
| Commit range comparison | `9ba12248...b19a04f5` | `namespace/project@9ba12248...b19a04f5` | `project@9ba12248...b19a04f5` |
| Repository file reference | `[README](doc/README.md)` | | |
| Repository file reference (specific line) | `[README](doc/README.md#L13)` | | |
| [Alert](../operations/incident_management/alerts.md) | `^alert#123` | `namespace/project^alert#123` | `project^alert#123` |
| [Contact](crm/_index.md#contacts) | `[contact:test@example.com]` | | |
| [Wiki page](project/wiki/_index.md) (if the page slug is the same as the title) | `[[Home]]` | | |
| [Wiki page](project/wiki/_index.md) (if the page slug is different from the title) | `[[How to use GitLab\|how-to-use-gitlab]]` | | |
**Footnotes**:
1. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9.
Iteration cadence references are always rendered following the format `[cadence:<ID>]`.
For example, the text reference `[cadence:"plan"]` renders as `[cadence:1]` if the referenced
iterations cadence's ID is `1`.
1. For labels or milestones, prepend a `/` before `namespace/project` to specify the exact label
or milestone, removing any possible ambiguity.
For example, referencing an issue by using `#123` formats the output as a link
to issue number 123 with text `#123`. Likewise, a link to issue number 123 is
recognized and formatted with text `#123`. If you don't want `#123` to link to an issue,
add a leading backslash `\#123`.
In addition to this, links to some objects are also recognized and formatted.
For example:
- Comments on issues: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234#note_101075757"`, rendered as `#1234 (comment 101075757)`
- The issues designs tab: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs"`, rendered as `#1234 (designs)`.
- Links to individual designs: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs/layout.png"`, rendered as `#1234[layout.png]`.
### Show item title
{{< history >}}
- Support for work items (tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390854) in GitLab 16.0.
- Support for epics introduced in GitLab 17.7, with the flag named `work_item_epics`, enabled by default.
- Generally available for epics in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
To include the title in the rendered link of an issue, task, objective, key result, merge request, or epic:
- Add a plus (`+`) at the end of the reference.
For example, a reference like `#123+` is rendered as `The issue title (#123)`.
URL references like `https://gitlab.com/gitlab-org/gitlab/-/issues/1234+` are also expanded.
### Show item summary
{{< history >}}
- Support for work items (tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390854) in GitLab 16.0.
- Support for epics introduced in GitLab 17.7, with the flag named `work_item_epics`, enabled by default.
- Generally available for epics in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
To include an extended summary in the rendered link of an epic, issue, task, objective, key result, or merge request:
- Add a `+s` at the end of the reference.
Summary includes information about **assignees**, **milestone** and **health status**, as applicable by work item type, of referenced item.
For example, a reference like `#123+s` is rendered as
`The issue title (#123) • First Assignee, Second Assignee+ • v15.10 • Needs attention`.
URL references like `https://gitlab.com/gitlab-org/gitlab/-/issues/1234+s` are also expanded.
To update the rendered references if the assignee, milestone, or health status changed:
- Refresh the page.
### Comment preview on hover
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29663) in GitLab 17.3 [with a flag](../administration/feature_flags/_index.md) named `comment_tooltips`. Disabled by default.
- Feature flag removed in GitLab 17.6
{{< /history >}}
Hovering over a link to a comment shows the author and first line of the comment.
### Embed Observability dashboards
You can embed GitLab Observability UI dashboards descriptions and comments, for example in epics, issues, and MRs.
To embed an Observability dashboard URL:
1. In GitLab Observability UI, copy the URL in the address bar.
1. Paste your link in a comment or description. GitLab Flavored Markdown recognizes the URL and displays the source.
## Tables
When creating tables:
- The first line contains the headers, separated by pipe characters (`|`).
- The second line separates the headers from the cells.
- The cells can contain only empty spaces, hyphens, and (optionally) colons for horizontal alignment.
- Each cell must contain at least one hyphen, but adding more hyphens to a cell does not change the cell's rendering.
- Any content other than hyphens, whitespace, or colons is not allowed
- The third, and any following lines, contain the cell values.
- You **can't** have cells separated over many lines in the Markdown, they must be kept to single lines, but they can be very long. You can also include HTML `<br>` tags to force newlines if needed.
- The cell sizes **don't** have to match each other. They are flexible, but must be separated by pipes (`|`).
- You **can** have blank cells.
- Column widths are calculated dynamically based on the content of the cells.
- To use the pipe character (`|`) in the text and not as table delimiter, you must [escape](#escape-characters) it with a backslash (`\|`).
Example:
```markdown
| header 1 | header 2 | header 3 |
| --- | --- | --- |
| cell 1 | cell 2 | cell 3 |
| cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |
| cell 7 | | cell 9 |
```
When rendered, the example looks similar to:
> | header 1 | header 2 | header 3 |
> | --- | --- | --- |
> | cell 1 | cell 2 | cell 3 |
> | cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |
> | cell 7 | | cell 9 |
### Alignment
Additionally, you can choose the alignment of text in columns by adding colons (`:`)
to the sides of the "dash" lines in the second row. This affects every cell in the column:
```markdown
| Left Aligned | Centered | Right Aligned |
| :--- | :---: | ---: |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
```
When rendered, the example looks similar to:
> | Left Aligned | Centered | Right Aligned |
> | :--- | :---: | ---: |
> | Cell 1 | Cell 2 | Cell 3 |
> | Cell 4 | Cell 5 | Cell 6 |
[In GitLab itself](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#tables),
the headers are always left-aligned in Chrome and Firefox, and centered in Safari.
### Cells with multiple lines
You can use HTML formatting to adjust the rendering of tables. For example, you can
use `<br>` tags to force a cell to have multiple lines:
```markdown
| Name | Details |
| --- | --- |
| Item1 | This text is on one line |
| Item2 | This item has:<br>- Multiple items<br>- That we want listed separately |
```
When rendered, the example looks similar to:
> | Name | Details |
> | --- | --- |
> | Item1 | This text is on one line |
> | Item2 | This item has:<br>- Multiple items<br>- That we want listed separately |
### Task lists in tables
To add [task lists](#task-lists) with checkboxes, use HTML formatting. Using either:
- **An HTML table with Markdown in the cells**. Tables formatted this way result in fully functioning
task lists.
```html
<table>
<thead>
<tr><th>header 1</th><th>header 2</th></tr>
</thead>
<tbody>
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell 3</td>
<td>
- [ ] Task one
- [ ] Task two
</td>
</tr>
</tbody>
</table>
```
- **A Markdown table with HTML list tags**. These tasks don't save their state when selected.
Tables formatted this way do not render properly on `docs.gitlab.com`.
```markdown
| header 1 | header 2 |
| --- | --- |
| cell 1 | cell 2 |
| cell 3 | <ul><li> - [ ] Task one </li><li> - [ ] Task two </li></ul> |
```
You can also [create a table in the rich text editor](rich_text_editor.md#tables) and insert a task list then.
### Copy and paste from a spreadsheet
If you're working in spreadsheet software (for example, Microsoft Excel, Google
Sheets, or Apple Numbers), GitLab creates a Markdown table when you copy and paste
from a spreadsheet. For example, suppose you have the
following spreadsheet:

Select the cells and copy them to your clipboard. Open a GitLab Markdown
entry and paste the spreadsheet:

### JSON tables
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86353) in GitLab 15.3.
- Ability to use Markdown [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/375177) in GitLab 17.9.
{{< /history >}}
To render tables with JSON code blocks, use the following syntax:
````markdown
```json:table
{}
```
````
Watch the following video walkthrough of this feature:
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=12yWKw1AdKY">Demo: JSON Tables in Markdown</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/12yWKw1AdKY" frameborder="0" allowfullscreen> </iframe>
</figure>
The `items` attribute is a list of objects representing the data points.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
]
}
```
````
To specify the table labels, use the `fields` attribute.
````markdown
```json:table
{
"fields" : ["a", "b", "c"],
"items" : [
{"a": "11", "b": "22", "c": "33"}
]
}
```
````
Not all elements of `items` must have corresponding values in `fields`.
````markdown
```json:table
{
"fields" : ["a", "b", "c"],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "c": "233"}
]
}
```
````
When `fields` is not explicitly specified, the labels are picked from the first element of `items`.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "c": "233"}
]
}
```
````
You can specify custom labels for `fields`.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
]
}
```
````
You can enable sorting for individual elements of `fields`.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA", "sortable": true},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
]
}
```
````
You can use the `filter` attribute to render a table with content filtered dynamically by user input.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
],
"filter" : true
}
```
````
You can use the `markdown` attribute to allow for GitLab Flavored Markdown in the items and caption,
including GitLab references. Fields do not support Markdown.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "**22**", "c": "33"},
{"a": "#1", "b": "222", "c": "233"}
],
"markdown" : true
}
```
````
By default, every JSON table has the caption `Generated with JSON data`.
You can override this caption by specifying the `caption` attribute.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
],
"caption" : "Custom caption"
}
```
````
If JSON is invalid, an error occurs.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
],
}
```
````
## Multimedia
Embed images, videos, and audio.
You can add multimedia using Markdown syntax to link files, set dimensions, and display them inline.
Formatting options let you customize titles, specify width and height, and control how media appears
in the rendered output.
### Images
Embed images using inline or reference [links](#links) prepended with a `!`. For example:
<!--
DO NOT change the name of markdown_logo_v17_11.png. This file is used for a test in
spec/controllers/help_controller_spec.rb.
-->
<!-- markdownlint-disable proper-names -->
```markdown

```
> 
<!-- markdownlint-enable proper-names -->
In image links:
- Text in the square brackets (`[ ]`) becomes the image alt text.
- Text in double quotes after the image link path becomes the title text.
To see title text, hover over the image.
To learn about creating accessible alt text, see [Accessible images and videos](#accessible-images-and-videos).
### Videos
Image tags that link to files with a video extension are automatically converted to
a video player. The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`:
Here's an example video:
```markdown

```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#videos):
> 
### Change image or video dimensions
{{< history >}}
- Support for images [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/28118) in GitLab 15.7.
- Support for videos [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17139) in GitLab 15.9.
{{< /history >}}
You can control the width and height of an image or video by following the image with
an attribute list.
The value must an integer with a unit of either `px` (default) or `%`.
For example
```markdown
{width=100 height=100px}
{width=75%}
```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#change-image-or-video-dimensions):
> {width=100 height=100px}
You can also use the `img` HTML tag instead of Markdown and set its `height` and
`width` parameters.
When you paste a higher resolution PNG image into a Markdown text box [in GitLab 17.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/419913),
dimensions are always appended. The dimensions are automatically adjusted to
accommodate for retina (and other higher-resolution) displays. For instance,
a 144ppi image is resized to 50% of its dimensions, whereas a 96ppi image is
resized to 75% of its dimensions.
### Audio
Similar to videos, link tags for files with an audio extension are automatically converted to
an audio player. The valid audio extensions are `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`:
Here's an example audio clip:
```markdown

```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#audio):
> 
## Blockquotes
Use a blockquote to highlight information, such as a side note. It's generated
by starting the lines of the blockquote with `>`:
```markdown
> Blockquotes help you emulate reply text.
> This line is part of the same quote.
Quote break.
> This very long line is still quoted properly when it wraps. Keep writing to make sure this line is long enough to actually wrap for everyone. You can also *use* **Markdown** in a blockquote.
```
When rendered, the example looks similar to:
> > Blockquotes help you emulate reply text.
> > This line is part of the same quote.
>
> Quote break.
>
> > This very long line is still quoted properly when it wraps. Keep writing to make sure this line is long enough to actually wrap for everyone. You can also *use* **Markdown** in a blockquote.
### Multiline blockquote
Create multi-line blockquotes fenced by `>>>`:
```markdown
>>>
If you paste a message from somewhere else
that spans multiple lines,
you can quote that without having to manually prepend `>` to every line!
>>>
```
> If you paste a message from somewhere else
>
> that spans multiple lines,
>
> you can quote that without having to manually prepend `>` to every line!
## Code spans and blocks
Highlight anything that should be viewed as code and not standard text.
Inline code is formatted with single backticks `` ` ``:
```markdown
Inline `code` has `back-ticks around` it.
```
When rendered, the example looks similar to:
> Inline `code` has `back-ticks around` it.
For a similar effect with a larger code example, you can use a code block.
To create a code block:
- Fence an entire block of code with triple backticks (```` ``` ````). You can use more than three backticks,
as long as both the opening and closing set have the same number.
- Fence an entire block of code with triple tildes (`~~~`).
- Indent it four or more spaces.
For example:
- ````markdown
```python
def function():
#indenting works just fine in the fenced code block
s = "Python code"
print s
```
````
- ```markdown
Using 4 spaces
is like using
3-backtick fences.
```
- ```markdown
~~~javascript
var s = "JavaScript syntax highlighting";
alert(s);
~~~
```
The three previous examples render as:
- > ```python
> def function():
> #indenting works just fine in the fenced code block
> s = "Python code"
> print s
> ```
- > ```plaintext
> Using 4 spaces
> is like using
> 3-backtick fences.
> ```
- > ```javascript
> var s = "JavaScript syntax highlighting";
> alert(s);
> ```
### Syntax highlighting
GitLab uses the [Rouge Ruby library](https://github.com/rouge-ruby/rouge) for more colorful syntax
highlighting in code blocks. For a list of supported languages visit the
[Rouge project wiki](https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers).
Syntax highlighting is supported only in code blocks, so you can't highlight inline code.
To fence and apply syntax highlighting to a block of code, append the code language
to the opening code declaration, after the three back-ticks (```` ``` ````) or three tildes (`~~~`).
Code blocks that use `plaintext` or have no code language specified have no syntax highlighting:
````plaintext
```
No language indicated, so **no** syntax highlighting.
s = "No highlighting is shown for this line."
But let's throw in a <b>tag</b>.
```
````
When rendered, the example looks similar to:
> ```plaintext
> No language indicated, so **no** syntax highlighting.
> s = "No highlighting is shown for this line."
> But let's throw in a <b>tag</b>.
> ```
## Diagrams and flowcharts
You can generate diagrams from text by using:
- [Mermaid](https://mermaidjs.github.io/)
- [PlantUML](https://plantuml.com)
- [Kroki](https://kroki.io) to create a wide variety of diagrams.
In wikis, you can also add and edit diagrams created with the [diagrams.net editor](project/wiki/markdown.md#diagramsnet-editor).
### Mermaid
{{< history >}}
- Support for Entity Relationship diagrams and mind maps [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384386) in GitLab 16.0.
{{< /history >}}
Visit the [official page](https://mermaidjs.github.io/) for more details. The
[Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) helps you
learn Mermaid and debug issues in your Mermaid code. Use it to identify and resolve
issues in your diagrams.
To generate a diagram or flowchart, write your text inside the `mermaid` block:
````markdown
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
````
When rendered, the example looks similar to:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
You can also include subgraphs:
````markdown
```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph "SubGraph 1 Flow"
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph "Main Graph"
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```
````
When rendered, the example looks similar to:
```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph "SubGraph 1 Flow"
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph "Main Graph"
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```
### PlantUML
PlantUML integration is enabled on GitLab.com. To make PlantUML available in GitLab Self-Managed
installation of GitLab, a GitLab administrator [must enable it](../administration/integration/plantuml.md).
After you enable PlantUML, diagram delimiters `@startuml`/`@enduml` aren't required, as these
are replaced by the `plantuml` block. For example:
````markdown
```plantuml
Bob -> Alice : hello
Alice -> Bob : hi
```
````
You can include or embed a PlantUML diagram from separate files in the repository using
the `::include` directive.
For more information, see [Include diagram files](../administration/integration/plantuml.md#include-diagram-files).
### Kroki
To make Kroki available in GitLab, a GitLab administrator must enable it.
For more information, see the [Kroki integration](../administration/integration/kroki.md) page.
## Math equations
{{< history >}}
- LaTeX-compatible fencing [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21757) in GitLab 15.4 [with a flag](../administration/feature_flags/_index.md) named `markdown_dollar_math`. Disabled by default. Enabled on GitLab.com.
- LaTeX-compatible fencing [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/371180) in GitLab 15.8. Feature flag `markdown_dollar_math` removed.
{{< /history >}}
Math written in LaTeX syntax is rendered with [KaTeX](https://github.com/KaTeX/KaTeX).
_KaTeX only supports a [subset](https://katex.org/docs/supported.html) of LaTeX._
This syntax also works in AsciiDoc wikis and files using `:stem: latexmath`. For details, see
the [Asciidoctor user manual](https://asciidoctor.org/docs/user-manual/#activating-stem-support).
To prevent malicious activity, GitLab renders only the first 50 inline math instances.
You can disable this limit [for a group](../api/graphql/reference/_index.md#mutationgroupupdate)
or for the entire [GitLab Self-Managed instance](../administration/instance_limits.md#math-rendering-limits).
The number of math blocks is also limited based on render time. If the limit is exceeded,
GitLab renders the excess math instances as text. Wiki and repository files do not have
these limits.
Math written between dollar signs with backticks (``` $`...`$ ```) or single dollar signs (`$...$`)
is rendered inline with the text.
Math written between double dollar signs (`$$...$$`) or in a [code block](#code-spans-and-blocks) with
the language declared as `math` is rendered on a separate line:
`````markdown
This math is inline: $`a^2+b^2=c^2`$.
This math is on a separate line using a ```` ```math ```` block:
```math
a^2+b^2=c^2
```
This math is on a separate line using inline `$$`: $$a^2+b^2=c^2$$
This math is on a separate line using a `$$...$$` block:
$$
a^2+b^2=c^2
$$
`````
When rendered, the example looks like:

{{< alert type="note" >}}
The rich text editor does not support inserting new math blocks. To insert a new math block, use the
plain text editor. For more information, see [issue 366527](https://gitlab.com/gitlab-org/gitlab/-/issues/366527).
{{< /alert >}}
## Table of contents
A table of contents is an unordered list that links to subheadings in the document.
You can add a table of contents to issues, merge requests, and epics, but you can't add one
to notes or comments.
Add one of these tags on their own line to the **description** field of any of the supported
content types:
<!--
Tags for the table of contents are presented in a code block to work around a Markdown bug.
Do not change the code block back to single backticks.
For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/359077.
-->
```markdown
[[_TOC_]]
or
[TOC]
```
- Markdown files.
- Wiki pages.
- Issues.
- Merge requests.
- Epics.
{{< alert type="note" >}}
A table of contents renders also when you use the TOC code in single square brackets, regardless of
being on its own line or not. This behavior is unintended.
For more information, see [issue 359077](https://gitlab.com/gitlab-org/gitlab/-/issues/359077).
{{< /alert >}}
```markdown
This sentence introduces my wiki page.
[[_TOC_]]
## My first heading
First section content.
## My second heading
Second section content.
```

## Alerts
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24482) in GitLab 17.10.
{{< /history >}}
Alerts can be used to highlight or call attention to something. The alert syntax
uses the Markdown blockquote syntax followed by the type of alert.
You can use alerts in any text box that supports Markdown.
You can use the following types of alerts:
- Note: information that users should take into account, even when skimming:
```markdown
> [!note]
> The following information is useful.
```
- Tip: Optional information to help a user be more successful:
```markdown
> [!tip]
> Tip of the day.
```
- Important: Crucial information necessary for users to succeed:
```markdown
> [!important]
> This is something important you should know.
```
- Caution: Negative potential consequences of an action:
```markdown
> [!caution]
> You need to be very careful about the following.
```
- Warning: Critical potential risks:
```markdown
> [!warning]
> The following would be dangerous.
```
The title text shown for an alert defaults to the name of the alert. For example,
`> [!warning]` alert has the title `Warning`.
To override an alert block's title, enter any text on the same line.
For example, to use the warning color but have `Data deletion` as the title:
```markdown
> [!warning] Data deletion
> The following instructions will make your data unrecoverable.
```
[Multiline blockquotes](#multiline-blockquote) also support the alert syntax. This
allows you to wrap large and more complex text in an alert.
```markdown
>>> [!note] Things to consider
You should consider the following ramifications:
1. consideration 1
1. consideration 2
>>>
```
The alerts render as:

## Colors
Markdown does not support changing text color.
You can write a color code in the formats: `HEX`, `RGB`, or `HSL`.
- `HEX`: `` `#RGB[A]` `` or `` `#RRGGBB[AA]` ``
- `RGB`: `` `RGB[A](R, G, B[, A])` ``
- `HSL`: `` `HSL[A](H, S, L[, A])` ``
Named colors are not supported.
In the GitLab application (but not the GitLab documentation) color codes in backticks
display a color chip next to the color code. For example:
```markdown
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#colors):
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
### Escape color codes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/359069) in GitLab 18.3.
{{< /history >}}
To display a color code as inline code without generating a color chip, prefix it with a backslash (`` \ ``).
For example:
- `\#FF0000`
- `\RGB(255,0,0)`
- `\HSL(0,100%,50%)`
In all cases, the backslash is removed, and no color chip is rendered in the output.
This is especially useful when you want to include values like issue numbers in inline code
without accidentally triggering a color chip.
## Emoji
You can use emoji anywhere GitLab Flavored Markdown is supported.
For example:
```markdown
Sometimes you want to :monkey: around a bit and add some :star2: to your
:speech_balloon:. Well we have a gift for you: emoji!
You can use it to point out a :bug: or warn about :speak_no_evil: patches.
And if someone improves your really :snail: code, send them some :birthday:.
People :heart: you for that.
If you're new to this, don't be :fearful:. You can join the emoji :family:.
Just look up one of the supported codes.
```
When rendered, the example looks similar to:
> Sometimes you want to <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/monkey.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":monkey:" alt=":monkey:">
> around a bit and add some <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/star2.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":star2:" alt=":star2:">
> to your <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/speech_balloon.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":speech_balloon:" alt=":speech_balloon:">.
> Well we have a gift for you: emoji!
>
> You can use it to point out a <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/bug.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":bug:" alt=":bug:">
> or warn about <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/speak_no_evil.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":speak_no_evil:" alt=":speak_no_evil:">
> patches. If someone improves your really <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/snail.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":snail:" alt=":snail:">
> code, send them some <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/birthday.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":birthday:" alt=":birthday:">.
> People <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/heart.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":heart:" alt=":heart:">
> you for that.
>
> If you're new to this, don't be <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/fearful.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":fearful:" alt=":fearful:">.
> You can join the emoji <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/family.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":family:" alt=":family:">.
> Just look up one of the supported codes.
Consult the [Emoji Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/)
for a list of all supported emoji codes.
### Emoji and your operating system
The previous emoji example uses hard-coded images. Rendered emoji
in GitLab might look different depending on the OS and browser used.
Most emoji are natively supported on macOS, Windows, iOS, Android, and fall back on image-based
emoji where there is no support.
<!-- vale gitlab_base.Spelling = NO -->
On Linux, you can download [Noto Color Emoji](https://github.com/googlefonts/noto-emoji)
to get full native emoji support. Ubuntu 22.04 (like many modern Linux distributions) has
this font installed by default.
<!-- vale gitlab_base.Spelling = YES -->
To learn more about adding custom emoji, see [Custom emoji](emoji_reactions.md#custom-emoji).
## Front matter
Front matter is metadata included at the beginning of a Markdown document, preceding
the content. This data can be used by static site generators like [Jekyll](https://jekyllrb.com/docs/front-matter/),
[Hugo](https://gohugo.io/content-management/front-matter/), and many other applications.
When you view a Markdown file rendered by GitLab, front matter is displayed as-is,
in a box at the top of the document. The HTML content displays after the front matter. To view an example,
you can toggle between the source and rendered version of a
[GitLab documentation file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/_index.md).
In GitLab, front matter is used only in Markdown files and wiki pages, not the other
places where Markdown formatting is supported. It must be at the very top of the document
and must be between delimiters.
The following delimiters are supported:
- YAML (`---`):
```yaml
---
title: About Front Matter
example:
language: yaml
---
```
- TOML (`+++`):
```toml
+++
title = "About Front Matter"
[example]
language = "toml"
+++
```
- JSON (`;;;`):
```json
;;;
{
"title": "About Front Matter"
"example": {
"language": "json"
}
}
;;;
```
Other languages are supported by adding a specifier to any of the existing
delimiters. For example:
```php
---php
$title = "About Front Matter";
$example = array(
'language' => "php",
);
---
```
## Includes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/195798) in GitLab 17.7.
{{< /history >}}
Use includes, or include directives, to add the content of a document inside another document.
For example, a book could be split into multiple chapters, and then each chapter could be included in
the main book document:
```markdown
::include{file=chapter1.md}
::include{file=chapter2.md}
```
In GitLab, include directives are used only in Markdown files and wiki pages, not the other
places where Markdown formatting is supported.
Use an include directive in a Markdown file:
```markdown
::include{file=example_file.md}
```
Use an include directive in a wiki page:
```markdown
::include{file=example_page.md}
```
Each `::include` must start at the beginning of a line, and specifies a file or URL for `file=`.
The content of the specified file (or URL) is included at the position of the `::include` and
processed with the remaining Markdown.
Include directives inside the included file are ignored.
For example, if `file1` includes `file2`, and `file2` includes `file3`, when `file1` is processed,
it doesn't have the contents of `file3`.
### Include limits
To guarantee good system performance and prevent malicious documents from causing problems, GitLab
enforces a maximum limit on the number of include directives processed in a document.
By default, a document can have up to 32 include directives.
To customize the number of processed include directives, administrators can change the
`asciidoc_max_includes` application setting with the
[application settings API](../api/settings.md#available-settings).
### Use includes from external URLs
To use includes from separate wiki pages or external URLs, administrators can enable the
`wiki_asciidoc_allow_uri_includes`
[application setting](../administration/wikis/_index.md#allow-uri-includes-for-asciidoc).
```markdown
<!-- define application setting wiki_asciidoc_allow_uri_includes to true to allow content to be read from URI -->
::include{file=https://example.org/installation.md}
```
### Use includes in code blocks
You can use the `::include` directive inside code blocks to add content from files in your repository.
For example, if your repository contains a file `javascript_code.js`:
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
You can include it in your Markdown file:
````markdown
Our script contains:
```javascript
::include{file=javascript_code.js}
```
````
When rendered, the example looks similar to:
> Our script contains:
>
> ```javascript
> var s = "JavaScript syntax highlighting";
> alert(s);
> ```
## Placeholders
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14389) in GitLab 18.2 [with a flag](../administration/feature_flags/_index.md) named `markdown_placeholders`. Disabled by default.
{{< /history >}}
Placeholders can be used to display certain types of changeable data, such as a project's title
or latest tag. They are filled in each time the Markdown is rendered.
The syntax is `%{PLACEHOLDER}`.
| Placeholder | Example value | Description |
|---------------------------|---------------------|-------------|
| `%{gitlab_server}` | `gitlab.com` | Server of a project |
| `%{gitlab_pages_domain}` | `pages.gitlab.com` | Domain hosting GitLab Pages |
| `%{project_path}` | `gitlab-org/gitlab` | Path of a project including the parent groups |
| `%{project_name}` | `gitlab` | Name of a project |
| `%{project_id}` | `278964` | Database ID associated with a project |
| `%{project_namespace}` | `gitlab-org` | Project namespace of a project |
| `%{project_title}` | `GitLab` | Title of a project |
| `%{group_name}` | `gitlab-org` | Group of a project |
| `%{default_branch}` | `main` | Default branch name configured for a project's repository |
| `%{commit_sha}` | `ad10e011ce65492322037633ebc054efde37b143` | ID of the most recent commit to the default branch of a project's repository |
| `%{latest_tag}` | `v17.10.7-ee` | Latest tag added to the project's repository |
## Escape characters
Markdown reserves the following ASCII characters to format the page:
```plaintext
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
```
To use one of these reserved characters in your text, add the backslash character (` \ `) immediately before the
reserved character. When you place the backslash before a reserved character, the Markdown parser omits the
backslash and treats the reserved character as regular text.
Examples:
```plaintext
\# Not a heading
| Food | Do you like this food? (circle) |
|-----------------|---------------------------------|
| Pizza | Yes \| No |
\**Not bold, just italic text placed between some asterisks*\*
```
When rendered, the example looks similar to:
> \# Not a heading
>
> | Food | Do you like this food? (circle)|
> |-----------------|--------------------------------|
> | Pizza | Yes \| No |
>
> \**Not bold, just italic text placed between some asterisks*\*
A backslash doesn't always escape the character that follows it. The backslash appears as regular text in the following cases:
- When the backslash appears before a non-reserved character, such as `A`, `3`, or a space.
- When the backslash appears inside of these Markdown elements:
- Code blocks
- Code spans
- Auto-links
- Inline HTML, such as `<kbd>`
In these instances you might need to use the equivalent HTML entity, such as `]` for `]`.
### Use backslash with backticks
When the backslash (` \ `) character is at the end of an inline code sample, the backslash
can escape the last backtick. In this case, add extra spaces around the inline code,
for example:
```markdown
Use the backslash ` \ ` character to escape inline code that ends in a ` backslash\ `.
```
When rendered, the example looks similar to:
> Use the backslash ` \ ` character to escape inline code that ends in a ` backslash\ `.
## Footnotes
Footnotes add a link to a note rendered at the end of a Markdown file.
To make a footnote, you need both a reference tag and a separate line (anywhere in the file) with
the note content.
Regardless of the tag names, the relative order of the reference tags determines the rendered
numbering.
Regardless where you put the note, it's always shown at the bottom of the rendered file.
For example:
- Referencing footnotes:
```markdown
A footnote reference tag looks like this:[^1]
This reference tag is a mix of letters and numbers. [^footnote-42]
```
- Defining footnotes in a different part of the file:
```markdown
[^1]: This text is inside a footnote.
[^footnote-42]: This text is another footnote.
```
When rendered, footnotes look similar to:
> A footnote reference tag looks like this:[^1]
>
> This reference tag is a mix of letters and numbers.[^footnote-42]
>
> [^1]: This text is inside a footnote.
> [^footnote-42]: This text is another footnote.
{{< alert type="note" >}}
The rich text editor does not support inserting new footnotes. To insert a new footnote, use the
plain text editor. For more information, see [issue 365265](https://gitlab.com/gitlab-org/gitlab/-/issues/365265).
{{< /alert >}}
## Inline HTML
You can also use raw HTML in your Markdown, and it usually works pretty well.
See the documentation for `HTML::Pipeline`'s [SanitizationFilter](https://github.com/gjtorikian/html-pipeline/blob/v2.12.3/lib/html/pipeline/sanitization_filter.rb#L42)
class for the list of allowed HTML tags and attributes. In addition to the default
`SanitizationFilter` allowlist, GitLab allows `span`, `abbr`, `details` and `summary` elements.
`rel="license"` is allowed on links to support the [Rel-License microformat](https://microformats.org/wiki/rel-license) and license attribution.
```html
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>
</dl>
```
When rendered, the example looks similar to:
> <dl>
> <dt>Definition list</dt>
> <dd>Is something people use sometimes.</dd>
>
> <dt>Markdown in HTML</dt>
> <dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>
> </dl>
It's still possible to use Markdown inside HTML tags, but only if the lines containing Markdown
are separated into their own lines:
```html
<dl>
<dt>Markdown in HTML</dt>
Does *not* work **very** well. HTML tags work, in most cases.
</dd>
</dl>
```
When rendered, the example looks similar to:
<!--
The example below uses HTML to force correct rendering on docs.gitlab.com,
Markdown is fine in GitLab.
-->
<!-- markdownlint-disable MD027 -->
> <dl>
> <dt>Markdown in HTML</dt>
>
> Does <em>not</em> work <b>very</b> well. HTML tags work, in most cases.
>
> </dd>
> </dl>
<!-- markdownlint-enable MD027 -->
### Collapsible section
Content can be collapsed using HTML's [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)
and [`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)
tags. For example, collapse a long log file so it takes up less screen space.
```html
<details>
<summary>Click to expand</summary>
These details <em>remain</em> <strong>hidden</strong> until expanded.
<pre><code>PASTE LOGS HERE</code></pre>
</details>
```
When rendered, the example looks similar to:
> <details>
> <summary>Click to expand</summary>
>
> These details <em>remain</em> <strong>hidden</strong> until expanded.
>
> <pre><code>PASTE LOGS HERE</code></pre>
>
> </details>
---
Markdown inside these tags is also supported.
Remember to leave a blank line before and after any Markdown sections, as shown in the example:
````html
<details>
<summary>
Click to _expand._
</summary>
These details _remain_ **hidden** until expanded.
```
PASTE LOGS HERE
```
</details>
````
<!--
The example below uses HTML to force correct rendering on docs.gitlab.com, Markdown
works correctly in GitLab.
-->
When rendered, the example looks similar to:
> <details>
> <summary>Click to <em>expand.</em></summary>
>
> These details <em>remain</em> <b>hidden</b> until expanded.
>
> <pre><code>PASTE LOGS HERE</code></pre>
>
> </details>
### Keyboard HTML tag
The `<kbd>` element is used to identify text that represents user keyboard input. Text surrounded by `<kbd>` tags is typically displayed in the browser's default monospace font.
```html
Press <kbd>Enter</kbd> to go to the next page.
```
When rendered, the example looks similar to:
> Press <kbd>Enter</kbd> to go to the next page.
### Superscripts and subscripts
GitLab Flavored Markdown doesn't support the Redcarpet superscript syntax ( `x^2` ).
For superscripts and subscripts, use the standard HTML syntax:
```html
The formula for water is H<sub>2</sub>O
while the equation for the theory of relativity is E = mc<sup>2</sup>.
```
<!-- vale gitlab_base.Spelling = NO -->
When rendered, the example looks similar to:
> The formula for water is H<sub>2</sub>O
> while the equation for the theory of relativity is E = mc<sup>2</sup>.
<!-- vale gitlab_base.Spelling = YES -->
GitLab Flavored Markdown doesn't support the Redcarpet superscript syntax ( `x^2` ).
### HTML comments
You can use HTML comments in GitLab Flavored Markdown to add notes or explanations that aren't
visible in the rendered output.
Use HTML comments to:
- Add notes for other contributors.
- Temporarily hide content without deleting it.
- Provide context or explanations that shouldn't appear in the final document.
- Add metadata or processing instructions.
When using HTML comments, you should:
- Use them sparingly to avoid cluttering the source.
- Keep them concise and relevant.
- Use them for temporary notes rather than permanent documentation.
- Avoid including sensitive or confidential information. HTML comments are visible to anyone who can view the Markdown source.
HTML comments use the standard HTML syntax `<!-- comment text -->` and can span single or multiple
lines:
```html
<!-- This is a single-line comment -->
<!--
This is a multi-line comment
that spans several lines
and won't be visible in the rendered output
-->
This text is visible.
<!-- This comment between paragraphs is hidden -->
This text is also visible.
```
When rendered, only the visible text appears:
> This text is visible.
> This text is also visible.
#### Comments in code blocks
HTML comments inside code blocks are treated as literal text and are displayed:
````markdown
```html
<!-- This comment will be visible in the code block -->
<div>Content</div>
```
````
## References
- This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
- The original [Markdown Syntax Guide](https://daringfireball.net/projects/markdown/syntax)
at Daring Fireball is an excellent resource for a detailed explanation of standard Markdown.
- You can find the detailed specification for CommonMark in the [CommonMark Spec](https://spec.commonmark.org/current/).
- The [CommonMark Dingus](https://spec.commonmark.org/dingus/) helps you test CommonMark syntax.
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Flavored Markdown (GLFM)
description: Formatting, inline HTML, GitLab-specific references, diagrams, and flowcharts.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab Flavored Markdown (GLFM) is a powerful markup language that formats text in the GitLab user interface.
GLFM:
- Creates rich content with support for code, diagrams, math equations, and multimedia.
- Links issues, merge requests, and other GitLab content with cross-references.
- Organizes information with task lists, tables, and collapsible sections.
- Supports syntax highlighting for over 100 programming languages.
- Ensures accessibility with semantic heading structures and image descriptions.
When you enter text in the GitLab UI, GitLab assumes the text is in GitLab Flavored Markdown.
You can use GitLab Flavored Markdown in:
- Comments
- Issues
- Epics
- Merge requests
- Milestones
- Snippets (the snippet must be named with a `.md` extension)
- Wiki pages
- Markdown documents inside repositories
- Releases
You can also use other rich text files in GitLab. You might have to install a dependency
to do so. For more information, see the [`gitlab-markup` gem project](https://gitlab.com/gitlab-org/gitlab-markup).
{{< alert type="note" >}}
This Markdown specification is valid for GitLab only. We do our best to render the Markdown faithfully here,
however the [GitLab documentation website](https://docs.gitlab.com) and the [GitLab handbook](https://handbook.gitlab.com)
use a different Markdown renderer.
{{< /alert >}}
To see exact examples of how GitLab renders any of these examples:
1. Copy the relevant raw Markdown example (not the rendered version of the example).
1. Paste the Markdown somewhere in GitLab that supports Markdown previews, for example
issue or merge request comments or descriptions, or a new Markdown file.
1. Select **Preview** to view the GitLab-rendered Markdown.
## Differences with standard Markdown
<!--
Use this topic to list features that are not present in standard Markdown.
Don't repeat this information in each individual topic, unless there's a specific
reason, like in "Newlines".
-->
GitLab Flavored Markdown consists of the following:
- Core Markdown features, based on the [CommonMark specification](https://spec.commonmark.org/current/).
- Extensions from [GitHub Flavored Markdown](https://github.github.com/gfm/).
- Extensions made specifically for GitLab.
All standard Markdown formatting should work as expected in GitLab. Some standard
functionality is extended with additional features, without affecting the standard usage.
The following features are not found in standard Markdown:
- [Alerts](#alerts)
- [Color chips written in `HEX`, `RGB` or `HSL`](#colors)
- [Description lists](#description-lists)
- [Diagrams and flowcharts](#diagrams-and-flowcharts)
- [Emoji](#emoji)
- [Footnotes](#footnotes)
- [Front matter](#front-matter)
- [GitLab-specific references](#gitlab-specific-references)
- [Includes](#includes)
- [Placeholders](#placeholders)
- [Inline diffs](#inline-diff)
- [Math equations and symbols written in LaTeX](#math-equations)
- [Strikethrough](#emphasis)
- [Table of Contents](#table-of-contents)
- [Tables](#tables)
- [Task lists](#task-lists)
- [Wiki-specific Markdown](project/wiki/markdown.md)
The following features are extended from standard Markdown:
| Standard Markdown | Extended Markdown in GitLab |
|---------------------------------------|-----------------------------|
| [Blockquotes](#blockquotes) | [Multiline blockquotes](#multiline-blockquote) |
| [Code blocks](#code-spans-and-blocks) | [Colored code and syntax highlighting](#syntax-highlighting) |
| [Headings](#headings) | [Linkable heading IDs](#heading-ids-and-links) |
| [Images](#images) | [Embedded videos](#videos) and [audio](#audio) |
| [Links](#links) | [Automatically linking URLs](#url-auto-linking) |
## Markdown and accessibility
When you use GitLab Flavored Markdown, you are creating digital content.
This content should be as accessible as possible to your audience.
The following list is not exhaustive, but it provides guidance for some of the GitLab Flavored Markdown styles to pay
particular attention to:
### Accessible headings
Use heading formatting to create a logical heading structure.
The structure of headings on a page should make sense, like a good table of contents.
Ensure that there is only one `h1` element on a page, that heading levels are not skipped, and that they are nested correctly.
### Accessible tables
To keep tables accessible and scannable, tables should not have any empty cells.
If there is no otherwise meaningful value for a cell, consider entering **N/A** for "not applicable" or **None**.
### Accessible images and videos
Describe the image or video in the `[alt text]`. Make the description accurate, succinct, and unique.
Don't use `image of` or `video of` in the description. For more information, see [WebAim Alternative Text](https://webaim.org/techniques/alttext/).
## Headings
Create headings from 1 to 6 by using `#`.
```markdown
# H1
## H2
### H3
#### H4
##### H5
###### H6
```
Alternatively, for H1 and H2, use an underline style:
```markdown
Alt-H1
======
Alt-H2
------
```
### Heading IDs and links
{{< history >}}
- Heading link generation [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/440733) in GitLab 17.0.
{{< /history >}}
All Markdown-rendered headings automatically
get IDs that can be linked to, except in comments.
On hover, a link to those IDs becomes visible to make it easier to copy the link to
the heading to use it somewhere else.
The IDs are generated from the content of the heading according to the following rules:
1. All text is converted to lowercase.
1. All non-word text (such as punctuation or HTML) is removed.
1. All spaces are converted to hyphens.
1. Two or more hyphens in a row are converted to one.
1. If a heading with the same ID has already been generated, a unique
incrementing number is appended, starting at 1.
Example:
```markdown
# This heading has spaces in it
## This heading has a :thumbsup: in it
# This heading has Unicode in it: 한글
## This heading has spaces in it
### This heading has spaces in it
## This heading has 3.5 in it (and parentheses)
## This heading has multiple spaces and --- hyphens
```
Would generate the following link IDs:
1. `this-heading-has-spaces-in-it`
1. `this-heading-has-a-thumbsup-in-it`
1. `this-heading-has-unicode-in-it-한글`
1. `this-heading-has-spaces-in-it-1`
1. `this-heading-has-spaces-in-it-2`
1. `this-heading-has-35-in-it-and-parentheses`
1. `this-heading-has--multiple-spaces-and-----hyphens`
## Line breaks
A line break is inserted (a new paragraph starts) if the previous text is
ended with two newlines. For example, when you press <kbd>Enter</kbd> twice in a row. If you only
use one newline (press <kbd>Enter</kbd> once), the next sentence remains part of the
same paragraph. Use this approach if you want to keep long lines from wrapping, and keep
them editable:
```markdown
Here's a line for us to start with.
This longer line is separated from the one above by two newlines, so it is a *separate paragraph*.
This line is also a separate paragraph, but...
These lines are only separated by single newlines,
so they *do not break* and just follow the previous lines
in the *same paragraph*.
```
When rendered, the example looks similar to:
> Here's a line for us to start with.
>
> This longer line is separated from the one above by two newlines, so it is a *separate paragraph*.
>
> This line is also a separate paragraph, but...
> These lines are only separated by single newlines,
> so they *do not break* and just follow the previous lines
> in the *same paragraph*.
### Newlines
GitLab Flavored Markdown adheres to the Markdown specification for handling
[paragraphs and line breaks](https://spec.commonmark.org/current/).
A paragraph is one or more consecutive lines of text, separated by one or
more blank lines (two newlines at the end of the first paragraph), as explained in [line breaks](#line-breaks).
Need more control over line breaks or soft returns? Add a single line break
by ending a line with a backslash, or two or more spaces. Two newlines in a row create a new
paragraph, with a blank line in between:
```markdown
First paragraph.
Another line in the same paragraph.
A third line in the same paragraph, but this time ending with two spaces.<space><space>
A new line directly under the first paragraph.
Second paragraph.
Another line, this time ending with a backslash.\
A new line due to the previous backslash.
```
When rendered, the example looks similar to:
> First paragraph.
> Another line in the same paragraph.
> A third line in the same paragraph, but this time ending with two spaces.<br>
> A new line directly under the first paragraph.
>
> Second paragraph.
> Another line, this time ending with a backslash.\
> A new line due to the previous backslash.
## Emphasis
You can emphasize text in multiple ways. Use italics, bold, strikethrough,
or combine these emphasis styles together.
Examples:
```markdown
Emphasis, or italics, with *asterisks* or _underscores_.
Strong emphasis, or bold, with double **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough with double tildes. ~~Scratch this.~~
```
When rendered, the example looks similar to:
> Emphasis, or italics, with *asterisks* or _underscores_.
>
> Strong emphasis, or bold, with double **asterisks** or **underscores**.
>
> Combined emphasis with **asterisks and _underscores_**.
>
> Strikethrough with double tildes. ~~Scratch this.~~
### Mid-word emphasis
Avoid italicizing a portion of a word, especially when you're
dealing with code and names that often appear with multiple underscores.
GitLab Flavored Markdown ignores multiple underlines in words,
to allow better rendering of Markdown documents discussing code:
```markdown
perform_complicated_task
do_this_and_do_that_and_another_thing
but_emphasis is_desired _here_
```
When rendered, the example looks similar to:
<!-- vale gitlab_base.Spelling = NO -->
> perform_complicated_task
>
> do_this_and_do_that_and_another_thing
>
> but_emphasis is_desired _here_
<!-- vale gitlab_base.Spelling = YES -->
If you wish to emphasize only a part of a word, it can still be done with asterisks:
```markdown
perform*complicated*task
do*this*and*do*that*and*another thing
```
When rendered, the example looks similar to:
> perform*complicated*task
>
> do*this*and*do*that*and*another thing
### Inline diff
With inline diff tags, you can display `{+ additions +}` or `[- deletions -]`.
The wrapping tags can be either curly braces or square brackets:
```markdown
- {+ addition 1 +}
- [+ addition 2 +]
- {- deletion 3 -}
- [- deletion 4 -]
```

---
However, you cannot mix the wrapping tags:
```markdown
- {+ addition +]
- [+ addition +}
- {- deletion -]
- [- deletion -}
```
Diff highlighting doesn't work with `` `inline code` ``. If your text includes backticks (`` ` ``), [escape](#escape-characters)
each backtick with a backslash ` \ `:
```markdown
- {+ Just regular text +}
- {+ Text with `backticks` inside +}
- {+ Text with escaped \`backticks\` inside +}
```

### Horizontal rule
Create a horizontal rule by using three or more hyphens, asterisks, or underscores:
```markdown
---
***
___
```
When rendered, all horizontal rules look similar to:
---
## Lists
You can create ordered and unordered lists.
For an ordered list, add the number you want the list
to start with, like `1.`, followed by a space, at the start of each line.
After the first number, it does not matter what number you use. Ordered lists are
numbered automatically by vertical order, so repeating `1.` for all items in the
same list is common. If you start with a number other than `1.`, it uses that as the first
number, and counts up from there.
Examples:
```markdown
1. First ordered list item
2. Another item
- Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
1. Ordered sub-list
1. Next ordered sub-list item
4. And another item.
```
<!--
The "2." and "4." in the previous example are changed to "1." in the following example,
to match the style standards on docs.gitlab.com.
See https://docs.gitlab.com/ee/development/documentation/styleguide/#lists
-->
When rendered, the example looks similar to:
> 1. First ordered list item
> 1. Another item
> - Unordered sub-list.
> 1. Actual numbers don't matter, just that it's a number
> 1. Ordered sub-list
> 1. Next ordered sub-list item
> 1. And another item.
For an unordered list, add a `-`, `*` or `+`, followed by a space, at the start of
each line. Don't mix the characters in the same list.
```markdown
Unordered lists can:
- use
- minuses
They can also:
* use
* asterisks
They can even:
+ use
+ pluses
```
<!--
The "*" and "+" in the previous example are changed to "-" in the following example,
to match the style standards on docs.gitlab.com.
See https://docs.gitlab.com/ee/development/documentation/styleguide/#lists
-->
When rendered, the example looks similar to:
> Unordered lists can:
>
> - use
> - minuses
>
> They can also:
>
> - use
> - asterisks
>
> They can even:
>
> - use
> - pluses
---
If a list item contains multiple paragraphs, each subsequent paragraph should be indented
to the same level as the start of the list item text.
Example:
```markdown
1. First ordered list item
Second paragraph of first item.
1. Another item
```
When rendered, the example looks similar to:
> 1. First ordered list item
>
> Second paragraph of first item.
>
> 1. Another item
If the first item's paragraph isn't indented with the proper number of spaces,
the paragraph appears outside the list.
Use the correct number of spaces to properly indent under the list item.
For example:
```markdown
1. First ordered list item
(Misaligned paragraph of first item.)
1. Another item
```
When rendered, the example looks similar to:
<!-- markdownlint-disable MD027 -->
> 1. First ordered list item
>
> (Misaligned paragraph of first item.)
>
> 1. Another item
<!-- markdownlint-enable MD027 -->
---
Ordered lists that are the first sub-item of an unordered list item must have a preceding blank line if they don't start with `1.`.
For example, with a blank line:
```markdown
- Unordered list item
5. First ordered list item
```
When rendered, the example looks similar to:
<!-- markdownlint-disable MD029 -->
> - Unordered list item
>
> 5. First ordered list item
<!-- markdownlint-disable MD029 -->
If the blank line is missing, the second list item renders as part of the first one:
```markdown
- Unordered list item
5. First ordered list item
```
When rendered, the example looks similar to:
> - Unordered list item
> 5. First ordered list item
---
CommonMark ignores blank lines between ordered and unordered list items, and considers them part of a single list. The items are rendered as a
_[loose](https://spec.commonmark.org/0.30/#loose)_ list. Each list item is enclosed in a paragraph tag and therefore has paragraph spacing and margins.
This makes the list look like there is extra spacing between each item.
For example:
```markdown
- First list item
- Second list item
- A different list
```
When rendered, the example looks similar to:
> - First list item
> - Second list item
>
> - A different list
CommonMark ignores the blank line and renders this as one list with paragraph spacing.
### Description lists
{{< history >}}
- Description lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26314) in GitLab 17.7.
{{< /history >}}
A description list is a list of terms with corresponding descriptions.
Each term can have multiple descriptions.
In HTML this is represented with `<dl>`, `<dt>`, and `<dd>` tags.
To create a description list, place the term on one line, with the description on the next line beginning with a colon.
```markdown
Fruits
: apple
: orange
Vegetables
: broccoli
: kale
: spinach
```
You can also have a blank line between the term and description.
```markdown
Fruits
: apple
: orange
```
{{< alert type="note" >}}
The rich text editor does not support inserting new description lists. To insert a new description list, use the
plain text editor. For more information, see [issue 535956](https://gitlab.com/gitlab-org/gitlab/-/issues/535956).
{{< /alert >}}
### Task lists
{{< history >}}
- Inapplicable checkboxes [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85982) in GitLab 15.3.
{{< /history >}}
You can add task lists anywhere Markdown is supported.
- In issues, merge requests, epics, and comments, you can select the boxes.
- In all other places, you cannot select the boxes. You must edit the Markdown manually
by adding or removing an `x` in the brackets.
Besides complete and incomplete, tasks can also be **inapplicable**. Selecting an inapplicable checkbox
in an issue, merge request, epic, or comment has no effect.
To create a task list, follow the format of an ordered or unordered list:
```markdown
- [x] Completed task
- [~] Inapplicable task
- [ ] Incomplete task
- [x] Sub-task 1
- [~] Sub-task 2
- [ ] Sub-task 3
1. [x] Completed task
1. [~] Inapplicable task
1. [ ] Incomplete task
1. [x] Sub-task 1
1. [~] Sub-task 2
1. [ ] Sub-task 3
```

To include task lists in tables, [use HTML list tags or HTML tables](#task-lists-in-tables).
## Links
You can create links in multiple ways:
```markdown
- This line shows an [inline-style link](https://www.google.com)
- This line shows a [link to a repository file in the same directory](permissions.md)
- This line shows a [relative link to a file one directory higher](../_index.md)
- This line shows a [link that also has title text](https://www.google.com "This link takes you to Google!")
```
When rendered, the examples look similar to:
> - This line shows an [inline-style link](https://www.google.com)
> - This line shows a [link to a repository file in the same directory](permissions.md)
> - This line shows a [relative link to a file one directory higher](../_index.md)
> - This line shows a [link that also has title text](https://www.google.com "This link takes you to Google!")
{{< alert type="note" >}}
You cannot use relative links to reference project files in a wiki
page, or a wiki page in a project file. This limitation exists because wikis are always
in separate Git repositories in GitLab. For example, `[I'm a reference-style link](style)`
points to `wikis/style` only when the link is inside a wiki Markdown file.
{{< /alert >}}
Use heading ID anchors to link to a specific section in a page:
```markdown
- This line links to [a section on a different Markdown page, using a "#" and the heading ID](permissions.md#project-members-permissions)
- This line links to [a different section on the same page, using a "#" and the heading ID](#heading-ids-and-links)
```
When rendered, the examples look similar to:
> - This line links to [a section on a different Markdown page, using a "#" and the heading ID](permissions.md#project-members-permissions)
> - This line links to [a different section on the same page, using a "#" and the heading ID](#heading-ids-and-links)
Using link references:
<!--
The following codeblock uses extra spaces to avoid the Vale ReferenceLinks test.
Do not remove the two-space nesting.
-->
```markdown
- This line shows a [reference-style link, see below][Arbitrary case-insensitive reference text]
- You can [use numbers for reference-style link definitions, see below][1]
- Or leave it empty and use the [link text itself][], see below.
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://www.mozilla.org/en-US/
[1]: https://slashdot.org
[link text itself]: https://about.gitlab.com/
```
<!--
The example below uses in-line links to pass the Vale ReferenceLinks test.
Do not change to reference style links.
-->
When rendered, the example look similar to:
> - This line is a [reference-style link, see below](https://www.mozilla.org/en-US/)
> - You can [use numbers for reference-style link definitions, see below](https://slashdot.org)
> - Or leave it empty and use the [link text itself](https://about.gitlab.com/), see below.
>
> Some text to show that the reference links can follow later.
### URL auto-linking
Almost any URL you put into your text is auto-linked:
```markdown
- https://www.google.com
- https://www.google.com
- ftp://ftp.us.debian.org/debian/
- smb://foo/bar/baz
- irc://irc.freenode.net/
- http://localhost:3000
```
When rendered, the example looks similar to:
> - <https://www.google.com>
> - <https://www.google.com>
> - <ftp://ftp.us.debian.org/debian/>
> - <a href="smb://foo/bar/baz/">smb://foo/bar/baz</a>
> - <a href="irc://irc.freenode.net">irc://irc.freenode.net</a>
> - <http://localhost:3000>
## GitLab-specific references
{{< history >}}
- Autocomplete for wiki pages [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/442229) in GitLab 16.11.
- Ability to reference labels from groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/455120) in GitLab 17.1.
- Ability to reference issues, epics, and work items with `[work_item:NUMBER]` syntax [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.2.
- Ability to reference issues, epics, and work items with `[work_item:123]` syntax [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- Ability to reference issues, epics, and work items with `[work_item:123]` syntax [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
GitLab Flavored Markdown renders GitLab-specific references. For example, you can reference
an issue, a commit, a team member, or even an entire project team. GitLab Flavored Markdown turns
that reference into a link so you can navigate between them. All references to projects should use the
**project slug** rather than the project name.
Additionally, GitLab Flavored Markdown recognizes certain cross-project references and also has a shorthand
version to reference other projects from the same namespace.
GitLab Flavored Markdown recognizes the following:
| References | Input | Cross-project reference | Shortcut inside the same namespace |
|--------------------------------------------------------------------------------------|-------------------------------------------------------|------------------------------------------------|------------------------------------|
| Specific user | `@user_name` | | |
| Specific group | `@group_name` | | |
| Entire team | [`@all`](discussions/_index.md#mentioning-all-members) | | |
| Project | `namespace/project>` | | |
| Issue | ``#123`` or `[issue:123]` | `namespace/project#123` or `[issue:namespace/project/123]` | `project#123` or `[issue:project/123]` |
| [Work item](work_items/_index.md) | `[work_item:123]` | `[work_item:namespace/project/123]` | `[work_item:project/123]` |
| Merge request | `!123` | `namespace/project!123` | `project!123` |
| Snippet | `$123` | `namespace/project$123` | `project$123` |
| [Epic](group/epics/_index.md) | `#123` or `&123` or `[work_item:123]` | `group1/subgroup#123` or `group1/subgroup&123` or `[work_item:group1/subgroup/123]` | |
| [Iteration](group/iterations/_index.md) | `*iteration:"iteration title"` | | |
| [Iteration cadence](group/iterations/_index.md) by ID<sup>1</sup> | `[cadence:123]` | | |
| [Iteration cadence](group/iterations/_index.md) by title (one word)<sup>1</sup> | `[cadence:plan]` | | |
| [Iteration cadence](group/iterations/_index.md) by title (multiple words)<sup>1</sup> | `[cadence:"plan a"]` | | |
| [Vulnerability](application_security/vulnerabilities/_index.md) | `[vulnerability:123]` | `[vulnerability:namespace/project/123]` | `[vulnerability:project/123]` |
| Feature flag | `[feature_flag:123]` | `[feature_flag:namespace/project/123]` | `[feature_flag:project/123]` |
| Label by ID <sup>2</sup> | `~123` | `namespace/project~123` | `project~123` |
| Label by name (one word) <sup>2</sup> | `~bug` | `namespace/project~bug` | `project~bug` |
| Label by name (multiple words) <sup>2</sup> | `~"feature request"` | `namespace/project~"feature request"` | `project~"feature request"` |
| Label by name (scoped) <sup>2</sup> | `~"priority::high"` | `namespace/project~"priority::high"` | `project~"priority::high"` |
| Project milestone by ID <sup>2</sup> | `%123` | `namespace/project%123` | `project%123` |
| Milestone by name (one word) <sup>2</sup> | `%v1.23` | `namespace/project%v1.23` | `project%v1.23` |
| Milestone by name (multiple words) <sup>2</sup> | `%"release candidate"` | `namespace/project%"release candidate"` | `project%"release candidate"` |
| Commit (specific) | `9ba12248` | `namespace/project@9ba12248` | `project@9ba12248` |
| Commit range comparison | `9ba12248...b19a04f5` | `namespace/project@9ba12248...b19a04f5` | `project@9ba12248...b19a04f5` |
| Repository file reference | `[README](doc/README.md)` | | |
| Repository file reference (specific line) | `[README](doc/README.md#L13)` | | |
| [Alert](../operations/incident_management/alerts.md) | `^alert#123` | `namespace/project^alert#123` | `project^alert#123` |
| [Contact](crm/_index.md#contacts) | `[contact:test@example.com]` | | |
| [Wiki page](project/wiki/_index.md) (if the page slug is the same as the title) | `[[Home]]` | | |
| [Wiki page](project/wiki/_index.md) (if the page slug is different from the title) | `[[How to use GitLab\|how-to-use-gitlab]]` | | |
**Footnotes**:
1. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9.
Iteration cadence references are always rendered following the format `[cadence:<ID>]`.
For example, the text reference `[cadence:"plan"]` renders as `[cadence:1]` if the referenced
iterations cadence's ID is `1`.
1. For labels or milestones, prepend a `/` before `namespace/project` to specify the exact label
or milestone, removing any possible ambiguity.
For example, referencing an issue by using `#123` formats the output as a link
to issue number 123 with text `#123`. Likewise, a link to issue number 123 is
recognized and formatted with text `#123`. If you don't want `#123` to link to an issue,
add a leading backslash `\#123`.
In addition to this, links to some objects are also recognized and formatted.
For example:
- Comments on issues: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234#note_101075757"`, rendered as `#1234 (comment 101075757)`
- The issues designs tab: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs"`, rendered as `#1234 (designs)`.
- Links to individual designs: `"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs/layout.png"`, rendered as `#1234[layout.png]`.
### Show item title
{{< history >}}
- Support for work items (tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390854) in GitLab 16.0.
- Support for epics introduced in GitLab 17.7, with the flag named `work_item_epics`, enabled by default.
- Generally available for epics in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
To include the title in the rendered link of an issue, task, objective, key result, merge request, or epic:
- Add a plus (`+`) at the end of the reference.
For example, a reference like `#123+` is rendered as `The issue title (#123)`.
URL references like `https://gitlab.com/gitlab-org/gitlab/-/issues/1234+` are also expanded.
### Show item summary
{{< history >}}
- Support for work items (tasks, objectives, and key results) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390854) in GitLab 16.0.
- Support for epics introduced in GitLab 17.7, with the flag named `work_item_epics`, enabled by default.
- Generally available for epics in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
To include an extended summary in the rendered link of an epic, issue, task, objective, key result, or merge request:
- Add a `+s` at the end of the reference.
Summary includes information about **assignees**, **milestone** and **health status**, as applicable by work item type, of referenced item.
For example, a reference like `#123+s` is rendered as
`The issue title (#123) • First Assignee, Second Assignee+ • v15.10 • Needs attention`.
URL references like `https://gitlab.com/gitlab-org/gitlab/-/issues/1234+s` are also expanded.
To update the rendered references if the assignee, milestone, or health status changed:
- Refresh the page.
### Comment preview on hover
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29663) in GitLab 17.3 [with a flag](../administration/feature_flags/_index.md) named `comment_tooltips`. Disabled by default.
- Feature flag removed in GitLab 17.6
{{< /history >}}
Hovering over a link to a comment shows the author and first line of the comment.
### Embed Observability dashboards
You can embed GitLab Observability UI dashboards descriptions and comments, for example in epics, issues, and MRs.
To embed an Observability dashboard URL:
1. In GitLab Observability UI, copy the URL in the address bar.
1. Paste your link in a comment or description. GitLab Flavored Markdown recognizes the URL and displays the source.
## Tables
When creating tables:
- The first line contains the headers, separated by pipe characters (`|`).
- The second line separates the headers from the cells.
- The cells can contain only empty spaces, hyphens, and (optionally) colons for horizontal alignment.
- Each cell must contain at least one hyphen, but adding more hyphens to a cell does not change the cell's rendering.
- Any content other than hyphens, whitespace, or colons is not allowed
- The third, and any following lines, contain the cell values.
- You **can't** have cells separated over many lines in the Markdown, they must be kept to single lines, but they can be very long. You can also include HTML `<br>` tags to force newlines if needed.
- The cell sizes **don't** have to match each other. They are flexible, but must be separated by pipes (`|`).
- You **can** have blank cells.
- Column widths are calculated dynamically based on the content of the cells.
- To use the pipe character (`|`) in the text and not as table delimiter, you must [escape](#escape-characters) it with a backslash (`\|`).
Example:
```markdown
| header 1 | header 2 | header 3 |
| --- | --- | --- |
| cell 1 | cell 2 | cell 3 |
| cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |
| cell 7 | | cell 9 |
```
When rendered, the example looks similar to:
> | header 1 | header 2 | header 3 |
> | --- | --- | --- |
> | cell 1 | cell 2 | cell 3 |
> | cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |
> | cell 7 | | cell 9 |
### Alignment
Additionally, you can choose the alignment of text in columns by adding colons (`:`)
to the sides of the "dash" lines in the second row. This affects every cell in the column:
```markdown
| Left Aligned | Centered | Right Aligned |
| :--- | :---: | ---: |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
```
When rendered, the example looks similar to:
> | Left Aligned | Centered | Right Aligned |
> | :--- | :---: | ---: |
> | Cell 1 | Cell 2 | Cell 3 |
> | Cell 4 | Cell 5 | Cell 6 |
[In GitLab itself](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#tables),
the headers are always left-aligned in Chrome and Firefox, and centered in Safari.
### Cells with multiple lines
You can use HTML formatting to adjust the rendering of tables. For example, you can
use `<br>` tags to force a cell to have multiple lines:
```markdown
| Name | Details |
| --- | --- |
| Item1 | This text is on one line |
| Item2 | This item has:<br>- Multiple items<br>- That we want listed separately |
```
When rendered, the example looks similar to:
> | Name | Details |
> | --- | --- |
> | Item1 | This text is on one line |
> | Item2 | This item has:<br>- Multiple items<br>- That we want listed separately |
### Task lists in tables
To add [task lists](#task-lists) with checkboxes, use HTML formatting. Using either:
- **An HTML table with Markdown in the cells**. Tables formatted this way result in fully functioning
task lists.
```html
<table>
<thead>
<tr><th>header 1</th><th>header 2</th></tr>
</thead>
<tbody>
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell 3</td>
<td>
- [ ] Task one
- [ ] Task two
</td>
</tr>
</tbody>
</table>
```
- **A Markdown table with HTML list tags**. These tasks don't save their state when selected.
Tables formatted this way do not render properly on `docs.gitlab.com`.
```markdown
| header 1 | header 2 |
| --- | --- |
| cell 1 | cell 2 |
| cell 3 | <ul><li> - [ ] Task one </li><li> - [ ] Task two </li></ul> |
```
You can also [create a table in the rich text editor](rich_text_editor.md#tables) and insert a task list then.
### Copy and paste from a spreadsheet
If you're working in spreadsheet software (for example, Microsoft Excel, Google
Sheets, or Apple Numbers), GitLab creates a Markdown table when you copy and paste
from a spreadsheet. For example, suppose you have the
following spreadsheet:

Select the cells and copy them to your clipboard. Open a GitLab Markdown
entry and paste the spreadsheet:

### JSON tables
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86353) in GitLab 15.3.
- Ability to use Markdown [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/375177) in GitLab 17.9.
{{< /history >}}
To render tables with JSON code blocks, use the following syntax:
````markdown
```json:table
{}
```
````
Watch the following video walkthrough of this feature:
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=12yWKw1AdKY">Demo: JSON Tables in Markdown</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/12yWKw1AdKY" frameborder="0" allowfullscreen> </iframe>
</figure>
The `items` attribute is a list of objects representing the data points.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
]
}
```
````
To specify the table labels, use the `fields` attribute.
````markdown
```json:table
{
"fields" : ["a", "b", "c"],
"items" : [
{"a": "11", "b": "22", "c": "33"}
]
}
```
````
Not all elements of `items` must have corresponding values in `fields`.
````markdown
```json:table
{
"fields" : ["a", "b", "c"],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "c": "233"}
]
}
```
````
When `fields` is not explicitly specified, the labels are picked from the first element of `items`.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "c": "233"}
]
}
```
````
You can specify custom labels for `fields`.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
]
}
```
````
You can enable sorting for individual elements of `fields`.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA", "sortable": true},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
]
}
```
````
You can use the `filter` attribute to render a table with content filtered dynamically by user input.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "22", "c": "33"},
{"a": "211", "b": "222", "c": "233"}
],
"filter" : true
}
```
````
You can use the `markdown` attribute to allow for GitLab Flavored Markdown in the items and caption,
including GitLab references. Fields do not support Markdown.
````markdown
```json:table
{
"fields" : [
{"key": "a", "label": "AA"},
{"key": "b", "label": "BB"},
{"key": "c", "label": "CC"}
],
"items" : [
{"a": "11", "b": "**22**", "c": "33"},
{"a": "#1", "b": "222", "c": "233"}
],
"markdown" : true
}
```
````
By default, every JSON table has the caption `Generated with JSON data`.
You can override this caption by specifying the `caption` attribute.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
],
"caption" : "Custom caption"
}
```
````
If JSON is invalid, an error occurs.
````markdown
```json:table
{
"items" : [
{"a": "11", "b": "22", "c": "33"}
],
}
```
````
## Multimedia
Embed images, videos, and audio.
You can add multimedia using Markdown syntax to link files, set dimensions, and display them inline.
Formatting options let you customize titles, specify width and height, and control how media appears
in the rendered output.
### Images
Embed images using inline or reference [links](#links) prepended with a `!`. For example:
<!--
DO NOT change the name of markdown_logo_v17_11.png. This file is used for a test in
spec/controllers/help_controller_spec.rb.
-->
<!-- markdownlint-disable proper-names -->
```markdown

```
> 
<!-- markdownlint-enable proper-names -->
In image links:
- Text in the square brackets (`[ ]`) becomes the image alt text.
- Text in double quotes after the image link path becomes the title text.
To see title text, hover over the image.
To learn about creating accessible alt text, see [Accessible images and videos](#accessible-images-and-videos).
### Videos
Image tags that link to files with a video extension are automatically converted to
a video player. The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`:
Here's an example video:
```markdown

```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#videos):
> 
### Change image or video dimensions
{{< history >}}
- Support for images [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/28118) in GitLab 15.7.
- Support for videos [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17139) in GitLab 15.9.
{{< /history >}}
You can control the width and height of an image or video by following the image with
an attribute list.
The value must an integer with a unit of either `px` (default) or `%`.
For example
```markdown
{width=100 height=100px}
{width=75%}
```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#change-image-or-video-dimensions):
> {width=100 height=100px}
You can also use the `img` HTML tag instead of Markdown and set its `height` and
`width` parameters.
When you paste a higher resolution PNG image into a Markdown text box [in GitLab 17.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/419913),
dimensions are always appended. The dimensions are automatically adjusted to
accommodate for retina (and other higher-resolution) displays. For instance,
a 144ppi image is resized to 50% of its dimensions, whereas a 96ppi image is
resized to 75% of its dimensions.
### Audio
Similar to videos, link tags for files with an audio extension are automatically converted to
an audio player. The valid audio extensions are `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`:
Here's an example audio clip:
```markdown

```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#audio):
> 
## Blockquotes
Use a blockquote to highlight information, such as a side note. It's generated
by starting the lines of the blockquote with `>`:
```markdown
> Blockquotes help you emulate reply text.
> This line is part of the same quote.
Quote break.
> This very long line is still quoted properly when it wraps. Keep writing to make sure this line is long enough to actually wrap for everyone. You can also *use* **Markdown** in a blockquote.
```
When rendered, the example looks similar to:
> > Blockquotes help you emulate reply text.
> > This line is part of the same quote.
>
> Quote break.
>
> > This very long line is still quoted properly when it wraps. Keep writing to make sure this line is long enough to actually wrap for everyone. You can also *use* **Markdown** in a blockquote.
### Multiline blockquote
Create multi-line blockquotes fenced by `>>>`:
```markdown
>>>
If you paste a message from somewhere else
that spans multiple lines,
you can quote that without having to manually prepend `>` to every line!
>>>
```
> If you paste a message from somewhere else
>
> that spans multiple lines,
>
> you can quote that without having to manually prepend `>` to every line!
## Code spans and blocks
Highlight anything that should be viewed as code and not standard text.
Inline code is formatted with single backticks `` ` ``:
```markdown
Inline `code` has `back-ticks around` it.
```
When rendered, the example looks similar to:
> Inline `code` has `back-ticks around` it.
For a similar effect with a larger code example, you can use a code block.
To create a code block:
- Fence an entire block of code with triple backticks (```` ``` ````). You can use more than three backticks,
as long as both the opening and closing set have the same number.
- Fence an entire block of code with triple tildes (`~~~`).
- Indent it four or more spaces.
For example:
- ````markdown
```python
def function():
#indenting works just fine in the fenced code block
s = "Python code"
print s
```
````
- ```markdown
Using 4 spaces
is like using
3-backtick fences.
```
- ```markdown
~~~javascript
var s = "JavaScript syntax highlighting";
alert(s);
~~~
```
The three previous examples render as:
- > ```python
> def function():
> #indenting works just fine in the fenced code block
> s = "Python code"
> print s
> ```
- > ```plaintext
> Using 4 spaces
> is like using
> 3-backtick fences.
> ```
- > ```javascript
> var s = "JavaScript syntax highlighting";
> alert(s);
> ```
### Syntax highlighting
GitLab uses the [Rouge Ruby library](https://github.com/rouge-ruby/rouge) for more colorful syntax
highlighting in code blocks. For a list of supported languages visit the
[Rouge project wiki](https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers).
Syntax highlighting is supported only in code blocks, so you can't highlight inline code.
To fence and apply syntax highlighting to a block of code, append the code language
to the opening code declaration, after the three back-ticks (```` ``` ````) or three tildes (`~~~`).
Code blocks that use `plaintext` or have no code language specified have no syntax highlighting:
````plaintext
```
No language indicated, so **no** syntax highlighting.
s = "No highlighting is shown for this line."
But let's throw in a <b>tag</b>.
```
````
When rendered, the example looks similar to:
> ```plaintext
> No language indicated, so **no** syntax highlighting.
> s = "No highlighting is shown for this line."
> But let's throw in a <b>tag</b>.
> ```
## Diagrams and flowcharts
You can generate diagrams from text by using:
- [Mermaid](https://mermaidjs.github.io/)
- [PlantUML](https://plantuml.com)
- [Kroki](https://kroki.io) to create a wide variety of diagrams.
In wikis, you can also add and edit diagrams created with the [diagrams.net editor](project/wiki/markdown.md#diagramsnet-editor).
### Mermaid
{{< history >}}
- Support for Entity Relationship diagrams and mind maps [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384386) in GitLab 16.0.
{{< /history >}}
Visit the [official page](https://mermaidjs.github.io/) for more details. The
[Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) helps you
learn Mermaid and debug issues in your Mermaid code. Use it to identify and resolve
issues in your diagrams.
To generate a diagram or flowchart, write your text inside the `mermaid` block:
````markdown
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
````
When rendered, the example looks similar to:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
You can also include subgraphs:
````markdown
```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph "SubGraph 1 Flow"
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph "Main Graph"
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```
````
When rendered, the example looks similar to:
```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph "SubGraph 1 Flow"
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph "Main Graph"
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```
### PlantUML
PlantUML integration is enabled on GitLab.com. To make PlantUML available in GitLab Self-Managed
installation of GitLab, a GitLab administrator [must enable it](../administration/integration/plantuml.md).
After you enable PlantUML, diagram delimiters `@startuml`/`@enduml` aren't required, as these
are replaced by the `plantuml` block. For example:
````markdown
```plantuml
Bob -> Alice : hello
Alice -> Bob : hi
```
````
You can include or embed a PlantUML diagram from separate files in the repository using
the `::include` directive.
For more information, see [Include diagram files](../administration/integration/plantuml.md#include-diagram-files).
### Kroki
To make Kroki available in GitLab, a GitLab administrator must enable it.
For more information, see the [Kroki integration](../administration/integration/kroki.md) page.
## Math equations
{{< history >}}
- LaTeX-compatible fencing [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21757) in GitLab 15.4 [with a flag](../administration/feature_flags/_index.md) named `markdown_dollar_math`. Disabled by default. Enabled on GitLab.com.
- LaTeX-compatible fencing [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/371180) in GitLab 15.8. Feature flag `markdown_dollar_math` removed.
{{< /history >}}
Math written in LaTeX syntax is rendered with [KaTeX](https://github.com/KaTeX/KaTeX).
_KaTeX only supports a [subset](https://katex.org/docs/supported.html) of LaTeX._
This syntax also works in AsciiDoc wikis and files using `:stem: latexmath`. For details, see
the [Asciidoctor user manual](https://asciidoctor.org/docs/user-manual/#activating-stem-support).
To prevent malicious activity, GitLab renders only the first 50 inline math instances.
You can disable this limit [for a group](../api/graphql/reference/_index.md#mutationgroupupdate)
or for the entire [GitLab Self-Managed instance](../administration/instance_limits.md#math-rendering-limits).
The number of math blocks is also limited based on render time. If the limit is exceeded,
GitLab renders the excess math instances as text. Wiki and repository files do not have
these limits.
Math written between dollar signs with backticks (``` $`...`$ ```) or single dollar signs (`$...$`)
is rendered inline with the text.
Math written between double dollar signs (`$$...$$`) or in a [code block](#code-spans-and-blocks) with
the language declared as `math` is rendered on a separate line:
`````markdown
This math is inline: $`a^2+b^2=c^2`$.
This math is on a separate line using a ```` ```math ```` block:
```math
a^2+b^2=c^2
```
This math is on a separate line using inline `$$`: $$a^2+b^2=c^2$$
This math is on a separate line using a `$$...$$` block:
$$
a^2+b^2=c^2
$$
`````
When rendered, the example looks like:

{{< alert type="note" >}}
The rich text editor does not support inserting new math blocks. To insert a new math block, use the
plain text editor. For more information, see [issue 366527](https://gitlab.com/gitlab-org/gitlab/-/issues/366527).
{{< /alert >}}
## Table of contents
A table of contents is an unordered list that links to subheadings in the document.
You can add a table of contents to issues, merge requests, and epics, but you can't add one
to notes or comments.
Add one of these tags on their own line to the **description** field of any of the supported
content types:
<!--
Tags for the table of contents are presented in a code block to work around a Markdown bug.
Do not change the code block back to single backticks.
For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/359077.
-->
```markdown
[[_TOC_]]
or
[TOC]
```
- Markdown files.
- Wiki pages.
- Issues.
- Merge requests.
- Epics.
{{< alert type="note" >}}
A table of contents renders also when you use the TOC code in single square brackets, regardless of
being on its own line or not. This behavior is unintended.
For more information, see [issue 359077](https://gitlab.com/gitlab-org/gitlab/-/issues/359077).
{{< /alert >}}
```markdown
This sentence introduces my wiki page.
[[_TOC_]]
## My first heading
First section content.
## My second heading
Second section content.
```

## Alerts
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24482) in GitLab 17.10.
{{< /history >}}
Alerts can be used to highlight or call attention to something. The alert syntax
uses the Markdown blockquote syntax followed by the type of alert.
You can use alerts in any text box that supports Markdown.
You can use the following types of alerts:
- Note: information that users should take into account, even when skimming:
```markdown
> [!note]
> The following information is useful.
```
- Tip: Optional information to help a user be more successful:
```markdown
> [!tip]
> Tip of the day.
```
- Important: Crucial information necessary for users to succeed:
```markdown
> [!important]
> This is something important you should know.
```
- Caution: Negative potential consequences of an action:
```markdown
> [!caution]
> You need to be very careful about the following.
```
- Warning: Critical potential risks:
```markdown
> [!warning]
> The following would be dangerous.
```
The title text shown for an alert defaults to the name of the alert. For example,
`> [!warning]` alert has the title `Warning`.
To override an alert block's title, enter any text on the same line.
For example, to use the warning color but have `Data deletion` as the title:
```markdown
> [!warning] Data deletion
> The following instructions will make your data unrecoverable.
```
[Multiline blockquotes](#multiline-blockquote) also support the alert syntax. This
allows you to wrap large and more complex text in an alert.
```markdown
>>> [!note] Things to consider
You should consider the following ramifications:
1. consideration 1
1. consideration 2
>>>
```
The alerts render as:

## Colors
Markdown does not support changing text color.
You can write a color code in the formats: `HEX`, `RGB`, or `HSL`.
- `HEX`: `` `#RGB[A]` `` or `` `#RRGGBB[AA]` ``
- `RGB`: `` `RGB[A](R, G, B[, A])` ``
- `HSL`: `` `HSL[A](H, S, L[, A])` ``
Named colors are not supported.
In the GitLab application (but not the GitLab documentation) color codes in backticks
display a color chip next to the color code. For example:
```markdown
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
```
This example only works when [rendered in GitLab](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#colors):
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
### Escape color codes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/359069) in GitLab 18.3.
{{< /history >}}
To display a color code as inline code without generating a color chip, prefix it with a backslash (`` \ ``).
For example:
- `\#FF0000`
- `\RGB(255,0,0)`
- `\HSL(0,100%,50%)`
In all cases, the backslash is removed, and no color chip is rendered in the output.
This is especially useful when you want to include values like issue numbers in inline code
without accidentally triggering a color chip.
## Emoji
You can use emoji anywhere GitLab Flavored Markdown is supported.
For example:
```markdown
Sometimes you want to :monkey: around a bit and add some :star2: to your
:speech_balloon:. Well we have a gift for you: emoji!
You can use it to point out a :bug: or warn about :speak_no_evil: patches.
And if someone improves your really :snail: code, send them some :birthday:.
People :heart: you for that.
If you're new to this, don't be :fearful:. You can join the emoji :family:.
Just look up one of the supported codes.
```
When rendered, the example looks similar to:
> Sometimes you want to <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/monkey.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":monkey:" alt=":monkey:">
> around a bit and add some <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/star2.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":star2:" alt=":star2:">
> to your <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/speech_balloon.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":speech_balloon:" alt=":speech_balloon:">.
> Well we have a gift for you: emoji!
>
> You can use it to point out a <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/bug.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":bug:" alt=":bug:">
> or warn about <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/speak_no_evil.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":speak_no_evil:" alt=":speak_no_evil:">
> patches. If someone improves your really <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/snail.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":snail:" alt=":snail:">
> code, send them some <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/birthday.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":birthday:" alt=":birthday:">.
> People <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/heart.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":heart:" alt=":heart:">
> you for that.
>
> If you're new to this, don't be <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/fearful.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":fearful:" alt=":fearful:">.
> You can join the emoji <img src="https://gitlab.com/gitlab-org/gitlab/-/raw/master/public/-/emojis/4/family.png" width="20px" height="20px" style="display:inline;margin:0;border:0;padding:0;" title=":family:" alt=":family:">.
> Just look up one of the supported codes.
Consult the [Emoji Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/)
for a list of all supported emoji codes.
### Emoji and your operating system
The previous emoji example uses hard-coded images. Rendered emoji
in GitLab might look different depending on the OS and browser used.
Most emoji are natively supported on macOS, Windows, iOS, Android, and fall back on image-based
emoji where there is no support.
<!-- vale gitlab_base.Spelling = NO -->
On Linux, you can download [Noto Color Emoji](https://github.com/googlefonts/noto-emoji)
to get full native emoji support. Ubuntu 22.04 (like many modern Linux distributions) has
this font installed by default.
<!-- vale gitlab_base.Spelling = YES -->
To learn more about adding custom emoji, see [Custom emoji](emoji_reactions.md#custom-emoji).
## Front matter
Front matter is metadata included at the beginning of a Markdown document, preceding
the content. This data can be used by static site generators like [Jekyll](https://jekyllrb.com/docs/front-matter/),
[Hugo](https://gohugo.io/content-management/front-matter/), and many other applications.
When you view a Markdown file rendered by GitLab, front matter is displayed as-is,
in a box at the top of the document. The HTML content displays after the front matter. To view an example,
you can toggle between the source and rendered version of a
[GitLab documentation file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/_index.md).
In GitLab, front matter is used only in Markdown files and wiki pages, not the other
places where Markdown formatting is supported. It must be at the very top of the document
and must be between delimiters.
The following delimiters are supported:
- YAML (`---`):
```yaml
---
title: About Front Matter
example:
language: yaml
---
```
- TOML (`+++`):
```toml
+++
title = "About Front Matter"
[example]
language = "toml"
+++
```
- JSON (`;;;`):
```json
;;;
{
"title": "About Front Matter"
"example": {
"language": "json"
}
}
;;;
```
Other languages are supported by adding a specifier to any of the existing
delimiters. For example:
```php
---php
$title = "About Front Matter";
$example = array(
'language' => "php",
);
---
```
## Includes
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/195798) in GitLab 17.7.
{{< /history >}}
Use includes, or include directives, to add the content of a document inside another document.
For example, a book could be split into multiple chapters, and then each chapter could be included in
the main book document:
```markdown
::include{file=chapter1.md}
::include{file=chapter2.md}
```
In GitLab, include directives are used only in Markdown files and wiki pages, not the other
places where Markdown formatting is supported.
Use an include directive in a Markdown file:
```markdown
::include{file=example_file.md}
```
Use an include directive in a wiki page:
```markdown
::include{file=example_page.md}
```
Each `::include` must start at the beginning of a line, and specifies a file or URL for `file=`.
The content of the specified file (or URL) is included at the position of the `::include` and
processed with the remaining Markdown.
Include directives inside the included file are ignored.
For example, if `file1` includes `file2`, and `file2` includes `file3`, when `file1` is processed,
it doesn't have the contents of `file3`.
### Include limits
To guarantee good system performance and prevent malicious documents from causing problems, GitLab
enforces a maximum limit on the number of include directives processed in a document.
By default, a document can have up to 32 include directives.
To customize the number of processed include directives, administrators can change the
`asciidoc_max_includes` application setting with the
[application settings API](../api/settings.md#available-settings).
### Use includes from external URLs
To use includes from separate wiki pages or external URLs, administrators can enable the
`wiki_asciidoc_allow_uri_includes`
[application setting](../administration/wikis/_index.md#allow-uri-includes-for-asciidoc).
```markdown
<!-- define application setting wiki_asciidoc_allow_uri_includes to true to allow content to be read from URI -->
::include{file=https://example.org/installation.md}
```
### Use includes in code blocks
You can use the `::include` directive inside code blocks to add content from files in your repository.
For example, if your repository contains a file `javascript_code.js`:
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
You can include it in your Markdown file:
````markdown
Our script contains:
```javascript
::include{file=javascript_code.js}
```
````
When rendered, the example looks similar to:
> Our script contains:
>
> ```javascript
> var s = "JavaScript syntax highlighting";
> alert(s);
> ```
## Placeholders
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14389) in GitLab 18.2 [with a flag](../administration/feature_flags/_index.md) named `markdown_placeholders`. Disabled by default.
{{< /history >}}
Placeholders can be used to display certain types of changeable data, such as a project's title
or latest tag. They are filled in each time the Markdown is rendered.
The syntax is `%{PLACEHOLDER}`.
| Placeholder | Example value | Description |
|---------------------------|---------------------|-------------|
| `%{gitlab_server}` | `gitlab.com` | Server of a project |
| `%{gitlab_pages_domain}` | `pages.gitlab.com` | Domain hosting GitLab Pages |
| `%{project_path}` | `gitlab-org/gitlab` | Path of a project including the parent groups |
| `%{project_name}` | `gitlab` | Name of a project |
| `%{project_id}` | `278964` | Database ID associated with a project |
| `%{project_namespace}` | `gitlab-org` | Project namespace of a project |
| `%{project_title}` | `GitLab` | Title of a project |
| `%{group_name}` | `gitlab-org` | Group of a project |
| `%{default_branch}` | `main` | Default branch name configured for a project's repository |
| `%{commit_sha}` | `ad10e011ce65492322037633ebc054efde37b143` | ID of the most recent commit to the default branch of a project's repository |
| `%{latest_tag}` | `v17.10.7-ee` | Latest tag added to the project's repository |
## Escape characters
Markdown reserves the following ASCII characters to format the page:
```plaintext
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
```
To use one of these reserved characters in your text, add the backslash character (` \ `) immediately before the
reserved character. When you place the backslash before a reserved character, the Markdown parser omits the
backslash and treats the reserved character as regular text.
Examples:
```plaintext
\# Not a heading
| Food | Do you like this food? (circle) |
|-----------------|---------------------------------|
| Pizza | Yes \| No |
\**Not bold, just italic text placed between some asterisks*\*
```
When rendered, the example looks similar to:
> \# Not a heading
>
> | Food | Do you like this food? (circle)|
> |-----------------|--------------------------------|
> | Pizza | Yes \| No |
>
> \**Not bold, just italic text placed between some asterisks*\*
A backslash doesn't always escape the character that follows it. The backslash appears as regular text in the following cases:
- When the backslash appears before a non-reserved character, such as `A`, `3`, or a space.
- When the backslash appears inside of these Markdown elements:
- Code blocks
- Code spans
- Auto-links
- Inline HTML, such as `<kbd>`
In these instances you might need to use the equivalent HTML entity, such as `]` for `]`.
### Use backslash with backticks
When the backslash (` \ `) character is at the end of an inline code sample, the backslash
can escape the last backtick. In this case, add extra spaces around the inline code,
for example:
```markdown
Use the backslash ` \ ` character to escape inline code that ends in a ` backslash\ `.
```
When rendered, the example looks similar to:
> Use the backslash ` \ ` character to escape inline code that ends in a ` backslash\ `.
## Footnotes
Footnotes add a link to a note rendered at the end of a Markdown file.
To make a footnote, you need both a reference tag and a separate line (anywhere in the file) with
the note content.
Regardless of the tag names, the relative order of the reference tags determines the rendered
numbering.
Regardless where you put the note, it's always shown at the bottom of the rendered file.
For example:
- Referencing footnotes:
```markdown
A footnote reference tag looks like this:[^1]
This reference tag is a mix of letters and numbers. [^footnote-42]
```
- Defining footnotes in a different part of the file:
```markdown
[^1]: This text is inside a footnote.
[^footnote-42]: This text is another footnote.
```
When rendered, footnotes look similar to:
> A footnote reference tag looks like this:[^1]
>
> This reference tag is a mix of letters and numbers.[^footnote-42]
>
> [^1]: This text is inside a footnote.
> [^footnote-42]: This text is another footnote.
{{< alert type="note" >}}
The rich text editor does not support inserting new footnotes. To insert a new footnote, use the
plain text editor. For more information, see [issue 365265](https://gitlab.com/gitlab-org/gitlab/-/issues/365265).
{{< /alert >}}
## Inline HTML
You can also use raw HTML in your Markdown, and it usually works pretty well.
See the documentation for `HTML::Pipeline`'s [SanitizationFilter](https://github.com/gjtorikian/html-pipeline/blob/v2.12.3/lib/html/pipeline/sanitization_filter.rb#L42)
class for the list of allowed HTML tags and attributes. In addition to the default
`SanitizationFilter` allowlist, GitLab allows `span`, `abbr`, `details` and `summary` elements.
`rel="license"` is allowed on links to support the [Rel-License microformat](https://microformats.org/wiki/rel-license) and license attribution.
```html
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>
</dl>
```
When rendered, the example looks similar to:
> <dl>
> <dt>Definition list</dt>
> <dd>Is something people use sometimes.</dd>
>
> <dt>Markdown in HTML</dt>
> <dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>
> </dl>
It's still possible to use Markdown inside HTML tags, but only if the lines containing Markdown
are separated into their own lines:
```html
<dl>
<dt>Markdown in HTML</dt>
Does *not* work **very** well. HTML tags work, in most cases.
</dd>
</dl>
```
When rendered, the example looks similar to:
<!--
The example below uses HTML to force correct rendering on docs.gitlab.com,
Markdown is fine in GitLab.
-->
<!-- markdownlint-disable MD027 -->
> <dl>
> <dt>Markdown in HTML</dt>
>
> Does <em>not</em> work <b>very</b> well. HTML tags work, in most cases.
>
> </dd>
> </dl>
<!-- markdownlint-enable MD027 -->
### Collapsible section
Content can be collapsed using HTML's [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)
and [`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)
tags. For example, collapse a long log file so it takes up less screen space.
```html
<details>
<summary>Click to expand</summary>
These details <em>remain</em> <strong>hidden</strong> until expanded.
<pre><code>PASTE LOGS HERE</code></pre>
</details>
```
When rendered, the example looks similar to:
> <details>
> <summary>Click to expand</summary>
>
> These details <em>remain</em> <strong>hidden</strong> until expanded.
>
> <pre><code>PASTE LOGS HERE</code></pre>
>
> </details>
---
Markdown inside these tags is also supported.
Remember to leave a blank line before and after any Markdown sections, as shown in the example:
````html
<details>
<summary>
Click to _expand._
</summary>
These details _remain_ **hidden** until expanded.
```
PASTE LOGS HERE
```
</details>
````
<!--
The example below uses HTML to force correct rendering on docs.gitlab.com, Markdown
works correctly in GitLab.
-->
When rendered, the example looks similar to:
> <details>
> <summary>Click to <em>expand.</em></summary>
>
> These details <em>remain</em> <b>hidden</b> until expanded.
>
> <pre><code>PASTE LOGS HERE</code></pre>
>
> </details>
### Keyboard HTML tag
The `<kbd>` element is used to identify text that represents user keyboard input. Text surrounded by `<kbd>` tags is typically displayed in the browser's default monospace font.
```html
Press <kbd>Enter</kbd> to go to the next page.
```
When rendered, the example looks similar to:
> Press <kbd>Enter</kbd> to go to the next page.
### Superscripts and subscripts
GitLab Flavored Markdown doesn't support the Redcarpet superscript syntax ( `x^2` ).
For superscripts and subscripts, use the standard HTML syntax:
```html
The formula for water is H<sub>2</sub>O
while the equation for the theory of relativity is E = mc<sup>2</sup>.
```
<!-- vale gitlab_base.Spelling = NO -->
When rendered, the example looks similar to:
> The formula for water is H<sub>2</sub>O
> while the equation for the theory of relativity is E = mc<sup>2</sup>.
<!-- vale gitlab_base.Spelling = YES -->
GitLab Flavored Markdown doesn't support the Redcarpet superscript syntax ( `x^2` ).
### HTML comments
You can use HTML comments in GitLab Flavored Markdown to add notes or explanations that aren't
visible in the rendered output.
Use HTML comments to:
- Add notes for other contributors.
- Temporarily hide content without deleting it.
- Provide context or explanations that shouldn't appear in the final document.
- Add metadata or processing instructions.
When using HTML comments, you should:
- Use them sparingly to avoid cluttering the source.
- Keep them concise and relevant.
- Use them for temporary notes rather than permanent documentation.
- Avoid including sensitive or confidential information. HTML comments are visible to anyone who can view the Markdown source.
HTML comments use the standard HTML syntax `<!-- comment text -->` and can span single or multiple
lines:
```html
<!-- This is a single-line comment -->
<!--
This is a multi-line comment
that spans several lines
and won't be visible in the rendered output
-->
This text is visible.
<!-- This comment between paragraphs is hidden -->
This text is also visible.
```
When rendered, only the visible text appears:
> This text is visible.
> This text is also visible.
#### Comments in code blocks
HTML comments inside code blocks are treated as literal text and are displayed:
````markdown
```html
<!-- This comment will be visible in the code block -->
<div>Content</div>
```
````
## References
- This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
- The original [Markdown Syntax Guide](https://daringfireball.net/projects/markdown/syntax)
at Daring Fireball is an excellent resource for a detailed explanation of standard Markdown.
- You can find the detailed specification for CommonMark in the [CommonMark Spec](https://spec.commonmark.org/current/).
- The [CommonMark Dingus](https://spec.commonmark.org/dingus/) helps you test CommonMark syntax.
|
https://docs.gitlab.com/reserved_names
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/reserved_names.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
reserved_names.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Reserved project and group names
|
Naming conventions, restrictions, and reserved names.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To not conflict with existing routes used by GitLab, some words cannot be used as project or group names.
These words are listed in the
[`path_regex.rb` file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/path_regex.rb),
where:
- `TOP_LEVEL_ROUTES` are names reserved as usernames or top-level groups.
- `PROJECT_WILDCARD_ROUTES` are names reserved for subgroups or projects.
- `GROUP_ROUTES` are names reserved for all groups or projects.
## Rules for usernames, project and group names, and slugs
- Usernames must start and end with a letter (`a-zA-Z`) or a digit (`0-9`). Additionally:
- Usernames and group names can contain only letters (`a-zA-Z`), digits (`0-9`), emoji, underscores (`_`), dots (`.`), parentheses (`()`), dashes (`-`), or spaces.
- Project names can contain only letters (`a-zA-Z`), digits (`0-9`), emoji, underscores (`_`), dots (`.`), pluses (`+`), dashes (`-`), or spaces.
- Usernames and project or group slugs:
- Must start and end with a letter (`a-zA-Z`) or digit (`0-9`).
- Must not contain consecutive special characters.
- Cannot end in `.git` or `.atom`.
- Can contain only letters (`a-zA-Z`), digits (`0-9`), underscores (`_`), dots (`.`), or dashes (`-`).
## Reserved project names
You cannot create projects with the following names:
- `\-`
- `badges`
- `blame`
- `blob`
- `builds`
- `commits`
- `create`
- `create_dir`
- `edit`
- `environments/folders`
- `files`
- `find_file`
- `gitlab-lfs/objects`
- `info/lfs/objects`
- `new`
- `preview`
- `raw`
- `refs`
- `tree`
- `update`
- `wikis`
## Reserved group names
You cannot create groups with the following names, because they are reserved for top-level groups:
- `\-`
- `.well-known`
- `404.html`
- `422.html`
- `500.html`
- `502.html`
- `503.html`
- `admin`
- `api`
- `apple-touch-icon.png`
- `assets`
- `dashboard`
- `deploy.html`
- `explore`
- `favicon.ico`
- `favicon.png`
- `files`
- `groups`
- `health_check`
- `help`
- `import`
- `jwt`
- `login`
- `oauth`
- `profile`
- `projects`
- `public`
- `robots.txt`
- `s`
- `search`
- `sitemap`
- `sitemap.xml`
- `sitemap.xml.gz`
- `slash-command-logo.png`
- `snippets`
- `unsubscribes`
- `uploads`
- `users`
- `v2`
You cannot create subgroups with the following names:
- `\-`
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Reserved project and group names
description: Naming conventions, restrictions, and reserved names.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
To not conflict with existing routes used by GitLab, some words cannot be used as project or group names.
These words are listed in the
[`path_regex.rb` file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/path_regex.rb),
where:
- `TOP_LEVEL_ROUTES` are names reserved as usernames or top-level groups.
- `PROJECT_WILDCARD_ROUTES` are names reserved for subgroups or projects.
- `GROUP_ROUTES` are names reserved for all groups or projects.
## Rules for usernames, project and group names, and slugs
- Usernames must start and end with a letter (`a-zA-Z`) or a digit (`0-9`). Additionally:
- Usernames and group names can contain only letters (`a-zA-Z`), digits (`0-9`), emoji, underscores (`_`), dots (`.`), parentheses (`()`), dashes (`-`), or spaces.
- Project names can contain only letters (`a-zA-Z`), digits (`0-9`), emoji, underscores (`_`), dots (`.`), pluses (`+`), dashes (`-`), or spaces.
- Usernames and project or group slugs:
- Must start and end with a letter (`a-zA-Z`) or digit (`0-9`).
- Must not contain consecutive special characters.
- Cannot end in `.git` or `.atom`.
- Can contain only letters (`a-zA-Z`), digits (`0-9`), underscores (`_`), dots (`.`), or dashes (`-`).
## Reserved project names
You cannot create projects with the following names:
- `\-`
- `badges`
- `blame`
- `blob`
- `builds`
- `commits`
- `create`
- `create_dir`
- `edit`
- `environments/folders`
- `files`
- `find_file`
- `gitlab-lfs/objects`
- `info/lfs/objects`
- `new`
- `preview`
- `raw`
- `refs`
- `tree`
- `update`
- `wikis`
## Reserved group names
You cannot create groups with the following names, because they are reserved for top-level groups:
- `\-`
- `.well-known`
- `404.html`
- `422.html`
- `500.html`
- `502.html`
- `503.html`
- `admin`
- `api`
- `apple-touch-icon.png`
- `assets`
- `dashboard`
- `deploy.html`
- `explore`
- `favicon.ico`
- `favicon.png`
- `files`
- `groups`
- `health_check`
- `help`
- `import`
- `jwt`
- `login`
- `oauth`
- `profile`
- `projects`
- `public`
- `robots.txt`
- `s`
- `search`
- `sitemap`
- `sitemap.xml`
- `sitemap.xml.gz`
- `slash-command-logo.png`
- `snippets`
- `unsubscribes`
- `uploads`
- `users`
- `v2`
You cannot create subgroups with the following names:
- `\-`
|
https://docs.gitlab.com/rich_text_editor
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/rich_text_editor.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
rich_text_editor.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Rich text editor
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371931) for editing issue descriptions in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/382636) for [discussions](discussions/_index.md), and creating and editing issues and merge requests in GitLab 15.11 with the same flag.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/407507) for epics in GitLab 16.1 with the same flag.
- Feature flag `content_editor_on_issues` enabled by default in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
- Rich text editor [set to default editor for new users](https://gitlab.com/gitlab-org/gitlab/-/issues/536611) in 18.2.
{{< /history >}}
The Rich text editor is the default text editor for new users in GitLab.
Rich text editor is available in:
- [Wikis](project/wiki/_index.md)
- Issues
- Epics
- Merge requests
- [Designs](project/issues/design_management.md)
Features of the editor include:
- Format text, including as bold, italics, block quotes, headings, and inline code.
- Format ordered lists, unordered lists, and checklists.
- Insert links, attachments, images, video, and audio.
- Create and edit a table structure.
- Insert and format code blocks with syntax highlighting.
- Preview Mermaid, PlantUML, and Kroki diagrams in real time.
To track work on adding the rich text editor to more places across GitLab, see
[epic 7098](https://gitlab.com/groups/gitlab-org/-/epics/7098).
## Switch to the rich text editor
Use the rich text editor to edit descriptions, wiki pages, add comments.
To switch to the rich text editor: In a text box, in the lower-left corner, select
**Switch to rich text editing**.
## Switch to the plain text editor
If you want to enter Markdown source in the text box, return to using the plain text editor.
To switch to the plain text editor: In a text box, in the lower-left corner, select
**Switch to plain text editing**.

## Compatibility with GitLab Flavored Markdown
The rich text editor is fully compatible with [GitLab Flavored Markdown](markdown.md).
It means that you can switch between plain text and rich text modes without losing any data.
### Input rules
Rich text editor also supports input rules that let you work with rich content as if you were
typing Markdown.
Supported input rules:
| Input rule syntax | Content inserted |
| --------------------------------------------------------- | -------------------- |
| `# Heading 1` through `###### Heading 6` | Headings 1 through 6 |
| `**bold**` or `__bold__` | Bold text |
| `_italics_` or `*italics*` | Italicized text |
| `~~strike~~` | Strikethrough |
| `[link](https://example.com)` | Hyperlink |
| `code` | Inline code |
| ` ```rb ` + <kbd>Enter</kbd> <br> ` ```js ` + <kbd>Enter</kbd> | Code block |
| `* List item`, or<br> `- List item`, or<br> `+ List item` | Unordered list |
| `1. List item` | Numbered list |
| `<details>` | Collapsible section |
## Tables
Unlike in raw Markdown, you can use the rich text editor to insert block content paragraphs,
list items, diagrams (or even another table!) in table cells.
### Insert a table
To insert a table:
1. Select **Insert table** {{< icon name="table" >}}.
1. From the dropdown list, select the dimensions of the new table.

### Edit a table
Inside a table cell, you can use a menu to insert or delete rows or columns.
To open the menu: In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}}.

### Operations on multiple cells
Select multiple cells and merge or split them.
To merge selected cells into one:
1. Select multiple cells - select one and drag your cursor.
1. In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}} **> Merge N cells**.
To split merged cells: In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}} **> Split cell**.
## Insert diagrams
Insert [Mermaid](https://mermaidjs.github.io/) and [PlantUML](https://plantuml.com/) diagrams and
preview them live as you type the diagram code.
To insert a diagram:
1. On the top bar of a text box, select {{< icon name="plus" >}} **More options** and then **Mermaid diagram** or **PlantUML diagram**.
1. Enter the code for your diagram. The diagram preview appears in the text box.

## Related topics
- [Set the default text editor](profile/preferences.md#set-the-default-text-editor)
- [Keyboard shortcuts](shortcuts.md#rich-text-editor) for rich text editor
- [GitLab Flavored Markdown](markdown.md)
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Rich text editor
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371931) for editing issue descriptions in GitLab 15.5 [with a flag](../administration/feature_flags/_index.md) named `content_editor_on_issues`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/382636) for [discussions](discussions/_index.md), and creating and editing issues and merge requests in GitLab 15.11 with the same flag.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/407507) for epics in GitLab 16.1 with the same flag.
- Feature flag `content_editor_on_issues` enabled by default in GitLab 16.2.
- Feature flag `content_editor_on_issues` removed in GitLab 16.5.
- Rich text editor [set to default editor for new users](https://gitlab.com/gitlab-org/gitlab/-/issues/536611) in 18.2.
{{< /history >}}
The Rich text editor is the default text editor for new users in GitLab.
Rich text editor is available in:
- [Wikis](project/wiki/_index.md)
- Issues
- Epics
- Merge requests
- [Designs](project/issues/design_management.md)
Features of the editor include:
- Format text, including as bold, italics, block quotes, headings, and inline code.
- Format ordered lists, unordered lists, and checklists.
- Insert links, attachments, images, video, and audio.
- Create and edit a table structure.
- Insert and format code blocks with syntax highlighting.
- Preview Mermaid, PlantUML, and Kroki diagrams in real time.
To track work on adding the rich text editor to more places across GitLab, see
[epic 7098](https://gitlab.com/groups/gitlab-org/-/epics/7098).
## Switch to the rich text editor
Use the rich text editor to edit descriptions, wiki pages, add comments.
To switch to the rich text editor: In a text box, in the lower-left corner, select
**Switch to rich text editing**.
## Switch to the plain text editor
If you want to enter Markdown source in the text box, return to using the plain text editor.
To switch to the plain text editor: In a text box, in the lower-left corner, select
**Switch to plain text editing**.

## Compatibility with GitLab Flavored Markdown
The rich text editor is fully compatible with [GitLab Flavored Markdown](markdown.md).
It means that you can switch between plain text and rich text modes without losing any data.
### Input rules
Rich text editor also supports input rules that let you work with rich content as if you were
typing Markdown.
Supported input rules:
| Input rule syntax | Content inserted |
| --------------------------------------------------------- | -------------------- |
| `# Heading 1` through `###### Heading 6` | Headings 1 through 6 |
| `**bold**` or `__bold__` | Bold text |
| `_italics_` or `*italics*` | Italicized text |
| `~~strike~~` | Strikethrough |
| `[link](https://example.com)` | Hyperlink |
| `code` | Inline code |
| ` ```rb ` + <kbd>Enter</kbd> <br> ` ```js ` + <kbd>Enter</kbd> | Code block |
| `* List item`, or<br> `- List item`, or<br> `+ List item` | Unordered list |
| `1. List item` | Numbered list |
| `<details>` | Collapsible section |
## Tables
Unlike in raw Markdown, you can use the rich text editor to insert block content paragraphs,
list items, diagrams (or even another table!) in table cells.
### Insert a table
To insert a table:
1. Select **Insert table** {{< icon name="table" >}}.
1. From the dropdown list, select the dimensions of the new table.

### Edit a table
Inside a table cell, you can use a menu to insert or delete rows or columns.
To open the menu: In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}}.

### Operations on multiple cells
Select multiple cells and merge or split them.
To merge selected cells into one:
1. Select multiple cells - select one and drag your cursor.
1. In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}} **> Merge N cells**.
To split merged cells: In the upper-right corner of a cell, select the chevron {{< icon name="chevron-down" >}} **> Split cell**.
## Insert diagrams
Insert [Mermaid](https://mermaidjs.github.io/) and [PlantUML](https://plantuml.com/) diagrams and
preview them live as you type the diagram code.
To insert a diagram:
1. On the top bar of a text box, select {{< icon name="plus" >}} **More options** and then **Mermaid diagram** or **PlantUML diagram**.
1. Enter the code for your diagram. The diagram preview appears in the text box.

## Related topics
- [Set the default text editor](profile/preferences.md#set-the-default-text-editor)
- [Keyboard shortcuts](shortcuts.md#rich-text-editor) for rich text editor
- [GitLab Flavored Markdown](markdown.md)
|
https://docs.gitlab.com/shortcuts
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/shortcuts.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
shortcuts.md
|
Growth
|
Engagement
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab keyboard shortcuts
|
Global shortcuts, navigation, and quick access.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab has several keyboard shortcuts you can use to access its different
features.
To display a window in GitLab that lists its keyboard shortcuts, use one of the
following methods:
- Press <kbd>?</kbd>.
- In the lower-left corner of the application, select **Help** and then **Keyboard shortcuts**.
Although [global shortcuts](#global-shortcuts) work from any area of GitLab,
you must be in specific pages for the other shortcuts to be available, as
explained in each section.
## Global shortcuts
These shortcuts are available in most areas of GitLab:
| Keyboard shortcut | Description |
|------------------------------------|-------------|
| <kbd>?</kbd> | Show or hide the shortcut reference sheet. |
| <kbd>Shift</kbd> + <kbd>p</kbd> | Go to your **Projects** page. |
| <kbd>Shift</kbd> + <kbd>g</kbd> | Go to your **Groups** page. |
| <kbd>Shift</kbd> + <kbd>a</kbd> | Go to your **Activity** page. |
| <kbd>Shift</kbd> + <kbd>l</kbd> | Go to your **Milestones** page. |
| <kbd>Shift</kbd> + <kbd>s</kbd> | Go to your **Snippets** page. |
| <kbd>s</kbd> / <kbd>/</kbd> | Put cursor in the search bar. |
| <kbd>f</kbd> | Focus filter bar |
| <kbd>Shift</kbd> + <kbd>i</kbd> | Go to your **Issues** page. |
| <kbd>Shift</kbd> + <kbd>m</kbd> | Go to your [**Merge requests**](project/merge_requests/_index.md) page. |
| <kbd>Shift</kbd> + <kbd>r</kbd> | Go to your **Review requests** page. |
| <kbd>Shift</kbd> + <kbd>t</kbd> | Go to your **To-Do List** page. |
| <kbd>p</kbd>, then <kbd>b</kbd> | Show or hide the Performance Bar. |
| <kbd>Escape</kbd> | Hide tooltips or popovers. |
| <kbd>g</kbd>, then <kbd>x</kbd> | Toggle between [GitLab](https://gitlab.com/) and [GitLab Next](https://next.gitlab.com/) (GitLab SaaS only). |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
| <kbd>d</kbd> | Open GitLab Duo Chat |
Additionally, the following shortcuts are available when editing text in text
fields (for example, comments, replies, issue descriptions, and merge request
descriptions):
| macOS shortcut | Windows shortcut | Description |
|------------------------------------------------------|------------------------------------------------------|-------------|
| <kbd>↑</kbd> | <kbd>↑</kbd> | Edit your last comment. You must be in a blank text field below a thread, and you must already have at least one comment in the thread. |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | Toggle Markdown preview when editing text in a text field that has **Write** and **Preview** tabs at the top. |
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold the selected text (surround it with `**`). |
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italicize the selected text (surround it with `_`). |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | Strike through the selected text (surround it with `~~`). |
| <kbd>Command</kbd> + <kbd>k</kbd> | <kbd>Control</kbd> + <kbd>k</kbd> | Add a link (surround the selected text with `[]()`). |
| <kbd>Command</kbd> + <kbd>[</kbd> | <kbd>Control</kbd> + <kbd>[</kbd> | Outdent text. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/351924) in GitLab 15.3. |
| <kbd>Command</kbd> + <kbd>]</kbd> | <kbd>Control</kbd> + <kbd>]</kbd> | Indent text. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/351924) in GitLab 15.3. |
| <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Control</kbd> + <kbd>Enter</kbd> | Submit or save changes |
The shortcuts for editing in text fields are always enabled, even if other
keyboard shortcuts are disabled.
## Project
These shortcuts are available from any page in a project. You must type them
relatively quickly to work, and they take you to another page in the project.
| Keyboard shortcut | Description |
|-----------------------------|-------------|
| <kbd>g</kbd> + <kbd>o</kbd> | Go to the **Project overview** page. |
| <kbd>g</kbd> + <kbd>v</kbd> | Go to the project **Activity** page (**Manage > Activity**). |
| <kbd>g</kbd> + <kbd>r</kbd> | Go to the project **Releases** page (**Deploy > Releases**). |
| <kbd>g</kbd> + <kbd>f</kbd> | Go to the [project files](#project-files) (**Code > Repository**). |
| <kbd>t</kbd> | Open the project file search dialog. (**Code > Repository**, select **Find Files**). |
| <kbd>g</kbd> + <kbd>c</kbd> | Go to the project **Commits** page (**Code > Commits**). |
| <kbd>g</kbd> + <kbd>n</kbd> | Go to the [**Repository graph**](#repository-graph) page (**Code > Repository graph**). |
| <kbd>g</kbd> + <kbd>d</kbd> | Go to the charts in the **Repository analytics** page (**Analyze > Repository analytics**). |
| <kbd>g</kbd> + <kbd>i</kbd> | Go to the project **Issues** page (**Plan > Issues**). |
| <kbd>i</kbd> | Go to the **New Issue** page (**Plan > Issues**, select **New issue** ). |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to the project **Issue boards** page (**Plan > Issue boards**). |
| <kbd>g</kbd> + <kbd>m</kbd> | Go to the project [**Merge requests**](project/merge_requests/_index.md) page (**Code > Merge requests**). |
| <kbd>g</kbd> + <kbd>p</kbd> | Go to the CI/CD **Pipelines** page (**Build > Pipelines**). |
| <kbd>g</kbd> + <kbd>j</kbd> | Go to the CI/CD **Jobs** page (**Build > Jobs**). |
| <kbd>g</kbd> + <kbd>e</kbd> | Go to the project **Environments** page (**Operate > Environments**). |
| <kbd>g</kbd> + <kbd>k</kbd> | Go to the project **Kubernetes clusters** integration page (**Operate > Kubernetes clusters**). You must have at least [`maintainer` permissions](permissions.md) to access this page. |
| <kbd>g</kbd> + <kbd>s</kbd> | Go to the project **Snippets** page (**Code > Snippets**). |
| <kbd>g</kbd> + <kbd>w</kbd> | Go to the [project wiki](project/wiki/_index.md) (**Plan > Wiki**), if enabled. |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
### Issues
These shortcuts are available when viewing issues:
| Keyboard shortcut | Description |
|-------------------------------|-------------|
| <kbd>e</kbd> | Edit description. |
| <kbd>a</kbd> | Change assignee. |
| <kbd>m</kbd> | Change milestone. |
| <kbd>l</kbd> | Change label. |
| <kbd>c</kbd> + <kbd>r</kbd> | Copy issue reference. |
| <kbd>r</kbd> | Start writing a comment. Pre-selected text is quoted in the comment. |
| <kbd>→</kbd> | Go to the next design. |
| <kbd>←</kbd> | Go to the previous design. |
| <kbd>Escape</kbd> | Close the design. |
### Merge requests
These shortcuts are available when viewing [merge requests](project/merge_requests/_index.md):
| macOS shortcut | Windows shortcut | Description |
|-----------------------------------|-----------------------------------|-------------|
| <kbd>]</kbd> or <kbd>j</kbd> | | Move to next file. |
| <kbd>[</kbd> or <kbd>k</kbd> | | Move to previous file. |
| <kbd>Command</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>p</kbd> | Search for, and then jump to a file for review. |
| <kbd>n</kbd> | | Move to next open thread. |
| <kbd>p</kbd> | | Move to previous open thread. |
| <kbd>b</kbd> | | Copy source branch name. |
| <kbd>c</kbd> + <kbd>r</kbd> | | Copy merge request reference. |
| <kbd>r</kbd> | | Start writing a comment. Pre-selected text is quoted in the comment. |
| <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Shift</kbd> + <kbd>Control</kbd> + <kbd>Enter</kbd> | Publish your comment immediately. |
| <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Control</kbd> + <kbd>Enter</kbd> | Add your comment in a pending state, as part of a [review](project/merge_requests/reviews/_index.md#start-a-review). |
| <kbd>c</kbd> | | Move to next commit. |
| <kbd>x</kbd> | | Move to previous commit. |
| <kbd>f</kbd> | | Toggle file browser. |
| <kbd>v</kbd> | | Mark file as viewed or unviewed. |
| <kbd>;</kbd> | | Expand all files. |
| <kbd>Shift</kbd> + <kbd>;</kbd> | | Collapse all files. |
### Project files
These shortcuts are available when browsing the files in a project (go to
**Code > Repository**):
| Keyboard shortcut | Description |
|-------------------|-------------|
| <kbd>↑</kbd> | Move selection up (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>↓</kbd> | Move selection down (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>Enter</kbd> | Open selection (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>Escape</kbd> | Go back to the **Find File** screen (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>y</kbd> | Go to file permalink (only while viewing a file). |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
### Repository graph
These shortcuts are available when viewing the project [repository graph](project/repository/_index.md#repository-history-graph)
page (go to **Code > Repository graph**):
| Keyboard shortcut | Description |
|--------------------------------------------------------------------|-------------|
| <kbd>←</kbd> or <kbd>h</kbd> | Scroll left. |
| <kbd>→</kbd> or <kbd>l</kbd> | Scroll right. |
| <kbd>↑</kbd> or <kbd>k</kbd> | Scroll up. |
| <kbd>↓</kbd> or <kbd>j</kbd> | Scroll down. |
| <kbd>Shift</kbd> + <kbd>↑</kbd> or <kbd>Shift</kbd> + <kbd>k</kbd> | Scroll to top. |
| <kbd>Shift</kbd> + <kbd>↓</kbd> or <kbd>Shift</kbd> + <kbd>j</kbd> | Scroll to bottom. |
### Incidents
These shortcuts are available when viewing incidents:
| Keyboard shortcut | Description |
|-------------------------------|-------------|
| <kbd>c</kbd> + <kbd>r</kbd> | Copy incident reference. |
### Wiki pages
This shortcut is available when viewing a [wiki page](project/wiki/_index.md):
| Keyboard shortcut | Description |
|-------------------|-----------------|
| <kbd>e</kbd> | Edit wiki page. |
### Rich text editor
These shortcuts are available when editing a file with the
[rich text editor](https://about.gitlab.com/direction/plan/knowledge/content_editor/):
| macOS shortcut | Windows shortcut | Description |
|----------------|------------------|-------------|
| <kbd>Command</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>c</kbd> | Copy |
| <kbd>Command</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>x</kbd> | Cut |
| <kbd>Command</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>v</kbd> | Paste |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | Paste without formatting |
| <kbd>Command</kbd> + <kbd>z</kbd> | <kbd>Control</kbd> + <kbd>z</kbd> | Undo |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | Redo |
| <kbd>Shift</kbd> + <kbd>Enter</kbd> | <kbd>Shift</kbd> + <kbd>Enter</kbd> | Add a line break |
#### Formatting
| macOS shortcut | Windows/Linux shortcut | Description |
|----------------|------------------------|-------------|
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold |
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italic |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | Strikethrough |
| <kbd>Command</kbd> + <kbd>k</kbd> | <kbd>Control</kbd> + <kbd>k</kbd> | Insert a link |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>0</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | Apply normal text style |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>1</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | Apply heading style 1 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>2</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | Apply heading style 2 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>3</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | Apply heading style 3 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>4</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | Apply heading style 4 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>5</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | Apply heading style 5 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>6</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | Apply heading style 6 |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Ordered list |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | Unordered list |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | Task list |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>c</kbd> | Code block |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd> | Highlight |
| <kbd>Command</kbd> + <kbd>,</kbd> | <kbd>Control</kbd> + <kbd>,</kbd> | Subscript |
| <kbd>Command</kbd> + <kbd>.</kbd> | <kbd>Control</kbd> + <kbd>.</kbd> | Superscript |
| <kbd>Tab</kbd> | <kbd>Tab</kbd> | Indent list |
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | <kbd>Shift</kbd> + <kbd>Tab</kbd> | Outdent list |
#### Text selection
| macOS shortcut | Windows shortcut | Description |
|-----------------------------------|-----------------------------------|-------------|
| <kbd>Command</kbd> + <kbd>a</kbd> | <kbd>Control</kbd> + <kbd>a</kbd> | Select all |
| <kbd>Shift</kbd> + <kbd>←</kbd> | <kbd>Shift</kbd> + <kbd>←</kbd> | Extend selection one character to left |
| <kbd>Shift</kbd> + <kbd>→</kbd> | <kbd>Shift</kbd> + <kbd>→</kbd> | Extend selection one character to right |
| <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection one line up |
| <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection one line down |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection to the beginning of the document |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection to the end of the document |
## Epics
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
These shortcuts are available when viewing [epics](group/epics/_index.md):
| Keyboard shortcut | Description |
|------------------------------|-------------------|
| <kbd>e</kbd> | Edit description. |
| <kbd>l</kbd> | Change label. |
| <kbd>c</kbd> + <kbd>r</kbd> | Copy epic reference. |
## Disable keyboard shortcuts
{{< history >}}
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/202494) from the shortcuts page to user preferences in GitLab 16.4.
{{< /history >}}
To disable keyboard shortcuts:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. In the **Behavior** section, clear the **Enable keyboard shortcuts** checkbox.
1. Select **Save changes**.
## Enable keyboard shortcuts
{{< history >}}
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/202494) from the shortcuts page to user preferences in GitLab 16.4.
{{< /history >}}
To enable keyboard shortcuts:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. In the **Behavior** section, select the **Enable keyboard shortcuts** checkbox.
1. Select **Save changes**.
## Troubleshooting
### Linux shortcuts
Linux users may encounter GitLab keyboard shortcuts that are overridden by
their operating system, or their browser.
|
---
stage: Growth
group: Engagement
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab keyboard shortcuts
description: Global shortcuts, navigation, and quick access.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab has several keyboard shortcuts you can use to access its different
features.
To display a window in GitLab that lists its keyboard shortcuts, use one of the
following methods:
- Press <kbd>?</kbd>.
- In the lower-left corner of the application, select **Help** and then **Keyboard shortcuts**.
Although [global shortcuts](#global-shortcuts) work from any area of GitLab,
you must be in specific pages for the other shortcuts to be available, as
explained in each section.
## Global shortcuts
These shortcuts are available in most areas of GitLab:
| Keyboard shortcut | Description |
|------------------------------------|-------------|
| <kbd>?</kbd> | Show or hide the shortcut reference sheet. |
| <kbd>Shift</kbd> + <kbd>p</kbd> | Go to your **Projects** page. |
| <kbd>Shift</kbd> + <kbd>g</kbd> | Go to your **Groups** page. |
| <kbd>Shift</kbd> + <kbd>a</kbd> | Go to your **Activity** page. |
| <kbd>Shift</kbd> + <kbd>l</kbd> | Go to your **Milestones** page. |
| <kbd>Shift</kbd> + <kbd>s</kbd> | Go to your **Snippets** page. |
| <kbd>s</kbd> / <kbd>/</kbd> | Put cursor in the search bar. |
| <kbd>f</kbd> | Focus filter bar |
| <kbd>Shift</kbd> + <kbd>i</kbd> | Go to your **Issues** page. |
| <kbd>Shift</kbd> + <kbd>m</kbd> | Go to your [**Merge requests**](project/merge_requests/_index.md) page. |
| <kbd>Shift</kbd> + <kbd>r</kbd> | Go to your **Review requests** page. |
| <kbd>Shift</kbd> + <kbd>t</kbd> | Go to your **To-Do List** page. |
| <kbd>p</kbd>, then <kbd>b</kbd> | Show or hide the Performance Bar. |
| <kbd>Escape</kbd> | Hide tooltips or popovers. |
| <kbd>g</kbd>, then <kbd>x</kbd> | Toggle between [GitLab](https://gitlab.com/) and [GitLab Next](https://next.gitlab.com/) (GitLab SaaS only). |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
| <kbd>d</kbd> | Open GitLab Duo Chat |
Additionally, the following shortcuts are available when editing text in text
fields (for example, comments, replies, issue descriptions, and merge request
descriptions):
| macOS shortcut | Windows shortcut | Description |
|------------------------------------------------------|------------------------------------------------------|-------------|
| <kbd>↑</kbd> | <kbd>↑</kbd> | Edit your last comment. You must be in a blank text field below a thread, and you must already have at least one comment in the thread. |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | Toggle Markdown preview when editing text in a text field that has **Write** and **Preview** tabs at the top. |
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold the selected text (surround it with `**`). |
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italicize the selected text (surround it with `_`). |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | Strike through the selected text (surround it with `~~`). |
| <kbd>Command</kbd> + <kbd>k</kbd> | <kbd>Control</kbd> + <kbd>k</kbd> | Add a link (surround the selected text with `[]()`). |
| <kbd>Command</kbd> + <kbd>[</kbd> | <kbd>Control</kbd> + <kbd>[</kbd> | Outdent text. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/351924) in GitLab 15.3. |
| <kbd>Command</kbd> + <kbd>]</kbd> | <kbd>Control</kbd> + <kbd>]</kbd> | Indent text. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/351924) in GitLab 15.3. |
| <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Control</kbd> + <kbd>Enter</kbd> | Submit or save changes |
The shortcuts for editing in text fields are always enabled, even if other
keyboard shortcuts are disabled.
## Project
These shortcuts are available from any page in a project. You must type them
relatively quickly to work, and they take you to another page in the project.
| Keyboard shortcut | Description |
|-----------------------------|-------------|
| <kbd>g</kbd> + <kbd>o</kbd> | Go to the **Project overview** page. |
| <kbd>g</kbd> + <kbd>v</kbd> | Go to the project **Activity** page (**Manage > Activity**). |
| <kbd>g</kbd> + <kbd>r</kbd> | Go to the project **Releases** page (**Deploy > Releases**). |
| <kbd>g</kbd> + <kbd>f</kbd> | Go to the [project files](#project-files) (**Code > Repository**). |
| <kbd>t</kbd> | Open the project file search dialog. (**Code > Repository**, select **Find Files**). |
| <kbd>g</kbd> + <kbd>c</kbd> | Go to the project **Commits** page (**Code > Commits**). |
| <kbd>g</kbd> + <kbd>n</kbd> | Go to the [**Repository graph**](#repository-graph) page (**Code > Repository graph**). |
| <kbd>g</kbd> + <kbd>d</kbd> | Go to the charts in the **Repository analytics** page (**Analyze > Repository analytics**). |
| <kbd>g</kbd> + <kbd>i</kbd> | Go to the project **Issues** page (**Plan > Issues**). |
| <kbd>i</kbd> | Go to the **New Issue** page (**Plan > Issues**, select **New issue** ). |
| <kbd>g</kbd> + <kbd>b</kbd> | Go to the project **Issue boards** page (**Plan > Issue boards**). |
| <kbd>g</kbd> + <kbd>m</kbd> | Go to the project [**Merge requests**](project/merge_requests/_index.md) page (**Code > Merge requests**). |
| <kbd>g</kbd> + <kbd>p</kbd> | Go to the CI/CD **Pipelines** page (**Build > Pipelines**). |
| <kbd>g</kbd> + <kbd>j</kbd> | Go to the CI/CD **Jobs** page (**Build > Jobs**). |
| <kbd>g</kbd> + <kbd>e</kbd> | Go to the project **Environments** page (**Operate > Environments**). |
| <kbd>g</kbd> + <kbd>k</kbd> | Go to the project **Kubernetes clusters** integration page (**Operate > Kubernetes clusters**). You must have at least [`maintainer` permissions](permissions.md) to access this page. |
| <kbd>g</kbd> + <kbd>s</kbd> | Go to the project **Snippets** page (**Code > Snippets**). |
| <kbd>g</kbd> + <kbd>w</kbd> | Go to the [project wiki](project/wiki/_index.md) (**Plan > Wiki**), if enabled. |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
### Issues
These shortcuts are available when viewing issues:
| Keyboard shortcut | Description |
|-------------------------------|-------------|
| <kbd>e</kbd> | Edit description. |
| <kbd>a</kbd> | Change assignee. |
| <kbd>m</kbd> | Change milestone. |
| <kbd>l</kbd> | Change label. |
| <kbd>c</kbd> + <kbd>r</kbd> | Copy issue reference. |
| <kbd>r</kbd> | Start writing a comment. Pre-selected text is quoted in the comment. |
| <kbd>→</kbd> | Go to the next design. |
| <kbd>←</kbd> | Go to the previous design. |
| <kbd>Escape</kbd> | Close the design. |
### Merge requests
These shortcuts are available when viewing [merge requests](project/merge_requests/_index.md):
| macOS shortcut | Windows shortcut | Description |
|-----------------------------------|-----------------------------------|-------------|
| <kbd>]</kbd> or <kbd>j</kbd> | | Move to next file. |
| <kbd>[</kbd> or <kbd>k</kbd> | | Move to previous file. |
| <kbd>Command</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>p</kbd> | Search for, and then jump to a file for review. |
| <kbd>n</kbd> | | Move to next open thread. |
| <kbd>p</kbd> | | Move to previous open thread. |
| <kbd>b</kbd> | | Copy source branch name. |
| <kbd>c</kbd> + <kbd>r</kbd> | | Copy merge request reference. |
| <kbd>r</kbd> | | Start writing a comment. Pre-selected text is quoted in the comment. |
| <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Shift</kbd> + <kbd>Control</kbd> + <kbd>Enter</kbd> | Publish your comment immediately. |
| <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Control</kbd> + <kbd>Enter</kbd> | Add your comment in a pending state, as part of a [review](project/merge_requests/reviews/_index.md#start-a-review). |
| <kbd>c</kbd> | | Move to next commit. |
| <kbd>x</kbd> | | Move to previous commit. |
| <kbd>f</kbd> | | Toggle file browser. |
| <kbd>v</kbd> | | Mark file as viewed or unviewed. |
| <kbd>;</kbd> | | Expand all files. |
| <kbd>Shift</kbd> + <kbd>;</kbd> | | Collapse all files. |
### Project files
These shortcuts are available when browsing the files in a project (go to
**Code > Repository**):
| Keyboard shortcut | Description |
|-------------------|-------------|
| <kbd>↑</kbd> | Move selection up (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>↓</kbd> | Move selection down (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>Enter</kbd> | Open selection (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>Escape</kbd> | Go back to the **Find File** screen (only while searching for files, **Code > Repository**, then select **Find File**). |
| <kbd>y</kbd> | Go to file permalink (only while viewing a file). |
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/_index.md). |
### Repository graph
These shortcuts are available when viewing the project [repository graph](project/repository/_index.md#repository-history-graph)
page (go to **Code > Repository graph**):
| Keyboard shortcut | Description |
|--------------------------------------------------------------------|-------------|
| <kbd>←</kbd> or <kbd>h</kbd> | Scroll left. |
| <kbd>→</kbd> or <kbd>l</kbd> | Scroll right. |
| <kbd>↑</kbd> or <kbd>k</kbd> | Scroll up. |
| <kbd>↓</kbd> or <kbd>j</kbd> | Scroll down. |
| <kbd>Shift</kbd> + <kbd>↑</kbd> or <kbd>Shift</kbd> + <kbd>k</kbd> | Scroll to top. |
| <kbd>Shift</kbd> + <kbd>↓</kbd> or <kbd>Shift</kbd> + <kbd>j</kbd> | Scroll to bottom. |
### Incidents
These shortcuts are available when viewing incidents:
| Keyboard shortcut | Description |
|-------------------------------|-------------|
| <kbd>c</kbd> + <kbd>r</kbd> | Copy incident reference. |
### Wiki pages
This shortcut is available when viewing a [wiki page](project/wiki/_index.md):
| Keyboard shortcut | Description |
|-------------------|-----------------|
| <kbd>e</kbd> | Edit wiki page. |
### Rich text editor
These shortcuts are available when editing a file with the
[rich text editor](https://about.gitlab.com/direction/plan/knowledge/content_editor/):
| macOS shortcut | Windows shortcut | Description |
|----------------|------------------|-------------|
| <kbd>Command</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>c</kbd> | Copy |
| <kbd>Command</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>x</kbd> | Cut |
| <kbd>Command</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>v</kbd> | Paste |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | Paste without formatting |
| <kbd>Command</kbd> + <kbd>z</kbd> | <kbd>Control</kbd> + <kbd>z</kbd> | Undo |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd> | Redo |
| <kbd>Shift</kbd> + <kbd>Enter</kbd> | <kbd>Shift</kbd> + <kbd>Enter</kbd> | Add a line break |
#### Formatting
| macOS shortcut | Windows/Linux shortcut | Description |
|----------------|------------------------|-------------|
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold |
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italic |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | Strikethrough |
| <kbd>Command</kbd> + <kbd>k</kbd> | <kbd>Control</kbd> + <kbd>k</kbd> | Insert a link |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>0</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | Apply normal text style |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>1</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | Apply heading style 1 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>2</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | Apply heading style 2 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>3</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | Apply heading style 3 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>4</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | Apply heading style 4 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>5</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | Apply heading style 5 |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>6</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | Apply heading style 6 |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Ordered list |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | Unordered list |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | Task list |
| <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>c</kbd> | Code block |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd> | Highlight |
| <kbd>Command</kbd> + <kbd>,</kbd> | <kbd>Control</kbd> + <kbd>,</kbd> | Subscript |
| <kbd>Command</kbd> + <kbd>.</kbd> | <kbd>Control</kbd> + <kbd>.</kbd> | Superscript |
| <kbd>Tab</kbd> | <kbd>Tab</kbd> | Indent list |
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | <kbd>Shift</kbd> + <kbd>Tab</kbd> | Outdent list |
#### Text selection
| macOS shortcut | Windows shortcut | Description |
|-----------------------------------|-----------------------------------|-------------|
| <kbd>Command</kbd> + <kbd>a</kbd> | <kbd>Control</kbd> + <kbd>a</kbd> | Select all |
| <kbd>Shift</kbd> + <kbd>←</kbd> | <kbd>Shift</kbd> + <kbd>←</kbd> | Extend selection one character to left |
| <kbd>Shift</kbd> + <kbd>→</kbd> | <kbd>Shift</kbd> + <kbd>→</kbd> | Extend selection one character to right |
| <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection one line up |
| <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection one line down |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection to the beginning of the document |
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection to the end of the document |
## Epics
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
These shortcuts are available when viewing [epics](group/epics/_index.md):
| Keyboard shortcut | Description |
|------------------------------|-------------------|
| <kbd>e</kbd> | Edit description. |
| <kbd>l</kbd> | Change label. |
| <kbd>c</kbd> + <kbd>r</kbd> | Copy epic reference. |
## Disable keyboard shortcuts
{{< history >}}
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/202494) from the shortcuts page to user preferences in GitLab 16.4.
{{< /history >}}
To disable keyboard shortcuts:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. In the **Behavior** section, clear the **Enable keyboard shortcuts** checkbox.
1. Select **Save changes**.
## Enable keyboard shortcuts
{{< history >}}
- [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/202494) from the shortcuts page to user preferences in GitLab 16.4.
{{< /history >}}
To enable keyboard shortcuts:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. In the **Behavior** section, select the **Enable keyboard shortcuts** checkbox.
1. Select **Save changes**.
## Troubleshooting
### Linux shortcuts
Linux users may encounter GitLab keyboard shortcuts that are overridden by
their operating system, or their browser.
|
https://docs.gitlab.com/todos
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/todos.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
todos.md
|
Growth
|
Engagement
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
To-Do List
|
Task management, actions, and access changes.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Your *To-Do List* is a chronological list of items waiting for your input.
The items are known as *to-do items*.
You can use the To-Do List to track [actions](#actions-that-create-to-do-items)
related to the work you do in GitLab. When people contact you or your attention is
needed, a to-do item appears in your To-Do List.
## Access the To-Do List
To access your To-Do List:
On the left sidebar, at the top, select **To-Do List** ({{< icon name="task-done" >}}).
### Filter the To-Do List
To filter your To-Do List:
1. Above the list, put your cursor in the text box.
1. Select from one of the predefined filters.
1. Press <kbd>Enter</kbd>.
### Sort the To-Do List
To sort the To-Do List:
1. On the **To Do** tab, in the upper-right corner, select from the options:
- **Recommended** sorts by the combination of created date and previously snoozed dates, with previously snoozed items at the top.
- **Updated** sorts by the date the item was most recently updated.
- **Label priority** sorts [by priorities you've set](project/labels.md#set-label-priority).
1. Optional. Select the sort direction.
{{< alert type="note" >}}
On the **Snoozed** and **Done** tabs, **Recommended** sorts items by their creation date only.
{{< /alert >}}
## Actions that create to-do items
{{< history >}}
- Multiple to-do items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 13.8 [with a flag](../administration/feature_flags/_index.md) named `multiple_todos`. Disabled by default.
- Member access request notifications [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374725) in GitLab 15.8.
- Multiple to-do items [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 16.2.
- Multiple to-do items [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 17.8. Feature flag `multiple_todos` enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Many to-do items are created automatically.
Some of the actions that add a to-do item to your To-Do List:
- An issue or merge request is assigned to you.
- A [merge request review](project/merge_requests/reviews/_index.md) is requested.
- You're [mentioned](discussions/_index.md#mentions) in the description or
comment of an issue, merge request, or epic.
- You're mentioned in a comment on a commit or design.
- The CI/CD pipeline for your merge request fails.
- An open merge request cannot be merged due to conflict, and one of the
following is true:
- You're the author.
- You're the user that set the merge request to automatically merge after a
pipeline succeeds.
- A merge request is removed from a [merge train](../ci/pipelines/merge_trains.md), and you're the user that added it.
- A member access request is raised for a group or project you're an owner of.
[In GitLab 17.8 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/28355), you receive a new to-do notification every time someone mentions you, even in the same issue or merge request.
For other actions that create to-do items like assignments or review requests,
you receive only one notification per action type, even if that action occurs multiple times in the same issue or merge request.
To-do items aren't affected by [GitLab notification email settings](profile/notifications.md).
The only exception: If your notification setting is set to **Custom** and **Merge request you're eligible to approve is created** is
selected, you get a to-do item when you are eligible to approve a merge request.
## Create a to-do item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390549) in objectives, key results, and tasks in GitLab 16.0.
{{< /history >}}
You can manually add an item to your To-Do List.
1. Go to your:
- [Issue](project/issues/_index.md)
- [Merge request](project/merge_requests/_index.md)
- [Epic](group/epics/_index.md)
- [Design](project/issues/design_management.md)
- [Incident](../operations/incident_management/incidents.md)
- [Objective or key result](okrs.md)
- [Task](tasks.md)
1. In the upper-right corner, select **Add a to-do item** ({{< icon name="todo-add" >}}).
### Create a to-do item by mentioning someone
You can create a to-do item by mentioning someone anywhere except for a code block. Mentioning a user many times in one message only creates one to-do item.
For example, from the following comment, everyone except `frank` gets a to-do item created for them:
````markdown
@alice What do you think? cc: @bob
- @carol can you please have a look?
> @dan what do you think?
Hey @erin, this is what they said:
```
Hi, please message @frank :incoming_envelope:
```
````
### Re-add a done to-do item
If you marked a to-do item as done by mistake, you can re-add it from the **Done** tab:
1. On the left sidebar, at the top, select **To-Do List** ({{< icon name="task-done" >}}).
1. At the top, select **Done**.
1. [Find the to-do item](#filter-the-to-do-list) you want to re-add.
1. Next to this to-do item, select **Re-add this to-do item** {{< icon name="redo" >}}.
The to-do item is now visible in the **To Do** tab of the To-Do List.
## Actions that mark a to-do item as done
Various actions on the to-do item object (like issue, merge request, or epic) mark its
corresponding to-do item as done.
To-do items are marked as done if you:
- Add an emoji reaction to the description or comment.
- Add or remove a label.
- Change the assignee.
- Change the milestone.
- Close the to-do item's object.
- Create a comment.
- Edit the description.
- Resolve a [design discussion thread](project/issues/design_management.md#resolve-a-discussion-thread-on-a-design).
- Accept or deny a project or group membership request.
To-do items are **not** marked as done if you:
- Add a linked item (like a [linked issue](project/issues/related_issues.md)).
- Add a child item (like [child epic](group/epics/manage_epics.md#multi-level-child-epics) or [task](tasks.md)).
- Add a [time entry](project/time_tracking.md).
- Assign yourself.
- Change the [health status](project/issues/managing_issues.md#health-status).
If someone else closes, merges, or takes action on an issue, merge request, or
epic, your to-do item remains pending.
## Mark a to-do item as done
You can manually mark a to-do item as done.
There are two ways to do this:
- In the To-Do List, to the right of the to-do item, select **Mark as done** ({{< icon name="check" >}}).
- In the upper-right corner of the resource (for example, issue or merge request), select **Mark as done** ({{< icon name="todo-done" >}}).
### Bulk edit to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16564) in GitLab 17.10.
{{< /history >}}
You can bulk edit your to-do items:
- On the **To Do** tab: Mark to-do items as done or snooze them.
- On the **Snoozed** tab: Mark to-do items as done or remove them.
- On the **Done** tab: Restore to-do items.
To bulk edit to-do items:
1. In your To-Do List:
- To select individual items, to the left of each item you want to edit, select the checkbox.
- To select all items on the page, in the upper-left corner, select the **Select all** checkbox.
1. In the upper-right corner, select the desired action.
## Snooze to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17712) in GitLab 17.9.
{{< /history >}}
You can snooze to-do items to temporarily hide them from your main To-Do List. This allows you to focus on more urgent tasks and return to snoozed items later.
To snooze a to-do item:
1. In your To-Do List, next to the to-do item you want to snooze, select Snooze ({{< icon name="clock" >}}).
1. If you wish to snooze the to-do item until a specific time and date, select the
`Until a specific time and date` option. Otherwise, choose one of the preset snooze durations:
- For one hour
- Until later today (4 hours later)
- Until tomorrow (tomorrow at 8 AM local time)
Snoozed to-do items are removed from your main To-Do List and appear in a separate **Snoozed** tab.
When the snooze period ends, the to-do item automatically returns to your main To-Do List. It appears with an indicator showing when it was originally created.
## View snoozed to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17712) in GitLab 17.9.
{{< /history >}}
To view or manage your snoozed to-do items:
1. Go to your To-Do List.
1. At the top of the list, select the Snoozed tab.
From the Snoozed tab, you can:
- View when a snoozed to-do is scheduled to return to your main list.
- Remove the snooze to immediately return an item to your main To-Do List.
- Mark a snoozed to-do as done.
## How a user's To-Do List is affected when their access changes
For security reasons, GitLab deletes to-do items when a user no longer has access to a related resource.
For example, if the user no longer has access to an issue, merge request, epic, project, or group,
GitLab deletes the related to-do items.
This process occurs in the hour after their access changes. Deletion is delayed to
prevent data loss, in case the user's access was accidentally revoked.
|
---
stage: Growth
group: Engagement
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: To-Do List
description: Task management, actions, and access changes.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Your *To-Do List* is a chronological list of items waiting for your input.
The items are known as *to-do items*.
You can use the To-Do List to track [actions](#actions-that-create-to-do-items)
related to the work you do in GitLab. When people contact you or your attention is
needed, a to-do item appears in your To-Do List.
## Access the To-Do List
To access your To-Do List:
On the left sidebar, at the top, select **To-Do List** ({{< icon name="task-done" >}}).
### Filter the To-Do List
To filter your To-Do List:
1. Above the list, put your cursor in the text box.
1. Select from one of the predefined filters.
1. Press <kbd>Enter</kbd>.
### Sort the To-Do List
To sort the To-Do List:
1. On the **To Do** tab, in the upper-right corner, select from the options:
- **Recommended** sorts by the combination of created date and previously snoozed dates, with previously snoozed items at the top.
- **Updated** sorts by the date the item was most recently updated.
- **Label priority** sorts [by priorities you've set](project/labels.md#set-label-priority).
1. Optional. Select the sort direction.
{{< alert type="note" >}}
On the **Snoozed** and **Done** tabs, **Recommended** sorts items by their creation date only.
{{< /alert >}}
## Actions that create to-do items
{{< history >}}
- Multiple to-do items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 13.8 [with a flag](../administration/feature_flags/_index.md) named `multiple_todos`. Disabled by default.
- Member access request notifications [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374725) in GitLab 15.8.
- Multiple to-do items [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 16.2.
- Multiple to-do items [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/28355) in GitLab 17.8. Feature flag `multiple_todos` enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Many to-do items are created automatically.
Some of the actions that add a to-do item to your To-Do List:
- An issue or merge request is assigned to you.
- A [merge request review](project/merge_requests/reviews/_index.md) is requested.
- You're [mentioned](discussions/_index.md#mentions) in the description or
comment of an issue, merge request, or epic.
- You're mentioned in a comment on a commit or design.
- The CI/CD pipeline for your merge request fails.
- An open merge request cannot be merged due to conflict, and one of the
following is true:
- You're the author.
- You're the user that set the merge request to automatically merge after a
pipeline succeeds.
- A merge request is removed from a [merge train](../ci/pipelines/merge_trains.md), and you're the user that added it.
- A member access request is raised for a group or project you're an owner of.
[In GitLab 17.8 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/28355), you receive a new to-do notification every time someone mentions you, even in the same issue or merge request.
For other actions that create to-do items like assignments or review requests,
you receive only one notification per action type, even if that action occurs multiple times in the same issue or merge request.
To-do items aren't affected by [GitLab notification email settings](profile/notifications.md).
The only exception: If your notification setting is set to **Custom** and **Merge request you're eligible to approve is created** is
selected, you get a to-do item when you are eligible to approve a merge request.
## Create a to-do item
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/390549) in objectives, key results, and tasks in GitLab 16.0.
{{< /history >}}
You can manually add an item to your To-Do List.
1. Go to your:
- [Issue](project/issues/_index.md)
- [Merge request](project/merge_requests/_index.md)
- [Epic](group/epics/_index.md)
- [Design](project/issues/design_management.md)
- [Incident](../operations/incident_management/incidents.md)
- [Objective or key result](okrs.md)
- [Task](tasks.md)
1. In the upper-right corner, select **Add a to-do item** ({{< icon name="todo-add" >}}).
### Create a to-do item by mentioning someone
You can create a to-do item by mentioning someone anywhere except for a code block. Mentioning a user many times in one message only creates one to-do item.
For example, from the following comment, everyone except `frank` gets a to-do item created for them:
````markdown
@alice What do you think? cc: @bob
- @carol can you please have a look?
> @dan what do you think?
Hey @erin, this is what they said:
```
Hi, please message @frank :incoming_envelope:
```
````
### Re-add a done to-do item
If you marked a to-do item as done by mistake, you can re-add it from the **Done** tab:
1. On the left sidebar, at the top, select **To-Do List** ({{< icon name="task-done" >}}).
1. At the top, select **Done**.
1. [Find the to-do item](#filter-the-to-do-list) you want to re-add.
1. Next to this to-do item, select **Re-add this to-do item** {{< icon name="redo" >}}.
The to-do item is now visible in the **To Do** tab of the To-Do List.
## Actions that mark a to-do item as done
Various actions on the to-do item object (like issue, merge request, or epic) mark its
corresponding to-do item as done.
To-do items are marked as done if you:
- Add an emoji reaction to the description or comment.
- Add or remove a label.
- Change the assignee.
- Change the milestone.
- Close the to-do item's object.
- Create a comment.
- Edit the description.
- Resolve a [design discussion thread](project/issues/design_management.md#resolve-a-discussion-thread-on-a-design).
- Accept or deny a project or group membership request.
To-do items are **not** marked as done if you:
- Add a linked item (like a [linked issue](project/issues/related_issues.md)).
- Add a child item (like [child epic](group/epics/manage_epics.md#multi-level-child-epics) or [task](tasks.md)).
- Add a [time entry](project/time_tracking.md).
- Assign yourself.
- Change the [health status](project/issues/managing_issues.md#health-status).
If someone else closes, merges, or takes action on an issue, merge request, or
epic, your to-do item remains pending.
## Mark a to-do item as done
You can manually mark a to-do item as done.
There are two ways to do this:
- In the To-Do List, to the right of the to-do item, select **Mark as done** ({{< icon name="check" >}}).
- In the upper-right corner of the resource (for example, issue or merge request), select **Mark as done** ({{< icon name="todo-done" >}}).
### Bulk edit to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16564) in GitLab 17.10.
{{< /history >}}
You can bulk edit your to-do items:
- On the **To Do** tab: Mark to-do items as done or snooze them.
- On the **Snoozed** tab: Mark to-do items as done or remove them.
- On the **Done** tab: Restore to-do items.
To bulk edit to-do items:
1. In your To-Do List:
- To select individual items, to the left of each item you want to edit, select the checkbox.
- To select all items on the page, in the upper-left corner, select the **Select all** checkbox.
1. In the upper-right corner, select the desired action.
## Snooze to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17712) in GitLab 17.9.
{{< /history >}}
You can snooze to-do items to temporarily hide them from your main To-Do List. This allows you to focus on more urgent tasks and return to snoozed items later.
To snooze a to-do item:
1. In your To-Do List, next to the to-do item you want to snooze, select Snooze ({{< icon name="clock" >}}).
1. If you wish to snooze the to-do item until a specific time and date, select the
`Until a specific time and date` option. Otherwise, choose one of the preset snooze durations:
- For one hour
- Until later today (4 hours later)
- Until tomorrow (tomorrow at 8 AM local time)
Snoozed to-do items are removed from your main To-Do List and appear in a separate **Snoozed** tab.
When the snooze period ends, the to-do item automatically returns to your main To-Do List. It appears with an indicator showing when it was originally created.
## View snoozed to-do items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17712) in GitLab 17.9.
{{< /history >}}
To view or manage your snoozed to-do items:
1. Go to your To-Do List.
1. At the top of the list, select the Snoozed tab.
From the Snoozed tab, you can:
- View when a snoozed to-do is scheduled to return to your main list.
- Remove the snooze to immediately return an item to your main To-Do List.
- Mark a snoozed to-do as done.
## How a user's To-Do List is affected when their access changes
For security reasons, GitLab deletes to-do items when a user no longer has access to a related resource.
For example, if the user no longer has access to an issue, merge request, epic, project, or group,
GitLab deletes the related to-do items.
This process occurs in the hour after their access changes. Deletion is delayed to
prevent data loss, in case the user's access was accidentally revoked.
|
https://docs.gitlab.com/ssh
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/ssh.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
ssh.md
|
Software Supply Chain Security
|
Authentication
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Use SSH keys to communicate with GitLab
|
Understand how to use SSH keys with GitLab for secure authentication and repository access.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Git is a distributed version control system, which means you can work locally,
then share or *push* your changes to a server. In this case, the server you push to is GitLab.
GitLab uses the SSH protocol to securely communicate with Git.
When you use SSH keys to authenticate to the GitLab remote server,
you don't need to supply your username and password each time.
## What are SSH keys
SSH uses two keys, a public key and a private key.
- The public key can be distributed.
- The private key should be protected.
It is not possible to reveal confidential data by uploading your public key. When you need to copy or upload your SSH public key, make sure you do not accidentally copy or upload your private key instead.
You can use your private key to [sign commits](project/repository/signed_commits/ssh.md),
which makes your use of GitLab and your data even more secure.
This signature then can be verified by anyone using your public key.
For details, see [Asymmetric cryptography, also known as public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography).
## Prerequisites
To use SSH to communicate with GitLab, you need:
- The OpenSSH client, which comes pre-installed on GNU/Linux, macOS, and Windows 10.
- SSH version 6.5 or later. Earlier versions used an MD5 signature, which is not secure.
To view the version of SSH installed on your system, run `ssh -V`.
## Supported SSH key types
To communicate with GitLab, you can use the following SSH key types:
- [ED25519](#ed25519-ssh-keys)
- [ED25519_SK](#ed25519_sk-ssh-keys)
- [ECDSA_SK](#ecdsa_sk-ssh-keys)
- [RSA](#rsa-ssh-keys)
- ECDSA (As noted in [Practical Cryptography With Go](https://leanpub.com/gocrypto/read#leanpub-auto-ecdsa), the security issues related to DSA also apply to ECDSA.)
Administrators can [restrict which keys are permitted and their minimum lengths](../security/ssh_keys_restrictions.md).
### ED25519 SSH keys
The book [Practical Cryptography With Go](https://leanpub.com/gocrypto/read#leanpub-auto-chapter-5-digital-signatures)
suggests that [ED25519](https://ed25519.cr.yp.to/) keys are more secure and performant than RSA keys.
OpenSSH 6.5 introduced ED25519 SSH keys in 2014, and they should be available on most
operating systems.
{{< alert type="note" >}}
ED25519 keys might not be fully supported by all FIPS systems. For more information, see [issue 367429](https://gitlab.com/gitlab-org/gitlab/-/issues/367429).
{{< /alert >}}
### ED25519_SK SSH keys
To use ED25519_SK SSH keys on GitLab, your local client and GitLab server
must have [OpenSSH 8.2](https://www.openssh.com/releasenotes.html#8.2) or later installed.
### ECDSA_SK SSH keys
To use ECDSA_SK SSH keys on GitLab, your local client and GitLab server
must have [OpenSSH 8.2](https://www.openssh.com/releasenotes.html#8.2) or later installed.
### RSA SSH keys
{{< history >}}
- Maximum RSA key length [changed](https://gitlab.com/groups/gitlab-org/-/epics/11186) in GitLab 16.3.
{{< /history >}}
Available documentation suggests ED25519 is more secure than RSA.
If you use an RSA key, the US National Institute of Standards and Technology in
[Publication 800-57 Part 3 (PDF)](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf)
recommends a key size of at least 2048 bits. Due to limitations in Go,
RSA keys [cannot exceed 8192 bits](ssh_troubleshooting.md#tls-server-sent-certificate-containing-rsa-key-larger-than-8192-bits).
The default key size depends on your version of `ssh-keygen`.
Review the `man` page for your installed `ssh-keygen` command for details.
## See if you have an existing SSH key pair
Before you create a key pair, see if a key pair already exists.
1. Go to your home directory.
1. Go to the `.ssh/` subdirectory. If the `.ssh/` subdirectory doesn't exist,
you are either not in the home directory, or you haven't used `ssh` before.
In the latter case, you need to [generate an SSH key pair](#generate-an-ssh-key-pair).
1. See if a file with one of the following formats exists:
| Algorithm | Public key | Private key |
|-----------------------|------------|-------------|
| ED25519 (preferred) | `id_ed25519.pub` | `id_ed25519` |
| ED25519_SK | `id_ed25519_sk.pub` | `id_ed25519_sk` |
| ECDSA_SK | `id_ecdsa_sk.pub` | `id_ecdsa_sk` |
| RSA (at least 2048-bit key size) | `id_rsa.pub` | `id_rsa` |
| DSA (deprecated) | `id_dsa.pub` | `id_dsa` |
| ECDSA | `id_ecdsa.pub` | `id_ecdsa` |
## Generate an SSH key pair
If you do not have an existing SSH key pair, generate a new one:
1. Open a terminal.
1. Run `ssh-keygen -t` followed by the key type and an optional comment.
This comment is included in the `.pub` file that's created.
You may want to use an email address for the comment.
For example, for ED25519:
```shell
ssh-keygen -t ed25519 -C "<comment>"
```
For 2048-bit RSA:
```shell
ssh-keygen -t rsa -b 2048 -C "<comment>"
```
1. Press <kbd>Enter</kbd>. Output similar to the following is displayed:
```plaintext
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
```
1. Accept the suggested filename and directory, unless you are generating a [deploy key](project/deploy_keys/_index.md)
or want to save in a specific directory where you store other keys.
You can also dedicate the SSH key pair to a [specific host](#configure-ssh-to-point-to-a-different-directory).
1. Specify a [passphrase](https://www.ssh.com/academy/ssh/passphrase):
```plaintext
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
```
A confirmation is displayed, including information about where your files are stored.
A public and private key are generated. [Add the public SSH key to your GitLab account](#add-an-ssh-key-to-your-gitlab-account)
and keep the private key secure.
### Configure SSH to point to a different directory
If you did not save your SSH key pair in the default directory,
configure your SSH client to point to the directory where the private key is stored.
1. Open a terminal and run this command:
```shell
eval $(ssh-agent -s)
ssh-add <directory to private SSH key>
```
1. Save these settings in the `~/.ssh/config` file. For example:
```conf
# GitLab.com
Host gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_com_rsa
# Private GitLab instance
Host gitlab.company.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/example_com_rsa
```
For more information on these settings, see the [`man ssh_config`](https://man.openbsd.org/ssh_config) page in the SSH configuration manual.
Public SSH keys must be unique to GitLab because they bind to your account.
Your SSH key is the only identifier you have when you push code with SSH.
It must uniquely map to a single user.
## Add an SSH key to your GitLab account
{{< history >}}
- Suggested default expiration date for keys [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/271239) in GitLab 15.4.
- Usage types for SSH keys [added](https://gitlab.com/gitlab-org/gitlab/-/issues/383046) in GitLab 15.7.
{{< /history >}}
To use SSH with GitLab, copy your public key to your GitLab account:
1. Copy the contents of your public key file. You can do this manually or use a script.
In these examples, replace `id_ed25519.pub` with your filename. For example, for RSA, use `id_rsa.pub`.
{{< tabs >}}
{{< tab title="macOS" >}}
```shell
tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy
```
{{< /tab >}}
{{< tab title="Linux (requires the xclip package)" >}}
```shell
xclip -sel clip < ~/.ssh/id_ed25519.pub
```
{{< /tab >}}
{{< tab title="Git Bash on Windows" >}}
```shell
cat ~/.ssh/id_ed25519.pub | clip
```
{{< /tab >}}
{{< /tabs >}}
1. Sign in to GitLab.
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Select **Add new key**.
1. In the **Key** box, paste the contents of your public key.
If you manually copied the key, make sure you copy the entire key,
which starts with `ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`,
`ssh-ed25519`, `sk-ecdsa-sha2-nistp256@openssh.com`, or `sk-ssh-ed25519@openssh.com`, and may end with a comment.
1. In the **Title** box, type a description, like `Work Laptop` or
`Home Workstation`.
1. Optional. Select the **Usage type** of the key. It can be used either for `Authentication` or `Signing` or both. `Authentication & Signing` is the default value.
1. Optional. Update **Expiration date** to modify the default expiration date.
- Administrators can view expiration dates and use them for
guidance when [deleting keys](../administration/credentials_inventory.md#delete-ssh-keys).
- GitLab checks all SSH keys at 01:00 AM UTC every day. It emails an expiration notice for all SSH keys that are scheduled to expire seven days from now.
- GitLab checks all SSH keys at 02:00 AM UTC every day. It emails an expiration notice for all SSH keys that expire on the current date.
1. Select **Add key**.
## Verify that you can connect
Verify that your SSH key was added correctly.
1. To ensure you're connecting to the correct server, check the server's SSH host keys fingerprint. For:
- GitLab.com, see the [SSH host keys fingerprints](gitlab_com/_index.md#ssh-host-keys-fingerprints) documentation.
- GitLab Self-Managed or GitLab Dedicated, see `https://gitlab.example.com/help/instance_configuration#ssh-host-keys-fingerprints`
where `gitlab.example.com` is the GitLab instance URL.
1. Open a terminal and run this command. Replace `gitlab.example.com` with your
GitLab instance URL:
```shell
ssh -T git@gitlab.example.com
```
1. If this is the first time you are connecting, you should verify the
authenticity of the GitLab host. If you see a message like:
```plaintext
The authenticity of host 'gitlab.example.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.example.com' (ECDSA) to the list of known hosts.
```
Type `yes` and press <kbd>Enter</kbd>.
1. Run the `ssh -T git@gitlab.example.com` command again. You should receive a _Welcome to GitLab, `@username`!_ message.
If the welcome message doesn't appear, you can troubleshoot by running `ssh`
in verbose mode:
```shell
ssh -Tvvv git@gitlab.example.com
```
By default, GitLab uses the `git` username to authenticate. It can be different if it was [changed by the administrator](https://docs.gitlab.com/omnibus/settings/configuration.html#change-the-name-of-the-git-user-or-group).
## Update your SSH key passphrase
You can update the passphrase for your SSH key:
1. Open a terminal and run this command:
```shell
ssh-keygen -p -f /path/to/ssh_key
```
1. At the prompts, enter the passphrase and then press <kbd>Enter</kbd>.
## Upgrade your RSA key pair to a more secure format
If your version of OpenSSH is between 6.5 and 7.8, you can save your private
RSA SSH keys in a more secure OpenSSH format by opening a terminal and running
this command:
```shell
ssh-keygen -o -f ~/.ssh/id_rsa
```
Alternatively, you can generate a new RSA key with the more secure encryption format with
the following command:
```shell
ssh-keygen -o -t rsa -b 4096 -C "<comment>"
```
## Generate an SSH key pair for a FIDO2 hardware security key
To generate ED25519_SK or ECDSA_SK SSH keys, you must use OpenSSH 8.2 or later:
1. Insert a hardware security key into your computer.
1. Open a terminal.
1. Run `ssh-keygen -t` followed by the key type and an optional comment.
This comment is included in the `.pub` file that's created.
You may want to use an email address for the comment.
For example, for ED25519_SK:
```shell
ssh-keygen -t ed25519-sk -C "<comment>"
```
For ECDSA_SK:
```shell
ssh-keygen -t ecdsa-sk -C "<comment>"
```
If your security key supports FIDO2 resident keys, you can enable this when
creating your SSH key:
```shell
ssh-keygen -t ed25519-sk -O resident -C "<comment>"
```
`-O resident` indicates that the key should be stored on the FIDO authenticator itself.
Resident key is easier to import to a new computer because it can be loaded directly
from the security key by [`ssh-add -K`](https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh-add.1#K)
or [`ssh-keygen -K`](https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh-keygen#K).
1. Press <kbd>Enter</kbd>. Output similar to the following is displayed:
```plaintext
Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
```
1. Touch the button on the hardware security key.
1. Accept the suggested filename and directory:
```plaintext
Enter file in which to save the key (/home/user/.ssh/id_ed25519_sk):
```
1. Specify a [passphrase](https://www.ssh.com/academy/ssh/passphrase):
```plaintext
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
```
A confirmation is displayed, including information about where your files are stored.
A public and private key are generated.
[Add the public SSH key to your GitLab account](#add-an-ssh-key-to-your-gitlab-account).
## Generate an SSH key pair with 1Password
You can use [1Password](https://1password.com/) and the [1Password browser extension](https://support.1password.com/getting-started-browser/) to either:
- Automatically generate a new SSH key.
- Use an existing SSH key in your 1Password vault to authenticate with GitLab.
1. Sign in to GitLab.
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Select **Add new key**.
1. Select **Key**, and you should see the 1Password helper appear.
1. Select the 1Password icon and unlock 1Password.
1. You can then select **Create SSH Key** or select an existing SSH key to fill in the public key.
1. In the **Title** box, enter a description, like `Work Laptop` or
`Home Workstation`.
1. Optional. Select the **Usage type** of the key. It can be used either for `Authentication` or `Signing` or both. `Authentication & Signing` is the default value.
1. Optional. Update **Expiration date** to modify the default expiration date.
1. Select **Add key**.
For more information about using 1Password with SSH keys, see the [1Password documentation](https://developer.1password.com/docs/ssh/get-started/).
## Use different keys for different repositories
You can use a different key for each repository.
Open a terminal and run this command:
```shell
git config core.sshCommand "ssh -o IdentitiesOnly=yes -i ~/.ssh/private-key-filename-for-this-repository -F /dev/null"
```
This command does not use the SSH Agent and requires Git 2.10 or later. For more information
on `ssh` command options, see the `man` pages for both `ssh` and `ssh_config`.
## View your SSH keys
To view the SSH keys for your account:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
Your existing SSH keys are listed at the bottom of the page. The information includes:
- The title for the key
- Public fingerprint
- Permitted usage types
- Creation date
- Last used date
- Expiry date
## Remove an SSH key
You can revoke or delete your SSH key to permanently remove it from your account.
Removing your SSH key has additional implications if you sign your commits with the key. For more information, see [Signed commits with removed SSH keys](project/repository/signed_commits/ssh.md#signed-commits-with-removed-ssh-keys).
### Revoke an SSH key
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108344) in GitLab 15.9.
{{< /history >}}
If your SSH key becomes compromised, revoke the key.
Prerequisites:
- The SSH key must have the `Signing` or `Authentication & Signing` usage type.
To revoke an SSH key:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Next to the SSH key you want to revoke, select **Revoke**.
1. Select **Revoke**.
### Delete an SSH key
To delete an SSH key:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Next to the key you want to delete, select **Remove** ({{< icon name="remove" >}}).
1. Select **Delete**.
## Use different accounts on a single GitLab instance
You can use multiple accounts to connect to a single instance of GitLab. You
can do this by using the command in the [previous topic](#use-different-keys-for-different-repositories).
However, even if you set `IdentitiesOnly` to `yes`, you cannot sign in if an
`IdentityFile` exists outside of a `Host` block.
Instead, you can assign aliases to hosts in the `~/.ssh/config` file.
- For the `Host`, use an alias like `user_1.gitlab.com` and
`user_2.gitlab.com`. Advanced configurations
are more difficult to maintain, and these strings are easier to
understand when you use tools like `git remote`.
- For the `IdentityFile`, use the path the private key.
```conf
# User1 Account Identity
Host <user_1.gitlab.com>
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<example_ssh_key1>
# User2 Account Identity
Host <user_2.gitlab.com>
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<example_ssh_key2>
```
Now, to clone a repository for `user_1`, use `user_1.gitlab.com` in the `git clone` command:
```shell
git clone git@<user_1.gitlab.com>:gitlab-org/gitlab.git
```
To update a previously-cloned repository that is aliased as `origin`:
```shell
git remote set-url origin git@<user_1.gitlab.com>:gitlab-org/gitlab.git
```
{{< alert type="note" >}}
Private and public keys contain sensitive data. Ensure the permissions
on the files make them readable to you but not accessible to others.
{{< /alert >}}
## Configure two-factor authentication (2FA)
You can set up two-factor authentication (2FA) for
[Git over SSH](../security/two_factor_authentication.md#2fa-for-git-over-ssh-operations). You should use
[ED25519_SK](#ed25519_sk-ssh-keys) or [ECDSA_SK](#ecdsa_sk-ssh-keys) SSH keys.
## Use EGit on Eclipse
If you are using [EGit](https://projects.eclipse.org/projects/technology.egit), you can [add your SSH key to Eclipse](https://wiki.eclipse.org/EGit/User_Guide/#Eclipse_SSH_Configuration).
## Use SSH on Microsoft Windows
If you're running Windows 10, you can either use the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install)
with [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install#update-to-wsl-2) which
has both `git` and `ssh` preinstalled, or install [Git for Windows](https://gitforwindows.org) to
use SSH through PowerShell.
The SSH key generated in WSL is not directly available for Git for Windows, and vice versa,
as both have a different home directory:
- WSL: `/home/<user>`
- Git for Windows: `C:\Users\<user>`
You can either copy over the `.ssh/` directory to use the same key, or generate a key in each environment.
If you're running Windows 11 and using [OpenSSH for Windows](https://learn.microsoft.com/en-us/windows-server/administration/OpenSSH/openssh-overview), ensure the `HOME`
environment variable is set correctly. Otherwise, your private SSH key might not be found.
Alternative tools include:
- [Cygwin](https://www.cygwin.com)
- [PuTTYgen](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) 0.81 and later (earlier versions are [vulnerable to disclosure attacks](https://www.openwall.com/lists/oss-security/2024/04/15/6))
## Overriding SSH settings on the GitLab server
GitLab integrates with the system-installed SSH daemon and designates a user
(typically named `git`) through which all access requests are handled. Users
who connect to the GitLab server over SSH are identified by their SSH key instead
of their username.
SSH *client* operations performed on the GitLab server are executed as this
user. You can modify this SSH configuration. For example, you can specify
a private SSH key for this user to use for authentication requests. However, this practice
is **not supported** and is strongly discouraged as it presents significant
security risks.
GitLab checks for this condition, and directs you
to this section if your server is configured this way. For example:
```shell
$ gitlab-rake gitlab:check
Git user has default SSH configuration? ... no
Try fixing it:
mkdir ~/gitlab-check-backup-1504540051
sudo mv /var/lib/git/.ssh/id_rsa ~/gitlab-check-backup-1504540051
sudo mv /var/lib/git/.ssh/id_rsa.pub ~/gitlab-check-backup-1504540051
For more information see:
doc/user/ssh.md#overriding-ssh-settings-on-the-gitlab-server
Please fix the error above and rerun the checks.
```
Remove the custom configuration as soon as you can. These customizations
are **explicitly not supported** and may stop working at any time.
## Verify GitLab SSH ownership and permissions
The GitLab SSH folder and files must have the following permissions:
- The folder `/var/opt/gitlab/.ssh/` must be owned by the `git` group and the `git` user, with permissions set to `700`.
- The `authorized_keys` file must have permissions set to `600`.
- The `authorized_keys.lock` file must have permissions set to `644`.
To verify that these permissions are correct, run the following:
```shell
stat -c "%a %n" /var/opt/gitlab/.ssh/.
```
### Set permissions
If the permissions are wrong, sign in to the application server and run:
```shell
cd /var/opt/gitlab/
chown git:git /var/opt/gitlab/.ssh/
chmod 700 /var/opt/gitlab/.ssh/
chmod 600 /var/opt/gitlab/.ssh/authorized_keys
chmod 644 /var/opt/gitlab/.ssh/authorized_keys.lock
```
|
---
stage: Software Supply Chain Security
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Use SSH keys to communicate with GitLab
description: Understand how to use SSH keys with GitLab for secure authentication
and repository access.
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Git is a distributed version control system, which means you can work locally,
then share or *push* your changes to a server. In this case, the server you push to is GitLab.
GitLab uses the SSH protocol to securely communicate with Git.
When you use SSH keys to authenticate to the GitLab remote server,
you don't need to supply your username and password each time.
## What are SSH keys
SSH uses two keys, a public key and a private key.
- The public key can be distributed.
- The private key should be protected.
It is not possible to reveal confidential data by uploading your public key. When you need to copy or upload your SSH public key, make sure you do not accidentally copy or upload your private key instead.
You can use your private key to [sign commits](project/repository/signed_commits/ssh.md),
which makes your use of GitLab and your data even more secure.
This signature then can be verified by anyone using your public key.
For details, see [Asymmetric cryptography, also known as public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography).
## Prerequisites
To use SSH to communicate with GitLab, you need:
- The OpenSSH client, which comes pre-installed on GNU/Linux, macOS, and Windows 10.
- SSH version 6.5 or later. Earlier versions used an MD5 signature, which is not secure.
To view the version of SSH installed on your system, run `ssh -V`.
## Supported SSH key types
To communicate with GitLab, you can use the following SSH key types:
- [ED25519](#ed25519-ssh-keys)
- [ED25519_SK](#ed25519_sk-ssh-keys)
- [ECDSA_SK](#ecdsa_sk-ssh-keys)
- [RSA](#rsa-ssh-keys)
- ECDSA (As noted in [Practical Cryptography With Go](https://leanpub.com/gocrypto/read#leanpub-auto-ecdsa), the security issues related to DSA also apply to ECDSA.)
Administrators can [restrict which keys are permitted and their minimum lengths](../security/ssh_keys_restrictions.md).
### ED25519 SSH keys
The book [Practical Cryptography With Go](https://leanpub.com/gocrypto/read#leanpub-auto-chapter-5-digital-signatures)
suggests that [ED25519](https://ed25519.cr.yp.to/) keys are more secure and performant than RSA keys.
OpenSSH 6.5 introduced ED25519 SSH keys in 2014, and they should be available on most
operating systems.
{{< alert type="note" >}}
ED25519 keys might not be fully supported by all FIPS systems. For more information, see [issue 367429](https://gitlab.com/gitlab-org/gitlab/-/issues/367429).
{{< /alert >}}
### ED25519_SK SSH keys
To use ED25519_SK SSH keys on GitLab, your local client and GitLab server
must have [OpenSSH 8.2](https://www.openssh.com/releasenotes.html#8.2) or later installed.
### ECDSA_SK SSH keys
To use ECDSA_SK SSH keys on GitLab, your local client and GitLab server
must have [OpenSSH 8.2](https://www.openssh.com/releasenotes.html#8.2) or later installed.
### RSA SSH keys
{{< history >}}
- Maximum RSA key length [changed](https://gitlab.com/groups/gitlab-org/-/epics/11186) in GitLab 16.3.
{{< /history >}}
Available documentation suggests ED25519 is more secure than RSA.
If you use an RSA key, the US National Institute of Standards and Technology in
[Publication 800-57 Part 3 (PDF)](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf)
recommends a key size of at least 2048 bits. Due to limitations in Go,
RSA keys [cannot exceed 8192 bits](ssh_troubleshooting.md#tls-server-sent-certificate-containing-rsa-key-larger-than-8192-bits).
The default key size depends on your version of `ssh-keygen`.
Review the `man` page for your installed `ssh-keygen` command for details.
## See if you have an existing SSH key pair
Before you create a key pair, see if a key pair already exists.
1. Go to your home directory.
1. Go to the `.ssh/` subdirectory. If the `.ssh/` subdirectory doesn't exist,
you are either not in the home directory, or you haven't used `ssh` before.
In the latter case, you need to [generate an SSH key pair](#generate-an-ssh-key-pair).
1. See if a file with one of the following formats exists:
| Algorithm | Public key | Private key |
|-----------------------|------------|-------------|
| ED25519 (preferred) | `id_ed25519.pub` | `id_ed25519` |
| ED25519_SK | `id_ed25519_sk.pub` | `id_ed25519_sk` |
| ECDSA_SK | `id_ecdsa_sk.pub` | `id_ecdsa_sk` |
| RSA (at least 2048-bit key size) | `id_rsa.pub` | `id_rsa` |
| DSA (deprecated) | `id_dsa.pub` | `id_dsa` |
| ECDSA | `id_ecdsa.pub` | `id_ecdsa` |
## Generate an SSH key pair
If you do not have an existing SSH key pair, generate a new one:
1. Open a terminal.
1. Run `ssh-keygen -t` followed by the key type and an optional comment.
This comment is included in the `.pub` file that's created.
You may want to use an email address for the comment.
For example, for ED25519:
```shell
ssh-keygen -t ed25519 -C "<comment>"
```
For 2048-bit RSA:
```shell
ssh-keygen -t rsa -b 2048 -C "<comment>"
```
1. Press <kbd>Enter</kbd>. Output similar to the following is displayed:
```plaintext
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
```
1. Accept the suggested filename and directory, unless you are generating a [deploy key](project/deploy_keys/_index.md)
or want to save in a specific directory where you store other keys.
You can also dedicate the SSH key pair to a [specific host](#configure-ssh-to-point-to-a-different-directory).
1. Specify a [passphrase](https://www.ssh.com/academy/ssh/passphrase):
```plaintext
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
```
A confirmation is displayed, including information about where your files are stored.
A public and private key are generated. [Add the public SSH key to your GitLab account](#add-an-ssh-key-to-your-gitlab-account)
and keep the private key secure.
### Configure SSH to point to a different directory
If you did not save your SSH key pair in the default directory,
configure your SSH client to point to the directory where the private key is stored.
1. Open a terminal and run this command:
```shell
eval $(ssh-agent -s)
ssh-add <directory to private SSH key>
```
1. Save these settings in the `~/.ssh/config` file. For example:
```conf
# GitLab.com
Host gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_com_rsa
# Private GitLab instance
Host gitlab.company.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/example_com_rsa
```
For more information on these settings, see the [`man ssh_config`](https://man.openbsd.org/ssh_config) page in the SSH configuration manual.
Public SSH keys must be unique to GitLab because they bind to your account.
Your SSH key is the only identifier you have when you push code with SSH.
It must uniquely map to a single user.
## Add an SSH key to your GitLab account
{{< history >}}
- Suggested default expiration date for keys [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/271239) in GitLab 15.4.
- Usage types for SSH keys [added](https://gitlab.com/gitlab-org/gitlab/-/issues/383046) in GitLab 15.7.
{{< /history >}}
To use SSH with GitLab, copy your public key to your GitLab account:
1. Copy the contents of your public key file. You can do this manually or use a script.
In these examples, replace `id_ed25519.pub` with your filename. For example, for RSA, use `id_rsa.pub`.
{{< tabs >}}
{{< tab title="macOS" >}}
```shell
tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy
```
{{< /tab >}}
{{< tab title="Linux (requires the xclip package)" >}}
```shell
xclip -sel clip < ~/.ssh/id_ed25519.pub
```
{{< /tab >}}
{{< tab title="Git Bash on Windows" >}}
```shell
cat ~/.ssh/id_ed25519.pub | clip
```
{{< /tab >}}
{{< /tabs >}}
1. Sign in to GitLab.
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Select **Add new key**.
1. In the **Key** box, paste the contents of your public key.
If you manually copied the key, make sure you copy the entire key,
which starts with `ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`,
`ssh-ed25519`, `sk-ecdsa-sha2-nistp256@openssh.com`, or `sk-ssh-ed25519@openssh.com`, and may end with a comment.
1. In the **Title** box, type a description, like `Work Laptop` or
`Home Workstation`.
1. Optional. Select the **Usage type** of the key. It can be used either for `Authentication` or `Signing` or both. `Authentication & Signing` is the default value.
1. Optional. Update **Expiration date** to modify the default expiration date.
- Administrators can view expiration dates and use them for
guidance when [deleting keys](../administration/credentials_inventory.md#delete-ssh-keys).
- GitLab checks all SSH keys at 01:00 AM UTC every day. It emails an expiration notice for all SSH keys that are scheduled to expire seven days from now.
- GitLab checks all SSH keys at 02:00 AM UTC every day. It emails an expiration notice for all SSH keys that expire on the current date.
1. Select **Add key**.
## Verify that you can connect
Verify that your SSH key was added correctly.
1. To ensure you're connecting to the correct server, check the server's SSH host keys fingerprint. For:
- GitLab.com, see the [SSH host keys fingerprints](gitlab_com/_index.md#ssh-host-keys-fingerprints) documentation.
- GitLab Self-Managed or GitLab Dedicated, see `https://gitlab.example.com/help/instance_configuration#ssh-host-keys-fingerprints`
where `gitlab.example.com` is the GitLab instance URL.
1. Open a terminal and run this command. Replace `gitlab.example.com` with your
GitLab instance URL:
```shell
ssh -T git@gitlab.example.com
```
1. If this is the first time you are connecting, you should verify the
authenticity of the GitLab host. If you see a message like:
```plaintext
The authenticity of host 'gitlab.example.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.example.com' (ECDSA) to the list of known hosts.
```
Type `yes` and press <kbd>Enter</kbd>.
1. Run the `ssh -T git@gitlab.example.com` command again. You should receive a _Welcome to GitLab, `@username`!_ message.
If the welcome message doesn't appear, you can troubleshoot by running `ssh`
in verbose mode:
```shell
ssh -Tvvv git@gitlab.example.com
```
By default, GitLab uses the `git` username to authenticate. It can be different if it was [changed by the administrator](https://docs.gitlab.com/omnibus/settings/configuration.html#change-the-name-of-the-git-user-or-group).
## Update your SSH key passphrase
You can update the passphrase for your SSH key:
1. Open a terminal and run this command:
```shell
ssh-keygen -p -f /path/to/ssh_key
```
1. At the prompts, enter the passphrase and then press <kbd>Enter</kbd>.
## Upgrade your RSA key pair to a more secure format
If your version of OpenSSH is between 6.5 and 7.8, you can save your private
RSA SSH keys in a more secure OpenSSH format by opening a terminal and running
this command:
```shell
ssh-keygen -o -f ~/.ssh/id_rsa
```
Alternatively, you can generate a new RSA key with the more secure encryption format with
the following command:
```shell
ssh-keygen -o -t rsa -b 4096 -C "<comment>"
```
## Generate an SSH key pair for a FIDO2 hardware security key
To generate ED25519_SK or ECDSA_SK SSH keys, you must use OpenSSH 8.2 or later:
1. Insert a hardware security key into your computer.
1. Open a terminal.
1. Run `ssh-keygen -t` followed by the key type and an optional comment.
This comment is included in the `.pub` file that's created.
You may want to use an email address for the comment.
For example, for ED25519_SK:
```shell
ssh-keygen -t ed25519-sk -C "<comment>"
```
For ECDSA_SK:
```shell
ssh-keygen -t ecdsa-sk -C "<comment>"
```
If your security key supports FIDO2 resident keys, you can enable this when
creating your SSH key:
```shell
ssh-keygen -t ed25519-sk -O resident -C "<comment>"
```
`-O resident` indicates that the key should be stored on the FIDO authenticator itself.
Resident key is easier to import to a new computer because it can be loaded directly
from the security key by [`ssh-add -K`](https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh-add.1#K)
or [`ssh-keygen -K`](https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh-keygen#K).
1. Press <kbd>Enter</kbd>. Output similar to the following is displayed:
```plaintext
Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
```
1. Touch the button on the hardware security key.
1. Accept the suggested filename and directory:
```plaintext
Enter file in which to save the key (/home/user/.ssh/id_ed25519_sk):
```
1. Specify a [passphrase](https://www.ssh.com/academy/ssh/passphrase):
```plaintext
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
```
A confirmation is displayed, including information about where your files are stored.
A public and private key are generated.
[Add the public SSH key to your GitLab account](#add-an-ssh-key-to-your-gitlab-account).
## Generate an SSH key pair with 1Password
You can use [1Password](https://1password.com/) and the [1Password browser extension](https://support.1password.com/getting-started-browser/) to either:
- Automatically generate a new SSH key.
- Use an existing SSH key in your 1Password vault to authenticate with GitLab.
1. Sign in to GitLab.
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Select **Add new key**.
1. Select **Key**, and you should see the 1Password helper appear.
1. Select the 1Password icon and unlock 1Password.
1. You can then select **Create SSH Key** or select an existing SSH key to fill in the public key.
1. In the **Title** box, enter a description, like `Work Laptop` or
`Home Workstation`.
1. Optional. Select the **Usage type** of the key. It can be used either for `Authentication` or `Signing` or both. `Authentication & Signing` is the default value.
1. Optional. Update **Expiration date** to modify the default expiration date.
1. Select **Add key**.
For more information about using 1Password with SSH keys, see the [1Password documentation](https://developer.1password.com/docs/ssh/get-started/).
## Use different keys for different repositories
You can use a different key for each repository.
Open a terminal and run this command:
```shell
git config core.sshCommand "ssh -o IdentitiesOnly=yes -i ~/.ssh/private-key-filename-for-this-repository -F /dev/null"
```
This command does not use the SSH Agent and requires Git 2.10 or later. For more information
on `ssh` command options, see the `man` pages for both `ssh` and `ssh_config`.
## View your SSH keys
To view the SSH keys for your account:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
Your existing SSH keys are listed at the bottom of the page. The information includes:
- The title for the key
- Public fingerprint
- Permitted usage types
- Creation date
- Last used date
- Expiry date
## Remove an SSH key
You can revoke or delete your SSH key to permanently remove it from your account.
Removing your SSH key has additional implications if you sign your commits with the key. For more information, see [Signed commits with removed SSH keys](project/repository/signed_commits/ssh.md#signed-commits-with-removed-ssh-keys).
### Revoke an SSH key
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108344) in GitLab 15.9.
{{< /history >}}
If your SSH key becomes compromised, revoke the key.
Prerequisites:
- The SSH key must have the `Signing` or `Authentication & Signing` usage type.
To revoke an SSH key:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Next to the SSH key you want to revoke, select **Revoke**.
1. Select **Revoke**.
### Delete an SSH key
To delete an SSH key:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Next to the key you want to delete, select **Remove** ({{< icon name="remove" >}}).
1. Select **Delete**.
## Use different accounts on a single GitLab instance
You can use multiple accounts to connect to a single instance of GitLab. You
can do this by using the command in the [previous topic](#use-different-keys-for-different-repositories).
However, even if you set `IdentitiesOnly` to `yes`, you cannot sign in if an
`IdentityFile` exists outside of a `Host` block.
Instead, you can assign aliases to hosts in the `~/.ssh/config` file.
- For the `Host`, use an alias like `user_1.gitlab.com` and
`user_2.gitlab.com`. Advanced configurations
are more difficult to maintain, and these strings are easier to
understand when you use tools like `git remote`.
- For the `IdentityFile`, use the path the private key.
```conf
# User1 Account Identity
Host <user_1.gitlab.com>
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<example_ssh_key1>
# User2 Account Identity
Host <user_2.gitlab.com>
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<example_ssh_key2>
```
Now, to clone a repository for `user_1`, use `user_1.gitlab.com` in the `git clone` command:
```shell
git clone git@<user_1.gitlab.com>:gitlab-org/gitlab.git
```
To update a previously-cloned repository that is aliased as `origin`:
```shell
git remote set-url origin git@<user_1.gitlab.com>:gitlab-org/gitlab.git
```
{{< alert type="note" >}}
Private and public keys contain sensitive data. Ensure the permissions
on the files make them readable to you but not accessible to others.
{{< /alert >}}
## Configure two-factor authentication (2FA)
You can set up two-factor authentication (2FA) for
[Git over SSH](../security/two_factor_authentication.md#2fa-for-git-over-ssh-operations). You should use
[ED25519_SK](#ed25519_sk-ssh-keys) or [ECDSA_SK](#ecdsa_sk-ssh-keys) SSH keys.
## Use EGit on Eclipse
If you are using [EGit](https://projects.eclipse.org/projects/technology.egit), you can [add your SSH key to Eclipse](https://wiki.eclipse.org/EGit/User_Guide/#Eclipse_SSH_Configuration).
## Use SSH on Microsoft Windows
If you're running Windows 10, you can either use the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install)
with [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install#update-to-wsl-2) which
has both `git` and `ssh` preinstalled, or install [Git for Windows](https://gitforwindows.org) to
use SSH through PowerShell.
The SSH key generated in WSL is not directly available for Git for Windows, and vice versa,
as both have a different home directory:
- WSL: `/home/<user>`
- Git for Windows: `C:\Users\<user>`
You can either copy over the `.ssh/` directory to use the same key, or generate a key in each environment.
If you're running Windows 11 and using [OpenSSH for Windows](https://learn.microsoft.com/en-us/windows-server/administration/OpenSSH/openssh-overview), ensure the `HOME`
environment variable is set correctly. Otherwise, your private SSH key might not be found.
Alternative tools include:
- [Cygwin](https://www.cygwin.com)
- [PuTTYgen](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) 0.81 and later (earlier versions are [vulnerable to disclosure attacks](https://www.openwall.com/lists/oss-security/2024/04/15/6))
## Overriding SSH settings on the GitLab server
GitLab integrates with the system-installed SSH daemon and designates a user
(typically named `git`) through which all access requests are handled. Users
who connect to the GitLab server over SSH are identified by their SSH key instead
of their username.
SSH *client* operations performed on the GitLab server are executed as this
user. You can modify this SSH configuration. For example, you can specify
a private SSH key for this user to use for authentication requests. However, this practice
is **not supported** and is strongly discouraged as it presents significant
security risks.
GitLab checks for this condition, and directs you
to this section if your server is configured this way. For example:
```shell
$ gitlab-rake gitlab:check
Git user has default SSH configuration? ... no
Try fixing it:
mkdir ~/gitlab-check-backup-1504540051
sudo mv /var/lib/git/.ssh/id_rsa ~/gitlab-check-backup-1504540051
sudo mv /var/lib/git/.ssh/id_rsa.pub ~/gitlab-check-backup-1504540051
For more information see:
doc/user/ssh.md#overriding-ssh-settings-on-the-gitlab-server
Please fix the error above and rerun the checks.
```
Remove the custom configuration as soon as you can. These customizations
are **explicitly not supported** and may stop working at any time.
## Verify GitLab SSH ownership and permissions
The GitLab SSH folder and files must have the following permissions:
- The folder `/var/opt/gitlab/.ssh/` must be owned by the `git` group and the `git` user, with permissions set to `700`.
- The `authorized_keys` file must have permissions set to `600`.
- The `authorized_keys.lock` file must have permissions set to `644`.
To verify that these permissions are correct, run the following:
```shell
stat -c "%a %n" /var/opt/gitlab/.ssh/.
```
### Set permissions
If the permissions are wrong, sign in to the application server and run:
```shell
cd /var/opt/gitlab/
chown git:git /var/opt/gitlab/.ssh/
chmod 700 /var/opt/gitlab/.ssh/
chmod 600 /var/opt/gitlab/.ssh/authorized_keys
chmod 644 /var/opt/gitlab/.ssh/authorized_keys.lock
```
|
https://docs.gitlab.com/snippets
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/snippets.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
snippets.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Snippets
|
Use snippets to store and share code, text, and files from your browser. Snippets support version control, commenting, and embedding.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With GitLab snippets, you can store and share bits of code and text with other users.
You can [comment on](#comment-on-snippets), [clone](#clone-snippets), and
[use version control](#versioned-snippets) in snippets. They can
[contain multiple files](#add-or-remove-multiple-files). They also support
[syntax highlighting](#filenames), [embedding](#embed-snippets), [downloading](#download-snippets),
and you can maintain your snippets with the [snippets API](../api/snippets.md).
You can create and manage your snippets with:
- The GitLab user interface.
- The [GitLab Workflow extension for VS Code](../editor_extensions/visual_studio_code/_index.md#create-a-snippet).
- The [`glab` CLI](../editor_extensions/gitlab_cli/_index.md).

GitLab provides two types of snippets:
- Personal snippets: Created independent of any project.
You can set a [visibility level](public_access.md)
for your snippet: public or private.
- Project snippets: Always related to a specific project.
Project snippets can be visible publicly, or to only project members.
{{< alert type="note" >}}
From July 2019, the `Internal` visibility setting is disabled for new projects, groups,
and snippets on GitLab.com. Existing snippets using the `Internal`
visibility setting keep this setting. You can read more about the change in the
[relevant issue](https://gitlab.com/gitlab-org/gitlab/-/issues/12388).
{{< /alert >}}
## Create snippets
You can create snippets in multiple ways, depending on whether you want to create a personal or project snippet:
1. Select the kind of snippet you want to create:
- To create a personal snippet, do one of the following:
- On the [Snippets dashboard](https://gitlab.com/dashboard/snippets), select **New snippet**.
- From a project: On the left sidebar, select **Create new** ({{< icon name="plus" >}}). Below **In GitLab**, select **New snippet**.
- From any other page: On the left sidebar, select **Create new** ({{< icon name="plus" >}}) and then **New snippet**.
- From the `glab` CLI, using the
[`glab snippet create`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/snippet/create.md) command.
For full instructions, see the command's documentation.
- If you installed the [GitLab Workflow extension for VS Code](../editor_extensions/visual_studio_code/_index.md),
use the [`Gitlab: Create snippet` command](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#create-snippet).
- To create a project snippet: Go to your project's page. Select
**Create new** ({{< icon name="plus" >}}). Below **In this project**, select **New snippet**.
1. In **Title**, add a title.
1. Optional. In **Description**, describe the snippet.
1. In **Files**, give your file an appropriate name and extension, such as `example.rb` or `index.html`.
Filenames with appropriate extensions display [syntax highlighting](#filenames).
Failure to add a filename can cause a known
[copy-pasting bug](https://gitlab.com/gitlab-org/gitlab/-/issues/22870).
If you do not provide a filename, GitLab [creates a name for you](#filenames).
1. Optional. Add [multiple files](#add-or-remove-multiple-files) to your snippet.
1. Select a visibility level, and select **Create snippet**.
After you create a snippet, you can still [add more files to it](#add-or-remove-multiple-files).
Snippets are [versioned by default](#versioned-snippets).
## Discover snippets
To discover all snippets visible to you in GitLab, you can:
- View a project's snippets:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Snippets**.
- View all the snippets you created:
1. On the left sidebar, select **Search or go to**.
1. Select **Your work**.
1. Select **Snippets**.
On GitLab.com, you can also visit your [snippets directly](https://gitlab.com/dashboard/snippets).
- Explore all public snippets:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. Select **Snippets**.
On GitLab.com, you can also visit [all public snippets directly](https://gitlab.com/explore/snippets).
## Change default visibility of snippets
Project snippets are enabled and available by default. To change their
default visibility:
1. In your project, go to **Settings > General**.
1. Expand the **Visibility, project features, permissions** section, and scroll to **Snippets**.
1. Toggle the default visibility, and select whether snippets can be viewed by
everyone, or only project members.
1. Select **Save changes**.
## Versioned snippets
Both personal and project snippets use version control by default.
This means that all snippets get their own underlying repository initialized with
a default branch at the moment the snippet is created. Whenever a change to the snippet is saved, a
new commit to the default branch is recorded. Commit messages are automatically
generated. The snippet's repository has only one branch. You can't delete this branch,
or create other branches.
## Filenames
Snippets support syntax highlighting based on the filename and
extension provided for them. You can submit a snippet
without a filename and extension, but a valid name is required for
creating content as a file in the repository.
If no filename and extension are provided for the snippet,
GitLab adds a filename in the format `snippetfile<x>.txt`
where `<x>` represents a number added to the file, starting with 1. This
number increments if you add more unnamed snippets.
When upgrading from an earlier version of GitLab to 13.0, existing snippets
without a supported filename are renamed to a compatible format. For
example, if the snippet's filename is `http://a-weird-filename.me` it is
changed to `http-a-weird-filename-me` to be included in the snippet's
repository. As snippets are stored by ID, changing their filenames breaks
direct or embedded links to the snippet.
## Add or remove multiple files
A single snippet can support up to 10 files, which helps keep related files together, such as:
- A snippet that includes a script and its output.
- A snippet that includes HTML, CSS, and JavaScript code.
- A snippet with a `docker-compose.yml` file and its associated `.env` file.
- A `gulpfile.js` file and a `package.json` file, which together can be
used to bootstrap a project and manage its dependencies.
If you need more than 10 files for your snippet, you should create a
[wiki](project/wiki/_index.md) instead. Wikis are available for projects at all
subscription levels, and [groups](project/wiki/group.md) for
[GitLab Premium](https://about.gitlab.com/pricing/).
Snippets with multiple files display a file count in the [snippet list](https://gitlab.com/dashboard/snippets):

You can manage snippets with Git (because they're [versioned](#versioned-snippets)
by a Git repository), through the [Snippets API](../api/snippets.md), and in the GitLab UI.
To add a new file to your snippet through the GitLab UI:
1. Go to your snippet in the GitLab UI.
1. Select **Edit** in the upper-right corner.
1. Select **Add another file**.
1. Add your content to the file in the form fields provided.
1. Select **Save changes**.
To delete a file from your snippet through the GitLab UI:
1. Go to your snippet in the GitLab UI.
1. Select **Edit** in the upper-right corner.
1. Select **Delete file** alongside the filename of each file you wish to delete.
1. Select **Save changes**.
## Clone snippets
To ensure you receive updates, clone the snippet instead of copying it locally. Cloning
maintains the snippet's connection with the repository.
To clone a snippet:
- Select **Clone**, then copy the URL to clone with SSH or HTTPS.
You can commit changes to a cloned snippet, and push the changes to GitLab.
## Embed snippets
Public snippets can be shared and embedded on any website. You can reuse a GitLab snippet in multiple places, and any change to the source
is reflected in the embedded snippets. When embedded, users can download it, or view the snippet in raw format.
To embed a snippet:
1. Confirm your snippet is publicly visible:
- If it's a project snippet, the project must be public.
- The snippet is publicly visible.
- In your project, go to **Settings > General**. Expand the **Visibility, project features, permissions**
section, and scroll to **Snippets**. Set the snippet permission to **Everyone with access**.
1. In your snippet's **Embed** section, select **Copy** to copy a one-line script
you can add to any website or blog post. For example:
```html
<script src="https://gitlab.com/namespace/project/snippets/SNIPPET_ID.js"></script>
```
1. Add your script to your file.
Embedded snippets display a header that shows:
- The filename, if defined.
- The snippet size.
- A link to GitLab.
- The actual snippet content.
For example:
<script src="https://gitlab.com/gitlab-org/gitlab-foss/snippets/1717978.js"></script>
## Download snippets
You can download the raw content of a snippet. By default, they download with Linux-style line endings (`LF`). If
you want to preserve the original line endings you must add a parameter `line_ending=raw`
(For example: `https://gitlab.com/snippets/SNIPPET_ID/raw?line_ending=raw`). In case a
snippet was created using the GitLab web interface the original line ending is Windows-like (`CRLF`).
## Comment on snippets
With snippets, you engage in a conversation about that piece of code,
which can encourage user collaboration.
## Mark snippet as spam
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators on GitLab Self-Managed can mark snippets as spam.
Prerequisites:
- You must be the administrator for your instance.
- [Akismet](../integration/akismet.md) spam protection must be enabled on the instance.
To do this task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Snippets**.
1. Select the snippet you want to report as spam.
1. Select **Submit as spam**.
GitLab forwards the spam to Akismet.
## Troubleshooting
### Snippet limitations
- No limits exist as to how many snippets you can create.
- Binary files are not supported.
- Creating or deleting branches is not supported. Only the default branch is used.
- Git tags are not supported in snippet repositories.
- Snippets' repositories are limited to 10 files. Attempting to push more
than 10 files results in an error.
- Revisions are not visible to the user on the GitLab UI, but [an issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/39271)
for updates.
- The default [maximum size for a snippet](../administration/snippets/_index.md) and current (as of 2024-04-17) is 50 MB.
- Git LFS is not supported.
### Reduce snippets repository size
Because versioned snippets are considered as part of the [namespace storage size](../administration/settings/account_and_limit_settings.md),
it's recommended to keep snippets' repositories as compact as possible.
For more information about tools to compact repositories,
see the documentation on [reducing repository size](project/repository/repository_size.md#methods-to-reduce-repository-size).
### Cannot enter text into the snippet text box
If the text area after the filename field is disabled and prevents you from
creating a new snippet, use this workaround:
1. Enter a title for your snippet.
1. Scroll to the bottom of the **Files** field, then select
**Add another file**. GitLab displays a second set of fields to add a second file.
1. In the filename field for the second file, enter a filename to avoid a [known copy-pasting bug](https://gitlab.com/gitlab-org/gitlab/-/issues/22870).
1. Enter any string into the text area for the second file.
1. Scroll back to the first filename, and select **Delete file**.
1. Create the rest of your file, and select **Create snippet** when done.
## Related topics
- [Configure snippet settings](../administration/snippets/_index.md) on GitLab Self-Managed
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use snippets to store and share code, text, and files from your browser.
Snippets support version control, commenting, and embedding.
title: Snippets
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With GitLab snippets, you can store and share bits of code and text with other users.
You can [comment on](#comment-on-snippets), [clone](#clone-snippets), and
[use version control](#versioned-snippets) in snippets. They can
[contain multiple files](#add-or-remove-multiple-files). They also support
[syntax highlighting](#filenames), [embedding](#embed-snippets), [downloading](#download-snippets),
and you can maintain your snippets with the [snippets API](../api/snippets.md).
You can create and manage your snippets with:
- The GitLab user interface.
- The [GitLab Workflow extension for VS Code](../editor_extensions/visual_studio_code/_index.md#create-a-snippet).
- The [`glab` CLI](../editor_extensions/gitlab_cli/_index.md).

GitLab provides two types of snippets:
- Personal snippets: Created independent of any project.
You can set a [visibility level](public_access.md)
for your snippet: public or private.
- Project snippets: Always related to a specific project.
Project snippets can be visible publicly, or to only project members.
{{< alert type="note" >}}
From July 2019, the `Internal` visibility setting is disabled for new projects, groups,
and snippets on GitLab.com. Existing snippets using the `Internal`
visibility setting keep this setting. You can read more about the change in the
[relevant issue](https://gitlab.com/gitlab-org/gitlab/-/issues/12388).
{{< /alert >}}
## Create snippets
You can create snippets in multiple ways, depending on whether you want to create a personal or project snippet:
1. Select the kind of snippet you want to create:
- To create a personal snippet, do one of the following:
- On the [Snippets dashboard](https://gitlab.com/dashboard/snippets), select **New snippet**.
- From a project: On the left sidebar, select **Create new** ({{< icon name="plus" >}}). Below **In GitLab**, select **New snippet**.
- From any other page: On the left sidebar, select **Create new** ({{< icon name="plus" >}}) and then **New snippet**.
- From the `glab` CLI, using the
[`glab snippet create`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/snippet/create.md) command.
For full instructions, see the command's documentation.
- If you installed the [GitLab Workflow extension for VS Code](../editor_extensions/visual_studio_code/_index.md),
use the [`Gitlab: Create snippet` command](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#create-snippet).
- To create a project snippet: Go to your project's page. Select
**Create new** ({{< icon name="plus" >}}). Below **In this project**, select **New snippet**.
1. In **Title**, add a title.
1. Optional. In **Description**, describe the snippet.
1. In **Files**, give your file an appropriate name and extension, such as `example.rb` or `index.html`.
Filenames with appropriate extensions display [syntax highlighting](#filenames).
Failure to add a filename can cause a known
[copy-pasting bug](https://gitlab.com/gitlab-org/gitlab/-/issues/22870).
If you do not provide a filename, GitLab [creates a name for you](#filenames).
1. Optional. Add [multiple files](#add-or-remove-multiple-files) to your snippet.
1. Select a visibility level, and select **Create snippet**.
After you create a snippet, you can still [add more files to it](#add-or-remove-multiple-files).
Snippets are [versioned by default](#versioned-snippets).
## Discover snippets
To discover all snippets visible to you in GitLab, you can:
- View a project's snippets:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Snippets**.
- View all the snippets you created:
1. On the left sidebar, select **Search or go to**.
1. Select **Your work**.
1. Select **Snippets**.
On GitLab.com, you can also visit your [snippets directly](https://gitlab.com/dashboard/snippets).
- Explore all public snippets:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. Select **Snippets**.
On GitLab.com, you can also visit [all public snippets directly](https://gitlab.com/explore/snippets).
## Change default visibility of snippets
Project snippets are enabled and available by default. To change their
default visibility:
1. In your project, go to **Settings > General**.
1. Expand the **Visibility, project features, permissions** section, and scroll to **Snippets**.
1. Toggle the default visibility, and select whether snippets can be viewed by
everyone, or only project members.
1. Select **Save changes**.
## Versioned snippets
Both personal and project snippets use version control by default.
This means that all snippets get their own underlying repository initialized with
a default branch at the moment the snippet is created. Whenever a change to the snippet is saved, a
new commit to the default branch is recorded. Commit messages are automatically
generated. The snippet's repository has only one branch. You can't delete this branch,
or create other branches.
## Filenames
Snippets support syntax highlighting based on the filename and
extension provided for them. You can submit a snippet
without a filename and extension, but a valid name is required for
creating content as a file in the repository.
If no filename and extension are provided for the snippet,
GitLab adds a filename in the format `snippetfile<x>.txt`
where `<x>` represents a number added to the file, starting with 1. This
number increments if you add more unnamed snippets.
When upgrading from an earlier version of GitLab to 13.0, existing snippets
without a supported filename are renamed to a compatible format. For
example, if the snippet's filename is `http://a-weird-filename.me` it is
changed to `http-a-weird-filename-me` to be included in the snippet's
repository. As snippets are stored by ID, changing their filenames breaks
direct or embedded links to the snippet.
## Add or remove multiple files
A single snippet can support up to 10 files, which helps keep related files together, such as:
- A snippet that includes a script and its output.
- A snippet that includes HTML, CSS, and JavaScript code.
- A snippet with a `docker-compose.yml` file and its associated `.env` file.
- A `gulpfile.js` file and a `package.json` file, which together can be
used to bootstrap a project and manage its dependencies.
If you need more than 10 files for your snippet, you should create a
[wiki](project/wiki/_index.md) instead. Wikis are available for projects at all
subscription levels, and [groups](project/wiki/group.md) for
[GitLab Premium](https://about.gitlab.com/pricing/).
Snippets with multiple files display a file count in the [snippet list](https://gitlab.com/dashboard/snippets):

You can manage snippets with Git (because they're [versioned](#versioned-snippets)
by a Git repository), through the [Snippets API](../api/snippets.md), and in the GitLab UI.
To add a new file to your snippet through the GitLab UI:
1. Go to your snippet in the GitLab UI.
1. Select **Edit** in the upper-right corner.
1. Select **Add another file**.
1. Add your content to the file in the form fields provided.
1. Select **Save changes**.
To delete a file from your snippet through the GitLab UI:
1. Go to your snippet in the GitLab UI.
1. Select **Edit** in the upper-right corner.
1. Select **Delete file** alongside the filename of each file you wish to delete.
1. Select **Save changes**.
## Clone snippets
To ensure you receive updates, clone the snippet instead of copying it locally. Cloning
maintains the snippet's connection with the repository.
To clone a snippet:
- Select **Clone**, then copy the URL to clone with SSH or HTTPS.
You can commit changes to a cloned snippet, and push the changes to GitLab.
## Embed snippets
Public snippets can be shared and embedded on any website. You can reuse a GitLab snippet in multiple places, and any change to the source
is reflected in the embedded snippets. When embedded, users can download it, or view the snippet in raw format.
To embed a snippet:
1. Confirm your snippet is publicly visible:
- If it's a project snippet, the project must be public.
- The snippet is publicly visible.
- In your project, go to **Settings > General**. Expand the **Visibility, project features, permissions**
section, and scroll to **Snippets**. Set the snippet permission to **Everyone with access**.
1. In your snippet's **Embed** section, select **Copy** to copy a one-line script
you can add to any website or blog post. For example:
```html
<script src="https://gitlab.com/namespace/project/snippets/SNIPPET_ID.js"></script>
```
1. Add your script to your file.
Embedded snippets display a header that shows:
- The filename, if defined.
- The snippet size.
- A link to GitLab.
- The actual snippet content.
For example:
<script src="https://gitlab.com/gitlab-org/gitlab-foss/snippets/1717978.js"></script>
## Download snippets
You can download the raw content of a snippet. By default, they download with Linux-style line endings (`LF`). If
you want to preserve the original line endings you must add a parameter `line_ending=raw`
(For example: `https://gitlab.com/snippets/SNIPPET_ID/raw?line_ending=raw`). In case a
snippet was created using the GitLab web interface the original line ending is Windows-like (`CRLF`).
## Comment on snippets
With snippets, you engage in a conversation about that piece of code,
which can encourage user collaboration.
## Mark snippet as spam
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators on GitLab Self-Managed can mark snippets as spam.
Prerequisites:
- You must be the administrator for your instance.
- [Akismet](../integration/akismet.md) spam protection must be enabled on the instance.
To do this task:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Snippets**.
1. Select the snippet you want to report as spam.
1. Select **Submit as spam**.
GitLab forwards the spam to Akismet.
## Troubleshooting
### Snippet limitations
- No limits exist as to how many snippets you can create.
- Binary files are not supported.
- Creating or deleting branches is not supported. Only the default branch is used.
- Git tags are not supported in snippet repositories.
- Snippets' repositories are limited to 10 files. Attempting to push more
than 10 files results in an error.
- Revisions are not visible to the user on the GitLab UI, but [an issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/39271)
for updates.
- The default [maximum size for a snippet](../administration/snippets/_index.md) and current (as of 2024-04-17) is 50 MB.
- Git LFS is not supported.
### Reduce snippets repository size
Because versioned snippets are considered as part of the [namespace storage size](../administration/settings/account_and_limit_settings.md),
it's recommended to keep snippets' repositories as compact as possible.
For more information about tools to compact repositories,
see the documentation on [reducing repository size](project/repository/repository_size.md#methods-to-reduce-repository-size).
### Cannot enter text into the snippet text box
If the text area after the filename field is disabled and prevents you from
creating a new snippet, use this workaround:
1. Enter a title for your snippet.
1. Scroll to the bottom of the **Files** field, then select
**Add another file**. GitLab displays a second set of fields to add a second file.
1. In the filename field for the second file, enter a filename to avoid a [known copy-pasting bug](https://gitlab.com/gitlab-org/gitlab/-/issues/22870).
1. Enter any string into the text area for the second file.
1. Scroll back to the first filename, and select **Delete file**.
1. Create the rest of your file, and select **Create snippet** when done.
## Related topics
- [Configure snippet settings](../administration/snippets/_index.md) on GitLab Self-Managed
|
https://docs.gitlab.com/user
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/_index.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
_index.md
|
none
|
unassigned
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Use GitLab
|
Get to know the GitLab end-to-end workflow.
|
Get to know the GitLab end-to-end workflow. Configure permissions,
organize your work, create and secure your application, and analyze its performance. Report on team productivity throughout the process.
{{< cards >}}
- [Manage your organization](../topics/set_up_organization.md)
- [Organize work with projects](project/organize_work_with_projects.md)
- [Plan and track work](../topics/plan_and_track.md)
- [Use Git](../topics/git/_index.md)
- [Manage your code](../topics/manage_code.md)
- [Use CI/CD to build your application](../topics/build_your_application.md)
- [Secure your application](application_security/secure_your_application.md)
- [Deploy and release your application](../topics/release_your_application.md)
- [Manage your infrastructure](infrastructure/_index.md)
- [Monitor your application](../operations/_index.md)
- [Analyze GitLab usage](analytics/_index.md)
{{< /cards >}}
|
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Use GitLab
description: Get to know the GitLab end-to-end workflow.
breadcrumbs:
- doc
- user
---
Get to know the GitLab end-to-end workflow. Configure permissions,
organize your work, create and secure your application, and analyze its performance. Report on team productivity throughout the process.
{{< cards >}}
- [Manage your organization](../topics/set_up_organization.md)
- [Organize work with projects](project/organize_work_with_projects.md)
- [Plan and track work](../topics/plan_and_track.md)
- [Use Git](../topics/git/_index.md)
- [Manage your code](../topics/manage_code.md)
- [Use CI/CD to build your application](../topics/build_your_application.md)
- [Secure your application](application_security/secure_your_application.md)
- [Deploy and release your application](../topics/release_your_application.md)
- [Manage your infrastructure](infrastructure/_index.md)
- [Monitor your application](../operations/_index.md)
- [Analyze GitLab usage](analytics/_index.md)
{{< /cards >}}
|
https://docs.gitlab.com/free_push_limit
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/free_push_limit.md
|
2025-08-13
|
doc/user
|
[
"doc",
"user"
] |
free_push_limit.md
|
Growth
|
Acquisition
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Free push limit
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
A 100 MiB per-file limit applies when pushing new files to any project in the Free tier.
If a new file that is 100 MiB or larger is pushed to a project in the Free tier, an error is displayed. For example:
```shell
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 10 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 100.03 MiB | 1.08 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: GitLab: You are attempting to check in one or more files which exceed the 100MiB limit:
- 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 (123 MiB)
- 5716ca5987cbf97d6bb54920bea6adde242d87e6 (396 MiB)
Please refer to https://docs.gitlab.com/ee/user/free_user_limit.html for further information.
To https://gitlab.com/group/my-project.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://gitlab.com/group/my-project.git'
```
The error lists the unique IDs for files rather than their filename. To look up the filename from the unique identify, run the following command:
```shell
tree -r | grep <id>
```
Because Git is not designed to handle large non-text-based data well, you should use [Git LFS](../topics/git/lfs/_index.md) for these files.
Git LFS is designed to work with Git to track large files.
## Feedback
If you have any feedback to share about this limit, do so in
[issue 428188](https://gitlab.com/gitlab-org/gitlab/-/issues/428188).
|
---
stage: Growth
group: Acquisition
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Free push limit
breadcrumbs:
- doc
- user
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
A 100 MiB per-file limit applies when pushing new files to any project in the Free tier.
If a new file that is 100 MiB or larger is pushed to a project in the Free tier, an error is displayed. For example:
```shell
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 10 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 100.03 MiB | 1.08 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: GitLab: You are attempting to check in one or more files which exceed the 100MiB limit:
- 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 (123 MiB)
- 5716ca5987cbf97d6bb54920bea6adde242d87e6 (396 MiB)
Please refer to https://docs.gitlab.com/ee/user/free_user_limit.html for further information.
To https://gitlab.com/group/my-project.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://gitlab.com/group/my-project.git'
```
The error lists the unique IDs for files rather than their filename. To look up the filename from the unique identify, run the following command:
```shell
tree -r | grep <id>
```
Because Git is not designed to handle large non-text-based data well, you should use [Git LFS](../topics/git/lfs/_index.md) for these files.
Git LFS is designed to work with Git to track large files.
## Feedback
If you have any feedback to share about this limit, do so in
[issue 428188](https://gitlab.com/gitlab-org/gitlab/-/issues/428188).
|
https://docs.gitlab.com/user/enterprise_user
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/enterprise_user
|
[
"doc",
"user",
"enterprise_user"
] |
_index.md
|
Software Supply Chain Security
|
Authentication
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Enterprise users
|
Domain verification, two-factor authentication, enterprise user management, and SAML response.
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
Enterprise users have user accounts that are administered by an organization that
has [verified their email domain](#verified-domains-for-groups) and purchased a [GitLab subscription](../../subscriptions/_index.md).
Enterprise users are identified by the `Enterprise` badge
next to their names on the [Members list](../group/_index.md#filter-and-sort-members-in-a-group).
You can also [use the API](../../api/group_enterprise_users.md) to interact with enterprise users.
## Automatic claims of enterprise users
A user is automatically claimed as an enterprise user of a group when both of the following conditions are met:
- The user's primary email has a domain that has been [verified](#verified-domains-for-groups) by the paid group.
- The user account meets at least one of the following conditions:
- It was created February 1, 2021 or later.
- It has a SAML or SCIM identity tied to the organization's group.
- It has a `provisioned_by_group_id` value that is the same as the group ID of the organization.
- It is a member of the organization's group, where the subscription was purchased or renewed February 1, 2021 or later.
After the user is claimed as an enterprise user:
- Their `enterprise_group_id` attribute is set to the organization's group's ID.
- The user receives a [welcome email](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/views/notify/user_associated_with_enterprise_group_email.html.haml).
If a group's purchased subscription expires or is canceled:
- Users claimed as enterprise users remain enterprise users of that group.
- The group is not able to [manage their enterprise users](#manage-enterprise-users).
- Primary emails for user accounts must be from a verified domain.
- No new users can be [automatically associated with the group](#automatic-claims-of-enterprise-users) until the paid subscription is renewed.
If a group's verified domains are removed:
- Users claimed as enterprise users remain enterprise users of that group.
- Primary emails for user accounts must be from a verified domain.
- No new users can be [automatically associated with the group](#automatic-claims-of-enterprise-users) until domains are verified.
If the organization moves its verified domains to another paid group, its enterprise users are [automatically claimed](#automatic-claims-of-enterprise-users) as enterprise users of that group.
### Identifying unclaimed users
If a user is not automatically claimed as an enterprise user, their existing access will not be revoked.
A group with domain verification enabled can have both claimed and unclaimed users as members.
The only difference between a member claimed as an enterprise user and a member that is not is that a Group Owner cannot [manage unclaimed users](#manage-enterprise-users).
### Identifying group members that have not been claimed as enterprise users
Groups that enable domain verification can have both claimed and unclaimed users as members.
Unclaimed users retain their existing access, but are not managed by group Owners.
See [Manage enterprise users in a namespace](#manage-enterprise-users).
You can discover any unclaimed users in your group by accessing and analyzing your list of billable
users at: `https://gitlab.com/groups/<group_id>/-/usage_quotas#seats-quota-tab`.
From this list, unclaimed users one of the following:
- No visible email address.
- An email address that does not match your verified domain.
To claim these users, they must update their primary email address to match the verified domain.
These users are automatically claimed when the next scheduled claim worker runs.
## Verified domains for groups
The following automated processes use verified domains to run:
- [Automatic claims of enterprise users](#automatic-claims-of-enterprise-users).
- [Bypass email confirmation for provisioned users](#bypass-email-confirmation-for-provisioned-users).
### Set up a verified domain
Prerequisites:
- A custom domain name `example.com` or subdomain `subdomain.example.com`.
- Access to your domain's server control panel to set up a DNS `TXT` record to verify your domain's ownership.
- A project in the group. This project will be linked to the verified domains, and should not be deleted. This project also needs to have the pages component enabled in its settings (**General** -> **Visibility, project features, permissions** -> **Pages**). If the pages component is disabled in its settings, a `500` error will be generated during domain verification.
- Ensure that [GitLab Pages](../project/pages/_index.md) is enabled for the project. If GitLab Pages is disabled, adding the domain might result in an error.
- You must have the Owner role for the top-level group.
Domain verification applies at the top-level group and to all subgroups and projects
nested under that top-level parent group.
You cannot verify a domain for more than one group. For example, if a group named
'group1' has a verified domain named 'domain1', you cannot also verify 'domain1'
for a different group named 'group2'.
Setting up a verified domain is similar to [setting up a custom domain on GitLab Pages](../project/pages/custom_domains_ssl_tls_certification/_index.md). However, you:
- Do not need to have a GitLab Pages website.
- Must link the domain to a single project, despite domain verification applying
at the top-level group and to all nested subgroups and projects, because domain
verification:
- Is tied to the project you choose. If the project is deleted, the domain verification is removed.
- Reuses the GitLab Pages custom domain verification feature, which requires a project.
- Must configure the `TXT` only in the DNS record to verify the domain's ownership.
In addition to appearing in the top-level group Domain Verification list, the
domain will also appear in the chosen project. A member in this project with
[at least the Maintainer role](../permissions.md#project-members-permissions)
can modify or remove the domain verification.
If needed, you can create a new project to set up domain verification directly
under your top-level group. This limits the ability to modify the domain verification
to members with at least the Maintainer role, because these users are able to set up a domain and therefore allow the group's enterprise users to update their email to match that domain.
For more information on group-level domain verification, see [epic 5299](https://gitlab.com/groups/gitlab-org/-/epics/5299).
#### 1. Add a custom domain for the matching email domain
The custom domain must match the email domain exactly. For example, if your email is `username@example.com`, verify the `example.com` domain.
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
1. In the upper-right corner, select **Add Domain**.
1. In **Domain**, enter the domain name.
1. In **Project**, link to a project.
1. In **Certificate**:
- If you do not have or do not want to use an SSL certificate, leave **Automatic certificate management using Let's
Encrypt** selected.
- Optional. Turn on the **Manually enter certificate information** toggle to add an SSL/TLS certificate. You can also
add the certificate and key later.
1. Select **Add Domain**.
{{< alert type="note" >}}
A valid certificate is not required for domain verification. You can ignore error messages regarding the certificate if you are not using GitLab Pages.
{{< /alert >}}
#### 2. Get a verification code
After you create a new domain, the verification code prompts you. Copy the values from GitLab
and paste them in your domain's control panel as a `TXT` record.

#### 3. Verify the domain's ownership
After you have added all the DNS records:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Domain Verification**.
1. On the domain table row, Select **Retry verification** ({{< icon name="retry" >}}).

{{< alert type="warning" >}}
For GitLab instances with domain verification enabled, if the domain cannot be verified for 7 days, that domain is removed from the GitLab project.
{{< /alert >}}
{{< alert type="note" >}}
- Domain verification is **required for GitLab.com users** to be marked as enterprise users.
- [DNS propagation can take up to 24 hours](https://www.inmotionhosting.com/support/domain-names/dns-nameserver-changes/complete-guide-to-dns-records/), although it's usually a couple of minutes to complete. Until it completes, the domain shows as unverified.
- Once your domain has been verified, leave the verification record in place. Your domain is periodically reverified, and may be disabled if the record is removed.
- A valid certificate is not required for domain verification.
{{< /alert >}}
### View domains in group
To view all configured domains in your group:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
You then see:
- A list of added domains.
- The domains' status of **Verified** or **Unverified**.
- The project where the domain has been configured.
### Manage domains in group
To edit or remove a domain:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
1. When viewing **Domain Verification**, select the project listed next to the relevant domain.
1. Edit or remove a domain following the relevant [GitLab Pages custom domains](../project/pages/custom_domains_ssl_tls_certification/_index.md) instructions.
## Manage enterprise users
In addition to the standard [group member permissions](../permissions.md#group-members-permissions),
Owners of a top-level group can also manage enterprise users in their group.
You can also [use the API](../../api/group_enterprise_users.md) to interact with enterprise users.
### Restrict authentication methods
You can restrict the specific authentication methods available to enterprise users, which can help
reduce the security footprint of your users.
- [Disable password authentication](../group/saml_sso/_index.md#disable-password-authentication-for-enterprise-users).
- [Disable personal access tokens](../../user/profile/personal_access_tokens.md#disable-personal-access-tokens-for-enterprise-users).
- [Disable two-factor authentication](../../security/two_factor_authentication.md#enterprise-users).
### Restrict group and project creation
You can restrict group and project creation for enterprise users, which helps you define:
- If enterprise users can create top-level groups.
- The maximum number of personal projects each enterprise user can create.
These restrictions are defined in the SAML response. For more information, see
[configure enterprise user settings from the SAML response](../group/saml_sso/_index.md#configure-enterprise-user-settings-from-saml-response).
### Bypass email confirmation for provisioned users
By default, users provisioned with SAML or SCIM are sent a verification email to verify their
identity. Instead, you can configure GitLab with a custom domain and GitLab automatically
confirms user accounts. Users still receive an enterprise user welcome email.
For more information, see [bypass user email confirmation with verified domains](../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
### View the email addresses for an enterprise user
Prerequisites:
- You must have the Owner role for a top-level group.
To view an enterprise user's email address:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Members**.
1. Hover over the enterprise user's name.
You can also use the [group and project members API](../../api/members.md)
to access users' information. For enterprise users of the group, this information
includes users' email addresses.
### Change the email addresses for an enterprise user
Enterprise users can follow the same process as other GitLab users to
[change their primary email address](../../user/profile/_index.md#change-your-primary-email).
The new email address must be from a verified domain. If your organization has no verified
domains, your enterprise users cannot change their primary email address.
Only GitLab support can change the primary email address to an email address from a
non-verified domain. This action [releases the enterprise user](#release-an-enterprise-user).
### Release an enterprise user
You can remove enterprise management features from a user account. Removing an enterprise user might be required if, for
example, a user wants to keep their GitLab account after leaving their company. Releasing a user
does not alter their account roles or permissions, but removes the management options
for the group Owner.
To release the user, GitLab support must update the user's primary email address to an
email address from a non-verified domain. This action automatically releases the account.
Allowing group Owners to change primary emails is proposed in
[issue 412966](https://gitlab.com/gitlab-org/gitlab/-/issues/412966).
### Enable the extension marketplace for the Web IDE and workspaces
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161819) as a [beta](../../policy/development_stages_support.md#beta) in GitLab 17.4 [with flags](../../administration/feature_flags/_index.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default.
- `web_ide_oauth` [enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163181) in GitLab 17.4.
- `web_ide_extensions_marketplace` [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.4.
- `web_ide_oauth` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167464) in GitLab 17.5.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/508996) the `vscode_extension_marketplace_settings` [feature flag](../../administration/feature_flags/_index.md) in GitLab 17.10. Disabled by default.
- `web_ide_extensions_marketplace` [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184662), and `vscode_extension_marketplace_settings` [enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184662) in GitLab 17.11.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/192659) in GitLab 18.1. Feature flags `web_ide_extensions_marketplace` and `vscode_extension_marketplace_settings` removed.
{{< /history >}}
Prerequisites:
- An administrator must [enable the extension marketplace](../../administration/settings/vscode_extension_marketplace.md).
- You must have the Owner role for a top-level group.
To enable the extension marketplace for the [Web IDE](../project/web_ide/_index.md) and [workspaces](../workspace/_index.md):
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **Web IDE and workspaces**, select the **Enable extension marketplace** checkbox.
1. Select **Save changes**.
## Troubleshooting
### Cannot disable two-factor authentication for an enterprise user
If a user does not have an **Enterprise** badge, a group Owner cannot disable or reset 2FA for their
account. Instead, the Owner should tell the enterprise user to consider available
[recovery options](../profile/account/two_factor_authentication_troubleshooting.md#recovery-options-and-2fa-reset).
|
---
stage: Software Supply Chain Security
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Enterprise users
description: Domain verification, two-factor authentication, enterprise user management,
and SAML response.
breadcrumbs:
- doc
- user
- enterprise_user
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
Enterprise users have user accounts that are administered by an organization that
has [verified their email domain](#verified-domains-for-groups) and purchased a [GitLab subscription](../../subscriptions/_index.md).
Enterprise users are identified by the `Enterprise` badge
next to their names on the [Members list](../group/_index.md#filter-and-sort-members-in-a-group).
You can also [use the API](../../api/group_enterprise_users.md) to interact with enterprise users.
## Automatic claims of enterprise users
A user is automatically claimed as an enterprise user of a group when both of the following conditions are met:
- The user's primary email has a domain that has been [verified](#verified-domains-for-groups) by the paid group.
- The user account meets at least one of the following conditions:
- It was created February 1, 2021 or later.
- It has a SAML or SCIM identity tied to the organization's group.
- It has a `provisioned_by_group_id` value that is the same as the group ID of the organization.
- It is a member of the organization's group, where the subscription was purchased or renewed February 1, 2021 or later.
After the user is claimed as an enterprise user:
- Their `enterprise_group_id` attribute is set to the organization's group's ID.
- The user receives a [welcome email](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/views/notify/user_associated_with_enterprise_group_email.html.haml).
If a group's purchased subscription expires or is canceled:
- Users claimed as enterprise users remain enterprise users of that group.
- The group is not able to [manage their enterprise users](#manage-enterprise-users).
- Primary emails for user accounts must be from a verified domain.
- No new users can be [automatically associated with the group](#automatic-claims-of-enterprise-users) until the paid subscription is renewed.
If a group's verified domains are removed:
- Users claimed as enterprise users remain enterprise users of that group.
- Primary emails for user accounts must be from a verified domain.
- No new users can be [automatically associated with the group](#automatic-claims-of-enterprise-users) until domains are verified.
If the organization moves its verified domains to another paid group, its enterprise users are [automatically claimed](#automatic-claims-of-enterprise-users) as enterprise users of that group.
### Identifying unclaimed users
If a user is not automatically claimed as an enterprise user, their existing access will not be revoked.
A group with domain verification enabled can have both claimed and unclaimed users as members.
The only difference between a member claimed as an enterprise user and a member that is not is that a Group Owner cannot [manage unclaimed users](#manage-enterprise-users).
### Identifying group members that have not been claimed as enterprise users
Groups that enable domain verification can have both claimed and unclaimed users as members.
Unclaimed users retain their existing access, but are not managed by group Owners.
See [Manage enterprise users in a namespace](#manage-enterprise-users).
You can discover any unclaimed users in your group by accessing and analyzing your list of billable
users at: `https://gitlab.com/groups/<group_id>/-/usage_quotas#seats-quota-tab`.
From this list, unclaimed users one of the following:
- No visible email address.
- An email address that does not match your verified domain.
To claim these users, they must update their primary email address to match the verified domain.
These users are automatically claimed when the next scheduled claim worker runs.
## Verified domains for groups
The following automated processes use verified domains to run:
- [Automatic claims of enterprise users](#automatic-claims-of-enterprise-users).
- [Bypass email confirmation for provisioned users](#bypass-email-confirmation-for-provisioned-users).
### Set up a verified domain
Prerequisites:
- A custom domain name `example.com` or subdomain `subdomain.example.com`.
- Access to your domain's server control panel to set up a DNS `TXT` record to verify your domain's ownership.
- A project in the group. This project will be linked to the verified domains, and should not be deleted. This project also needs to have the pages component enabled in its settings (**General** -> **Visibility, project features, permissions** -> **Pages**). If the pages component is disabled in its settings, a `500` error will be generated during domain verification.
- Ensure that [GitLab Pages](../project/pages/_index.md) is enabled for the project. If GitLab Pages is disabled, adding the domain might result in an error.
- You must have the Owner role for the top-level group.
Domain verification applies at the top-level group and to all subgroups and projects
nested under that top-level parent group.
You cannot verify a domain for more than one group. For example, if a group named
'group1' has a verified domain named 'domain1', you cannot also verify 'domain1'
for a different group named 'group2'.
Setting up a verified domain is similar to [setting up a custom domain on GitLab Pages](../project/pages/custom_domains_ssl_tls_certification/_index.md). However, you:
- Do not need to have a GitLab Pages website.
- Must link the domain to a single project, despite domain verification applying
at the top-level group and to all nested subgroups and projects, because domain
verification:
- Is tied to the project you choose. If the project is deleted, the domain verification is removed.
- Reuses the GitLab Pages custom domain verification feature, which requires a project.
- Must configure the `TXT` only in the DNS record to verify the domain's ownership.
In addition to appearing in the top-level group Domain Verification list, the
domain will also appear in the chosen project. A member in this project with
[at least the Maintainer role](../permissions.md#project-members-permissions)
can modify or remove the domain verification.
If needed, you can create a new project to set up domain verification directly
under your top-level group. This limits the ability to modify the domain verification
to members with at least the Maintainer role, because these users are able to set up a domain and therefore allow the group's enterprise users to update their email to match that domain.
For more information on group-level domain verification, see [epic 5299](https://gitlab.com/groups/gitlab-org/-/epics/5299).
#### 1. Add a custom domain for the matching email domain
The custom domain must match the email domain exactly. For example, if your email is `username@example.com`, verify the `example.com` domain.
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
1. In the upper-right corner, select **Add Domain**.
1. In **Domain**, enter the domain name.
1. In **Project**, link to a project.
1. In **Certificate**:
- If you do not have or do not want to use an SSL certificate, leave **Automatic certificate management using Let's
Encrypt** selected.
- Optional. Turn on the **Manually enter certificate information** toggle to add an SSL/TLS certificate. You can also
add the certificate and key later.
1. Select **Add Domain**.
{{< alert type="note" >}}
A valid certificate is not required for domain verification. You can ignore error messages regarding the certificate if you are not using GitLab Pages.
{{< /alert >}}
#### 2. Get a verification code
After you create a new domain, the verification code prompts you. Copy the values from GitLab
and paste them in your domain's control panel as a `TXT` record.

#### 3. Verify the domain's ownership
After you have added all the DNS records:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Domain Verification**.
1. On the domain table row, Select **Retry verification** ({{< icon name="retry" >}}).

{{< alert type="warning" >}}
For GitLab instances with domain verification enabled, if the domain cannot be verified for 7 days, that domain is removed from the GitLab project.
{{< /alert >}}
{{< alert type="note" >}}
- Domain verification is **required for GitLab.com users** to be marked as enterprise users.
- [DNS propagation can take up to 24 hours](https://www.inmotionhosting.com/support/domain-names/dns-nameserver-changes/complete-guide-to-dns-records/), although it's usually a couple of minutes to complete. Until it completes, the domain shows as unverified.
- Once your domain has been verified, leave the verification record in place. Your domain is periodically reverified, and may be disabled if the record is removed.
- A valid certificate is not required for domain verification.
{{< /alert >}}
### View domains in group
To view all configured domains in your group:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
You then see:
- A list of added domains.
- The domains' status of **Verified** or **Unverified**.
- The project where the domain has been configured.
### Manage domains in group
To edit or remove a domain:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Domain Verification**.
1. When viewing **Domain Verification**, select the project listed next to the relevant domain.
1. Edit or remove a domain following the relevant [GitLab Pages custom domains](../project/pages/custom_domains_ssl_tls_certification/_index.md) instructions.
## Manage enterprise users
In addition to the standard [group member permissions](../permissions.md#group-members-permissions),
Owners of a top-level group can also manage enterprise users in their group.
You can also [use the API](../../api/group_enterprise_users.md) to interact with enterprise users.
### Restrict authentication methods
You can restrict the specific authentication methods available to enterprise users, which can help
reduce the security footprint of your users.
- [Disable password authentication](../group/saml_sso/_index.md#disable-password-authentication-for-enterprise-users).
- [Disable personal access tokens](../../user/profile/personal_access_tokens.md#disable-personal-access-tokens-for-enterprise-users).
- [Disable two-factor authentication](../../security/two_factor_authentication.md#enterprise-users).
### Restrict group and project creation
You can restrict group and project creation for enterprise users, which helps you define:
- If enterprise users can create top-level groups.
- The maximum number of personal projects each enterprise user can create.
These restrictions are defined in the SAML response. For more information, see
[configure enterprise user settings from the SAML response](../group/saml_sso/_index.md#configure-enterprise-user-settings-from-saml-response).
### Bypass email confirmation for provisioned users
By default, users provisioned with SAML or SCIM are sent a verification email to verify their
identity. Instead, you can configure GitLab with a custom domain and GitLab automatically
confirms user accounts. Users still receive an enterprise user welcome email.
For more information, see [bypass user email confirmation with verified domains](../group/saml_sso/_index.md#bypass-user-email-confirmation-with-verified-domains).
### View the email addresses for an enterprise user
Prerequisites:
- You must have the Owner role for a top-level group.
To view an enterprise user's email address:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Members**.
1. Hover over the enterprise user's name.
You can also use the [group and project members API](../../api/members.md)
to access users' information. For enterprise users of the group, this information
includes users' email addresses.
### Change the email addresses for an enterprise user
Enterprise users can follow the same process as other GitLab users to
[change their primary email address](../../user/profile/_index.md#change-your-primary-email).
The new email address must be from a verified domain. If your organization has no verified
domains, your enterprise users cannot change their primary email address.
Only GitLab support can change the primary email address to an email address from a
non-verified domain. This action [releases the enterprise user](#release-an-enterprise-user).
### Release an enterprise user
You can remove enterprise management features from a user account. Removing an enterprise user might be required if, for
example, a user wants to keep their GitLab account after leaving their company. Releasing a user
does not alter their account roles or permissions, but removes the management options
for the group Owner.
To release the user, GitLab support must update the user's primary email address to an
email address from a non-verified domain. This action automatically releases the account.
Allowing group Owners to change primary emails is proposed in
[issue 412966](https://gitlab.com/gitlab-org/gitlab/-/issues/412966).
### Enable the extension marketplace for the Web IDE and workspaces
{{< details >}}
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161819) as a [beta](../../policy/development_stages_support.md#beta) in GitLab 17.4 [with flags](../../administration/feature_flags/_index.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default.
- `web_ide_oauth` [enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163181) in GitLab 17.4.
- `web_ide_extensions_marketplace` [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.4.
- `web_ide_oauth` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167464) in GitLab 17.5.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/508996) the `vscode_extension_marketplace_settings` [feature flag](../../administration/feature_flags/_index.md) in GitLab 17.10. Disabled by default.
- `web_ide_extensions_marketplace` [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184662), and `vscode_extension_marketplace_settings` [enabled on GitLab.com and GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184662) in GitLab 17.11.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/192659) in GitLab 18.1. Feature flags `web_ide_extensions_marketplace` and `vscode_extension_marketplace_settings` removed.
{{< /history >}}
Prerequisites:
- An administrator must [enable the extension marketplace](../../administration/settings/vscode_extension_marketplace.md).
- You must have the Owner role for a top-level group.
To enable the extension marketplace for the [Web IDE](../project/web_ide/_index.md) and [workspaces](../workspace/_index.md):
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **Web IDE and workspaces**, select the **Enable extension marketplace** checkbox.
1. Select **Save changes**.
## Troubleshooting
### Cannot disable two-factor authentication for an enterprise user
If a user does not have an **Enterprise** badge, a group Owner cannot disable or reset 2FA for their
account. Instead, the Owner should tell the enterprise user to consider available
[recovery options](../profile/account/two_factor_authentication_troubleshooting.md#recovery-options-and-2fa-reset).
|
https://docs.gitlab.com/user/abilities
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/abilities.md
|
2025-08-13
|
doc/user/custom_roles
|
[
"doc",
"user",
"custom_roles"
] |
abilities.md
|
Software Supply Chain Security
|
Authorization
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Custom permissions
| null |
<!--
This documentation is auto generated by a Rake task.
Please do not edit this file directly. To update this file, run:
bundle exec rake gitlab:custom_roles:compile_docs
To make changes to the output of the Rake task,
edit `tooling/custom_roles/docs/templates/custom_abilities.md.erb`.
-->
{{< history >}}
- Custom admin roles [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181346) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `custom_admin_roles`. Disabled by default.
{{< /history >}}
You can create a [custom role](_index.md) by adding one or more custom permissions to a base role.
{{< alert type="note" >}}
Some permissions depend on other permissions.
For example, the `admin_vulnerability` permission requires you to also include the `read_vulnerability` permission.
Any dependencies are noted in the `Description` column for each permission.
{{< /alert >}}
## Admin
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| View CI/CD | Read CI/CD details for runners and jobs in the Admin Area. | [`read_admin_cicd`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177233) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507960) |
| View Groups | Read group details in the Admin Area. | [`read_admin_groups`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197777) | Instance | GitLab [18.3](https://gitlab.com/gitlab-org/gitlab/-/issues/534449) |
| View Projects | Read project details in the Admin Area. | [`read_admin_projects`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197777) | Instance | GitLab [18.3](https://gitlab.com/gitlab-org/gitlab/-/issues/534449) |
| View subscription details | Read subscription details in the Admin area. | [`read_admin_subscription`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178230) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507961) |
| View system monitoring | Read system information such as background migrations, health checks, and Gitaly in the Admin Area. | [`read_admin_monitoring`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179439) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507959) |
| View users | Read the user list and user details in the Admin area. | [`read_admin_users`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177514) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/508782) |
## Code review workflow
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage merge request approvals and settings | Configure merge request settings at the group or project level. Group actions include managing merge checks and approval settings. Project actions include managing MR configurations, approval rules and settings, and branch targets. In order to enable Suggested reviewers, the "Manage project access tokens" custom permission needs to be enabled. | [`manage_merge_request_settings`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151586) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/443235) |
## Compliance management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage and assign compliance frameworks | Create, read, update, and delete compliance frameworks. Users with this permission can also assign a compliance framework label to a project, and set the default framework of a group. | [`admin_compliance_framework`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144183) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/411502) |
| Read compliance dashboard | Read compliance capabilities including adherence, violations, and frameworks for groups and projects. | [`read_compliance_dashboard`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175066) | Group,<br> Project | GitLab [17.7](https://gitlab.com/gitlab-org/gitlab/-/issues/465324) |
## Continuous delivery
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage deploy tokens | Manage deploy tokens at the group or project level. | [`manage_deploy_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151677) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/448843) |
| Manage Protected Environments | Create, read, update, and delete protected environments | [`admin_protected_environments`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178283) | Group,<br> Project | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/471385) |
## Groups and projects
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Archive project | Allows archiving of projects. | [`archive_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134998) | Project | GitLab [16.6](https://gitlab.com/gitlab-org/gitlab/-/issues/425957) |
| Delete group | Ability to delete or restore a group. This ability does not allow deleting top-level groups. Review the Retention period settings to prevent accidental deletion. | [`remove_group`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145166) | Group | GitLab [16.10](https://gitlab.com/gitlab-org/gitlab/-/issues/425962) |
| Delete project | Allows deletion of projects. | [`remove_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139696) | Project | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/425959) |
| Manage group members | Add or remove users in a group, and assign roles to users. When assigning a role, users with this custom permission must select a role that has the same or fewer permissions as the default role used as the base for their custom role. | [`admin_group_member`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131914) | Group | GitLab [16.5](https://gitlab.com/gitlab-org/gitlab/-/issues/17364) |
## Infrastructure as code
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage Terraform state | Execute terraform commands, lock/unlock terraform state files, and remove file versions. | [`admin_terraform_state`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140759) | Project | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/421789) |
## Integrations
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage integrations | Create, read, update, and delete integrations with external applications. | [`admin_integrations`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154601) | Group,<br> Project | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/460522) |
## Runner
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage runners | Create, view, edit, and delete group or project Runners. Includes configuring Runner settings. | [`admin_runners`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151825) | Group,<br> Project | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/442851) |
| View runners | Allows read-only access to group or project runners, including the runner fleet dashboard. | [`read_runners`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/156798) | Group,<br> Project | GitLab [17.2](https://gitlab.com/gitlab-org/gitlab/-/issues/468202) |
## Secrets management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage CI/CD variables | Create, read, update, and delete CI/CD variables. | [`admin_cicd_variables`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/143369) | Group,<br> Project | GitLab [16.10](https://gitlab.com/gitlab-org/gitlab/-/issues/437947) |
## Security policy management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Link to a security policy project | Allows linking security policy projects. | [`manage_security_policy_link`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148371) | Group,<br> Project | GitLab [16.11](https://gitlab.com/gitlab-org/gitlab/-/issues/440226) |
## Source code management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Approve merge request | Allows approval of merge requests. | [`admin_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128302) | Project | GitLab [16.4](https://gitlab.com/gitlab-org/gitlab/-/issues/412708) |
| Manage Protected Branches | Create, read, update, and delete protected branches for a project. | [`admin_protected_branch`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162208) | Project | GitLab [17.4](https://gitlab.com/gitlab-org/gitlab/-/issues/448823) |
| Manage push rules | Configure push rules for repositories at the group or project level. | [`admin_push_rules`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147872) | Group,<br> Project | GitLab [16.11](https://gitlab.com/gitlab-org/gitlab/-/issues/421786) |
| View repository code | Allows read-only access to the source code in the user interface. Does not allow users to edit or download repository archives, clone or pull repositories, view source code in an IDE, or view merge requests for private projects. You can download individual files because read-only access inherently grants the ability to make a local copy of the file. | [`read_code`](https://gitlab.com/gitlab-org/gitlab/-/issues/376180) | Group,<br> Project | GitLab [15.7](https://gitlab.com/gitlab-org/gitlab/-/issues/20277) |
## System access
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage group access tokens | Create, read, update, and delete group access tokens. When creating a token, users with this custom permission must select a role for that token that has the same or fewer permissions as the default role used as the base for the custom role. | [`manage_group_access_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140115) | Group | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/428353) |
| Manage project access tokens | Create, read, update, and delete project access tokens. When creating a token, users with this custom permission must select a role for that token that has the same or fewer permissions as the default role used as the base for the custom role. | [`manage_project_access_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132342) | Project | GitLab [16.5](https://gitlab.com/gitlab-org/gitlab/-/issues/421778) |
## Team planning
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| View CRM contact | Read CRM contact. | [`read_crm_contact`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154017) | Group | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/443268) |
## Vulnerability management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage vulnerabilities | Edit the status, linked issue, and severity of a vulnerability object. Also requires the `read_vulnerability` permission. | [`admin_vulnerability`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121534) | Group,<br> Project | GitLab [16.1](https://gitlab.com/gitlab-org/gitlab/-/issues/412536) |
| View dependency list | Allows read-only access to the dependencies and licenses. | [`read_dependency`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126247) | Group,<br> Project | GitLab [16.3](https://gitlab.com/gitlab-org/gitlab/-/issues/415255) |
| View vulnerability reports and dashboards | Read vulnerability reports and security dashboards. | [`read_vulnerability`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120704) | Group,<br> Project | GitLab [16.1](https://gitlab.com/gitlab-org/gitlab/-/issues/399119) |
## Webhooks
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage web hooks | Manage webhooks | [`admin_web_hook`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151551) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/quality/triage-ops/-/issues/1373) |
|
---
stage: Software Supply Chain Security
group: Authorization
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Custom permissions
breadcrumbs:
- doc
- user
- custom_roles
---
<!--
This documentation is auto generated by a Rake task.
Please do not edit this file directly. To update this file, run:
bundle exec rake gitlab:custom_roles:compile_docs
To make changes to the output of the Rake task,
edit `tooling/custom_roles/docs/templates/custom_abilities.md.erb`.
-->
{{< history >}}
- Custom admin roles [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181346) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `custom_admin_roles`. Disabled by default.
{{< /history >}}
You can create a [custom role](_index.md) by adding one or more custom permissions to a base role.
{{< alert type="note" >}}
Some permissions depend on other permissions.
For example, the `admin_vulnerability` permission requires you to also include the `read_vulnerability` permission.
Any dependencies are noted in the `Description` column for each permission.
{{< /alert >}}
## Admin
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| View CI/CD | Read CI/CD details for runners and jobs in the Admin Area. | [`read_admin_cicd`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177233) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507960) |
| View Groups | Read group details in the Admin Area. | [`read_admin_groups`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197777) | Instance | GitLab [18.3](https://gitlab.com/gitlab-org/gitlab/-/issues/534449) |
| View Projects | Read project details in the Admin Area. | [`read_admin_projects`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197777) | Instance | GitLab [18.3](https://gitlab.com/gitlab-org/gitlab/-/issues/534449) |
| View subscription details | Read subscription details in the Admin area. | [`read_admin_subscription`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178230) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507961) |
| View system monitoring | Read system information such as background migrations, health checks, and Gitaly in the Admin Area. | [`read_admin_monitoring`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179439) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/507959) |
| View users | Read the user list and user details in the Admin area. | [`read_admin_users`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177514) | Instance | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/508782) |
## Code review workflow
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage merge request approvals and settings | Configure merge request settings at the group or project level. Group actions include managing merge checks and approval settings. Project actions include managing MR configurations, approval rules and settings, and branch targets. In order to enable Suggested reviewers, the "Manage project access tokens" custom permission needs to be enabled. | [`manage_merge_request_settings`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151586) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/443235) |
## Compliance management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage and assign compliance frameworks | Create, read, update, and delete compliance frameworks. Users with this permission can also assign a compliance framework label to a project, and set the default framework of a group. | [`admin_compliance_framework`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144183) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/411502) |
| Read compliance dashboard | Read compliance capabilities including adherence, violations, and frameworks for groups and projects. | [`read_compliance_dashboard`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175066) | Group,<br> Project | GitLab [17.7](https://gitlab.com/gitlab-org/gitlab/-/issues/465324) |
## Continuous delivery
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage deploy tokens | Manage deploy tokens at the group or project level. | [`manage_deploy_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151677) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/448843) |
| Manage Protected Environments | Create, read, update, and delete protected environments | [`admin_protected_environments`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178283) | Group,<br> Project | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/471385) |
## Groups and projects
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Archive project | Allows archiving of projects. | [`archive_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134998) | Project | GitLab [16.6](https://gitlab.com/gitlab-org/gitlab/-/issues/425957) |
| Delete group | Ability to delete or restore a group. This ability does not allow deleting top-level groups. Review the Retention period settings to prevent accidental deletion. | [`remove_group`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145166) | Group | GitLab [16.10](https://gitlab.com/gitlab-org/gitlab/-/issues/425962) |
| Delete project | Allows deletion of projects. | [`remove_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139696) | Project | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/425959) |
| Manage group members | Add or remove users in a group, and assign roles to users. When assigning a role, users with this custom permission must select a role that has the same or fewer permissions as the default role used as the base for their custom role. | [`admin_group_member`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131914) | Group | GitLab [16.5](https://gitlab.com/gitlab-org/gitlab/-/issues/17364) |
## Infrastructure as code
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage Terraform state | Execute terraform commands, lock/unlock terraform state files, and remove file versions. | [`admin_terraform_state`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140759) | Project | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/421789) |
## Integrations
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage integrations | Create, read, update, and delete integrations with external applications. | [`admin_integrations`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154601) | Group,<br> Project | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/460522) |
## Runner
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage runners | Create, view, edit, and delete group or project Runners. Includes configuring Runner settings. | [`admin_runners`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151825) | Group,<br> Project | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/442851) |
| View runners | Allows read-only access to group or project runners, including the runner fleet dashboard. | [`read_runners`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/156798) | Group,<br> Project | GitLab [17.2](https://gitlab.com/gitlab-org/gitlab/-/issues/468202) |
## Secrets management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage CI/CD variables | Create, read, update, and delete CI/CD variables. | [`admin_cicd_variables`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/143369) | Group,<br> Project | GitLab [16.10](https://gitlab.com/gitlab-org/gitlab/-/issues/437947) |
## Security policy management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Link to a security policy project | Allows linking security policy projects. | [`manage_security_policy_link`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148371) | Group,<br> Project | GitLab [16.11](https://gitlab.com/gitlab-org/gitlab/-/issues/440226) |
## Source code management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Approve merge request | Allows approval of merge requests. | [`admin_merge_request`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128302) | Project | GitLab [16.4](https://gitlab.com/gitlab-org/gitlab/-/issues/412708) |
| Manage Protected Branches | Create, read, update, and delete protected branches for a project. | [`admin_protected_branch`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162208) | Project | GitLab [17.4](https://gitlab.com/gitlab-org/gitlab/-/issues/448823) |
| Manage push rules | Configure push rules for repositories at the group or project level. | [`admin_push_rules`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147872) | Group,<br> Project | GitLab [16.11](https://gitlab.com/gitlab-org/gitlab/-/issues/421786) |
| View repository code | Allows read-only access to the source code in the user interface. Does not allow users to edit or download repository archives, clone or pull repositories, view source code in an IDE, or view merge requests for private projects. You can download individual files because read-only access inherently grants the ability to make a local copy of the file. | [`read_code`](https://gitlab.com/gitlab-org/gitlab/-/issues/376180) | Group,<br> Project | GitLab [15.7](https://gitlab.com/gitlab-org/gitlab/-/issues/20277) |
## System access
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage group access tokens | Create, read, update, and delete group access tokens. When creating a token, users with this custom permission must select a role for that token that has the same or fewer permissions as the default role used as the base for the custom role. | [`manage_group_access_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140115) | Group | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/428353) |
| Manage project access tokens | Create, read, update, and delete project access tokens. When creating a token, users with this custom permission must select a role for that token that has the same or fewer permissions as the default role used as the base for the custom role. | [`manage_project_access_tokens`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132342) | Project | GitLab [16.5](https://gitlab.com/gitlab-org/gitlab/-/issues/421778) |
## Team planning
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| View CRM contact | Read CRM contact. | [`read_crm_contact`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154017) | Group | GitLab [17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/443268) |
## Vulnerability management
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage vulnerabilities | Edit the status, linked issue, and severity of a vulnerability object. Also requires the `read_vulnerability` permission. | [`admin_vulnerability`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121534) | Group,<br> Project | GitLab [16.1](https://gitlab.com/gitlab-org/gitlab/-/issues/412536) |
| View dependency list | Allows read-only access to the dependencies and licenses. | [`read_dependency`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126247) | Group,<br> Project | GitLab [16.3](https://gitlab.com/gitlab-org/gitlab/-/issues/415255) |
| View vulnerability reports and dashboards | Read vulnerability reports and security dashboards. | [`read_vulnerability`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120704) | Group,<br> Project | GitLab [16.1](https://gitlab.com/gitlab-org/gitlab/-/issues/399119) |
## Webhooks
| Permission | Description | API Attribute | Scope | Introduced |
|:-----------|:------------|:--------------|:------|:-----------|
| Manage web hooks | Manage webhooks | [`admin_web_hook`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151551) | Group,<br> Project | GitLab [17.0](https://gitlab.com/gitlab-org/quality/triage-ops/-/issues/1373) |
|
https://docs.gitlab.com/user/custom_roles
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/custom_roles
|
[
"doc",
"user",
"custom_roles"
] |
_index.md
|
Software Supply Chain Security
|
Authorization
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Custom roles
| null |
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Custom roles feature introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106256) in GitLab 15.7 [with a flag](../../administration/feature_flags/_index.md) named `customizable_roles`.
- [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110810) in GitLab 15.9.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114524) in GitLab 15.10.
- Ability to create and remove a custom role with the UI [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393235) in GitLab 16.4.
- Ability to use the UI to add a user to your group with a custom role, change a user's custom role, or remove a custom role from a group member [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393239) in GitLab 16.7.
- Ability to create and remove an instance-wide custom role on GitLab Self-Managed [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141562) in GitLab 16.9.
- Custom admin roles [introduced](https://gitlab.com/groups/gitlab-org/-/epics/15854) as an [experiment](../../policy/development_stages_support.md) in GitLab 17.7 [with a flag](../../administration/feature_flags/_index.md) named `custom_ability_read_admin_dashboard`.
- Ability to manage custom admin roles with the UI [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181346) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `custom_admin_roles`. Disabled by default.
{{< /history >}}
Custom roles allow you to create roles with only the specific [custom permissions](abilities.md)
required by your organization. Each custom role is based on an existing default role. For example,
you might create a custom role based on the Guest role, but also include permission to view code
in a project repository.
There are two types of custom roles:
- Custom member roles:
- Can be assigned to members of a group or project.
- Gains the same permissions in any subgroups or projects. For more information, see [membership types](../../user/project/members/_index.md#membership-types).
- [Uses a seat](../../subscriptions/manage_users_and_seats.md#gitlabcom-billing-and-usage) and becomes a [billable user](../../subscriptions/manage_users_and_seats.md#billable-users).
- A custom Guest member role that includes only the `read_code` permission does not use a seat.
- Custom admin roles:
- Can be assigned to any user on the instance.
- Gains permissions to perform specific admin actions.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demo of the custom roles feature, see [[Demo] Ultimate Guest can view code on private repositories via custom role](https://www.youtube.com/watch?v=46cp_-Rtxps).
<!-- Video published on 2023-02-13 -->
## Create a custom member role
To create a custom member role, you select a default GitLab role and add additional [permissions](abilities.md).
The base role defines the minimum permissions available to the custom role. You cannot use
[auditor](../../administration/auditor_users.md) as a base role.
Custom permissions can allow actions typically restricted to the Maintainer or Owner role. For
example, a custom role with permission to manage CI/CD variables also allows manangement of CI/CD
variables added by other Maintainers or Owners.
Custom member roles are available to groups and projects:
- On GitLab.com, under the top-level group where the custom role was created.
- On GitLab Self-Managed and GitLab Dedicated, in the entire instance.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
- You must have fewer than 10 custom roles.
To create a custom member role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Select **New role**.
1. GitLab Self-Managed and GitLab Dedicated instances only. Select **Member role**.
1. Enter a name and description for the custom role.
1. From the **Base role** dropdown list, select a default role.
1. Select any permissions for the custom role.
1. Select **Create role**.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberrolecreate) to create a custom role.
## Create a custom admin role
To create a custom admin role, you add [permissions](abilities.md) that allow actions typically
limited to administrators. Each custom admin role can have one or more permissions.
Prerequisites:
- You must have administrator access to the instance.
- You must have fewer than 10 custom roles.
To create a custom admin role:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Select **New role**.
1. Select **Admin role**.
1. Enter a name and description for the custom role.
1. Select any permissions for the custom role.
1. Select **Create role**.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroleadmincreate) to create a custom role.
## Edit a custom role
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/437590) in GitLab 17.0.
{{< /history >}}
You can edit the name, description, and permissions of a custom role, but you cannot edit the
base role. If you need to change the base role, you must create a new custom role.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To edit a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Edit role**.
1. Modify the role.
1. Select **Save role**.
You can also use the API to edit a [custom member role](../../api/graphql/reference/_index.md#mutationmemberroleupdate) or a [custom admin role](../../api/graphql/reference/_index.md#mutationmemberroleadminupdate).
## View details of a custom role
The **Roles and permissions** page lists basic information about all available default and custom roles. This
includes information like the name, description, and number of users assigned each custom role. Each custom role
includes either a `Custom member role` or `Custom admin role` badge.
You can also view more detailed information about a custom role including the role ID,
base role, and specific permissions.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To view details of a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **View details**.
## Delete a custom role
You cannot delete custom roles that are still assigned to a user. See [assign a custom role to a user](#assign-a-custom-member-role).
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To delete a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Delete role**.
1. On the confirmation dialog, select **Delete role**.
You can also use the API to delete a [custom member role](../../api/graphql/reference/_index.md#mutationmemberroledelete) or a [custom admin role](../../api/graphql/reference/_index.md#mutationmemberroleadmindelete).
## Assign a custom member role
You can assign or modify roles for members of your groups and projects. You can do this for existing users or when you add a user to a
[group](../group/_index.md#add-users-to-a-group),
[project](../project/members/_index.md#add-users-to-a-project),
or [instance](../profile/account/create_accounts.md).
Prerequisites:
- For groups, you must have the Owner role for the group.
- For projects, you must have at least the Maintainer role for the project.
To assign a custom member role to an existing user:
1. On the left sidebar, select **Search or go to** and find your group or project.
1. Select **Manage > Members**.
1. In the **Role** column, select the role for an existing member. The **Role details** drawer opens.
1. From the **Role** dropdown list, select a role to assign to the member.
1. Select **Update role** to assign the role.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroletouserassign) to assign or modify custom role assignments.
## Assign a custom admin role
You can assign or modify admin roles to users in your instance. You can do this for existing users or when you add a user to the [instance](../profile/account/create_accounts.md).
Prerequisites:
- You must be an administrator for the GitLab Self-Managed instance.
To assign a custom admin role to an existing user:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Overview > Users**.
1. Select **Edit** for a user.
1. In the **Access** section, set the access level to either **Regular** or **Auditor**.
1. From the **Admin area** dropdown list, select a custom admin role.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroletouserassign) to assign or modify custom role assignments.
## Assign a custom role to an invited group
{{< history >}}
- Support for custom roles for invited groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443369) in GitLab 17.4 behind a feature flag named `assign_custom_roles_to_group_links_sm`. Disabled by default.
- [Enabled on GitLab Self-Managed and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/471999) in GitLab 17.4.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
When you [invite a group to a group](../project/members/sharing_projects_groups.md#invite-a-group-to-a-group)
you can assign a custom role to every user in the group.
The assigned role is compared to user roles and permissions in their original group. Generally,
users are assigned the role with the smallest access level. However, if users
have a custom role in their original group:
- Only the base role is used for access level comparisons. Custom permissions are not compared.
- If the custom roles both have the same base role, users keep their custom role from the original group.
The following table provides examples of the maximum role available to users invited to a group:
| Scenario | User with Guest role | User with Guest role + `read_code` | User with Guest role + `read_vulnerability` | User with Developer role | User with Developer role + `admin_vulnerability` |
| ------------------------------------------------------- | -------------------- | ---------------------------------- | ------------------------------------------- | ---------------------------- | ------------------------------------------------ |
| **Invited with Guest role** | Guest | Guest | Guest | Guest | Guest |
| **Invited with Guest role + `read_code`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Guest + `read_code` | Guest + `read_code` |
| **Invited with Guest role + `read_vulnerability`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Guest + `read_vulnerability` | Guest + `read_vulnerability` |
| **Invited with Developer role** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Developer | Developer |
| **Invited with Developer role + `admin_vulnerability`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Developer | Developer + `admin_vulnerability` |
You can only assign custom roles when you invite a group to another group. [Issue 468329](https://gitlab.com/gitlab-org/gitlab/-/issues/468329) proposes to assign a custom role when inviting a group to a project.
## Supported objects
You can assign custom roles and permissions to the following:
| Object | Version | Issue |
|--------|---------------|-------|
| Users | 15.9 | Released |
| Groups | 17.7 | Partially supported. Further support for group assignment in projects is proposed in [Issue 468329](https://gitlab.com/gitlab-org/gitlab/-/issues/468329) |
| Tokens | Not supported | [Issue 434354](https://gitlab.com/gitlab-org/gitlab/-/issues/434354) |
## Sync users to custom roles
If you use tools like SAML or LDAP to manage your group membership, you can automatically sync your
users to custom roles. For more information, see:
- [Configure SAML Group Links](../group/saml_sso/group_sync.md#configure-saml-group-links).
- [Manage group memberships via LDAP](../group/access_and_permissions.md#manage-group-memberships-with-ldap).
## Sync LDAP groups to admin roles
You can link a custom admin role to an LDAP group. This link assigns the custom admin role to all users in the group.
If a user belongs to multiple LDAP groups with different assigned custom admin roles, GitLab assigns the role associated with whichever LDAP link was created earlier. For example, if a user is a member of the LDAP groups `owner` and `dev`. If the `owner` group was linked to a custom admin role before the `dev` group, the user would be assigned the role associated with the `owner` group.
For more information on the administration of LDAP and group sync, see [LDAP synchronization](../../administration/auth/ldap/ldap_synchronization.md#group-sync).
{{< alert type="note" >}}
If an LDAP user with a custom admin role is removed from the LDAP group after configuring a sync, the custom role is not removed until the next sync.
{{< /alert >}}
### Link a custom admin role with an LDAP CN
Prerequisites:
- You must have integrated an LDAP server with your instance.
To link a custom admin role with an LDAP CN:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. On the **LDAP Synchronization** tab, select an **LDAP Server**.
1. In the **Sync method** field, select `Group cn`.
1. In the **Group cn** field, begin typing the CN of the group. A dropdown list appears with matching CNs in the configured `group_base`.
1. From the dropdown list, select your CN.
1. In the **Custom admin role** field, select a custom admin role.
1. Select **Add**.
GitLab begins linking the role to any matching LDAP users. This process may take over an hour to complete.
### Link a custom admin role with an LDAP filter
Prerequisites:
- You must have integrated an LDAP server with your instance.
To link a custom admin role with an LDAP filter:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. On the **LDAP Synchronization** tab, select an **LDAP Server**.
1. In the **Sync method** field, select `User filter`.
1. In **User filter** box, enter a filter. For details, see [Set up LDAP user filter](../../administration/auth/ldap/_index.md#set-up-ldap-user-filter).
1. In the **Custom admin role** field, select a custom admin role.
1. Select **Add**.
GitLab begins linking the role to any matching LDAP users. This process may take over an hour to complete.
## Contribute new permissions
If a permission does not exist, you can:
- Discuss individual custom role and permission requests in [issue 391760](https://gitlab.com/gitlab-org/gitlab/-/issues/391760).
- Create an issue to request the permission with the [permission proposal issue template](https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Permission%2520Proposal).
- Contribute to GitLab and add the permission.
|
---
stage: Software Supply Chain Security
group: Authorization
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Custom roles
breadcrumbs:
- doc
- user
- custom_roles
---
{{< details >}}
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Custom roles feature introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106256) in GitLab 15.7 [with a flag](../../administration/feature_flags/_index.md) named `customizable_roles`.
- [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110810) in GitLab 15.9.
- [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114524) in GitLab 15.10.
- Ability to create and remove a custom role with the UI [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393235) in GitLab 16.4.
- Ability to use the UI to add a user to your group with a custom role, change a user's custom role, or remove a custom role from a group member [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393239) in GitLab 16.7.
- Ability to create and remove an instance-wide custom role on GitLab Self-Managed [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141562) in GitLab 16.9.
- Custom admin roles [introduced](https://gitlab.com/groups/gitlab-org/-/epics/15854) as an [experiment](../../policy/development_stages_support.md) in GitLab 17.7 [with a flag](../../administration/feature_flags/_index.md) named `custom_ability_read_admin_dashboard`.
- Ability to manage custom admin roles with the UI [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181346) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `custom_admin_roles`. Disabled by default.
{{< /history >}}
Custom roles allow you to create roles with only the specific [custom permissions](abilities.md)
required by your organization. Each custom role is based on an existing default role. For example,
you might create a custom role based on the Guest role, but also include permission to view code
in a project repository.
There are two types of custom roles:
- Custom member roles:
- Can be assigned to members of a group or project.
- Gains the same permissions in any subgroups or projects. For more information, see [membership types](../../user/project/members/_index.md#membership-types).
- [Uses a seat](../../subscriptions/manage_users_and_seats.md#gitlabcom-billing-and-usage) and becomes a [billable user](../../subscriptions/manage_users_and_seats.md#billable-users).
- A custom Guest member role that includes only the `read_code` permission does not use a seat.
- Custom admin roles:
- Can be assigned to any user on the instance.
- Gains permissions to perform specific admin actions.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demo of the custom roles feature, see [[Demo] Ultimate Guest can view code on private repositories via custom role](https://www.youtube.com/watch?v=46cp_-Rtxps).
<!-- Video published on 2023-02-13 -->
## Create a custom member role
To create a custom member role, you select a default GitLab role and add additional [permissions](abilities.md).
The base role defines the minimum permissions available to the custom role. You cannot use
[auditor](../../administration/auditor_users.md) as a base role.
Custom permissions can allow actions typically restricted to the Maintainer or Owner role. For
example, a custom role with permission to manage CI/CD variables also allows manangement of CI/CD
variables added by other Maintainers or Owners.
Custom member roles are available to groups and projects:
- On GitLab.com, under the top-level group where the custom role was created.
- On GitLab Self-Managed and GitLab Dedicated, in the entire instance.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
- You must have fewer than 10 custom roles.
To create a custom member role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Select **New role**.
1. GitLab Self-Managed and GitLab Dedicated instances only. Select **Member role**.
1. Enter a name and description for the custom role.
1. From the **Base role** dropdown list, select a default role.
1. Select any permissions for the custom role.
1. Select **Create role**.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberrolecreate) to create a custom role.
## Create a custom admin role
To create a custom admin role, you add [permissions](abilities.md) that allow actions typically
limited to administrators. Each custom admin role can have one or more permissions.
Prerequisites:
- You must have administrator access to the instance.
- You must have fewer than 10 custom roles.
To create a custom admin role:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Select **New role**.
1. Select **Admin role**.
1. Enter a name and description for the custom role.
1. Select any permissions for the custom role.
1. Select **Create role**.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroleadmincreate) to create a custom role.
## Edit a custom role
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/437590) in GitLab 17.0.
{{< /history >}}
You can edit the name, description, and permissions of a custom role, but you cannot edit the
base role. If you need to change the base role, you must create a new custom role.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To edit a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Edit role**.
1. Modify the role.
1. Select **Save role**.
You can also use the API to edit a [custom member role](../../api/graphql/reference/_index.md#mutationmemberroleupdate) or a [custom admin role](../../api/graphql/reference/_index.md#mutationmemberroleadminupdate).
## View details of a custom role
The **Roles and permissions** page lists basic information about all available default and custom roles. This
includes information like the name, description, and number of users assigned each custom role. Each custom role
includes either a `Custom member role` or `Custom admin role` badge.
You can also view more detailed information about a custom role including the role ID,
base role, and specific permissions.
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To view details of a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **View details**.
## Delete a custom role
You cannot delete custom roles that are still assigned to a user. See [assign a custom role to a user](#assign-a-custom-member-role).
Prerequisites:
- For GitLab.com, you must have the Owner role for the group.
- For GitLab Self-Managed and GitLab Dedicated, you must have administrator access to the instance.
To delete a custom role:
1. On the left sidebar:
- For GitLab.com, select **Search or go to** and find your group.
- For GitLab Self-Managed and GitLab Dedicated, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. Next to a custom role, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}) > **Delete role**.
1. On the confirmation dialog, select **Delete role**.
You can also use the API to delete a [custom member role](../../api/graphql/reference/_index.md#mutationmemberroledelete) or a [custom admin role](../../api/graphql/reference/_index.md#mutationmemberroleadmindelete).
## Assign a custom member role
You can assign or modify roles for members of your groups and projects. You can do this for existing users or when you add a user to a
[group](../group/_index.md#add-users-to-a-group),
[project](../project/members/_index.md#add-users-to-a-project),
or [instance](../profile/account/create_accounts.md).
Prerequisites:
- For groups, you must have the Owner role for the group.
- For projects, you must have at least the Maintainer role for the project.
To assign a custom member role to an existing user:
1. On the left sidebar, select **Search or go to** and find your group or project.
1. Select **Manage > Members**.
1. In the **Role** column, select the role for an existing member. The **Role details** drawer opens.
1. From the **Role** dropdown list, select a role to assign to the member.
1. Select **Update role** to assign the role.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroletouserassign) to assign or modify custom role assignments.
## Assign a custom admin role
You can assign or modify admin roles to users in your instance. You can do this for existing users or when you add a user to the [instance](../profile/account/create_accounts.md).
Prerequisites:
- You must be an administrator for the GitLab Self-Managed instance.
To assign a custom admin role to an existing user:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Overview > Users**.
1. Select **Edit** for a user.
1. In the **Access** section, set the access level to either **Regular** or **Auditor**.
1. From the **Admin area** dropdown list, select a custom admin role.
You can also [use the API](../../api/graphql/reference/_index.md#mutationmemberroletouserassign) to assign or modify custom role assignments.
## Assign a custom role to an invited group
{{< history >}}
- Support for custom roles for invited groups [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443369) in GitLab 17.4 behind a feature flag named `assign_custom_roles_to_group_links_sm`. Disabled by default.
- [Enabled on GitLab Self-Managed and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/471999) in GitLab 17.4.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
When you [invite a group to a group](../project/members/sharing_projects_groups.md#invite-a-group-to-a-group)
you can assign a custom role to every user in the group.
The assigned role is compared to user roles and permissions in their original group. Generally,
users are assigned the role with the smallest access level. However, if users
have a custom role in their original group:
- Only the base role is used for access level comparisons. Custom permissions are not compared.
- If the custom roles both have the same base role, users keep their custom role from the original group.
The following table provides examples of the maximum role available to users invited to a group:
| Scenario | User with Guest role | User with Guest role + `read_code` | User with Guest role + `read_vulnerability` | User with Developer role | User with Developer role + `admin_vulnerability` |
| ------------------------------------------------------- | -------------------- | ---------------------------------- | ------------------------------------------- | ---------------------------- | ------------------------------------------------ |
| **Invited with Guest role** | Guest | Guest | Guest | Guest | Guest |
| **Invited with Guest role + `read_code`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Guest + `read_code` | Guest + `read_code` |
| **Invited with Guest role + `read_vulnerability`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Guest + `read_vulnerability` | Guest + `read_vulnerability` |
| **Invited with Developer role** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Developer | Developer |
| **Invited with Developer role + `admin_vulnerability`** | Guest | Guest + `read_code` | Guest + `read_vulnerability` | Developer | Developer + `admin_vulnerability` |
You can only assign custom roles when you invite a group to another group. [Issue 468329](https://gitlab.com/gitlab-org/gitlab/-/issues/468329) proposes to assign a custom role when inviting a group to a project.
## Supported objects
You can assign custom roles and permissions to the following:
| Object | Version | Issue |
|--------|---------------|-------|
| Users | 15.9 | Released |
| Groups | 17.7 | Partially supported. Further support for group assignment in projects is proposed in [Issue 468329](https://gitlab.com/gitlab-org/gitlab/-/issues/468329) |
| Tokens | Not supported | [Issue 434354](https://gitlab.com/gitlab-org/gitlab/-/issues/434354) |
## Sync users to custom roles
If you use tools like SAML or LDAP to manage your group membership, you can automatically sync your
users to custom roles. For more information, see:
- [Configure SAML Group Links](../group/saml_sso/group_sync.md#configure-saml-group-links).
- [Manage group memberships via LDAP](../group/access_and_permissions.md#manage-group-memberships-with-ldap).
## Sync LDAP groups to admin roles
You can link a custom admin role to an LDAP group. This link assigns the custom admin role to all users in the group.
If a user belongs to multiple LDAP groups with different assigned custom admin roles, GitLab assigns the role associated with whichever LDAP link was created earlier. For example, if a user is a member of the LDAP groups `owner` and `dev`. If the `owner` group was linked to a custom admin role before the `dev` group, the user would be assigned the role associated with the `owner` group.
For more information on the administration of LDAP and group sync, see [LDAP synchronization](../../administration/auth/ldap/ldap_synchronization.md#group-sync).
{{< alert type="note" >}}
If an LDAP user with a custom admin role is removed from the LDAP group after configuring a sync, the custom role is not removed until the next sync.
{{< /alert >}}
### Link a custom admin role with an LDAP CN
Prerequisites:
- You must have integrated an LDAP server with your instance.
To link a custom admin role with an LDAP CN:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. On the **LDAP Synchronization** tab, select an **LDAP Server**.
1. In the **Sync method** field, select `Group cn`.
1. In the **Group cn** field, begin typing the CN of the group. A dropdown list appears with matching CNs in the configured `group_base`.
1. From the dropdown list, select your CN.
1. In the **Custom admin role** field, select a custom admin role.
1. Select **Add**.
GitLab begins linking the role to any matching LDAP users. This process may take over an hour to complete.
### Link a custom admin role with an LDAP filter
Prerequisites:
- You must have integrated an LDAP server with your instance.
To link a custom admin role with an LDAP filter:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > Roles and permissions**.
1. On the **LDAP Synchronization** tab, select an **LDAP Server**.
1. In the **Sync method** field, select `User filter`.
1. In **User filter** box, enter a filter. For details, see [Set up LDAP user filter](../../administration/auth/ldap/_index.md#set-up-ldap-user-filter).
1. In the **Custom admin role** field, select a custom admin role.
1. Select **Add**.
GitLab begins linking the role to any matching LDAP users. This process may take over an hour to complete.
## Contribute new permissions
If a permission does not exist, you can:
- Discuss individual custom role and permission requests in [issue 391760](https://gitlab.com/gitlab-org/gitlab/-/issues/391760).
- Create an issue to request the permission with the [permission proposal issue template](https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Permission%2520Proposal).
- Contribute to GitLab and add the permission.
|
https://docs.gitlab.com/user/turn_on_off
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/turn_on_off.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
turn_on_off.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Control GitLab Duo availability
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Core, Pro, or Enterprise
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Settings to turn AI features on and off introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
- [Settings to turn AI features on and off added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
{{< /history >}}
GitLab Duo is on by default when you [have a subscription](../../subscriptions/subscription-add-ons.md).
You can turn GitLab Duo on or off:
- On GitLab.com: For top-level groups, other groups or subgroups, and projects.
- On GitLab Self-Managed: For instances, groups or subgroups, and projects.
You can also turn GitLab Duo Core (a subset of GitLab Duo features) on or off.
## Turn GitLab Duo Core on or off
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/538857) in GitLab 18.0.
- GitLab availability settings, and group, subgroup, and project controls [added](https://gitlab.com/gitlab-org/gitlab/-/issues/551895) in GitLab 18.2.
{{< /history >}}
If you have [GitLab Duo Core](../../subscriptions/subscription-add-ons.md#gitlab-duo-core),
which is included with Premium and Ultimate subscriptions, GitLab Duo Chat and
Code Suggestions are available in your IDEs, and are turned on by default.
If you were an existing user with a Premium or Ultimate subscription before May 15, 2025,
when you upgrade to GitLab 18.0 or later, you have access to Chat and Code Suggestions in your IDEs,
but are turned off by default. However, you can turn them on.
### On GitLab.com
On GitLab.com, you can change availability for GitLab Duo Core for your top-level group (namespace).
Prerequisites:
- You must have the Owner role for the top-level group.
To change GitLab Duo Core availability:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this namespace**, select an option.
1. Under **GitLab Duo Core**, select or clear the **Turn on IDE features** checkbox.
If you selected **Always off** for GitLab Duo availability, you cannot access
this setting.
1. Select **Save changes**.
It might take up to 10 minutes for the change to take effect.
### On GitLab Self-Managed
On GitLab Self-Managed, you can change availability for GitLab Duo Core for your instance.
Prerequisites:
- You must be an administrator.
To change GitLab Duo Core availability:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this instance**, select an option.
1. Under **GitLab Duo Core**, select or clear the **Turn on IDE features** checkbox.
If you selected **Always off** for GitLab Duo availability, you cannot access
this setting.
1. Select **Save changes**.
## Turn GitLab Duo on or off
GitLab Duo is on by default when you [have a subscription](../../subscriptions/subscription-add-ons.md).
You can choose to change its availability for different groups and projects.
### On GitLab.com
On GitLab.com, you can control GitLab Duo availability for the top-level group,
other groups, subgroups, and projects.
#### For a top-level group
Prerequisites:
- You must have the Owner role for the group.
To change GitLab Duo availability for the top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this namespace**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a group or subgroup
Prerequisites:
- You must have the Owner role for the group.
To change GitLab Duo availability for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Under **GitLab Duo availability in this group**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a project
Prerequisites:
- You must have the Owner role for the project.
To change GitLab Duo availability for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **GitLab Duo**.
1. Turn the **Use AI-native features in this project** toggle on or off.
1. Select **Save changes**.
### On GitLab Self-Managed
On GitLab Self-Managed, you can control GitLab Duo availability for the instance,
groups, subgroups, or projects.
#### For an instance
Prerequisites:
- You must be an administrator.
To change GitLab Duo availability for the instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this instance**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for the entire instance.
#### For a group or subgroup
Prerequisites:
- You must have the Owner role for the group or subgroup.
To change GitLab Duo availability for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Under **GitLab Duo availability in this group**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a project
Prerequisites:
- You must have the Owner role for the project.
To change GitLab Duo availability for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **GitLab Duo**.
1. Turn the **Use AI-native features in this project** toggle on or off.
1. Select **Save changes**.
GitLab Duo availability changes for the project.
### For earlier GitLab versions
For information on how to turn GitLab Duo on of off in earlier GitLab versions,
see [Control GitLab Duo availability for earlier GitLab versions](turn_on_off_earlier.md).
## Turn on beta and experimental features
GitLab Duo features that are experimental and beta are turned off by default.
These features are subject to the [Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
### On GitLab.com
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< tabs >}}
{{< tab title="In 17.4 and later" >}}
In GitLab 17.4 and later, follow these instructions to
turn on GitLab Duo experimental and beta features for your group on GitLab.com.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6, you can change this setting for top-level groups only. (Subgroups do not have the required settings.)
In GitLab 17.7 and later, the settings are available for all groups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the top-level group.
To turn on GitLab Duo experiment and beta features for a top-level group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
1. Under **GitLab Duo** section, select **Change configuration**.
1. Under **Feature preview**, select **Turn on experiment and beta GitLab Duo features**.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to
turn on GitLab Duo experimental and beta features for your group on GitLab.com.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **GitLab Duo experiment and beta features**, select the **Use experiment and beta GitLab Duo features** checkbox.
1. Select **Save changes**.
{{< /tab >}}
{{< /tabs >}}
This setting [cascades to all projects](../project/merge_requests/approvals/settings.md#cascade-settings-from-the-instance-or-top-level-group)
that belong to the group.
### On GitLab Self-Managed
{{< tabs >}}
{{< tab title="In 17.4 and later" >}}
In GitLab 17.4 and later, follow these instructions to turn on GitLab Duo
experiment and beta features for your GitLab Self-Managed instance.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6, the GitLab Duo settings page is available for Self-Managed instances.
Beginning with GitLab 17.7, the settings page includes more configuration options.
{{< /alert >}}
Prerequisites:
- You must be an administrator.
To turn on GitLab Duo experiment and beta features for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **Settings > GitLab Duo**.
1. Expand **Change configuration**.
1. Under **Feature Preview**, select **Use experiment and beta GitLab Duo features**.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
To enable GitLab Duo beta and experimental features for GitLab versions
where GitLab Duo Chat is not yet generally available, see the
[GitLab Duo Chat documentation](../gitlab_duo_chat/turn_on_off.md#for-gitlab-self-managed).
{{< /tab >}}
{{< /tabs >}}
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Control GitLab Duo availability
breadcrumbs:
- doc
- user
- gitlab_duo
---
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Core, Pro, or Enterprise
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Settings to turn AI features on and off introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
- [Settings to turn AI features on and off added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
{{< /history >}}
GitLab Duo is on by default when you [have a subscription](../../subscriptions/subscription-add-ons.md).
You can turn GitLab Duo on or off:
- On GitLab.com: For top-level groups, other groups or subgroups, and projects.
- On GitLab Self-Managed: For instances, groups or subgroups, and projects.
You can also turn GitLab Duo Core (a subset of GitLab Duo features) on or off.
## Turn GitLab Duo Core on or off
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/538857) in GitLab 18.0.
- GitLab availability settings, and group, subgroup, and project controls [added](https://gitlab.com/gitlab-org/gitlab/-/issues/551895) in GitLab 18.2.
{{< /history >}}
If you have [GitLab Duo Core](../../subscriptions/subscription-add-ons.md#gitlab-duo-core),
which is included with Premium and Ultimate subscriptions, GitLab Duo Chat and
Code Suggestions are available in your IDEs, and are turned on by default.
If you were an existing user with a Premium or Ultimate subscription before May 15, 2025,
when you upgrade to GitLab 18.0 or later, you have access to Chat and Code Suggestions in your IDEs,
but are turned off by default. However, you can turn them on.
### On GitLab.com
On GitLab.com, you can change availability for GitLab Duo Core for your top-level group (namespace).
Prerequisites:
- You must have the Owner role for the top-level group.
To change GitLab Duo Core availability:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this namespace**, select an option.
1. Under **GitLab Duo Core**, select or clear the **Turn on IDE features** checkbox.
If you selected **Always off** for GitLab Duo availability, you cannot access
this setting.
1. Select **Save changes**.
It might take up to 10 minutes for the change to take effect.
### On GitLab Self-Managed
On GitLab Self-Managed, you can change availability for GitLab Duo Core for your instance.
Prerequisites:
- You must be an administrator.
To change GitLab Duo Core availability:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this instance**, select an option.
1. Under **GitLab Duo Core**, select or clear the **Turn on IDE features** checkbox.
If you selected **Always off** for GitLab Duo availability, you cannot access
this setting.
1. Select **Save changes**.
## Turn GitLab Duo on or off
GitLab Duo is on by default when you [have a subscription](../../subscriptions/subscription-add-ons.md).
You can choose to change its availability for different groups and projects.
### On GitLab.com
On GitLab.com, you can control GitLab Duo availability for the top-level group,
other groups, subgroups, and projects.
#### For a top-level group
Prerequisites:
- You must have the Owner role for the group.
To change GitLab Duo availability for the top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this namespace**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a group or subgroup
Prerequisites:
- You must have the Owner role for the group.
To change GitLab Duo availability for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Under **GitLab Duo availability in this group**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a project
Prerequisites:
- You must have the Owner role for the project.
To change GitLab Duo availability for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **GitLab Duo**.
1. Turn the **Use AI-native features in this project** toggle on or off.
1. Select **Save changes**.
### On GitLab Self-Managed
On GitLab Self-Managed, you can control GitLab Duo availability for the instance,
groups, subgroups, or projects.
#### For an instance
Prerequisites:
- You must be an administrator.
To change GitLab Duo availability for the instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Under **GitLab Duo availability in this instance**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for the entire instance.
#### For a group or subgroup
Prerequisites:
- You must have the Owner role for the group or subgroup.
To change GitLab Duo availability for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Under **GitLab Duo availability in this group**, select an option.
1. Select **Save changes**.
GitLab Duo availability changes for all subgroups and projects.
#### For a project
Prerequisites:
- You must have the Owner role for the project.
To change GitLab Duo availability for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **GitLab Duo**.
1. Turn the **Use AI-native features in this project** toggle on or off.
1. Select **Save changes**.
GitLab Duo availability changes for the project.
### For earlier GitLab versions
For information on how to turn GitLab Duo on of off in earlier GitLab versions,
see [Control GitLab Duo availability for earlier GitLab versions](turn_on_off_earlier.md).
## Turn on beta and experimental features
GitLab Duo features that are experimental and beta are turned off by default.
These features are subject to the [Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
### On GitLab.com
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< tabs >}}
{{< tab title="In 17.4 and later" >}}
In GitLab 17.4 and later, follow these instructions to
turn on GitLab Duo experimental and beta features for your group on GitLab.com.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6, you can change this setting for top-level groups only. (Subgroups do not have the required settings.)
In GitLab 17.7 and later, the settings are available for all groups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the top-level group.
To turn on GitLab Duo experiment and beta features for a top-level group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
1. Under **GitLab Duo** section, select **Change configuration**.
1. Under **Feature preview**, select **Turn on experiment and beta GitLab Duo features**.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to
turn on GitLab Duo experimental and beta features for your group on GitLab.com.
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Under **GitLab Duo experiment and beta features**, select the **Use experiment and beta GitLab Duo features** checkbox.
1. Select **Save changes**.
{{< /tab >}}
{{< /tabs >}}
This setting [cascades to all projects](../project/merge_requests/approvals/settings.md#cascade-settings-from-the-instance-or-top-level-group)
that belong to the group.
### On GitLab Self-Managed
{{< tabs >}}
{{< tab title="In 17.4 and later" >}}
In GitLab 17.4 and later, follow these instructions to turn on GitLab Duo
experiment and beta features for your GitLab Self-Managed instance.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6, the GitLab Duo settings page is available for Self-Managed instances.
Beginning with GitLab 17.7, the settings page includes more configuration options.
{{< /alert >}}
Prerequisites:
- You must be an administrator.
To turn on GitLab Duo experiment and beta features for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **Settings > GitLab Duo**.
1. Expand **Change configuration**.
1. Under **Feature Preview**, select **Use experiment and beta GitLab Duo features**.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
To enable GitLab Duo beta and experimental features for GitLab versions
where GitLab Duo Chat is not yet generally available, see the
[GitLab Duo Chat documentation](../gitlab_duo_chat/turn_on_off.md#for-gitlab-self-managed).
{{< /tab >}}
{{< /tabs >}}
|
https://docs.gitlab.com/user/gateway
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gateway.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
gateway.md
| null | null | null | null | null |
<!-- markdownlint-disable -->
This document was moved to [another location](../../administration/gitlab_duo/gateway.md).
<!-- This redirect file can be deleted after <2025-10-27>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
---
redirect_to: ../../administration/gitlab_duo/gateway.md
remove_date: '2025-10-27'
breadcrumbs:
- doc
- user
- gitlab_duo
---
<!-- markdownlint-disable -->
This document was moved to [another location](../../administration/gitlab_duo/gateway.md).
<!-- This redirect file can be deleted after <2025-10-27>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
https://docs.gitlab.com/user/context
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/context.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
context.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo contextual awareness
| null |
Depending on which GitLab Duo feature you are using and where you are using it,
different information is available to help GitLab Duo make decisions and offer suggestions.
Information can be available:
- Always.
- Based on your location (the context changes when you navigate).
- When referenced explicitly. For example, you mention the information by URL, ID, or file path.
## GitLab Duo Chat
The following context is available to GitLab Duo Chat.
### Always available
- GitLab documentation.
- General programming knowledge, best practices, and language specifics.
- Content in the file you're viewing or editing, including code before and after your cursor.
- The `/refactor`, `/fix`, and `/tests` slash commands have access to the latest
[Repository X-Ray report](../project/repository/code_suggestions/repository_xray.md).
### Based on location
When you have any of these resources open, GitLab Duo knows about them.
- Files (included with the `/include` command)
- Code selected in a file
- Issues (GitLab Duo Enterprise only)
- Epics (GitLab Duo Enterprise only)
- [Other work item types](../work_items/_index.md#work-item-types) (GitLab Duo Enterprise only)
{{< alert type="note" >}}
In the IDEs, secrets and sensitive values that match known formats are redacted before
they are sent to GitLab Duo Chat.
{{< /alert >}}
In the UI, when you're in a merge request, GitLab Duo also knows about:
- The merge request itself (GitLab Duo Enterprise only).
- Commits in the merge request (GitLab Duo Enterprise only).
- The merge request pipeline's CI/CD jobs (GitLab Duo Enterprise only).
### When referenced explicitly
All of the resources that are available based on your location
are also available when you refer to them explicitly by their ID or URL.
## Software development flow
The following context is available to the software development flow in GitLab Duo Agent Platform.
### Always available
- General programming knowledge, best practices, and language specifics.
- Your entire project and all of its files that are tracked by Git.
- The GitLab [Search API](../../api/search.md), which is used to find related issues or merge requests.
### Based on location
- Files you have open in the IDE (close files if you do not want them used for context).
### When referenced explicitly
- Files
- Epics
- Issues
- Merge requests
- The merge request's pipelines
## Code Suggestions
The following context is available to Code Suggestions.
### Always available
- General programming knowledge, best practices, and language specifics.
- The name, extension, and content of the file you're viewing or editing,
including content before and after your cursor.
### Based on location
- Files you have open in tabs in the IDE. Optional, but on by default.
- These files provide GitLab Duo with information about the standards and practices in your project.
- Close files if you do not want them used for context.
- Code completion is aware of all [supported languages](../project/repository/code_suggestions/supported_extensions.md#supported-languages-by-ide).
- Code generation is aware of files in these languages only:
Go, Java, JavaScript, Kotlin, Python, Ruby, Rust, TypeScript (`.ts` and `.tsx` files), Vue, and YAML.
- Files imported in the file you're viewing or editing. Optional, and off by default.
- These files provide GitLab Duo with information about the classes and methods in your file.
- Code selected in your editor.
- [Repository X-Ray files](../project/repository/code_suggestions/repository_xray.md).
{{< alert type="note" >}}
Secrets and sensitive values that match known formats are redacted before
they are used to generate code.
This applies to files added by using `/include`.
{{< /alert >}}
#### Change what Code Suggestions uses for context
You can change whether or not Code Suggestions uses other files as context.
##### Using open files as context
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464767) in GitLab 17.1 [with a flag](../../administration/feature_flags/_index.md) named `advanced_context_resolver`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462750) in GitLab 17.1 [with a flag](../../administration/feature_flags/_index.md) named `code_suggestions_context`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/276) in GitLab Workflow for VS Code 4.20.0.
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-jetbrains-plugin/-/issues/462) in GitLab Duo for JetBrains 2.7.0.
- [Added](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/merge_requests/152) to the GitLab Neovim plugin on July 16, 2024.
- Feature flags `advanced_context_resolver` and `code_suggestions_context` enabled on GitLab.com in GitLab 17.2.
- Feature flags `advanced_context_resolver` and `code_suggestions_context` [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161538) in GitLab 17.4.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
By default, Code Suggestions uses the open files in your IDE for context when making suggestions.
However, you can turn this setting off.
Prerequisites:
- GitLab 17.2 or later. Earlier GitLab versions that support Code Suggestions
cannot weigh the content of open tabs more heavily than other files in your project.
- A supported extension:
- GitLab Workflow extension for VS Code 6.2.2 or later.
- GitLab plugin for JetBrains IDEs 3.6.5 or later.
- GitLab plugin for Neovim 1.1.0 or later.
- GitLab extension for Visual Studio 0.51.0 or later.
To change open files being used as context:
{{< tabs >}}
{{< tab title="Visual Studio Code" >}}
1. On the top bar, go to **Code > Settings > Extensions**.
1. Search for GitLab Workflow in the list, and select the gear icon.
1. Select **Settings**.
1. In your **User** settings, search for `open tabs`.
1. Under **GitLab › Duo Code Suggestions: Open Tabs Context**,
select or clear **Use the contents of open tabs as context**.
{{< /tab >}}
{{< tab title="JetBrains IDEs" >}}
1. Go to your IDE's top menu bar and select **Settings**.
1. On the left sidebar, expand **Tools**, then select **GitLab Duo**.
1. Below **Additional languages**, select or clear **Send open tabs as context**.
1. Select **Apply** or **Save**.
{{< /tab >}}
{{< /tabs >}}
##### Using imported files as context
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/514124) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `code_suggestions_include_context_imports`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/514124) in GitLab 17.11.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Use the imported files in your IDE to provide context about your code project. Imported file context is supported for JavaScript and TypeScript files, including `.js`, `.jsx`, `.ts`, `.tsx`, and `.vue` file types.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Duo contextual awareness
breadcrumbs:
- doc
- user
- gitlab_duo
---
Depending on which GitLab Duo feature you are using and where you are using it,
different information is available to help GitLab Duo make decisions and offer suggestions.
Information can be available:
- Always.
- Based on your location (the context changes when you navigate).
- When referenced explicitly. For example, you mention the information by URL, ID, or file path.
## GitLab Duo Chat
The following context is available to GitLab Duo Chat.
### Always available
- GitLab documentation.
- General programming knowledge, best practices, and language specifics.
- Content in the file you're viewing or editing, including code before and after your cursor.
- The `/refactor`, `/fix`, and `/tests` slash commands have access to the latest
[Repository X-Ray report](../project/repository/code_suggestions/repository_xray.md).
### Based on location
When you have any of these resources open, GitLab Duo knows about them.
- Files (included with the `/include` command)
- Code selected in a file
- Issues (GitLab Duo Enterprise only)
- Epics (GitLab Duo Enterprise only)
- [Other work item types](../work_items/_index.md#work-item-types) (GitLab Duo Enterprise only)
{{< alert type="note" >}}
In the IDEs, secrets and sensitive values that match known formats are redacted before
they are sent to GitLab Duo Chat.
{{< /alert >}}
In the UI, when you're in a merge request, GitLab Duo also knows about:
- The merge request itself (GitLab Duo Enterprise only).
- Commits in the merge request (GitLab Duo Enterprise only).
- The merge request pipeline's CI/CD jobs (GitLab Duo Enterprise only).
### When referenced explicitly
All of the resources that are available based on your location
are also available when you refer to them explicitly by their ID or URL.
## Software development flow
The following context is available to the software development flow in GitLab Duo Agent Platform.
### Always available
- General programming knowledge, best practices, and language specifics.
- Your entire project and all of its files that are tracked by Git.
- The GitLab [Search API](../../api/search.md), which is used to find related issues or merge requests.
### Based on location
- Files you have open in the IDE (close files if you do not want them used for context).
### When referenced explicitly
- Files
- Epics
- Issues
- Merge requests
- The merge request's pipelines
## Code Suggestions
The following context is available to Code Suggestions.
### Always available
- General programming knowledge, best practices, and language specifics.
- The name, extension, and content of the file you're viewing or editing,
including content before and after your cursor.
### Based on location
- Files you have open in tabs in the IDE. Optional, but on by default.
- These files provide GitLab Duo with information about the standards and practices in your project.
- Close files if you do not want them used for context.
- Code completion is aware of all [supported languages](../project/repository/code_suggestions/supported_extensions.md#supported-languages-by-ide).
- Code generation is aware of files in these languages only:
Go, Java, JavaScript, Kotlin, Python, Ruby, Rust, TypeScript (`.ts` and `.tsx` files), Vue, and YAML.
- Files imported in the file you're viewing or editing. Optional, and off by default.
- These files provide GitLab Duo with information about the classes and methods in your file.
- Code selected in your editor.
- [Repository X-Ray files](../project/repository/code_suggestions/repository_xray.md).
{{< alert type="note" >}}
Secrets and sensitive values that match known formats are redacted before
they are used to generate code.
This applies to files added by using `/include`.
{{< /alert >}}
#### Change what Code Suggestions uses for context
You can change whether or not Code Suggestions uses other files as context.
##### Using open files as context
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464767) in GitLab 17.1 [with a flag](../../administration/feature_flags/_index.md) named `advanced_context_resolver`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462750) in GitLab 17.1 [with a flag](../../administration/feature_flags/_index.md) named `code_suggestions_context`. Disabled by default.
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/276) in GitLab Workflow for VS Code 4.20.0.
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-jetbrains-plugin/-/issues/462) in GitLab Duo for JetBrains 2.7.0.
- [Added](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/merge_requests/152) to the GitLab Neovim plugin on July 16, 2024.
- Feature flags `advanced_context_resolver` and `code_suggestions_context` enabled on GitLab.com in GitLab 17.2.
- Feature flags `advanced_context_resolver` and `code_suggestions_context` [enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161538) in GitLab 17.4.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
By default, Code Suggestions uses the open files in your IDE for context when making suggestions.
However, you can turn this setting off.
Prerequisites:
- GitLab 17.2 or later. Earlier GitLab versions that support Code Suggestions
cannot weigh the content of open tabs more heavily than other files in your project.
- A supported extension:
- GitLab Workflow extension for VS Code 6.2.2 or later.
- GitLab plugin for JetBrains IDEs 3.6.5 or later.
- GitLab plugin for Neovim 1.1.0 or later.
- GitLab extension for Visual Studio 0.51.0 or later.
To change open files being used as context:
{{< tabs >}}
{{< tab title="Visual Studio Code" >}}
1. On the top bar, go to **Code > Settings > Extensions**.
1. Search for GitLab Workflow in the list, and select the gear icon.
1. Select **Settings**.
1. In your **User** settings, search for `open tabs`.
1. Under **GitLab › Duo Code Suggestions: Open Tabs Context**,
select or clear **Use the contents of open tabs as context**.
{{< /tab >}}
{{< tab title="JetBrains IDEs" >}}
1. Go to your IDE's top menu bar and select **Settings**.
1. On the left sidebar, expand **Tools**, then select **GitLab Duo**.
1. Below **Additional languages**, select or clear **Send open tabs as context**.
1. Select **Apply** or **Save**.
{{< /tab >}}
{{< /tabs >}}
##### Using imported files as context
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/514124) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `code_suggestions_include_context_imports`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/514124) in GitLab 17.11.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Use the imported files in your IDE to provide context about your code project. Imported file context is supported for JavaScript and TypeScript files, including `.js`, `.jsx`, `.ts`, `.tsx`, and `.vue` file types.
|
https://docs.gitlab.com/user/gitlab_duo
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
_index.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo
|
Get help from a suite of AI-native features while you work in GitLab.
|
GitLab Duo is a suite of AI-native features that assist you while you work in GitLab.
These features aim to help increase velocity and solve key pain points across the software development lifecycle.
GitLab Duo features are available in [IDE extensions](../../editor_extensions/_index.md) and the GitLab UI.
Some features are also available as part of [GitLab Duo Chat](../gitlab_duo_chat/examples.md).
{{< walkthrough data="duo-walkthrough" >}}
- [View list of all GitLab Duo features](feature_summary.md)
- [Set up GitLab Duo on GitLab Self-Managed](setup.md)
- [Use your own models with GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
{{< /walkthrough >}}
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Get help from a suite of AI-native features while you work in GitLab.
title: GitLab Duo
breadcrumbs:
- doc
- user
- gitlab_duo
---
GitLab Duo is a suite of AI-native features that assist you while you work in GitLab.
These features aim to help increase velocity and solve key pain points across the software development lifecycle.
GitLab Duo features are available in [IDE extensions](../../editor_extensions/_index.md) and the GitLab UI.
Some features are also available as part of [GitLab Duo Chat](../gitlab_duo_chat/examples.md).
{{< walkthrough data="duo-walkthrough" >}}
- [View list of all GitLab Duo features](feature_summary.md)
- [Set up GitLab Duo on GitLab Self-Managed](setup.md)
- [Use your own models with GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
{{< /walkthrough >}}
|
https://docs.gitlab.com/user/data_usage
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/data_usage.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
data_usage.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo data usage
|
AI-native features and functionality.
|
GitLab Duo uses generative AI to help increase your velocity and make you more productive. Each AI-native feature operates independently and is not required for other features to function.
GitLab uses the right large language models (LLMs) for specific tasks. These LLMs are [Anthropic Claude](https://www.anthropic.com/product), [Fireworks AI-hosted Codestral](https://mistral.ai/news/codestral-2501), and [Google Vertex AI Models](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#genai-models).
## Progressive enhancement
GitLab Duo AI-native features are designed as a progressive enhancement to existing GitLab features across the DevSecOps platform. These features are designed to fail gracefully and should not prevent the core functionality of the underlying feature. You should note each feature is subject to its expected functionality as defined by the relevant [feature support policy](../../policy/development_stages_support.md).
## Stability and performance
GitLab Duo AI-native features are in a variety of [feature support levels](../../policy/development_stages_support.md#beta). Due to the nature of these features, there may be high demand for usage which may cause degraded performance or unexpected downtime of the feature. We have built these features to gracefully degrade and have controls in place to allow us to mitigate abuse or misuse. GitLab may disable beta and experimental features for any or all customers at any time at our discretion.
## Data privacy
GitLab Duo AI-native features are powered by a generative AI model. The processing of any personal data is in accordance with our [Privacy Statement](https://about.gitlab.com/privacy/). You may also visit the [Sub-Processors page](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors) to see the list of Sub-Processors we use to provide these features.
## Data retention
The below reflects the current retention periods of GitLab AI model [Sub-Processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors):
Excluding [Fireworks AI prompt caching](../project/repository/code_suggestions/_index.md#prompt-caching), GitLab has arranged zero-day data retention with Anthropic, Fireworks AI, and Google for GitLab Duo requests. Anthropic, Fireworks AI (when prompt caching is disabled), and Google discard model input and output data immediately after the output is provided; input and output data is not stored for abuse monitoring. Model input and output is never used to train models.
All of these AI providers are under data protection agreements with GitLab that prohibit the use of Customer Content for their own purposes, except to perform their independent legal obligations.
GitLab Duo Chat and GitLab Duo Agent Platform retain chat history and workflow history, respectively, to help you return quickly to previously discussed topics. You can delete chats in the GitLab Duo Chat interface. GitLab does not otherwise retain input and output data unless customers provide consent through a GitLab [Support Ticket](https://about.gitlab.com/support/portal/). Learn more about [AI feature logging](../../administration/logs/_index.md).
Fireworks AI prompt caching is enabled by default to improve Code Suggestions latency. For more information and how to opt out of prompt caching, see the [Code Suggestions prompt caching documentation](../project/repository/code_suggestions/_index.md#prompt-caching).
## Training data
GitLab does not train generative AI models.
For more information on our AI [sub-processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors), see:
- Google Vertex AI models API [data governance](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance), [responsible AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/responsible-ai), [details about foundation model training](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance#foundation_model_training), Google [Secure AI Framework (SAIF)](https://safety.google/cybersecurity-advancements/saif/), and [release notes](https://cloud.google.com/vertex-ai/docs/release-notes).
- Anthropic Claude's [constitution](https://www.anthropic.com/news/claudes-constitution), training data [FAQ](https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training), [models overview](https://docs.anthropic.com/en/docs/about-claude/models), and [data recency article](https://support.anthropic.com/en/articles/8114494-how-up-to-date-is-claude-s-training-data).
## Telemetry
GitLab Duo collects aggregated or de-identified first-party usage data through a Snowplow collector. This usage data includes the following metrics:
- Number of unique users
- Number of unique instances
- Prompt and suffix lengths
- Model used
- Status code responses
- API responses times
- Code Suggestions also collects:
- Language the suggestion was in (for example, Python)
- Editor being used (for example, VS Code)
- Number of suggestions shown, accepted, rejected, or that had errors
- Duration of time that a suggestion was shown
## Model accuracy and quality
Generative AI may produce unexpected results that may be:
- Low-quality
- Incoherent
- Incomplete
- Produce failed pipelines
- Insecure code
- Offensive or insensitive
- Out of date information
GitLab is actively iterating on all our AI-assisted capabilities to improve the quality of the generated content. We improve the quality through prompt engineering, evaluating new AI/ML models to power these features, and through novel heuristics built into these features directly.
## Secret detection and redaction
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/632) in GitLab 17.9.
{{< /history >}}
GitLab Duo includes secret detection and redaction, powered by Gitleaks. It automatically
detects and removes sensitive information like API keys, credentials, and tokens from your
code before processing it with large language models. This security feature is particularly
important for compliance with data protection regulations, like GDPR.
Your code goes through a pre-scan security workflow when using GitLab Duo:
1. Your code is scanned for sensitive information using Gitleaks.
1. Any detected secrets are automatically removed from the request.
## GitLab Duo Self-Hosted
When you are using [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
and the self-hosted AI gateway, you do not share any data with GitLab.
GitLab Self-Managed administrators can use [Service Ping](../../administration/settings/usage_statistics.md#service-ping)
to send usage statistics to GitLab. This is separate to the [telemetry data](#telemetry).
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: AI-native features and functionality.
title: GitLab Duo data usage
breadcrumbs:
- doc
- user
- gitlab_duo
---
GitLab Duo uses generative AI to help increase your velocity and make you more productive. Each AI-native feature operates independently and is not required for other features to function.
GitLab uses the right large language models (LLMs) for specific tasks. These LLMs are [Anthropic Claude](https://www.anthropic.com/product), [Fireworks AI-hosted Codestral](https://mistral.ai/news/codestral-2501), and [Google Vertex AI Models](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#genai-models).
## Progressive enhancement
GitLab Duo AI-native features are designed as a progressive enhancement to existing GitLab features across the DevSecOps platform. These features are designed to fail gracefully and should not prevent the core functionality of the underlying feature. You should note each feature is subject to its expected functionality as defined by the relevant [feature support policy](../../policy/development_stages_support.md).
## Stability and performance
GitLab Duo AI-native features are in a variety of [feature support levels](../../policy/development_stages_support.md#beta). Due to the nature of these features, there may be high demand for usage which may cause degraded performance or unexpected downtime of the feature. We have built these features to gracefully degrade and have controls in place to allow us to mitigate abuse or misuse. GitLab may disable beta and experimental features for any or all customers at any time at our discretion.
## Data privacy
GitLab Duo AI-native features are powered by a generative AI model. The processing of any personal data is in accordance with our [Privacy Statement](https://about.gitlab.com/privacy/). You may also visit the [Sub-Processors page](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors) to see the list of Sub-Processors we use to provide these features.
## Data retention
The below reflects the current retention periods of GitLab AI model [Sub-Processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors):
Excluding [Fireworks AI prompt caching](../project/repository/code_suggestions/_index.md#prompt-caching), GitLab has arranged zero-day data retention with Anthropic, Fireworks AI, and Google for GitLab Duo requests. Anthropic, Fireworks AI (when prompt caching is disabled), and Google discard model input and output data immediately after the output is provided; input and output data is not stored for abuse monitoring. Model input and output is never used to train models.
All of these AI providers are under data protection agreements with GitLab that prohibit the use of Customer Content for their own purposes, except to perform their independent legal obligations.
GitLab Duo Chat and GitLab Duo Agent Platform retain chat history and workflow history, respectively, to help you return quickly to previously discussed topics. You can delete chats in the GitLab Duo Chat interface. GitLab does not otherwise retain input and output data unless customers provide consent through a GitLab [Support Ticket](https://about.gitlab.com/support/portal/). Learn more about [AI feature logging](../../administration/logs/_index.md).
Fireworks AI prompt caching is enabled by default to improve Code Suggestions latency. For more information and how to opt out of prompt caching, see the [Code Suggestions prompt caching documentation](../project/repository/code_suggestions/_index.md#prompt-caching).
## Training data
GitLab does not train generative AI models.
For more information on our AI [sub-processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors), see:
- Google Vertex AI models API [data governance](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance), [responsible AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/responsible-ai), [details about foundation model training](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance#foundation_model_training), Google [Secure AI Framework (SAIF)](https://safety.google/cybersecurity-advancements/saif/), and [release notes](https://cloud.google.com/vertex-ai/docs/release-notes).
- Anthropic Claude's [constitution](https://www.anthropic.com/news/claudes-constitution), training data [FAQ](https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training), [models overview](https://docs.anthropic.com/en/docs/about-claude/models), and [data recency article](https://support.anthropic.com/en/articles/8114494-how-up-to-date-is-claude-s-training-data).
## Telemetry
GitLab Duo collects aggregated or de-identified first-party usage data through a Snowplow collector. This usage data includes the following metrics:
- Number of unique users
- Number of unique instances
- Prompt and suffix lengths
- Model used
- Status code responses
- API responses times
- Code Suggestions also collects:
- Language the suggestion was in (for example, Python)
- Editor being used (for example, VS Code)
- Number of suggestions shown, accepted, rejected, or that had errors
- Duration of time that a suggestion was shown
## Model accuracy and quality
Generative AI may produce unexpected results that may be:
- Low-quality
- Incoherent
- Incomplete
- Produce failed pipelines
- Insecure code
- Offensive or insensitive
- Out of date information
GitLab is actively iterating on all our AI-assisted capabilities to improve the quality of the generated content. We improve the quality through prompt engineering, evaluating new AI/ML models to power these features, and through novel heuristics built into these features directly.
## Secret detection and redaction
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/632) in GitLab 17.9.
{{< /history >}}
GitLab Duo includes secret detection and redaction, powered by Gitleaks. It automatically
detects and removes sensitive information like API keys, credentials, and tokens from your
code before processing it with large language models. This security feature is particularly
important for compliance with data protection regulations, like GDPR.
Your code goes through a pre-scan security workflow when using GitLab Duo:
1. Your code is scanned for sensitive information using Gitleaks.
1. Any detected secrets are automatically removed from the request.
## GitLab Duo Self-Hosted
When you are using [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
and the self-hosted AI gateway, you do not share any data with GitLab.
GitLab Self-Managed administrators can use [Service Ping](../../administration/settings/usage_statistics.md#service-ping)
to send usage statistics to GitLab. This is separate to the [telemetry data](#telemetry).
|
https://docs.gitlab.com/user/choose_path
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/choose_path.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
choose_path.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo: Choose your path
|
Learn how to use GitLab Duo AI-native features to enhance your software development lifecycle.
|
GitLab Duo is a suite of AI-native features that assist you while you work in GitLab.
Select the path that best matches what you want to do:
{{< tabs >}}
{{< tab title="Get started" >}}
**Perfect for**: New users exploring GitLab Duo
Follow this path to learn how to:
- Use the variety of GitLab Duo features
- Get help from AI through GitLab Duo Chat
- Generate and improve code
[Start here: GitLab Duo →](_index.md)
{{< /tab >}}
{{< tab title="Enhance my coding" >}}
**Perfect for**: Developers looking to boost productivity
Follow this path to learn how to:
- Use Code Suggestions in your IDE
- Generate, understand, and refactor code
- Create tests automatically
[Start here: Code Suggestions →](../project/repository/code_suggestions/_index.md)
{{< /tab >}}
{{< tab title="Improve code reviews" >}}
**Perfect for**: Reviewers and team leads
Follow this path to learn how to:
- Generate merge request descriptions
- Get AI-native code reviews
- Summarize review comments and generate commit messages
[Start here: GitLab Duo in merge requests →](../project/merge_requests/duo_in_merge_requests.md)
{{< /tab >}}
{{< tab title="Secure my application" >}}
**Perfect for**: Security and DevSecOps professionals
Follow this path to learn how to:
- Understand vulnerabilities
- Automatically generate fix suggestions
- Create merge requests to address security issues
[Start here: Vulnerability explanation and resolution →](../application_security/vulnerabilities/_index.md#vulnerability-explanation)
{{< /tab >}}
{{< /tabs >}}
## Quick start
Want to start using GitLab Duo right now? Here's how:
1. Open GitLab Duo Chat by selecting **GitLab Duo Chat** in the upper-right corner of the GitLab UI,
or in your IDE.
1. Ask a question about your project, code, or how to use GitLab.
1. Try one of the AI-native features like Code Suggestions in your IDE, or use Chat:
- In the UI to summarize a bulky issue.
- In the IDE to refactor some existing code.
[View all of the GitLab Duo possibilities →](_index.md)
## Common tasks
Need to do something specific? Here are some common tasks:
| Task | Description | Quick Guide |
|------|-------------|-------------|
| Get AI assistance | Ask GitLab Duo questions about code, projects, or GitLab | [GitLab Duo Chat →](../gitlab_duo_chat/_index.md) |
| Generate code | Get code suggestions as you type in your IDE | [Code Suggestions →](../project/repository/code_suggestions/_index.md) |
| Understand code | Have code explained in plain language | [Code Explanation →](../project/repository/code_explain.md) |
| Fix CI/CD issues | Analyze and fix failed jobs | [Root Cause Analysis →](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis) |
| Summarize changes | Generate descriptions for merge requests | [Merge Request Summary →](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes) |
## How GitLab Duo integrates with your workflow
GitLab Duo is integrated with your development processes and is available:
- In the GitLab UI
- Through GitLab Duo Chat
- In IDE extensions
- In the CLI
## Experience levels
### For beginners
If you're new to GitLab Duo, start with these features:
- **[GitLab Duo Chat](../gitlab_duo_chat/_index.md)** - Ask questions about GitLab and get help with basic tasks
- **[Code Suggestions](../project/repository/code_suggestions/_index.md)** - Get AI-native code completion in your IDE
- **[Code Explanation](../project/repository/code_explain.md)** - Understand code in files or merge requests
- **[Merge Request Summary](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes)** - Generate descriptions for your changes automatically
### For intermediate users
After you're comfortable with the basics, try these more advanced features:
- **[Test Generation](../gitlab_duo_chat/examples.md#write-tests-in-the-ide)** - Create tests for your code automatically
- **[Root Cause Analysis](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis)** - Troubleshoot failed CI/CD jobs
### For advanced users
When you're ready to maximize your productivity with GitLab Duo:
- **[GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)** - Host LLMs on your own infrastructure
- **[GitLab Duo Agent Platform](../duo_agent_platform/_index.md)** - Automate tasks in your development workflow
- **[Vulnerability Resolution](../application_security/vulnerabilities/_index.md#vulnerability-resolution)** - Automatically generate merge requests to fix security issues
## Best practices
Follow these tips for effective GitLab Duo usage:
1. **Be specific in your prompts**
- Provide clear context for better results
- Include relevant details about your code and objectives
- Use code task commands like `/explain`, `/refactor`, and `/tests` in Chat
1. **Improve code responsibly**
- Always review AI-generated code before using it
- Test generated code to ensure it works as expected
- Use vulnerability resolution with appropriate review
1. **Refine iteratively**
- If a response isn't helpful, refine your question
- Try breaking complex requests into smaller parts
- Add more details for better context
1. **Leverage Chat for learning**
- Ask about GitLab features you're not familiar with
- Get explanations for error messages and problems
- Learn best practices for your specific technology
## Next steps
Ready to dive deeper? Try these resources:
- [GitLab Duo use cases](use_cases.md) - Practical examples and exercises
- [Set up GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md) - For complete control over your data
## Troubleshooting
Having issues? Check these common solutions:
- [GitLab Duo features don't work on self-managed](troubleshooting.md#gitlab-duo-features-do-not-work-on-self-managed)
- [GitLab Duo features not available for users](troubleshooting.md#gitlab-duo-features-not-available-for-users)
- [Run a health check](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo) to diagnose your GitLab Duo setup
Need more help? Search the GitLab documentation or [ask the GitLab community](https://forum.gitlab.com/).
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Learn how to use GitLab Duo AI-native features to enhance your software
development lifecycle.
title: 'GitLab Duo: Choose your path'
breadcrumbs:
- doc
- user
- gitlab_duo
---
GitLab Duo is a suite of AI-native features that assist you while you work in GitLab.
Select the path that best matches what you want to do:
{{< tabs >}}
{{< tab title="Get started" >}}
**Perfect for**: New users exploring GitLab Duo
Follow this path to learn how to:
- Use the variety of GitLab Duo features
- Get help from AI through GitLab Duo Chat
- Generate and improve code
[Start here: GitLab Duo →](_index.md)
{{< /tab >}}
{{< tab title="Enhance my coding" >}}
**Perfect for**: Developers looking to boost productivity
Follow this path to learn how to:
- Use Code Suggestions in your IDE
- Generate, understand, and refactor code
- Create tests automatically
[Start here: Code Suggestions →](../project/repository/code_suggestions/_index.md)
{{< /tab >}}
{{< tab title="Improve code reviews" >}}
**Perfect for**: Reviewers and team leads
Follow this path to learn how to:
- Generate merge request descriptions
- Get AI-native code reviews
- Summarize review comments and generate commit messages
[Start here: GitLab Duo in merge requests →](../project/merge_requests/duo_in_merge_requests.md)
{{< /tab >}}
{{< tab title="Secure my application" >}}
**Perfect for**: Security and DevSecOps professionals
Follow this path to learn how to:
- Understand vulnerabilities
- Automatically generate fix suggestions
- Create merge requests to address security issues
[Start here: Vulnerability explanation and resolution →](../application_security/vulnerabilities/_index.md#vulnerability-explanation)
{{< /tab >}}
{{< /tabs >}}
## Quick start
Want to start using GitLab Duo right now? Here's how:
1. Open GitLab Duo Chat by selecting **GitLab Duo Chat** in the upper-right corner of the GitLab UI,
or in your IDE.
1. Ask a question about your project, code, or how to use GitLab.
1. Try one of the AI-native features like Code Suggestions in your IDE, or use Chat:
- In the UI to summarize a bulky issue.
- In the IDE to refactor some existing code.
[View all of the GitLab Duo possibilities →](_index.md)
## Common tasks
Need to do something specific? Here are some common tasks:
| Task | Description | Quick Guide |
|------|-------------|-------------|
| Get AI assistance | Ask GitLab Duo questions about code, projects, or GitLab | [GitLab Duo Chat →](../gitlab_duo_chat/_index.md) |
| Generate code | Get code suggestions as you type in your IDE | [Code Suggestions →](../project/repository/code_suggestions/_index.md) |
| Understand code | Have code explained in plain language | [Code Explanation →](../project/repository/code_explain.md) |
| Fix CI/CD issues | Analyze and fix failed jobs | [Root Cause Analysis →](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis) |
| Summarize changes | Generate descriptions for merge requests | [Merge Request Summary →](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes) |
## How GitLab Duo integrates with your workflow
GitLab Duo is integrated with your development processes and is available:
- In the GitLab UI
- Through GitLab Duo Chat
- In IDE extensions
- In the CLI
## Experience levels
### For beginners
If you're new to GitLab Duo, start with these features:
- **[GitLab Duo Chat](../gitlab_duo_chat/_index.md)** - Ask questions about GitLab and get help with basic tasks
- **[Code Suggestions](../project/repository/code_suggestions/_index.md)** - Get AI-native code completion in your IDE
- **[Code Explanation](../project/repository/code_explain.md)** - Understand code in files or merge requests
- **[Merge Request Summary](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes)** - Generate descriptions for your changes automatically
### For intermediate users
After you're comfortable with the basics, try these more advanced features:
- **[Test Generation](../gitlab_duo_chat/examples.md#write-tests-in-the-ide)** - Create tests for your code automatically
- **[Root Cause Analysis](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis)** - Troubleshoot failed CI/CD jobs
### For advanced users
When you're ready to maximize your productivity with GitLab Duo:
- **[GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)** - Host LLMs on your own infrastructure
- **[GitLab Duo Agent Platform](../duo_agent_platform/_index.md)** - Automate tasks in your development workflow
- **[Vulnerability Resolution](../application_security/vulnerabilities/_index.md#vulnerability-resolution)** - Automatically generate merge requests to fix security issues
## Best practices
Follow these tips for effective GitLab Duo usage:
1. **Be specific in your prompts**
- Provide clear context for better results
- Include relevant details about your code and objectives
- Use code task commands like `/explain`, `/refactor`, and `/tests` in Chat
1. **Improve code responsibly**
- Always review AI-generated code before using it
- Test generated code to ensure it works as expected
- Use vulnerability resolution with appropriate review
1. **Refine iteratively**
- If a response isn't helpful, refine your question
- Try breaking complex requests into smaller parts
- Add more details for better context
1. **Leverage Chat for learning**
- Ask about GitLab features you're not familiar with
- Get explanations for error messages and problems
- Learn best practices for your specific technology
## Next steps
Ready to dive deeper? Try these resources:
- [GitLab Duo use cases](use_cases.md) - Practical examples and exercises
- [Set up GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md) - For complete control over your data
## Troubleshooting
Having issues? Check these common solutions:
- [GitLab Duo features don't work on self-managed](troubleshooting.md#gitlab-duo-features-do-not-work-on-self-managed)
- [GitLab Duo features not available for users](troubleshooting.md#gitlab-duo-features-not-available-for-users)
- [Run a health check](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo) to diagnose your GitLab Duo setup
Need more help? Search the GitLab documentation or [ask the GitLab community](https://forum.gitlab.com/).
|
https://docs.gitlab.com/user/model_selection
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/model_selection.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
model_selection.md
|
AI-powered
|
Custom Models
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo model selection
|
Configure large language models for GitLab Duo features.
|
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Core, Pro or Enterprise
- Offering: GitLab.com
- Status: Private beta
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/17570) for top-level groups in GitLab 18.1 with a [flag](../../administration/feature_flags/_index.md) named `ai_model_switching`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
To help meet your performance and compliance requirements,
on GitLab.com, you can choose to use different large language models (LLMs) with GitLab Duo.
If you do not select a specific LLM, all GitLab Duo features use the default LLMs.
You should use the defaults if you do not have unique requirements.
## Select an LLM for a feature
Prerequisites:
- The group that you want to select LLMs for must:
- Be a [top-level group](../group/_index.md#group-hierarchy) on GitLab.com.
- Have GitLab Duo Core, Pro, or Enterprise enabled.
- You must have the Owner role for the group.
- In GitLab 18.3 or later, you must [assign a default namespace](#assign-a-default-gitlab-duo-namespace) if you belong to multiple GitLab Duo namespaces.
To select a different LLM for a feature:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
If you **GitLab Duo** is not visible, ensure you have GitLab Duo Core, Pro or Enterprise turned on for the group.
1. Select **Configure features**.
1. For the feature you want to configure, select an LLM from the dropdown list.

## Assign a default GitLab Duo namespace
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/552081) in GitLab 18.3 with a [flag](../../administration/feature_flags/_index.md) named `ai_user_default_duo_namespace`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
If you belong to multiple GitLab Duo namespaces, you must choose one as your default namespace.
You must do this because GitLab Duo might not be able to automatically detect the namespace you are working from, and therefore the LLMs you want to use. For example, when:
- Using GitLab Duo in the CLI.
- A new project has not been initialised with Git, so the IDE cannot identify an associated namespace.
If this happens, GitLab Duo uses the LLMs you have selected in your default namespace.
To select a default namespace:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. Go to the **Behavior** section.
1. From the **Default GitLab Duo group** dropdown list, select the namespace to set as your default.
1. Select **Save changes**.
## Troubleshooting
When selecting models other than the default, you might encounter the following issues.
### LLM is not available
If you are using the GitLab Default LLM for a GitLab Duo AI-native feature, GitLab might change the default LLM without notifying the user to maintain optimal performance and reliability.
If you have selected a specific LLM for a GitLab Duo AI-native feature, and that LLM is not available, there is no automatic fallback, and the feature that uses this LLM is unavailable.
### Latency issues with code completion
If you are assigned a seat in a project that has a specific LLM selected for [code completion](../project/repository/code_suggestions/_index.md#code-completion-and-generation):
- Your IDE extension disables the [direct connection to the AI gateway](../../administration/gitlab_duo/gateway.md#region-support).
- Code completion requests go through the GitLab monolith, which then selects the specified model to respond to these requests.
This might cause increased latency with code completion requests.
### Agentic Chat incompatibility
When a specific LLM is selected for GitLab Duo Chat or its sub-features, [GitLab Duo Agentic Chat](../gitlab_duo_chat/agentic_chat.md) is not available in that namespace.
### No default GitLab Duo namespace
When using a GitLab Duo feature with a selected LLM, you might get an error that states that you have not selected a default GitLab Duo namespace. For example, on:
- GitLab Duo Code Suggestions, you might get `Error 422: No default Duo group found. Select a default Duo group in your user preferences and try again.`
- GitLab Duo Chat, you might get `Error G3002: I'm sorry, you have not selected a default GitLab Duo namespace. Please select a default GitLab Duo namespace in your user preferences.`
This issue occurs when:
- The `ai_user_default_duo_namespace` feature flag is enabled.
- You belong to multiple GitLab Duo namespaces, but have not chosen one as your default namespace.
To resolve this, you can do either of the following:
- [Assign a default GitLab Duo namespace](#assign-a-default-gitlab-duo-namespace).
- To opt out of this requirement whilst the model selection feature is in beta, ask [GitLab Support](https://about.gitlab.com/support/) to disable the `ai_user_default_duo_namespace` feature flag.
|
---
stage: AI-powered
group: Custom Models
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Configure large language models for GitLab Duo features.
title: GitLab Duo model selection
breadcrumbs:
- doc
- user
- gitlab_duo
---
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Core, Pro or Enterprise
- Offering: GitLab.com
- Status: Private beta
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/17570) for top-level groups in GitLab 18.1 with a [flag](../../administration/feature_flags/_index.md) named `ai_model_switching`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
To help meet your performance and compliance requirements,
on GitLab.com, you can choose to use different large language models (LLMs) with GitLab Duo.
If you do not select a specific LLM, all GitLab Duo features use the default LLMs.
You should use the defaults if you do not have unique requirements.
## Select an LLM for a feature
Prerequisites:
- The group that you want to select LLMs for must:
- Be a [top-level group](../group/_index.md#group-hierarchy) on GitLab.com.
- Have GitLab Duo Core, Pro, or Enterprise enabled.
- You must have the Owner role for the group.
- In GitLab 18.3 or later, you must [assign a default namespace](#assign-a-default-gitlab-duo-namespace) if you belong to multiple GitLab Duo namespaces.
To select a different LLM for a feature:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
If you **GitLab Duo** is not visible, ensure you have GitLab Duo Core, Pro or Enterprise turned on for the group.
1. Select **Configure features**.
1. For the feature you want to configure, select an LLM from the dropdown list.

## Assign a default GitLab Duo namespace
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/552081) in GitLab 18.3 with a [flag](../../administration/feature_flags/_index.md) named `ai_user_default_duo_namespace`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
If you belong to multiple GitLab Duo namespaces, you must choose one as your default namespace.
You must do this because GitLab Duo might not be able to automatically detect the namespace you are working from, and therefore the LLMs you want to use. For example, when:
- Using GitLab Duo in the CLI.
- A new project has not been initialised with Git, so the IDE cannot identify an associated namespace.
If this happens, GitLab Duo uses the LLMs you have selected in your default namespace.
To select a default namespace:
1. On the left sidebar, select your avatar.
1. Select **Preferences**.
1. Go to the **Behavior** section.
1. From the **Default GitLab Duo group** dropdown list, select the namespace to set as your default.
1. Select **Save changes**.
## Troubleshooting
When selecting models other than the default, you might encounter the following issues.
### LLM is not available
If you are using the GitLab Default LLM for a GitLab Duo AI-native feature, GitLab might change the default LLM without notifying the user to maintain optimal performance and reliability.
If you have selected a specific LLM for a GitLab Duo AI-native feature, and that LLM is not available, there is no automatic fallback, and the feature that uses this LLM is unavailable.
### Latency issues with code completion
If you are assigned a seat in a project that has a specific LLM selected for [code completion](../project/repository/code_suggestions/_index.md#code-completion-and-generation):
- Your IDE extension disables the [direct connection to the AI gateway](../../administration/gitlab_duo/gateway.md#region-support).
- Code completion requests go through the GitLab monolith, which then selects the specified model to respond to these requests.
This might cause increased latency with code completion requests.
### Agentic Chat incompatibility
When a specific LLM is selected for GitLab Duo Chat or its sub-features, [GitLab Duo Agentic Chat](../gitlab_duo_chat/agentic_chat.md) is not available in that namespace.
### No default GitLab Duo namespace
When using a GitLab Duo feature with a selected LLM, you might get an error that states that you have not selected a default GitLab Duo namespace. For example, on:
- GitLab Duo Code Suggestions, you might get `Error 422: No default Duo group found. Select a default Duo group in your user preferences and try again.`
- GitLab Duo Chat, you might get `Error G3002: I'm sorry, you have not selected a default GitLab Duo namespace. Please select a default GitLab Duo namespace in your user preferences.`
This issue occurs when:
- The `ai_user_default_duo_namespace` feature flag is enabled.
- You belong to multiple GitLab Duo namespaces, but have not chosen one as your default namespace.
To resolve this, you can do either of the following:
- [Assign a default GitLab Duo namespace](#assign-a-default-gitlab-duo-namespace).
- To opt out of this requirement whilst the model selection feature is in beta, ask [GitLab Support](https://about.gitlab.com/support/) to disable the `ai_user_default_duo_namespace` feature flag.
|
https://docs.gitlab.com/user/use_cases
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/use_cases.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
use_cases.md
|
AI-powered
|
AI Framework
|
This page is maintained by Developer Relations, author @dnsmichi, see https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/content/#maintained-documentation
|
GitLab Duo use cases
|
AI-native features and functionality.
|
The following use cases provide practical examples, exercises, and workflows with GitLab Duo.
Learn how to:
- Refactor existing source code.
- Use GitLab Duo Root Cause Analysis to troubleshoot failed jobs.
- Solve security vulnerabilities.
{{< alert type="note" >}}
If you have GitLab Self-Managed: GitLab Duo requires GitLab 17.2 and later for the best user experience and results. Earlier versions may continue to work, however the experience may be degraded.
{{< /alert >}}
## Use GitLab Duo to solve development challenges
### Start with a C# application
In these examples, open your C# IDE, ensure that [GitLab Duo is enabled](turn_on_off.md),
and explore how to use GitLab Duo AI-native features for more efficiency.
#### CLI tool for querying the GitLab REST API
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the [GitLab Duo Coffee Chat: Get started with C#](https://www.youtube.com/watch?v=AdRtX9L--Po)
<!-- Video published on 2024-01-30 -->
The challenge is to create a CLI tool for querying the GitLab REST API.
- Ask GitLab Duo Chat how to start a new C# project and learn how to use the dotNET CLI:
```markdown
How can I get started creating an empty C# console application in VS Code?
```
- Use Code Suggestions to generate a REST API client with a new code comment:
```csharp
// Connect to a REST API and print the response
```
- The generated source code might need an explanation: Use the code task `/explain`
to get an insight how the REST API calls work.
After the source code is generated from a Code Suggestions comment,
you need to configure CI/CD.
- Chat can help with best practices for a `.gitignore` file for C#:
```markdown
Show a .gitignore and .gitlab-ci.yml configuration for a C# project.
```
- If your CI/CD job fails, use Root Cause Analysis to [troubleshoot failed CI/CD jobs](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis).
Alternatively, you can copy the error message into
GitLab Duo Chat, and ask for help:
```markdown
Explain the CI/CD error: The current .NET SDK does not support targeting
.NET 8.0
```
- To create tests later, ask GitLab Duo to use the code task `/refactor` to refactor
the selected code into a function.
- Chat can also explain programming language specific keywords and functions, or C#
compiler errors.
```markdown
Can you explain async and await in C# with practical examples?
explain error CS0122: 'Program' is inaccessible due to its protection level
```
- Generate tests by using the `/tests` code task.
The next question is where to put the generated tests in C# solutions.
As a beginner, you might not know that the application and test projects must exist on the same
solutions level to avoid import problems.
- GitLab Duo Chat can help by asking and refining the prompt questions:
```markdown
In C# and VS Code, how can I add a reference to a project from a test project?
Provide the XML configuration which I can add to a C# .csproj file to add a
reference to another project in the existing solution?
```
- Sometimes, you must refine the prompt to get better results. The prompt
`/refactor into the public class` creates a proposal for code that can be accessed
from the test project later.
```markdown
/refactor into the public class
```
- You can also use the `/refactor` code task to ask Chat how to execute tests in the
`.gitlab-ci.yml` file.
```markdown
/refactor add a job to run tests (the test project)
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-29)
### Improve a C++ application
#### Refactor a C++ application with SQLite
In this example, existing source code with a single main function exists. It repeats code, and cannot be tested.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the [GitLab Duo Coffee Chat: C++, SQLite and CMake](https://www.youtube.com/watch?v=zGOo1jzQ5zM)
<!-- Video published on 2024-01-10 -->
To refactor the source code into reusable and testable functions:
1. Open VS Code or the Web IDE with GitLab Duo enabled.
1. Select the source code, and use a refined prompt to ask GitLab Duo Chat to refactor it into functions:
```markdown
/refactor into functions
```
This refactoring step might not work for the entire selected source code.
1. Split the refactoring strategy into functional blocks.
For example, iterate on all insert, update, and delete operations in the database.
1. To generate tests for the newly created functions, select the source code again and
use the code task `/tests`. Include a specific prompt of instructions for the test framework:
```markdown
/tests using the CTest test framework
```
1. If your application uses the `Boost.Test` framework instead, refine the prompt:
```markdown
/tests using the Boost.Test framework
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-09)
#### Refactor C++ functions into object-oriented code
In this example, existing source code has been wrapped into functions.
To support more database types in the future, the code must be refactored into classes and object inheritance.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps in [GitLab Duo Coffee Chat: Refactor C++ functions into `OOP` classes](https://www.youtube.com/watch?v=Z9EJh0J9358)
<!-- Video published on 2024-01-24 -->
##### Start working on the class
- Ask GitLab Duo Chat how to implement an object-oriented pattern for a base database class and inherit it in a SQLite class:
```markdown
Explain a generic database implementation using a base class, and SQLite specific class using C++. Provide source examples and steps to follow.
```
- The learning curve includes asking GitLab Duo Chat about pure virtual functions and virtual function overrides in the implementation class.
```markdown
What is a pure virtual function, and what is required for the developer inheriting from that class?
```
- Code tasks can help refactoring the code. Select the functions in the C++ header file, and use a refined prompt:
```markdown
/refactor into class with public functions, and private path/db attributes. Inherit from the base class DB
/refactor into a base class with pure virtual functions called DB. Remote the SQLite specific parts.
```
- GitLab Duo Chat also guides with constructor overloading, object initialization, and optimized memory management with shared pointers.
```markdown
How to add a function implementation to a class in a cpp file?
How to pass values to class attributes through the class constructor call?
```
##### Find better answers
- The following question did not provide enough context.
```markdown
Should I use virtual override instead of just override?
```
- Instead, try to add more context to get better answers.
```markdown
When implementing a pure virtual function in an inherited class, should I use virtual function override, or just function override? Context is C++.
```
- A relatively complex question involves how to instantiate an object from the newly created class, and call specific functions.
```markdown
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer pointers.
```
- The result can be helpful, but needed refinements for shared pointers and required source code headers.
```markdown
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer shared pointers. Explain which header includes are necessary.
```
- Code Suggestions helps generate the correct syntax for `std::shared_ptr` pointer arithmetic and help improve the code quality.
```cpp
// Define the SQLite path in a variable, default value database.db
// Create a shared pointer for the SQLite class
// Open a database connection using OpenConnection
```
##### Refactor your code
- After refactoring the source code, compiler errors may occur. Ask Chat to explain them.
```markdown
Explain the error: `db` is a private member of `SQLiteDB`
```
- A specific SQL query string should be refactored into a multi-line string for more efficient editing.
```cpp
std::string sql = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL)";
```
- Select the source code, and use the `/refactor` code task:
```markdown
/refactor into a stringstream with multiple lines
```
- You can also refactor utility functions into a class with static functions in C++ and then ask Chat how to call them.
```markdown
/refactor into a class providing static functions
How to call the static functions in the class?
```
After refactoring the source code, the foundation for more database types is built, and overall code quality improved.
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-23)
### Explain, test, and refactor a Kotlin application
In this example, the adventure application from the [Kotlin Code Generation prompts](use_cases.md#kotlin-code-generation-prompts)
must be analyzed, and improved with refactoring and tests.
The current source code looks like this:
```kotlin
package org.example
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
val choice = readLine()?.toIntOrNull() ?: 0
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Math.random() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
1. Select the source code in the IDE, then right-click for GitLab Duo Chat to explain the code.
1. Refine the prompts to learn more about bugs, optimization tips, or vulnerabilities:
```markdown
/explain focus on bugs and improvements
The provided code is a simple text adventure game written in Kotlin. It allows the user to search for a golden LEGO brick or
examine the room. While the code is functional, there are a few potential bugs and areas for improvement:
1. Potential Bugs:
The searchForBrick() function uses Math.random() to determine if the player finds the golden LEGO brick. However, this function
does not handle the case where the player finds the brick. The game will continue indefinitely, even after the player has found
the brick.
2. Improvements:
Game Over Condition: The game should have a proper game over condition when the player finds the golden LEGO brick. This could
be achieved by introducing a boolean flag or a separate game state to track whether the brick has been found.
```
1. Use the `/tests` command to ask Chat to generate tests for the selected code:
```markdown
/tests
To test the code, we can use JUnit for Kotlin. Here are some tests you can write:
import org.junit.jupiter.api.Test
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.PrintStream
class TextAdventureTest {
private val standardOut = System.out
private val standardIn = System.`in`
@Test
fun `test searchForBrick success`() {
val outContent = ByteArrayOutputStream()
System.setOut(PrintStream(outContent))
searchForBrick()
val output = outContent.toString().trim()
assert(output.contains("Congratulations! You found the golden LEGO brick!"))
System.setOut(standardOut)
}
...
}
```
After you ensure that everything is tested, ask Chat to refactor the selected code:
```markdown
/refactor fix bugs, improve UX
...
Improvements:
Extracted the menu printing logic into a separate printMenu function for better code organization and readability.
Used Random.nextDouble() instead of Math.random() for better compatibility with Kotlin's standard library.
Added a prompt for the user to enter their choice after printing the menu.
Removed the unnecessary gameOver variable initialization, as it's already assigned a value in the createTextAdventure function.
Added a comment in the searchForBrick function to remind you to add additional logic or game over condition if needed.
These changes should improve the code's readability, maintainability, and user experience.
```
The refactored source code can look like this:
```kotlin
package org.example
import kotlin.random.Random
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
printMenu()
val choice = readLine()?.toIntOrNull()
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun printMenu() {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
print("Enter your choice: ")
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Random.nextDouble() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
// Add additional logic or game over condition here
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
### Get Started with PowerShell
{{< alert type="note" >}}
PowerShell support is [experimental](../project/repository/code_suggestions/supported_extensions.md#add-support-for-more-languages).
{{< /alert >}}
1. Use GitLab Duo Chat to ask how to get started with a PowerShell script that prints the file size of the current directory.
```markdown
How to get started with a PowerShell script that prints the file size of the current directory?
```
Alternatively, you can use Code Suggestions to generate the source code.
1. Create a new script `get-file-sizes.ps1` with the following content:
```powershell
# Collect the files in a directory and print their size
```
1. Wait for Code Suggestions to complete the prompt, and then add the following prompts to
experiment with different output formats:
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
```
1. Repeat the steps with prompts for different export formats,
or use Code Suggestions auto-complete. For example:
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
$csvFile = "$directory\file-sizes.csv"
$fileData = foreach ($file in $files) {
[PSCustomObject]@{
FileName = $file.Name
FileSize = [Math]::Round(($file.Length / 1KB), 2)
}
}
$fileData | Export-Csv -Path $csvFile -NoTypeInformation
Write-Host "File sizes saved to $csvFile"
# Repeat the code above but store the results in a JSON file
$jsonFile = "$directory\file-sizes.json"
$fileData | ConvertTo-Json | Out-File -FilePath $jsonFile
Write-Host "File sizes saved to $jsonFile"
# Repeat the code above but store the results in a XML file
$xmlFile = "$directory\file-sizes.xml"
$fileData | ConvertTo-Xml -NoTypeInformation | Out-File -FilePath $xmlFile
Write-Host "File sizes saved to $xmlFile"
# Repeat the code above but store the results in a HTML file
$htmlFile = "$directory\file-sizes.html"
$fileData | ConvertTo-Html -Property FileName, FileSize | Out-File -FilePath $htmlFile
Write-Host "File sizes saved to $htmlFile"
# Repeat the code above but store the results in a TXT file
$txtFile = "$directory\file-sizes.txt"
$fileData | Out-File -FilePath $txtFile
Write-Host "File sizes saved to $txtFile"
```
## Explain and resolve vulnerabilities
### Vulnerabilities in C code
In this example, detected security vulnerabilities in C should be fixed with the help from GitLab Duo.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps [GitLab Duo Coffee Chat: Vulnerability Resolution Challenge #1](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
<!-- Video published on 2024-01-30 -->
[This source code snippet](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30/-/blob/4685e4e1c658565ae956ad9befdfcc128e60c6cf/src/main-vulnerable-source.c)
introduces a security vulnerability with a [buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow):
```c
strcpy(region, "Hello GitLab Duo Vulnerability Resolution challenge");
printf("Contents of region: %s\n", region);
```
[SAST security scanners](../application_security/sast/analyzers.md) can detect and report the problem. Use [Vulnerability Explanation](../application_security/vulnerabilities/_index.md#vulnerability-explanation) to understand the problem.
Vulnerability Resolution helps to generate an MR.
If the suggested changes do not fit requirements, or might lead to problems, you can use Code Suggestions and Chat to refine. For example:
1. Open VS Code or the Web IDE with GitLab Duo enabled, and add a comment with instructions:
```c
// Avoid potential buffer overflows
// Possible AI-generated code below
strncpy(region, "Hello GitLab Duo Vulnerability Resolution challenge", pagesize);
region[pagesize-1] = '\0';
printf("Contents of region: %s\n", region);
```
1. Delete the suggested code, and use a different comment to use an alternative method.
```c
// Avoid potential buffer overflows using snprintf()
// Possible AI-generated code below
snprintf(region, pagesize, "Hello GitLab Duo Vulnerability Resolution challenge");
printf("Contents of region: %s\n", region);
```
1. Use GitLab Duo Chat to ask questions. The `/refactor` code task can generate different suggestions.
If you prefer a specific algorithm or function, refine the prompt:
```markdown
/refactor using snprintf
```
Resources:
- Project with source code: [GitLab Duo Coffee Chat 2024-01-30 - Vulnerability Resolution Challenge](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30)
## Answer questions about GitLab
In this example, the challenge is to use GitLab Duo Chat to solve problems.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps in [GitLab Duo Coffee Chat: Solve problems with GitLab Duo Chat Challenge](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
<!-- Video published on 2024-02-02 -->
- You can use GitLab Duo Chat to explain CI/CD errors.
```markdown
Explain this CI/CD error: build.sh: line 14: go command not found
```
- What happens when you are impatient, and input just one or two words?
```markdown
labels
issue labels
```
GitLab Duo Chat asks for more context.
- Refine your question into a full sentence, describing the problem and asking for a solution.
```markdown
Explain labels in GitLab. Provide an example for efficient usage.
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-02-01)
## Root Cause Analysis use cases
Use Root Cause Analysis to determine the root cause of a CI/CD
job failure. The following examples illustrate common errors, and
encourage you to fork and practice finding and fixing the root cause.
For more information, see the blog post [Developing GitLab Duo: Blending AI and Root Cause Analysis to fix CI/CD pipelines](https://about.gitlab.com/blog/2024/06/06/developing-gitlab-duo-blending-ai-and-root-cause-analysis-to-fix-ci-cd/).
### Analyze missing Go runtime
CI/CD jobs can be executed in containers, spawned from the contributed `image`
attribute. If the container does not provide a programming language runtime,
the executed `script` sections that reference the `go` binary fail. For example,
the error message `/bin/sh: eval: line 149: go: not found` must be understood
and fixed. If the `go` command is not found in the container's runtime context,
it might be due to multiple reasons:
- The job uses a minimal container image like `alpine`, and the Go language
runtime was not installed.
- The job uses the wrong default container image specified in
the CI/CD configuration, or uses the `default` keyword.
- The job uses the shell executor instead of the container image. The host operating
system is broken, doesn't have the Go language runtime installed, or is not
configured.
The project [Challenge: Root Cause Analysis - Go GitLab Release Fetcher](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-challenges/root-cause-analysis/challenge-root-cause-analysis-go-gitlab-release-fetcher)
provides an exercise to analyze and fix CI/CD problems with a Go Tanuki app. In this exercise,
the `build` and `docker-build` jobs are failing. When you have fixed
the problem, the CI/CD pipeline succeeds and the `build` job prints an output.
The `solution/` directory provides two possible solutions.
## Use GitLab Duo to contribute to GitLab
GitLab Duo usage focuses on contributing to the GitLab codebase, and how customers can contribute more efficiently.
The GitLab codebase is large, and requires to understand sometimes complex algorithms or application specific implementations.
### Contribute to frontend: Profile Settings
In this example, the challenge is to update the GitLab profile page and improve the social networks settings.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the recording here: [GitLab Duo Coffee Chat: Contribute to GitLab using Code Suggestions and Chat](https://www.youtube.com/watch?v=TauP7soXj-E)
<!-- Video published on 2024-02-23 -->
You can use GitLab Duo Chat to explain and refactor code, and generate tests.
Code Suggestions help complete existing code, and can generate new functions and algorithms in Ruby, Go, or VueJS.
1. Use the `/explain` code task to explain selected code sections, and learn how the HAML templates work.
1. You can refine the code task prompts, and instead ask `/explain how HAML rendering works`
Alternatively, you can write in the chat prompt directly, for example:
```markdown
how to populate a select in haml
```
The refactoring examples involve the following:
1. `/refactor into a HAML dropdown`
1. After inspecting the existing UI form code, refine the prompt to `/refactor into a HAML dropdown with a form select`
GitLab Duo Chat helped with error debugging, prefixing the error message:
```markdown
Explain this error: undefined method `icon` for
```
## Code generation prompts
The following examples provide [code generation](../project/repository/code_suggestions/_index.md#best-practices-for-code-generation)
prompts for the [supported languages](../project/repository/code_suggestions/supported_extensions.md) in GitLab Duo.
You can use multi-line comments to refine code generation prompts.
The examples are stored in the [GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts),
maintained by the Developer Relations team. These examples are tested working. You should review and adapt them for your environment.
### C code generation prompts
Create a Linux statistics tool that collects I/O, performance, disk usage, and TCP latency
and prints their output. For a full example, see the blog post [Top tips for efficient AI-powered Code Suggestions with GitLab Duo blog post](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/#code-suggestions-flow-with-comments).
```c
// Create a Linux statistic tool
// Collect IO, performance, disk usage, TCP latency
// Print summaries
// Import required headers
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <sys/statfs.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
int main() {
struct stat statbuf;
if (stat("/etc", &statbuf) != 0) {
perror("stat");
return 1;
}
printf("IO Block Size: %ld\n", statbuf.st_blksize);
// TODO: add CPU usage, disk usage, network latency measurements
```
The AI-generated source code examples are available in the [`c` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c?ref_type=heads).
### C++ code generation prompts
Create a CLI application that acts as HTTP client.
```c++
// Create a CLI app as HTTP client
// Create a main function
// Include all headers
// Read program options: URL, API endpoint, basic auth
#include <iostream>
#include <curl/curl.h>
#include <string>
int main(int argc, char** argv) {
std::string url;
std::string endpoint;
std::string username;
std::string password;
// Parse command line options
// ...
CURL* curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
// Set up basic auth
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_easy_setopt(curl, CURLOPT_USERPWD, (username + ":" + password).c_str());
CURLcode res = curl_easy_perform(curl);
if(res != CURLE_OK) {
std::cerr << "Request failed: " << curl_easy_strerror(res) << std::endl;
}
curl_easy_cleanup(curl);
}
return 0;
}
```
Create an application to manage distributed file nodes.
```c++
// Create an application to manage distributed file nodes
// Provide an overview the health state of nodes
// Use OOP patterns to define the base file node
// Add specific filesystems inherited from the base file
class FileNode {
public:
std::string name;
std::string ipAddress;
int port;
HealthState healthState;
FileNode(std::string name, std::string ipAddress, int port)
: name(name), ipAddress(ipAddress), port(port), healthState(HealthState::Healthy) {}
void setHealthState(HealthState state) {
healthState = state;
}
};
class LocalFileNode : public FileNode {
public:
std::string mountPoint;
LocalFileNode(std::string name, std::string mountPoint)
: FileNode(name, "127.0.0.1", 0), mountPoint(mountPoint) {}
};
class NetworkFileNode : public FileNode {
public:
std::string user;
std::string password;
NetworkFileNode(std::string name, std::string ipAddress, int port, std::string user, std::string password)
: FileNode(name, ipAddress, port), user(user), password(password) {}
};
int main(){
}
```
Create an eBPF program which attaches to `XDP` kernel events to measure network traffic.
Only works on Linux kernels.
```c++
// Create an eBPF program which attaches to XDP kernel events
// Count all packets by IP address
// Print a summary
// Include necessary headers
#include <bpf/bpf.h>
struct data {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__type(key, uint32_t);
__type(value, uint64_t);
};
BPF_TABLE("array", int, long, counts, 1024);
int xdp_prog(struct xdp_md *ctx) {
void* data_end = (void*)(long)ctx->data_end;
void* data = (void*)(long)ctx->data;
struct ethhdr *eth = data;
if ((void*)eth + sizeof(*eth) <= data_end) {
struct iphdr *ip = data + sizeof(*eth);
if ((void*)ip + sizeof(*ip) <= data_end) {
counts.increment(ip->saddr);
}
}
return XDP_PASS;
}
```
The AI-generated source code examples are available in the [`c++` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c%2B%2B?ref_type=heads).
### `C#` code generation prompts
Create a medical analyzer app from different sensors, and store the data in `MSSQL`.
```c#
// Create a medical analyzer app
// Collect data from different sensors
// Store data in MSSQL
// Provide methods to access the sensor data
using System.Data.SqlClient;
namespace MedicalAnalyzer
{
public class SensorDataStore
{
private SqlConnection connection;
public SensorDataStore()
{
// Create SQL Server connection
connection = new SqlConnection("connection string here");
}
public void StoreSensorData(SensorData data)
{
// Open connection
connection.Open();
// Insert sensor data into database
var command = connection.CreateCommand();
command.CommandText = "INSERT INTO SensorData (Timestamp, DeviceId, Value) " +
"VALUES (@timestamp, @deviceId, @value)";
command.Parameters.AddWithValue("@timestamp", data.Timestamp);
command.Parameters.AddWithValue("@deviceId", data.DeviceId);
command.Parameters.AddWithValue("@value", data.Value);
command.ExecuteNonQuery();
// Close connection
connection.Close();
}
public SensorData[] GetSensorData(DateTime startTime, DateTime endTime)
{
// Query database and return results
}
}
}
```
The AI-generated source code examples are available in the [`c#` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c%23?ref_type=heads).
### CSS code generation prompts
```css
/* Create CSS classes for animating a rainbow */
@keyframes rainbow {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.rainbow {
background: linear-gradient(to right, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff);
background-size: 600% 600%;
animation: rainbow 30s ease infinite;
}
```
The AI-generated source code examples are available in the [`css` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/css?ref_type=heads).
### Go code generation prompts
Create an observability application for Kubernetes which reads and prints the state of containers, pods, and services in the cluster.
```go
// Create a client for Kubernetes observability
// Create a function that
// Reads the kubernetes configuration file from the KUBECONFIG env var
// Create kubernetes context, namespace default
// Inspect container, pod, service status and print an overview
// Import necessary packages
// Create main package
package main
import (
"context"
"fmt"
"os"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func main() {
clientset := getClientset()
namespace := "default"
printPods(clientset, namespace)
printServices(clientset, namespace)
printContainers(clientset, namespace)
}
func getClientset() *kubernetes.Clientset {
kubeconfig := os.Getenv("KUBECONFIG")
config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
if err != nil {
panic(err)
}
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
panic(err)
}
return clientset
}
func printPods(clientset *kubernetes.Clientset, namespace string) {
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
fmt.Printf("There are %d pods in the %s namespace\n", len(pods.Items), namespace)
}
func printServices(clientset *kubernetes.Clientset, namespace string) {
services, err := clientset.CoreV1().Services(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
fmt.Printf("There are %d services in the %s namespace\n", len(services.Items), namespace)
}
// Create a function to print Containers
// Collect and print the count
func printContainers(clientset *kubernetes.Clientset, namespace string) {
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
var totalContainers int
for _, pod := range pods.Items {
totalContainers += len(pod.Spec.Containers)
}
fmt.Printf("There are %d containers in the %s namespace\n", totalContainers, namespace)
}
```
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the recording here: [GitLab Duo Coffee Chat: Code Generation Challenge with Go and Kubernetes Observability](https://www.youtube.com/watch?v=ORpRqp-A9hQ)
<!-- Video published on 2024-03-27. Maintainer: Developer Relations. -->
Create an in-memory key value store, similar to Redis. For a complete walkthrough, see the
blog post, [Top tips for efficient AI-powered Code Suggestions with GitLab Duo](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/#iterate-faster-with-code-generation)
blog post.
```go
// Create an in-memory key value store, similar to Redis
// Provide methods to
// set/unset keys
// update values
// list/print with filters
// Use BoltDB as external library
```
The AI-generated source code examples are available in the [`go` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/go?ref_type=heads).
### Java code generation prompts
Create a data analytics application, with different data sources for metrics.
Provide an API for data queries and aggregation.
```java
// Create a data analytics app
// Parse different input sources and their values
// Store the metrics in a columnar format
// Provide an API to query and aggregate data
```
The AI-generated source code examples are available in the [`java` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/java?ref_type=heads).
### JavaScript code generation prompts
Create a paid-time-off application for employees in ReactJS, with a date-time picker.
```javascript
// Create a Paid Time Off app for users
// Create a date-time picker in ReactJS
// Provide start and end options
// Show public holidays based on the selected country
// Send the request to a server API
```
The AI-generated source code examples are available in the [`javascript` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/javascript).
### HTML code generation prompts
```html
<!-- Create an AI knowledge base.
Describe where AI can help with efficient DevSecOps workflows.
Add a table with one Dev, one Ops, one Sec example.
-->
<table>
<tr>
<th>Dev</th>
<th>Ops</th>
<th>Sec</th>
</tr>
<tr>
<td>Automated testing and continuous integration</td>
<td>Infrastructure as code and automated provisioning</td>
<td>Static code analysis and vulnerability scanning</td>
</tr>
</table>
```
The AI-generated source code examples are available in the [`html` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/html).
### Kotlin code generation prompts
Generate a text adventure and search for a treasure. Add visual helpers and use random timer traps for game over.
```kotlin
package org.example
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
val choice = readLine()?.toIntOrNull() ?: 0
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Math.random() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
The AI-generated source code examples are available in the [`kotlin` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/kotlin?ref_type=heads).
### PHP code generation prompts
Create an RSS feed fetcher for GitLab releases, allow filtering by title.
```php
// Create a web form to show GitLab releases
// Fetch the RSS feed from https://about.gitlab.com/atom.xml
// Provide filter options for the title
$feedUrl = 'https://about.gitlab.com/atom.xml';
$xml = simplexml_load_file($feedUrl);
$titleFilter = $_GET['titleFilter'];
echo '<h1>GitLab Releases</h1>';
echo '<ul>';
foreach ($xml->entry as $entry) {
$title = $entry->title;
if (empty($titleFilter) || strpos($title, $titleFilter) !== false) {
echo '<li>' . $title . '</li>';
}
}
echo '</ul>';
```
The AI-generated source code examples are available in the [`php` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/php).
### PowerShell code generation prompts
Create a script which collects all files in a directory and prints their size.
Refine the prompt to store the results in a CSV or JSON file.
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
$csvFile = "$directory\file-sizes.csv"
$fileData = foreach ($file in $files) {
[PSCustomObject]@{
FileName = $file.Name
FileSize = [Math]::Round(($file.Length / 1KB), 2)
}
}
$fileData | Export-Csv -Path $csvFile -NoTypeInformation
Write-Host "File sizes saved to $csvFile"
# Repeat the code above but store the results in a JSON file
$jsonFile = "$directory\file-sizes.json"
$fileData | ConvertTo-Json | Out-File -FilePath $jsonFile
Write-Host "File sizes saved to $jsonFile"
```
The AI-generated source code examples are available in the [`powershell` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/powershell?ref_type=heads).
### Python code generation prompts
Create a webserver using Flask to manage users using the REST API, store them in SQLite.
```python
# Create a Flask webserver
# Add REST API entrypoints to manage users by ID
# Implement create, update, delete functions
# User data needs to be stored in SQlite, create table if not exists
# Run the server on port 8080, support TLS
# Print required packages for requirements.txt in a comment.
# Use Python 3.10 as default
# Potential AI-generated code below
import flask
from flask import request
import sqlite3
app = flask.Flask(__name__)
# Create SQLite database and users table if not exists
conn = sqlite3.connect('users.db')
conn.execute('''CREATE TABLE IF NOT EXISTS users
(id INTEGER PRIMARY KEY, name TEXT, email TEXT)''')
@app.route('/users', methods=['POST'])
def create_user():
# Get user data from request
name = request.form['name']
email = request.form['email']
# Insert user into database
conn.execute('INSERT INTO users (name, email) VALUES (?, ?)', (name, email))
return 'User created successfully'
@app.route('/users/<int:id>', methods=['PUT'])
def update_user(id):
# Get user data from request
name = request.form['name']
email = request.form['email']
# Update user in database
conn.execute('UPDATE users SET name = ?, email = ? WHERE id = ?', (name, email, id))
return 'User updated successfully'
@app.route('/users/<int:id>', methods=['DELETE'])
def delete_user(id):
# Delete user from database
conn.execute('DELETE FROM users WHERE id = ?', (id,))
return 'User deleted successfully'
if __name__ == '__main__':
# Required packages - flask, sqlite3
app.run(host='0.0.0.0', port=8080, ssl_context='adhoc')
```
The AI-generated source code examples are available in the [`python` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/python?ref_type=heads).
### Ruby code generation prompts
Create a log parser application which stores log data in Elasticsearch.
```ruby
# Create a Ruby app as log parser
# Provide hooks to replace sensitive strings in log lines
# Format the logs and store them in Elasticsearch
# Potential AI-generated code below
require 'logger'
require 'elasticsearch'
class LogParser
attr_reader :logger
def initialize
@logger = Logger.new(STDOUT)
@elasticsearch = Elasticsearch::Client.new
end
def parse_and_store(logs)
sanitized_logs = sanitize_logs(logs)
formatted_logs = format_logs(sanitized_logs)
store_in_elasticsearch(formatted_logs)
end
private
def sanitize_logs(logs)
logs.map { |line| sanitize_line(line) }
end
def sanitize_line(line)
# replace sensitive data
line.gsub(/\d{16}/, '[REDACTED]')
end
def format_logs(logs)
logs.map { |line| "#{Time.now}: #{line}" }
end
def store_in_elasticsearch(logs)
logs.each { |log| @elasticsearch.index(index: 'app-logs', document: log) }
end
end
```
Create a log client utility class that supports the syslog format with
severity levels, application name and message string.
```ruby
# Create Logging utility class
# Define default log level as attribute
# Add method for logging, inputs: level, app, message
# Print the data with formatted date and time in syslog format
# Potential AI-generated code below
class Logging
attr_accessor :log_level
def log(level, app, message)
time = Time.now.strftime("%b %d %H:%M:%S")
puts "#{time} #{app}[#{Process.pid}]: #{level} - #{message}"
end
end
# Instantiate class and test the log method
# Potential AI-generated code below
logger = Logging.new
logger.log_level = :debug
logger.log(:info, 'MyApp', 'Application started - info')
logger.log(:debug, 'MyApp', 'Application started - debug')
logger.log(:error, 'MyApp', 'Application started - error')
logger.log(:fatal, 'MyApp', 'Application started - fatal')
logger.log(:warn, 'MyApp', 'Application started - warn')
```
The AI-generated source code examples are available in the [`ruby` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/ruby).
### Rust code generation prompts
```rust
// Query the GitLab REST API
// Get all open merge requests for gitlab-org/gitlab
use serde_json::Value;
fn main() {
let client = reqwest::blocking::Client::new();
let url = "https://gitlab.com/api/v4/projects/278964/merge_requests?state=opened";
let response = client.get(url).send().unwrap().text().unwrap();
let json: Value = serde_json::from_str(&response).unwrap();
// TODO: Pagination, default fetch results: 20
// Read the response headers to access the next page
println!("{}", json.to_string());
for mr in json.as_array().unwrap() {
println!("{} - URL: {}", mr["title"], mr["web_url"]);
}
}
```
Create an RSS feed reader app, example from the blog post [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/).
```rust
// Create a function that iterates over the source array
// and fetches the data using HTTP from the RSS feed items.
// Store the results in a new hash map.
// Print the hash map to the terminal.
```
The AI-generated source code examples are available in the [`rust` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/rust?ref_type=heads).
### Scala code generation prompts
```scala
// Implement Newtons Method
// Create an object with a main function
// Add a function that implements Newtons method for solving equations
// Add a driver function which tests the implemented function
object NewtonsMethod {
def solveEquation(f: Double => Double, df: Double => Double, x0: Double, tolerance: Double): Double = {
var x = x0
var error = Double.PositiveInfinity
while (math.abs(error) > tolerance) {
error = f(x) / df(x)
x -= error
}
x
}
def main(args: Array[String]): Unit = {
val f: Double => Double = x => x * x - 4
val df: Double => Double = x => 2 * x
val x0 = 3.0
val tolerance = 1e-6
val root = solveEquation(f, df, x0, tolerance)
println(s"The root is: $root")
}
}
```
The AI-generated source code examples are available in the [`scala` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/scala?ref_type=heads).
### Shell scripts code generation prompts
Create a script `mytop.sh` that displays the top 10 processes by CPU, memory and disk I/O usage.
Start with the first code comment, and let Code Suggestions generate everything else.
```shell
#!/bin/bash
# Get the top 10 processes by CPU usage
top -b -n 1 | head -n 11 | awk '{print $1, $2, $3, $9}' | column -t
# Get the top 10 processes by memory usage
top -b -n 1 | head -n 11 | awk '{print $1, $2, $4, $6}' | column -t
# Get the top 10 processes by disk I/O
top -b -n 1 | head -n 11 | awk '{print $1, $2, $7, $8}' | column -t
# Get the top 10 processes by network I/O
top -b -n 1 | head -n 11 | awk '{print $1, $2, $10, $11}' | column -t
```
The AI-generated source code examples are available in the [`shell` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/shell?ref_type=heads).
### TypeScript code generation prompts
Create a utility function that parses IPv6 and IPv4 address formats.
```typescript
"use strict";
// Generate a TypeScript function which parses IPv6 and IPv4 address formats
// Use regular expressions
function parseAddress(address) {
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (ipv6Regex.test(address)) {
return {
ipVersion: 6,
address
};
}
else if (ipv4Regex.test(address)) {
return {
ipVersion: 4,
address
};
}
else {
throw new Error('Invalid IP address');
}
}
// Test the function with random inputs
const testInputs = [
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',
'192.168.0.1',
'not-an-ip'
];
for (const input of testInputs) {
try {
const result = parseAddress(input);
console.log(result);
}
catch (error) {
console.error(`Invalid address: ${input}`);
}
}
```
The AI-generated source code examples are available in the [`typescript` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/typescript?ref_type=heads).
## Resources
Many of the use cases are available as hands-on recordings in the [GitLab Duo Coffee Chat YouTube playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp5uj_JgQiSvHw1jQu0mSVZ).
### Blog resources
The following blog posts provide tutorials for these use cases:
- [Top tips for efficient AI-powered Code Suggestions with GitLab Duo](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/)
- [10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/)
- [GitLab Duo Chat 101: Get more done on GitLab with our AI assistant](https://about.gitlab.com/blog/2024/05/29/gitlab-duo-chat-101-get-more-done-on-gitlab-with-our-ai-assistant/)
- [Developing GitLab Duo: How we are dogfooding our AI features](https://about.gitlab.com/blog/2024/05/20/developing-gitlab-duo-how-we-are-dogfooding-our-ai-features/)
- [Developing GitLab Duo: Secure and thoroughly test AI-generated code](https://about.gitlab.com/blog/2024/05/30/how-gitlab-duo-helps-secure-and-thoroughly-test-ai-generated-code/)
- [Developing GitLab Duo: Blending AI and Root Cause Analysis to fix CI/CD pipelines](https://about.gitlab.com/blog/2024/06/06/developing-gitlab-duo-blending-ai-and-root-cause-analysis-to-fix-ci-cd/)
- [Developing GitLab Duo: AI Impact analytics dashboard measures the ROI of AI](https://about.gitlab.com/blog/2024/05/15/developing-gitlab-duo-ai-impact-analytics-dashboard-measures-the-roi-of-ai/)
Code Suggestions tutorial blog posts are available for the following languages:
- [Learning Rust with a little help from AI](https://about.gitlab.com/blog/2023/08/10/learning-rust-with-a-little-help-from-ai-code-suggestions-getting-started/)
- [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/)
- [Learning Python with a little help from AI](https://about.gitlab.com/blog/2023/11/09/learning-python-with-a-little-help-from-ai-code-suggestions/)
- [Write Terraform plans faster with GitLab Duo Code Suggestions](https://about.gitlab.com/blog/2024/01/24/write-terraform-plans-faster-with-gitlab-duo-code-suggestions/)
- [Explore the Dragon Realm: Build a C++ adventure game with a little help from AI](https://about.gitlab.com/blog/2023/08/24/building-a-text-adventure-using-cplusplus-and-code-suggestions/)
|
---
stage: AI-powered
group: AI Framework
info: This page is maintained by Developer Relations, author @dnsmichi, see https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/content/#maintained-documentation
description: AI-native features and functionality.
title: GitLab Duo use cases
breadcrumbs:
- doc
- user
- gitlab_duo
---
The following use cases provide practical examples, exercises, and workflows with GitLab Duo.
Learn how to:
- Refactor existing source code.
- Use GitLab Duo Root Cause Analysis to troubleshoot failed jobs.
- Solve security vulnerabilities.
{{< alert type="note" >}}
If you have GitLab Self-Managed: GitLab Duo requires GitLab 17.2 and later for the best user experience and results. Earlier versions may continue to work, however the experience may be degraded.
{{< /alert >}}
## Use GitLab Duo to solve development challenges
### Start with a C# application
In these examples, open your C# IDE, ensure that [GitLab Duo is enabled](turn_on_off.md),
and explore how to use GitLab Duo AI-native features for more efficiency.
#### CLI tool for querying the GitLab REST API
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the [GitLab Duo Coffee Chat: Get started with C#](https://www.youtube.com/watch?v=AdRtX9L--Po)
<!-- Video published on 2024-01-30 -->
The challenge is to create a CLI tool for querying the GitLab REST API.
- Ask GitLab Duo Chat how to start a new C# project and learn how to use the dotNET CLI:
```markdown
How can I get started creating an empty C# console application in VS Code?
```
- Use Code Suggestions to generate a REST API client with a new code comment:
```csharp
// Connect to a REST API and print the response
```
- The generated source code might need an explanation: Use the code task `/explain`
to get an insight how the REST API calls work.
After the source code is generated from a Code Suggestions comment,
you need to configure CI/CD.
- Chat can help with best practices for a `.gitignore` file for C#:
```markdown
Show a .gitignore and .gitlab-ci.yml configuration for a C# project.
```
- If your CI/CD job fails, use Root Cause Analysis to [troubleshoot failed CI/CD jobs](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis).
Alternatively, you can copy the error message into
GitLab Duo Chat, and ask for help:
```markdown
Explain the CI/CD error: The current .NET SDK does not support targeting
.NET 8.0
```
- To create tests later, ask GitLab Duo to use the code task `/refactor` to refactor
the selected code into a function.
- Chat can also explain programming language specific keywords and functions, or C#
compiler errors.
```markdown
Can you explain async and await in C# with practical examples?
explain error CS0122: 'Program' is inaccessible due to its protection level
```
- Generate tests by using the `/tests` code task.
The next question is where to put the generated tests in C# solutions.
As a beginner, you might not know that the application and test projects must exist on the same
solutions level to avoid import problems.
- GitLab Duo Chat can help by asking and refining the prompt questions:
```markdown
In C# and VS Code, how can I add a reference to a project from a test project?
Provide the XML configuration which I can add to a C# .csproj file to add a
reference to another project in the existing solution?
```
- Sometimes, you must refine the prompt to get better results. The prompt
`/refactor into the public class` creates a proposal for code that can be accessed
from the test project later.
```markdown
/refactor into the public class
```
- You can also use the `/refactor` code task to ask Chat how to execute tests in the
`.gitlab-ci.yml` file.
```markdown
/refactor add a job to run tests (the test project)
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-29)
### Improve a C++ application
#### Refactor a C++ application with SQLite
In this example, existing source code with a single main function exists. It repeats code, and cannot be tested.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the [GitLab Duo Coffee Chat: C++, SQLite and CMake](https://www.youtube.com/watch?v=zGOo1jzQ5zM)
<!-- Video published on 2024-01-10 -->
To refactor the source code into reusable and testable functions:
1. Open VS Code or the Web IDE with GitLab Duo enabled.
1. Select the source code, and use a refined prompt to ask GitLab Duo Chat to refactor it into functions:
```markdown
/refactor into functions
```
This refactoring step might not work for the entire selected source code.
1. Split the refactoring strategy into functional blocks.
For example, iterate on all insert, update, and delete operations in the database.
1. To generate tests for the newly created functions, select the source code again and
use the code task `/tests`. Include a specific prompt of instructions for the test framework:
```markdown
/tests using the CTest test framework
```
1. If your application uses the `Boost.Test` framework instead, refine the prompt:
```markdown
/tests using the Boost.Test framework
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-09)
#### Refactor C++ functions into object-oriented code
In this example, existing source code has been wrapped into functions.
To support more database types in the future, the code must be refactored into classes and object inheritance.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps in [GitLab Duo Coffee Chat: Refactor C++ functions into `OOP` classes](https://www.youtube.com/watch?v=Z9EJh0J9358)
<!-- Video published on 2024-01-24 -->
##### Start working on the class
- Ask GitLab Duo Chat how to implement an object-oriented pattern for a base database class and inherit it in a SQLite class:
```markdown
Explain a generic database implementation using a base class, and SQLite specific class using C++. Provide source examples and steps to follow.
```
- The learning curve includes asking GitLab Duo Chat about pure virtual functions and virtual function overrides in the implementation class.
```markdown
What is a pure virtual function, and what is required for the developer inheriting from that class?
```
- Code tasks can help refactoring the code. Select the functions in the C++ header file, and use a refined prompt:
```markdown
/refactor into class with public functions, and private path/db attributes. Inherit from the base class DB
/refactor into a base class with pure virtual functions called DB. Remote the SQLite specific parts.
```
- GitLab Duo Chat also guides with constructor overloading, object initialization, and optimized memory management with shared pointers.
```markdown
How to add a function implementation to a class in a cpp file?
How to pass values to class attributes through the class constructor call?
```
##### Find better answers
- The following question did not provide enough context.
```markdown
Should I use virtual override instead of just override?
```
- Instead, try to add more context to get better answers.
```markdown
When implementing a pure virtual function in an inherited class, should I use virtual function override, or just function override? Context is C++.
```
- A relatively complex question involves how to instantiate an object from the newly created class, and call specific functions.
```markdown
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer pointers.
```
- The result can be helpful, but needed refinements for shared pointers and required source code headers.
```markdown
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer shared pointers. Explain which header includes are necessary.
```
- Code Suggestions helps generate the correct syntax for `std::shared_ptr` pointer arithmetic and help improve the code quality.
```cpp
// Define the SQLite path in a variable, default value database.db
// Create a shared pointer for the SQLite class
// Open a database connection using OpenConnection
```
##### Refactor your code
- After refactoring the source code, compiler errors may occur. Ask Chat to explain them.
```markdown
Explain the error: `db` is a private member of `SQLiteDB`
```
- A specific SQL query string should be refactored into a multi-line string for more efficient editing.
```cpp
std::string sql = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL)";
```
- Select the source code, and use the `/refactor` code task:
```markdown
/refactor into a stringstream with multiple lines
```
- You can also refactor utility functions into a class with static functions in C++ and then ask Chat how to call them.
```markdown
/refactor into a class providing static functions
How to call the static functions in the class?
```
After refactoring the source code, the foundation for more database types is built, and overall code quality improved.
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-23)
### Explain, test, and refactor a Kotlin application
In this example, the adventure application from the [Kotlin Code Generation prompts](use_cases.md#kotlin-code-generation-prompts)
must be analyzed, and improved with refactoring and tests.
The current source code looks like this:
```kotlin
package org.example
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
val choice = readLine()?.toIntOrNull() ?: 0
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Math.random() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
1. Select the source code in the IDE, then right-click for GitLab Duo Chat to explain the code.
1. Refine the prompts to learn more about bugs, optimization tips, or vulnerabilities:
```markdown
/explain focus on bugs and improvements
The provided code is a simple text adventure game written in Kotlin. It allows the user to search for a golden LEGO brick or
examine the room. While the code is functional, there are a few potential bugs and areas for improvement:
1. Potential Bugs:
The searchForBrick() function uses Math.random() to determine if the player finds the golden LEGO brick. However, this function
does not handle the case where the player finds the brick. The game will continue indefinitely, even after the player has found
the brick.
2. Improvements:
Game Over Condition: The game should have a proper game over condition when the player finds the golden LEGO brick. This could
be achieved by introducing a boolean flag or a separate game state to track whether the brick has been found.
```
1. Use the `/tests` command to ask Chat to generate tests for the selected code:
```markdown
/tests
To test the code, we can use JUnit for Kotlin. Here are some tests you can write:
import org.junit.jupiter.api.Test
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.PrintStream
class TextAdventureTest {
private val standardOut = System.out
private val standardIn = System.`in`
@Test
fun `test searchForBrick success`() {
val outContent = ByteArrayOutputStream()
System.setOut(PrintStream(outContent))
searchForBrick()
val output = outContent.toString().trim()
assert(output.contains("Congratulations! You found the golden LEGO brick!"))
System.setOut(standardOut)
}
...
}
```
After you ensure that everything is tested, ask Chat to refactor the selected code:
```markdown
/refactor fix bugs, improve UX
...
Improvements:
Extracted the menu printing logic into a separate printMenu function for better code organization and readability.
Used Random.nextDouble() instead of Math.random() for better compatibility with Kotlin's standard library.
Added a prompt for the user to enter their choice after printing the menu.
Removed the unnecessary gameOver variable initialization, as it's already assigned a value in the createTextAdventure function.
Added a comment in the searchForBrick function to remind you to add additional logic or game over condition if needed.
These changes should improve the code's readability, maintainability, and user experience.
```
The refactored source code can look like this:
```kotlin
package org.example
import kotlin.random.Random
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
printMenu()
val choice = readLine()?.toIntOrNull()
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun printMenu() {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
print("Enter your choice: ")
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Random.nextDouble() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
// Add additional logic or game over condition here
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
### Get Started with PowerShell
{{< alert type="note" >}}
PowerShell support is [experimental](../project/repository/code_suggestions/supported_extensions.md#add-support-for-more-languages).
{{< /alert >}}
1. Use GitLab Duo Chat to ask how to get started with a PowerShell script that prints the file size of the current directory.
```markdown
How to get started with a PowerShell script that prints the file size of the current directory?
```
Alternatively, you can use Code Suggestions to generate the source code.
1. Create a new script `get-file-sizes.ps1` with the following content:
```powershell
# Collect the files in a directory and print their size
```
1. Wait for Code Suggestions to complete the prompt, and then add the following prompts to
experiment with different output formats:
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
```
1. Repeat the steps with prompts for different export formats,
or use Code Suggestions auto-complete. For example:
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
$csvFile = "$directory\file-sizes.csv"
$fileData = foreach ($file in $files) {
[PSCustomObject]@{
FileName = $file.Name
FileSize = [Math]::Round(($file.Length / 1KB), 2)
}
}
$fileData | Export-Csv -Path $csvFile -NoTypeInformation
Write-Host "File sizes saved to $csvFile"
# Repeat the code above but store the results in a JSON file
$jsonFile = "$directory\file-sizes.json"
$fileData | ConvertTo-Json | Out-File -FilePath $jsonFile
Write-Host "File sizes saved to $jsonFile"
# Repeat the code above but store the results in a XML file
$xmlFile = "$directory\file-sizes.xml"
$fileData | ConvertTo-Xml -NoTypeInformation | Out-File -FilePath $xmlFile
Write-Host "File sizes saved to $xmlFile"
# Repeat the code above but store the results in a HTML file
$htmlFile = "$directory\file-sizes.html"
$fileData | ConvertTo-Html -Property FileName, FileSize | Out-File -FilePath $htmlFile
Write-Host "File sizes saved to $htmlFile"
# Repeat the code above but store the results in a TXT file
$txtFile = "$directory\file-sizes.txt"
$fileData | Out-File -FilePath $txtFile
Write-Host "File sizes saved to $txtFile"
```
## Explain and resolve vulnerabilities
### Vulnerabilities in C code
In this example, detected security vulnerabilities in C should be fixed with the help from GitLab Duo.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps [GitLab Duo Coffee Chat: Vulnerability Resolution Challenge #1](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
<!-- Video published on 2024-01-30 -->
[This source code snippet](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30/-/blob/4685e4e1c658565ae956ad9befdfcc128e60c6cf/src/main-vulnerable-source.c)
introduces a security vulnerability with a [buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow):
```c
strcpy(region, "Hello GitLab Duo Vulnerability Resolution challenge");
printf("Contents of region: %s\n", region);
```
[SAST security scanners](../application_security/sast/analyzers.md) can detect and report the problem. Use [Vulnerability Explanation](../application_security/vulnerabilities/_index.md#vulnerability-explanation) to understand the problem.
Vulnerability Resolution helps to generate an MR.
If the suggested changes do not fit requirements, or might lead to problems, you can use Code Suggestions and Chat to refine. For example:
1. Open VS Code or the Web IDE with GitLab Duo enabled, and add a comment with instructions:
```c
// Avoid potential buffer overflows
// Possible AI-generated code below
strncpy(region, "Hello GitLab Duo Vulnerability Resolution challenge", pagesize);
region[pagesize-1] = '\0';
printf("Contents of region: %s\n", region);
```
1. Delete the suggested code, and use a different comment to use an alternative method.
```c
// Avoid potential buffer overflows using snprintf()
// Possible AI-generated code below
snprintf(region, pagesize, "Hello GitLab Duo Vulnerability Resolution challenge");
printf("Contents of region: %s\n", region);
```
1. Use GitLab Duo Chat to ask questions. The `/refactor` code task can generate different suggestions.
If you prefer a specific algorithm or function, refine the prompt:
```markdown
/refactor using snprintf
```
Resources:
- Project with source code: [GitLab Duo Coffee Chat 2024-01-30 - Vulnerability Resolution Challenge](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30)
## Answer questions about GitLab
In this example, the challenge is to use GitLab Duo Chat to solve problems.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the walkthrough of these steps in [GitLab Duo Coffee Chat: Solve problems with GitLab Duo Chat Challenge](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
<!-- Video published on 2024-02-02 -->
- You can use GitLab Duo Chat to explain CI/CD errors.
```markdown
Explain this CI/CD error: build.sh: line 14: go command not found
```
- What happens when you are impatient, and input just one or two words?
```markdown
labels
issue labels
```
GitLab Duo Chat asks for more context.
- Refine your question into a full sentence, describing the problem and asking for a solution.
```markdown
Explain labels in GitLab. Provide an example for efficient usage.
```
Resources:
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-02-01)
## Root Cause Analysis use cases
Use Root Cause Analysis to determine the root cause of a CI/CD
job failure. The following examples illustrate common errors, and
encourage you to fork and practice finding and fixing the root cause.
For more information, see the blog post [Developing GitLab Duo: Blending AI and Root Cause Analysis to fix CI/CD pipelines](https://about.gitlab.com/blog/2024/06/06/developing-gitlab-duo-blending-ai-and-root-cause-analysis-to-fix-ci-cd/).
### Analyze missing Go runtime
CI/CD jobs can be executed in containers, spawned from the contributed `image`
attribute. If the container does not provide a programming language runtime,
the executed `script` sections that reference the `go` binary fail. For example,
the error message `/bin/sh: eval: line 149: go: not found` must be understood
and fixed. If the `go` command is not found in the container's runtime context,
it might be due to multiple reasons:
- The job uses a minimal container image like `alpine`, and the Go language
runtime was not installed.
- The job uses the wrong default container image specified in
the CI/CD configuration, or uses the `default` keyword.
- The job uses the shell executor instead of the container image. The host operating
system is broken, doesn't have the Go language runtime installed, or is not
configured.
The project [Challenge: Root Cause Analysis - Go GitLab Release Fetcher](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-challenges/root-cause-analysis/challenge-root-cause-analysis-go-gitlab-release-fetcher)
provides an exercise to analyze and fix CI/CD problems with a Go Tanuki app. In this exercise,
the `build` and `docker-build` jobs are failing. When you have fixed
the problem, the CI/CD pipeline succeeds and the `build` job prints an output.
The `solution/` directory provides two possible solutions.
## Use GitLab Duo to contribute to GitLab
GitLab Duo usage focuses on contributing to the GitLab codebase, and how customers can contribute more efficiently.
The GitLab codebase is large, and requires to understand sometimes complex algorithms or application specific implementations.
### Contribute to frontend: Profile Settings
In this example, the challenge is to update the GitLab profile page and improve the social networks settings.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the recording here: [GitLab Duo Coffee Chat: Contribute to GitLab using Code Suggestions and Chat](https://www.youtube.com/watch?v=TauP7soXj-E)
<!-- Video published on 2024-02-23 -->
You can use GitLab Duo Chat to explain and refactor code, and generate tests.
Code Suggestions help complete existing code, and can generate new functions and algorithms in Ruby, Go, or VueJS.
1. Use the `/explain` code task to explain selected code sections, and learn how the HAML templates work.
1. You can refine the code task prompts, and instead ask `/explain how HAML rendering works`
Alternatively, you can write in the chat prompt directly, for example:
```markdown
how to populate a select in haml
```
The refactoring examples involve the following:
1. `/refactor into a HAML dropdown`
1. After inspecting the existing UI form code, refine the prompt to `/refactor into a HAML dropdown with a form select`
GitLab Duo Chat helped with error debugging, prefixing the error message:
```markdown
Explain this error: undefined method `icon` for
```
## Code generation prompts
The following examples provide [code generation](../project/repository/code_suggestions/_index.md#best-practices-for-code-generation)
prompts for the [supported languages](../project/repository/code_suggestions/supported_extensions.md) in GitLab Duo.
You can use multi-line comments to refine code generation prompts.
The examples are stored in the [GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts),
maintained by the Developer Relations team. These examples are tested working. You should review and adapt them for your environment.
### C code generation prompts
Create a Linux statistics tool that collects I/O, performance, disk usage, and TCP latency
and prints their output. For a full example, see the blog post [Top tips for efficient AI-powered Code Suggestions with GitLab Duo blog post](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/#code-suggestions-flow-with-comments).
```c
// Create a Linux statistic tool
// Collect IO, performance, disk usage, TCP latency
// Print summaries
// Import required headers
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <sys/statfs.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
int main() {
struct stat statbuf;
if (stat("/etc", &statbuf) != 0) {
perror("stat");
return 1;
}
printf("IO Block Size: %ld\n", statbuf.st_blksize);
// TODO: add CPU usage, disk usage, network latency measurements
```
The AI-generated source code examples are available in the [`c` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c?ref_type=heads).
### C++ code generation prompts
Create a CLI application that acts as HTTP client.
```c++
// Create a CLI app as HTTP client
// Create a main function
// Include all headers
// Read program options: URL, API endpoint, basic auth
#include <iostream>
#include <curl/curl.h>
#include <string>
int main(int argc, char** argv) {
std::string url;
std::string endpoint;
std::string username;
std::string password;
// Parse command line options
// ...
CURL* curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
// Set up basic auth
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_easy_setopt(curl, CURLOPT_USERPWD, (username + ":" + password).c_str());
CURLcode res = curl_easy_perform(curl);
if(res != CURLE_OK) {
std::cerr << "Request failed: " << curl_easy_strerror(res) << std::endl;
}
curl_easy_cleanup(curl);
}
return 0;
}
```
Create an application to manage distributed file nodes.
```c++
// Create an application to manage distributed file nodes
// Provide an overview the health state of nodes
// Use OOP patterns to define the base file node
// Add specific filesystems inherited from the base file
class FileNode {
public:
std::string name;
std::string ipAddress;
int port;
HealthState healthState;
FileNode(std::string name, std::string ipAddress, int port)
: name(name), ipAddress(ipAddress), port(port), healthState(HealthState::Healthy) {}
void setHealthState(HealthState state) {
healthState = state;
}
};
class LocalFileNode : public FileNode {
public:
std::string mountPoint;
LocalFileNode(std::string name, std::string mountPoint)
: FileNode(name, "127.0.0.1", 0), mountPoint(mountPoint) {}
};
class NetworkFileNode : public FileNode {
public:
std::string user;
std::string password;
NetworkFileNode(std::string name, std::string ipAddress, int port, std::string user, std::string password)
: FileNode(name, ipAddress, port), user(user), password(password) {}
};
int main(){
}
```
Create an eBPF program which attaches to `XDP` kernel events to measure network traffic.
Only works on Linux kernels.
```c++
// Create an eBPF program which attaches to XDP kernel events
// Count all packets by IP address
// Print a summary
// Include necessary headers
#include <bpf/bpf.h>
struct data {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__type(key, uint32_t);
__type(value, uint64_t);
};
BPF_TABLE("array", int, long, counts, 1024);
int xdp_prog(struct xdp_md *ctx) {
void* data_end = (void*)(long)ctx->data_end;
void* data = (void*)(long)ctx->data;
struct ethhdr *eth = data;
if ((void*)eth + sizeof(*eth) <= data_end) {
struct iphdr *ip = data + sizeof(*eth);
if ((void*)ip + sizeof(*ip) <= data_end) {
counts.increment(ip->saddr);
}
}
return XDP_PASS;
}
```
The AI-generated source code examples are available in the [`c++` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c%2B%2B?ref_type=heads).
### `C#` code generation prompts
Create a medical analyzer app from different sensors, and store the data in `MSSQL`.
```c#
// Create a medical analyzer app
// Collect data from different sensors
// Store data in MSSQL
// Provide methods to access the sensor data
using System.Data.SqlClient;
namespace MedicalAnalyzer
{
public class SensorDataStore
{
private SqlConnection connection;
public SensorDataStore()
{
// Create SQL Server connection
connection = new SqlConnection("connection string here");
}
public void StoreSensorData(SensorData data)
{
// Open connection
connection.Open();
// Insert sensor data into database
var command = connection.CreateCommand();
command.CommandText = "INSERT INTO SensorData (Timestamp, DeviceId, Value) " +
"VALUES (@timestamp, @deviceId, @value)";
command.Parameters.AddWithValue("@timestamp", data.Timestamp);
command.Parameters.AddWithValue("@deviceId", data.DeviceId);
command.Parameters.AddWithValue("@value", data.Value);
command.ExecuteNonQuery();
// Close connection
connection.Close();
}
public SensorData[] GetSensorData(DateTime startTime, DateTime endTime)
{
// Query database and return results
}
}
}
```
The AI-generated source code examples are available in the [`c#` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/c%23?ref_type=heads).
### CSS code generation prompts
```css
/* Create CSS classes for animating a rainbow */
@keyframes rainbow {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.rainbow {
background: linear-gradient(to right, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff);
background-size: 600% 600%;
animation: rainbow 30s ease infinite;
}
```
The AI-generated source code examples are available in the [`css` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/css?ref_type=heads).
### Go code generation prompts
Create an observability application for Kubernetes which reads and prints the state of containers, pods, and services in the cluster.
```go
// Create a client for Kubernetes observability
// Create a function that
// Reads the kubernetes configuration file from the KUBECONFIG env var
// Create kubernetes context, namespace default
// Inspect container, pod, service status and print an overview
// Import necessary packages
// Create main package
package main
import (
"context"
"fmt"
"os"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func main() {
clientset := getClientset()
namespace := "default"
printPods(clientset, namespace)
printServices(clientset, namespace)
printContainers(clientset, namespace)
}
func getClientset() *kubernetes.Clientset {
kubeconfig := os.Getenv("KUBECONFIG")
config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
if err != nil {
panic(err)
}
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
panic(err)
}
return clientset
}
func printPods(clientset *kubernetes.Clientset, namespace string) {
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
fmt.Printf("There are %d pods in the %s namespace\n", len(pods.Items), namespace)
}
func printServices(clientset *kubernetes.Clientset, namespace string) {
services, err := clientset.CoreV1().Services(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
fmt.Printf("There are %d services in the %s namespace\n", len(services.Items), namespace)
}
// Create a function to print Containers
// Collect and print the count
func printContainers(clientset *kubernetes.Clientset, namespace string) {
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
var totalContainers int
for _, pod := range pods.Items {
totalContainers += len(pod.Spec.Containers)
}
fmt.Printf("There are %d containers in the %s namespace\n", totalContainers, namespace)
}
```
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch the recording here: [GitLab Duo Coffee Chat: Code Generation Challenge with Go and Kubernetes Observability](https://www.youtube.com/watch?v=ORpRqp-A9hQ)
<!-- Video published on 2024-03-27. Maintainer: Developer Relations. -->
Create an in-memory key value store, similar to Redis. For a complete walkthrough, see the
blog post, [Top tips for efficient AI-powered Code Suggestions with GitLab Duo](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/#iterate-faster-with-code-generation)
blog post.
```go
// Create an in-memory key value store, similar to Redis
// Provide methods to
// set/unset keys
// update values
// list/print with filters
// Use BoltDB as external library
```
The AI-generated source code examples are available in the [`go` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/go?ref_type=heads).
### Java code generation prompts
Create a data analytics application, with different data sources for metrics.
Provide an API for data queries and aggregation.
```java
// Create a data analytics app
// Parse different input sources and their values
// Store the metrics in a columnar format
// Provide an API to query and aggregate data
```
The AI-generated source code examples are available in the [`java` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/java?ref_type=heads).
### JavaScript code generation prompts
Create a paid-time-off application for employees in ReactJS, with a date-time picker.
```javascript
// Create a Paid Time Off app for users
// Create a date-time picker in ReactJS
// Provide start and end options
// Show public holidays based on the selected country
// Send the request to a server API
```
The AI-generated source code examples are available in the [`javascript` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/javascript).
### HTML code generation prompts
```html
<!-- Create an AI knowledge base.
Describe where AI can help with efficient DevSecOps workflows.
Add a table with one Dev, one Ops, one Sec example.
-->
<table>
<tr>
<th>Dev</th>
<th>Ops</th>
<th>Sec</th>
</tr>
<tr>
<td>Automated testing and continuous integration</td>
<td>Infrastructure as code and automated provisioning</td>
<td>Static code analysis and vulnerability scanning</td>
</tr>
</table>
```
The AI-generated source code examples are available in the [`html` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/html).
### Kotlin code generation prompts
Generate a text adventure and search for a treasure. Add visual helpers and use random timer traps for game over.
```kotlin
package org.example
// Create a text adventure
// Search for the golden LEGO brick
// Add visual helpers
// Use random timer traps for game over
// Create a text adventure
fun createTextAdventure() {
println("Welcome to the golden LEGO brick adventure!")
println("You find yourself in a dimly lit room. What do you do?")
var gameOver = false
while (!gameOver) {
println("1. Search for the golden LEGO brick")
println("2. Examine the room")
println("3. Quit")
val choice = readLine()?.toIntOrNull() ?: 0
when (choice) {
1 -> searchForBrick()
2 -> examineRoom()
3 -> {
println("Goodbye!")
gameOver = true
}
else -> println("Invalid choice. Please try again.")
}
}
}
fun searchForBrick() {
println("You search the room carefully, looking for any sign of the golden LEGO brick.")
if (Math.random() < 0.2) {
println("Congratulations! You found the golden LEGO brick!")
} else {
println("Your search turns up nothing. You'll have to try again.")
}
}
fun examineRoom() {
println("You look around the room, taking in the details.")
println("The room is dimly lit, with shadows in the corners.")
println("There is a door to the north and a table in the center of the room.")
}
fun main() {
createTextAdventure()
}
```
The AI-generated source code examples are available in the [`kotlin` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/kotlin?ref_type=heads).
### PHP code generation prompts
Create an RSS feed fetcher for GitLab releases, allow filtering by title.
```php
// Create a web form to show GitLab releases
// Fetch the RSS feed from https://about.gitlab.com/atom.xml
// Provide filter options for the title
$feedUrl = 'https://about.gitlab.com/atom.xml';
$xml = simplexml_load_file($feedUrl);
$titleFilter = $_GET['titleFilter'];
echo '<h1>GitLab Releases</h1>';
echo '<ul>';
foreach ($xml->entry as $entry) {
$title = $entry->title;
if (empty($titleFilter) || strpos($title, $titleFilter) !== false) {
echo '<li>' . $title . '</li>';
}
}
echo '</ul>';
```
The AI-generated source code examples are available in the [`php` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/php).
### PowerShell code generation prompts
Create a script which collects all files in a directory and prints their size.
Refine the prompt to store the results in a CSV or JSON file.
```powershell
# Collect the files in a directory and print their size
$directory = Read-Host -Prompt "Enter the directory path to get file sizes"
$files = Get-ChildItem -Path $directory -File
foreach ($file in $files) {
$fileSize = [Math]::Round(($file.Length / 1KB), 2)
Write-Host "$($file.Name) - $fileSize KB"
}
# Repeat the code above but store the results in a CSV file
$csvFile = "$directory\file-sizes.csv"
$fileData = foreach ($file in $files) {
[PSCustomObject]@{
FileName = $file.Name
FileSize = [Math]::Round(($file.Length / 1KB), 2)
}
}
$fileData | Export-Csv -Path $csvFile -NoTypeInformation
Write-Host "File sizes saved to $csvFile"
# Repeat the code above but store the results in a JSON file
$jsonFile = "$directory\file-sizes.json"
$fileData | ConvertTo-Json | Out-File -FilePath $jsonFile
Write-Host "File sizes saved to $jsonFile"
```
The AI-generated source code examples are available in the [`powershell` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/powershell?ref_type=heads).
### Python code generation prompts
Create a webserver using Flask to manage users using the REST API, store them in SQLite.
```python
# Create a Flask webserver
# Add REST API entrypoints to manage users by ID
# Implement create, update, delete functions
# User data needs to be stored in SQlite, create table if not exists
# Run the server on port 8080, support TLS
# Print required packages for requirements.txt in a comment.
# Use Python 3.10 as default
# Potential AI-generated code below
import flask
from flask import request
import sqlite3
app = flask.Flask(__name__)
# Create SQLite database and users table if not exists
conn = sqlite3.connect('users.db')
conn.execute('''CREATE TABLE IF NOT EXISTS users
(id INTEGER PRIMARY KEY, name TEXT, email TEXT)''')
@app.route('/users', methods=['POST'])
def create_user():
# Get user data from request
name = request.form['name']
email = request.form['email']
# Insert user into database
conn.execute('INSERT INTO users (name, email) VALUES (?, ?)', (name, email))
return 'User created successfully'
@app.route('/users/<int:id>', methods=['PUT'])
def update_user(id):
# Get user data from request
name = request.form['name']
email = request.form['email']
# Update user in database
conn.execute('UPDATE users SET name = ?, email = ? WHERE id = ?', (name, email, id))
return 'User updated successfully'
@app.route('/users/<int:id>', methods=['DELETE'])
def delete_user(id):
# Delete user from database
conn.execute('DELETE FROM users WHERE id = ?', (id,))
return 'User deleted successfully'
if __name__ == '__main__':
# Required packages - flask, sqlite3
app.run(host='0.0.0.0', port=8080, ssl_context='adhoc')
```
The AI-generated source code examples are available in the [`python` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/python?ref_type=heads).
### Ruby code generation prompts
Create a log parser application which stores log data in Elasticsearch.
```ruby
# Create a Ruby app as log parser
# Provide hooks to replace sensitive strings in log lines
# Format the logs and store them in Elasticsearch
# Potential AI-generated code below
require 'logger'
require 'elasticsearch'
class LogParser
attr_reader :logger
def initialize
@logger = Logger.new(STDOUT)
@elasticsearch = Elasticsearch::Client.new
end
def parse_and_store(logs)
sanitized_logs = sanitize_logs(logs)
formatted_logs = format_logs(sanitized_logs)
store_in_elasticsearch(formatted_logs)
end
private
def sanitize_logs(logs)
logs.map { |line| sanitize_line(line) }
end
def sanitize_line(line)
# replace sensitive data
line.gsub(/\d{16}/, '[REDACTED]')
end
def format_logs(logs)
logs.map { |line| "#{Time.now}: #{line}" }
end
def store_in_elasticsearch(logs)
logs.each { |log| @elasticsearch.index(index: 'app-logs', document: log) }
end
end
```
Create a log client utility class that supports the syslog format with
severity levels, application name and message string.
```ruby
# Create Logging utility class
# Define default log level as attribute
# Add method for logging, inputs: level, app, message
# Print the data with formatted date and time in syslog format
# Potential AI-generated code below
class Logging
attr_accessor :log_level
def log(level, app, message)
time = Time.now.strftime("%b %d %H:%M:%S")
puts "#{time} #{app}[#{Process.pid}]: #{level} - #{message}"
end
end
# Instantiate class and test the log method
# Potential AI-generated code below
logger = Logging.new
logger.log_level = :debug
logger.log(:info, 'MyApp', 'Application started - info')
logger.log(:debug, 'MyApp', 'Application started - debug')
logger.log(:error, 'MyApp', 'Application started - error')
logger.log(:fatal, 'MyApp', 'Application started - fatal')
logger.log(:warn, 'MyApp', 'Application started - warn')
```
The AI-generated source code examples are available in the [`ruby` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/ruby).
### Rust code generation prompts
```rust
// Query the GitLab REST API
// Get all open merge requests for gitlab-org/gitlab
use serde_json::Value;
fn main() {
let client = reqwest::blocking::Client::new();
let url = "https://gitlab.com/api/v4/projects/278964/merge_requests?state=opened";
let response = client.get(url).send().unwrap().text().unwrap();
let json: Value = serde_json::from_str(&response).unwrap();
// TODO: Pagination, default fetch results: 20
// Read the response headers to access the next page
println!("{}", json.to_string());
for mr in json.as_array().unwrap() {
println!("{} - URL: {}", mr["title"], mr["web_url"]);
}
}
```
Create an RSS feed reader app, example from the blog post [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/).
```rust
// Create a function that iterates over the source array
// and fetches the data using HTTP from the RSS feed items.
// Store the results in a new hash map.
// Print the hash map to the terminal.
```
The AI-generated source code examples are available in the [`rust` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/rust?ref_type=heads).
### Scala code generation prompts
```scala
// Implement Newtons Method
// Create an object with a main function
// Add a function that implements Newtons method for solving equations
// Add a driver function which tests the implemented function
object NewtonsMethod {
def solveEquation(f: Double => Double, df: Double => Double, x0: Double, tolerance: Double): Double = {
var x = x0
var error = Double.PositiveInfinity
while (math.abs(error) > tolerance) {
error = f(x) / df(x)
x -= error
}
x
}
def main(args: Array[String]): Unit = {
val f: Double => Double = x => x * x - 4
val df: Double => Double = x => 2 * x
val x0 = 3.0
val tolerance = 1e-6
val root = solveEquation(f, df, x0, tolerance)
println(s"The root is: $root")
}
}
```
The AI-generated source code examples are available in the [`scala` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/scala?ref_type=heads).
### Shell scripts code generation prompts
Create a script `mytop.sh` that displays the top 10 processes by CPU, memory and disk I/O usage.
Start with the first code comment, and let Code Suggestions generate everything else.
```shell
#!/bin/bash
# Get the top 10 processes by CPU usage
top -b -n 1 | head -n 11 | awk '{print $1, $2, $3, $9}' | column -t
# Get the top 10 processes by memory usage
top -b -n 1 | head -n 11 | awk '{print $1, $2, $4, $6}' | column -t
# Get the top 10 processes by disk I/O
top -b -n 1 | head -n 11 | awk '{print $1, $2, $7, $8}' | column -t
# Get the top 10 processes by network I/O
top -b -n 1 | head -n 11 | awk '{print $1, $2, $10, $11}' | column -t
```
The AI-generated source code examples are available in the [`shell` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/shell?ref_type=heads).
### TypeScript code generation prompts
Create a utility function that parses IPv6 and IPv4 address formats.
```typescript
"use strict";
// Generate a TypeScript function which parses IPv6 and IPv4 address formats
// Use regular expressions
function parseAddress(address) {
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (ipv6Regex.test(address)) {
return {
ipVersion: 6,
address
};
}
else if (ipv4Regex.test(address)) {
return {
ipVersion: 4,
address
};
}
else {
throw new Error('Invalid IP address');
}
}
// Test the function with random inputs
const testInputs = [
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',
'192.168.0.1',
'not-an-ip'
];
for (const input of testInputs) {
try {
const result = parseAddress(input);
console.log(result);
}
catch (error) {
console.error(`Invalid address: ${input}`);
}
}
```
The AI-generated source code examples are available in the [`typescript` directory in the GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts/-/tree/main/code-suggestions/typescript?ref_type=heads).
## Resources
Many of the use cases are available as hands-on recordings in the [GitLab Duo Coffee Chat YouTube playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp5uj_JgQiSvHw1jQu0mSVZ).
### Blog resources
The following blog posts provide tutorials for these use cases:
- [Top tips for efficient AI-powered Code Suggestions with GitLab Duo](https://about.gitlab.com/blog/2024/06/11/top-tips-for-efficient-ai-powered-code-suggestions-with-gitlab-duo/)
- [10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/)
- [GitLab Duo Chat 101: Get more done on GitLab with our AI assistant](https://about.gitlab.com/blog/2024/05/29/gitlab-duo-chat-101-get-more-done-on-gitlab-with-our-ai-assistant/)
- [Developing GitLab Duo: How we are dogfooding our AI features](https://about.gitlab.com/blog/2024/05/20/developing-gitlab-duo-how-we-are-dogfooding-our-ai-features/)
- [Developing GitLab Duo: Secure and thoroughly test AI-generated code](https://about.gitlab.com/blog/2024/05/30/how-gitlab-duo-helps-secure-and-thoroughly-test-ai-generated-code/)
- [Developing GitLab Duo: Blending AI and Root Cause Analysis to fix CI/CD pipelines](https://about.gitlab.com/blog/2024/06/06/developing-gitlab-duo-blending-ai-and-root-cause-analysis-to-fix-ci-cd/)
- [Developing GitLab Duo: AI Impact analytics dashboard measures the ROI of AI](https://about.gitlab.com/blog/2024/05/15/developing-gitlab-duo-ai-impact-analytics-dashboard-measures-the-roi-of-ai/)
Code Suggestions tutorial blog posts are available for the following languages:
- [Learning Rust with a little help from AI](https://about.gitlab.com/blog/2023/08/10/learning-rust-with-a-little-help-from-ai-code-suggestions-getting-started/)
- [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/)
- [Learning Python with a little help from AI](https://about.gitlab.com/blog/2023/11/09/learning-python-with-a-little-help-from-ai-code-suggestions/)
- [Write Terraform plans faster with GitLab Duo Code Suggestions](https://about.gitlab.com/blog/2024/01/24/write-terraform-plans-faster-with-gitlab-duo-code-suggestions/)
- [Explore the Dragon Realm: Build a C++ adventure game with a little help from AI](https://about.gitlab.com/blog/2023/08/24/building-a-text-adventure-using-cplusplus-and-code-suggestions/)
|
https://docs.gitlab.com/user/prompt_guardrails
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/prompt_guardrails.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
prompt_guardrails.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo prompt guardrails
|
AI-native features and functionality.
|
GitLab Duo has foundational prompt guardrails. These guardrails rely on structured prompts,
enforced context boundaries, and filtering tools, which help:
- Reduce sensitive data exposure.
- Prevent prompt injection.
- Guide the model towards safe and helpful responses.
These safeguards support compliance with common regulatory standards,
like GDPR, by helping to minimize risks associated with AI-driven workflows.
{{< alert type="note" >}}
While these guardrails may reduce risks, they do not eliminate all vulnerabilities.
No system can guarantee complete protection against all misuse or sophisticated attacks.
{{< /alert >}}
## General guardrails
The prompts used by GitLab Duo aim to:
- Avoid disallowed content: The model is instructed to be informative, courteous,
and refrain from hateful or accusatory language.
- Adhere strictly to user requests: The model is instructed to stick closely to the prompt and avoid role play,
impersonation, or deviating into unrelated content.
- Use tags to isolate content: Tags instruct the model to focus on provided snippets,
helping to reduce the risk of prompt injection.
- Filter secrets: Code suggestions are scanned to help avoid sending sensitive information inadvertently. Example: A customer's job logs containing sensitive configuration data are encapsulated in `<log>` tags, helping to ensure the model focuses only on the provided context without making unrelated assumptions.
## Guardrails by job role
Depending on your role, you might have different concerns about the guardrails
set up for GitLab Duo.
### For technical users
- **Code isolation**: Tags like `<selected_code>`, `<git_diff>`, and `<log>`
encourage the model to focus strictly on the code or content you provide, helping reduce the risk of prompt injection.
- **Secrets filtering**: Tools such as Gitleaks scan code suggestions to help prevent sensitive data,
like API keys or passwords, from being shared.
- **Focused responses**: GitLab Duo focuses on the topic to help avoid behavior that could lead to unhelpful or unexpected outputs.
- **Root Cause Analysis**: When troubleshooting, GitLab Duo aims to analyze job logs without making assumptions about anything beyond what's provided.
### For auditors and compliance teams
- **Regulatory alignment**: The system helps reduce risks like data leaks,
which helps organizations stay aligned with standards like GDPR.
- **Transparency**: The way prompts and contexts are structured helps make
GitLab Duo actions predictable and available for auditing. For details, see [guardrails by feature](#guardrails-for-features).
- **Content control**: For tasks like summarizing discussions or resolving vulnerabilities,
GitLab Duo uses only the inputs provided, helping to reduce the chance of errors or unintended outputs.
- **Protection against malicious inputs**: Filters and tagging mechanisms help safeguard
the system from harmful or poorly formatted user content.
### For decision makers
- **Building confidence**: The safeguards help ensure GitLab Duo behaves responsibly,
which is critical for trust in new tools.
- **Informed decisions**: Clear documentation of security features gives you the
information needed to assess the suitability of GitLab Duo for your organization.
- **Reducing risks**: By working to tackle common concerns around sensitive data and model behavior,
GitLab Duo offers a secure, practical solution for integrating AI into your workflows.
## Guardrails for features
Individual features include specific prompt instructions to help limit exposure. The prompt instructions adhere to the following principles.
### GitLab Duo Chat
Responses should remain on-topic, constructive, and non-abusive.
Personality shifts, role play, or malicious instructions are discouraged.
Focusing on user-provided content helps reduce injection risk.
### Discussion Summary
Comments are summarized and interacting with potentially malicious content is discouraged.
The user should be warned about suspicious comments without revealing or replicating them.
### Code Explanation, Test Generation, Refactor Code, Fix Code
Uses a tag to contain code and limit the model's focus, which
helps to prevent the model from considering external, unverified instructions or content.
### GitLab Duo for CLI
Frames tasks as generating Git commands from natural language, helping limit scope and risk of harmful output.
### Merge Request Summary
Isolates the code to help prevent prompt injection.
### Code Review
Isolates the code to help prevent prompt injection.
### Merge Commit Message Generation
Uses tags to help isolate and constrain the content the model can reference.
### Root Cause Analysis
Uses a tag to help focus strictly on provided job logs and
prevent assumptions beyond the given data.
### Vulnerability Resolution
Encourages addressing security issues without altering intended functionality.
The model is instructed to focus on the provided code diff to help prevent changes to code.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: AI-native features and functionality.
title: GitLab Duo prompt guardrails
breadcrumbs:
- doc
- user
- gitlab_duo
---
GitLab Duo has foundational prompt guardrails. These guardrails rely on structured prompts,
enforced context boundaries, and filtering tools, which help:
- Reduce sensitive data exposure.
- Prevent prompt injection.
- Guide the model towards safe and helpful responses.
These safeguards support compliance with common regulatory standards,
like GDPR, by helping to minimize risks associated with AI-driven workflows.
{{< alert type="note" >}}
While these guardrails may reduce risks, they do not eliminate all vulnerabilities.
No system can guarantee complete protection against all misuse or sophisticated attacks.
{{< /alert >}}
## General guardrails
The prompts used by GitLab Duo aim to:
- Avoid disallowed content: The model is instructed to be informative, courteous,
and refrain from hateful or accusatory language.
- Adhere strictly to user requests: The model is instructed to stick closely to the prompt and avoid role play,
impersonation, or deviating into unrelated content.
- Use tags to isolate content: Tags instruct the model to focus on provided snippets,
helping to reduce the risk of prompt injection.
- Filter secrets: Code suggestions are scanned to help avoid sending sensitive information inadvertently. Example: A customer's job logs containing sensitive configuration data are encapsulated in `<log>` tags, helping to ensure the model focuses only on the provided context without making unrelated assumptions.
## Guardrails by job role
Depending on your role, you might have different concerns about the guardrails
set up for GitLab Duo.
### For technical users
- **Code isolation**: Tags like `<selected_code>`, `<git_diff>`, and `<log>`
encourage the model to focus strictly on the code or content you provide, helping reduce the risk of prompt injection.
- **Secrets filtering**: Tools such as Gitleaks scan code suggestions to help prevent sensitive data,
like API keys or passwords, from being shared.
- **Focused responses**: GitLab Duo focuses on the topic to help avoid behavior that could lead to unhelpful or unexpected outputs.
- **Root Cause Analysis**: When troubleshooting, GitLab Duo aims to analyze job logs without making assumptions about anything beyond what's provided.
### For auditors and compliance teams
- **Regulatory alignment**: The system helps reduce risks like data leaks,
which helps organizations stay aligned with standards like GDPR.
- **Transparency**: The way prompts and contexts are structured helps make
GitLab Duo actions predictable and available for auditing. For details, see [guardrails by feature](#guardrails-for-features).
- **Content control**: For tasks like summarizing discussions or resolving vulnerabilities,
GitLab Duo uses only the inputs provided, helping to reduce the chance of errors or unintended outputs.
- **Protection against malicious inputs**: Filters and tagging mechanisms help safeguard
the system from harmful or poorly formatted user content.
### For decision makers
- **Building confidence**: The safeguards help ensure GitLab Duo behaves responsibly,
which is critical for trust in new tools.
- **Informed decisions**: Clear documentation of security features gives you the
information needed to assess the suitability of GitLab Duo for your organization.
- **Reducing risks**: By working to tackle common concerns around sensitive data and model behavior,
GitLab Duo offers a secure, practical solution for integrating AI into your workflows.
## Guardrails for features
Individual features include specific prompt instructions to help limit exposure. The prompt instructions adhere to the following principles.
### GitLab Duo Chat
Responses should remain on-topic, constructive, and non-abusive.
Personality shifts, role play, or malicious instructions are discouraged.
Focusing on user-provided content helps reduce injection risk.
### Discussion Summary
Comments are summarized and interacting with potentially malicious content is discouraged.
The user should be warned about suspicious comments without revealing or replicating them.
### Code Explanation, Test Generation, Refactor Code, Fix Code
Uses a tag to contain code and limit the model's focus, which
helps to prevent the model from considering external, unverified instructions or content.
### GitLab Duo for CLI
Frames tasks as generating Git commands from natural language, helping limit scope and risk of harmful output.
### Merge Request Summary
Isolates the code to help prevent prompt injection.
### Code Review
Isolates the code to help prevent prompt injection.
### Merge Commit Message Generation
Uses tags to help isolate and constrain the content the model can reference.
### Root Cause Analysis
Uses a tag to help focus strictly on provided job logs and
prevent assumptions beyond the given data.
### Vulnerability Resolution
Encourages addressing security issues without altering intended functionality.
The model is instructed to focus on the provided code diff to help prevent changes to code.
|
https://docs.gitlab.com/user/turn_on_off_earlier
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/turn_on_off_earlier.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
turn_on_off_earlier.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo availability - earlier versions
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Pro or Enterprise
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Settings to turn AI features on and off introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
- [Settings to turn AI features on and off added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
{{< /history >}}
For GitLab Duo Pro or Enterprise, you can turn GitLab Duo on or off for a group, project, or instance.
When GitLab Duo is turned off for a group, project, or instance:
- GitLab Duo features that access resources, like code, issues, and vulnerabilities, are not available.
- Code Suggestions is not available.
- GitLab Duo Chat is not available.
## For a group or subgroup
{{< tabs >}}
{{< tab title="In 17.8 to 18.1" >}}
In GitLab 17.8 and later, follow these instructions to turn GitLab Duo on or off
for a group, including its subgroups and projects.
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Go to the settings, based on your deployment type and group level:
- For GitLab.com top-level groups: Select **Settings > GitLab Duo** and select **Change configuration**.
- For GitLab.com subgroups: Select **Settings > General** and expand **GitLab Duo features**.
- For GitLab Self-Managed (all groups and subgroups): Select **Settings > General** and expand **GitLab Duo features**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.7" >}}
In GitLab 17.7, follow these instructions to turn GitLab Duo on or off
for a group, including its subgroups and projects.
{{< alert type="note" >}}
In GitLab 17.7:
- For GitLab.com, the GitLab Duo settings page is only available for top-level groups, not for subgroups.
- For GitLab Self-Managed, the GitLab Duo settings page is not available for groups or subgroups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.4 to 17.6" >}}
In GitLab 17.4 to 17.6, follow these instructions to turn GitLab Duo on or off
for a group and its subgroups and projects.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6:
- For GitLab.com, the GitLab Duo settings page is only available for top-level groups, not for subgroups.
- For GitLab Self-Managed, the GitLab Duo settings page is not available for groups or subgroups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for a group
and its subgroups and projects.
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Select or clear the **Use GitLab Duo features** checkbox.
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade the setting to
all subgroups.

{{< /tab >}}
{{< /tabs >}}
## For a project
{{< tabs >}}
{{< tab title="In 17.4 to 18.1" >}}
In GitLab 17.4 and later, follow these instructions to turn GitLab Duo on or off for a project.
Prerequisites:
- You must have the Owner role for the project.
To turn GitLab Duo on or off for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **GitLab Duo**, turn the toggle on or off.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for a project.
1. Use the GitLab GraphQL API
[`projectSettingsUpdate`](../../api/graphql/reference/_index.md#mutationprojectsettingsupdate)
mutation.
1. Set the
[`duo_features_enabled`](../../api/graphql/getting_started.md#update-project-settings)
setting to `true` or `false`.
{{< /tab >}}
{{< /tabs >}}
## For an instance
{{< details >}}
- Offering: GitLab Self-Managed
{{< /details >}}
{{< tabs >}}
{{< tab title="In 17.7 to 18.1" >}}
In GitLab 17.7 and later, follow these instructions to turn GitLab Duo on or off for an instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.4 to 17.6" >}}
In GitLab 17.4 to 17.6, follow these instructions to turn GitLab Duo on or off for the instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for an instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **AI-powered features**.
1. Select or clear the **Use Duo features** checkbox.
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade
the setting to all groups in the instance.
{{< /tab >}}
{{< /tabs >}}
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Duo availability - earlier versions
breadcrumbs:
- doc
- user
- gitlab_duo
---
{{< details >}}
- Tier: Premium, Ultimate
- Add-on: GitLab Duo Pro or Enterprise
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Settings to turn AI features on and off introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
- [Settings to turn AI features on and off added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
{{< /history >}}
For GitLab Duo Pro or Enterprise, you can turn GitLab Duo on or off for a group, project, or instance.
When GitLab Duo is turned off for a group, project, or instance:
- GitLab Duo features that access resources, like code, issues, and vulnerabilities, are not available.
- Code Suggestions is not available.
- GitLab Duo Chat is not available.
## For a group or subgroup
{{< tabs >}}
{{< tab title="In 17.8 to 18.1" >}}
In GitLab 17.8 and later, follow these instructions to turn GitLab Duo on or off
for a group, including its subgroups and projects.
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Go to the settings, based on your deployment type and group level:
- For GitLab.com top-level groups: Select **Settings > GitLab Duo** and select **Change configuration**.
- For GitLab.com subgroups: Select **Settings > General** and expand **GitLab Duo features**.
- For GitLab Self-Managed (all groups and subgroups): Select **Settings > General** and expand **GitLab Duo features**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.7" >}}
In GitLab 17.7, follow these instructions to turn GitLab Duo on or off
for a group, including its subgroups and projects.
{{< alert type="note" >}}
In GitLab 17.7:
- For GitLab.com, the GitLab Duo settings page is only available for top-level groups, not for subgroups.
- For GitLab Self-Managed, the GitLab Duo settings page is not available for groups or subgroups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.4 to 17.6" >}}
In GitLab 17.4 to 17.6, follow these instructions to turn GitLab Duo on or off
for a group and its subgroups and projects.
{{< alert type="note" >}}
In GitLab 17.4 to 17.6:
- For GitLab.com, the GitLab Duo settings page is only available for top-level groups, not for subgroups.
- For GitLab Self-Managed, the GitLab Duo settings page is not available for groups or subgroups.
{{< /alert >}}
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a top-level group:
1. On the left sidebar, select **Search or go to** and find your top-level group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for a group
and its subgroups and projects.
Prerequisites:
- You must have the Owner role for the group.
To turn GitLab Duo on or off for a group or subgroup:
1. On the left sidebar, select **Search or go to** and find your group or subgroup.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Select or clear the **Use GitLab Duo features** checkbox.
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade the setting to
all subgroups.

{{< /tab >}}
{{< /tabs >}}
## For a project
{{< tabs >}}
{{< tab title="In 17.4 to 18.1" >}}
In GitLab 17.4 and later, follow these instructions to turn GitLab Duo on or off for a project.
Prerequisites:
- You must have the Owner role for the project.
To turn GitLab Duo on or off for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **GitLab Duo**, turn the toggle on or off.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for a project.
1. Use the GitLab GraphQL API
[`projectSettingsUpdate`](../../api/graphql/reference/_index.md#mutationprojectsettingsupdate)
mutation.
1. Set the
[`duo_features_enabled`](../../api/graphql/getting_started.md#update-project-settings)
setting to `true` or `false`.
{{< /tab >}}
{{< /tabs >}}
## For an instance
{{< details >}}
- Offering: GitLab Self-Managed
{{< /details >}}
{{< tabs >}}
{{< tab title="In 17.7 to 18.1" >}}
In GitLab 17.7 and later, follow these instructions to turn GitLab Duo on or off for an instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **GitLab Duo**.
1. Select **Change configuration**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.4 to 17.6" >}}
In GitLab 17.4 to 17.6, follow these instructions to turn GitLab Duo on or off for the instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin area**.
1. Select **Settings > General**.
1. Expand **GitLab Duo features**.
1. Choose an option.
1. Select **Save changes**.
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, follow these instructions to turn GitLab Duo on or off for an instance.
Prerequisites:
- You must be an administrator.
To turn GitLab Duo on or off for an instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **AI-powered features**.
1. Select or clear the **Use Duo features** checkbox.
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade
the setting to all groups in the instance.
{{< /tab >}}
{{< /tabs >}}
|
https://docs.gitlab.com/user/setup
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/setup.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
setup.md
| null | null | null | null | null |
<!-- markdownlint-disable -->
This document was moved to [another location](../../administration/gitlab_duo/setup.md).
<!-- This redirect file can be deleted after <2025-10-27>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
---
redirect_to: ../../administration/gitlab_duo/setup.md
remove_date: '2025-10-27'
breadcrumbs:
- doc
- user
- gitlab_duo
---
<!-- markdownlint-disable -->
This document was moved to [another location](../../administration/gitlab_duo/setup.md).
<!-- This redirect file can be deleted after <2025-10-27>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
https://docs.gitlab.com/user/security
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/security.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
security.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo authentication and authorization
| null |
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/506641) in GitLab 17.9.
{{< /history >}}
GitLab Duo with Amazon Q uses a composite identity to authenticate requests.
{{< alert type="note" >}}
Support for a composite identity in other areas of the product
is proposed in [issue 511373](https://gitlab.com/gitlab-org/gitlab/-/issues/511373).
{{< /alert >}}
The token that authenticates requests is a composite of two identities:
- The primary author, which is the Amazon Q [service account](../profile/service_accounts.md).
This service account is instance-wide and has the Developer role
on the project where the Amazon Q quick action was used. The service account is the owner of the token.
- The secondary author, which is the human user who submitted the quick action.
This user's `id` is included in the scopes of the token.
This composite identity ensures that any activities authored by Amazon Q are
correctly attributed to the Amazon Q service account.
At the same time, the composite identity ensures that there is no
[privilege escalation](https://en.wikipedia.org/wiki/Privilege_escalation) for the human user.
This [dynamic scope](https://github.com/doorkeeper-gem/doorkeeper/pull/1739)
is checked during the authorization of the API request.
When authorization is requested, GitLab validates that both the service account
and the user who originated the quick action have sufficient permissions.
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
flowchart TD
A[API Request] --> B{Human user has access?}
B -->|No| D[Access denied]
B -->|Yes| C{Service account has access?}
C -->|No| D
C -->|Yes| E[API request succeeds]
style D fill:#ffcccc
style E fill:#ccffcc
```
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Duo authentication and authorization
breadcrumbs:
- doc
- user
- gitlab_duo
---
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/506641) in GitLab 17.9.
{{< /history >}}
GitLab Duo with Amazon Q uses a composite identity to authenticate requests.
{{< alert type="note" >}}
Support for a composite identity in other areas of the product
is proposed in [issue 511373](https://gitlab.com/gitlab-org/gitlab/-/issues/511373).
{{< /alert >}}
The token that authenticates requests is a composite of two identities:
- The primary author, which is the Amazon Q [service account](../profile/service_accounts.md).
This service account is instance-wide and has the Developer role
on the project where the Amazon Q quick action was used. The service account is the owner of the token.
- The secondary author, which is the human user who submitted the quick action.
This user's `id` is included in the scopes of the token.
This composite identity ensures that any activities authored by Amazon Q are
correctly attributed to the Amazon Q service account.
At the same time, the composite identity ensures that there is no
[privilege escalation](https://en.wikipedia.org/wiki/Privilege_escalation) for the human user.
This [dynamic scope](https://github.com/doorkeeper-gem/doorkeeper/pull/1739)
is checked during the authorization of the API request.
When authorization is requested, GitLab validates that both the service account
and the user who originated the quick action have sufficient permissions.
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
flowchart TD
A[API Request] --> B{Human user has access?}
B -->|No| D[Access denied]
B -->|Yes| C{Service account has access?}
C -->|No| D
C -->|Yes| E[API request succeeds]
style D fill:#ffcccc
style E fill:#ccffcc
```
|
https://docs.gitlab.com/user/context_exclusion
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/context_exclusion.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
context_exclusion.md
|
AI-powered
|
Code Creation
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Control GitLab Duo context exclusion
| null |
## Exclude context from GitLab Duo
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/17124) in GitLab 18.1 [with a flag](../../administration/feature_flags/_index.md) named `use_duo_context_exclusion`. Disabled by default.
{{< /history >}}
You can control which project content is included as context for GitLab Duo. Use this to protect sensitive information such as password files and configuration files.
### Manage GitLab Duo context exclusions
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **GitLab Duo**, in the **GitLab Duo Content Exclusions section**, select **Manage exclusions**.
1. Specify which project files and directories are excluded from GitLab Duo context, and select **Save exclusions**.
1. Optional. To delete an existing exclusion, select **Delete** ({{< icon name="remove" >}}) for the appropriate exclusion.
1. Select **Save changes**.
|
---
stage: AI-powered
group: Code Creation
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Control GitLab Duo context exclusion
breadcrumbs:
- doc
- user
- gitlab_duo
---
## Exclude context from GitLab Duo
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/17124) in GitLab 18.1 [with a flag](../../administration/feature_flags/_index.md) named `use_duo_context_exclusion`. Disabled by default.
{{< /history >}}
You can control which project content is included as context for GitLab Duo. Use this to protect sensitive information such as password files and configuration files.
### Manage GitLab Duo context exclusions
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **GitLab Duo**, in the **GitLab Duo Content Exclusions section**, select **Manage exclusions**.
1. Specify which project files and directories are excluded from GitLab Duo context, and select **Save exclusions**.
1. Optional. To delete an existing exclusion, select **Delete** ({{< icon name="remove" >}}) for the appropriate exclusion.
1. Select **Save changes**.
|
https://docs.gitlab.com/user/feature_summary
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/feature_summary.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
feature_summary.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Summary of GitLab Duo features
|
AI-native features and functionality.
|
{{< history >}}
- [First GitLab Duo features introduced](https://about.gitlab.com/blog/2023/05/03/gitlab-ai-assisted-features/) in GitLab 16.0.
- [Removed third-party AI setting](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136144) in GitLab 16.6.
- [Removed support for OpenAI from all GitLab Duo features](https://gitlab.com/groups/gitlab-org/-/epics/10964) in GitLab 16.6.
{{< /history >}}
The following features are generally available on GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
They require a Premium or Ultimate subscription and one of the available add-ons.
The GitLab Duo with Amazon Q features are available as a separate add-on, and
are available on GitLab Self-Managed only.
| Feature | GitLab Duo Core | GitLab Duo Pro | GitLab Duo Enterprise | GitLab Duo with Amazon Q |
|---------|----------|---------|----------------|--------------------------|
| [Code Suggestions](../project/repository/code_suggestions/_index.md) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo Chat](../gitlab_duo_chat/_index.md) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Code Explanation](../gitlab_duo_chat/examples.md#explain-selected-code) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Refactor Code](../gitlab_duo_chat/examples.md#refactor-code-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Fix Code](../gitlab_duo_chat/examples.md#fix-code-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Test Generation](../gitlab_duo_chat/examples.md#write-tests-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo Chat](../gitlab_duo_chat/_index.md) in GitLab UI | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Code Explanation](../project/repository/code_explain.md) in GitLab UI | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Discussion Summary](../discussions/_index.md#summarize-issue-discussions-with-duo-chat) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Root Cause Analysis](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Vulnerability Explanation](../application_security/vulnerabilities/_index.md#vulnerability-explanation) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Vulnerability Resolution](../application_security/vulnerabilities/_index.md#vulnerability-resolution) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [AI Impact Dashboard](../analytics/ai_impact_analytics.md) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled">}} Yes |
| [Merge Commit Message Generation](../project/merge_requests/duo_in_merge_requests.md#generate-a-merge-commit-message) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo for the CLI](../../editor_extensions/gitlab_cli/_index.md#gitlab-duo-for-the-cli) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} [Yes](#amazon-q-developer-pro-included-with-gitlab-duo-with-amazon-q) |
| [Code Review](../project/merge_requests/duo_in_merge_requests.md#have-gitlab-duo-review-your-code) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
## Beta and experimental features
{{< history >}}
- GitLab Duo Agentic Chat added in GitLab 18.2.
{{< /history >}}
The following features are not generally available.
They require a Premium or Ultimate subscription and one of the available add-ons.
| Feature | GitLab Duo Core | GitLab Duo Pro | GitLab Duo Enterprise | GitLab Duo with Amazon Q | GitLab.com | GitLab Self-Managed | GitLab Dedicated | GitLab Duo Self-Hosted |
|---------|----------|---------|----------------|--------------------------|-----------|-------------|-----------|------------------------|
| [Code Review Summary](../project/merge_requests/duo_in_merge_requests.md#summarize-a-code-review) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Experiment | Experiment | {{< icon name="dash-circle" >}} No | Experiment |
| [Issue Description Generation](../project/issues/managing_issues.md#populate-an-issue-with-issue-description-generation) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Experiment | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | Not applicable |
| [Merge Request Summary](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Beta | Beta | {{< icon name="dash-circle" >}} No | Beta |
| [GitLab Duo Agentic Chat](../gitlab_duo_chat/agentic_chat.md) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} [Yes](#amazon-q-developer-pro-included-with-gitlab-duo-with-amazon-q) | Experiment | Experiment | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
[GitLab Duo Agent Platform](../duo_agent_platform/_index.md) is in private beta, does not require an add-on, and is not supported for GitLab Duo Self-Hosted.
## Features available in GitLab Duo Self-Hosted
Your organization can use [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
to self-host the AI gateway and language models if you:
- Have the GitLab Duo Enterprise add-on.
- Are a GitLab Self-Managed customer.
To check which GitLab Duo features are available for use with GitLab Duo Self-Hosted,
and the status of those features, see the
[supported GitLab Duo features for GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md#supported-gitlab-duo-features).
## Amazon Q Developer Pro included with GitLab Duo With Amazon Q
License credits for [Amazon Q Developer Pro](https://aws.amazon.com/q/developer/) are included with a subscription to GitLab Duo with Amazon Q.
This subscription includes:
- [Amazon Q Developer in the IDE](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE.html), including Visual Studio, VS Code, JetBrains, and Eclipse.
- [Amazon Q Developer on the command line](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line.html).
- [Amazon Q Developer in the AWS Management Console](https://aws.amazon.com/q/developer/operate/).
For more information about the capabilities of Amazon Q Developer, see the [AWS website](https://aws.amazon.com/q/developer/).
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: AI-native features and functionality.
title: Summary of GitLab Duo features
breadcrumbs:
- doc
- user
- gitlab_duo
---
{{< history >}}
- [First GitLab Duo features introduced](https://about.gitlab.com/blog/2023/05/03/gitlab-ai-assisted-features/) in GitLab 16.0.
- [Removed third-party AI setting](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136144) in GitLab 16.6.
- [Removed support for OpenAI from all GitLab Duo features](https://gitlab.com/groups/gitlab-org/-/epics/10964) in GitLab 16.6.
{{< /history >}}
The following features are generally available on GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
They require a Premium or Ultimate subscription and one of the available add-ons.
The GitLab Duo with Amazon Q features are available as a separate add-on, and
are available on GitLab Self-Managed only.
| Feature | GitLab Duo Core | GitLab Duo Pro | GitLab Duo Enterprise | GitLab Duo with Amazon Q |
|---------|----------|---------|----------------|--------------------------|
| [Code Suggestions](../project/repository/code_suggestions/_index.md) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo Chat](../gitlab_duo_chat/_index.md) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Code Explanation](../gitlab_duo_chat/examples.md#explain-selected-code) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Refactor Code](../gitlab_duo_chat/examples.md#refactor-code-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Fix Code](../gitlab_duo_chat/examples.md#fix-code-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Test Generation](../gitlab_duo_chat/examples.md#write-tests-in-the-ide) in IDEs | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo Chat](../gitlab_duo_chat/_index.md) in GitLab UI | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Code Explanation](../project/repository/code_explain.md) in GitLab UI | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Discussion Summary](../discussions/_index.md#summarize-issue-discussions-with-duo-chat) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Root Cause Analysis](../gitlab_duo_chat/examples.md#troubleshoot-failed-cicd-jobs-with-root-cause-analysis) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Vulnerability Explanation](../application_security/vulnerabilities/_index.md#vulnerability-explanation) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [Vulnerability Resolution](../application_security/vulnerabilities/_index.md#vulnerability-resolution) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [AI Impact Dashboard](../analytics/ai_impact_analytics.md) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled">}} Yes |
| [Merge Commit Message Generation](../project/merge_requests/duo_in_merge_requests.md#generate-a-merge-commit-message) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes |
| [GitLab Duo for the CLI](../../editor_extensions/gitlab_cli/_index.md#gitlab-duo-for-the-cli) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} [Yes](#amazon-q-developer-pro-included-with-gitlab-duo-with-amazon-q) |
| [Code Review](../project/merge_requests/duo_in_merge_requests.md#have-gitlab-duo-review-your-code) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No |
## Beta and experimental features
{{< history >}}
- GitLab Duo Agentic Chat added in GitLab 18.2.
{{< /history >}}
The following features are not generally available.
They require a Premium or Ultimate subscription and one of the available add-ons.
| Feature | GitLab Duo Core | GitLab Duo Pro | GitLab Duo Enterprise | GitLab Duo with Amazon Q | GitLab.com | GitLab Self-Managed | GitLab Dedicated | GitLab Duo Self-Hosted |
|---------|----------|---------|----------------|--------------------------|-----------|-------------|-----------|------------------------|
| [Code Review Summary](../project/merge_requests/duo_in_merge_requests.md#summarize-a-code-review) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Experiment | Experiment | {{< icon name="dash-circle" >}} No | Experiment |
| [Issue Description Generation](../project/issues/managing_issues.md#populate-an-issue-with-issue-description-generation) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Experiment | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | Not applicable |
| [Merge Request Summary](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes) | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="dash-circle" >}} No | Beta | Beta | {{< icon name="dash-circle" >}} No | Beta |
| [GitLab Duo Agentic Chat](../gitlab_duo_chat/agentic_chat.md) | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} Yes | {{< icon name="check-circle-filled" >}} [Yes](#amazon-q-developer-pro-included-with-gitlab-duo-with-amazon-q) | Experiment | Experiment | {{< icon name="dash-circle" >}} No | {{< icon name="dash-circle" >}} No |
[GitLab Duo Agent Platform](../duo_agent_platform/_index.md) is in private beta, does not require an add-on, and is not supported for GitLab Duo Self-Hosted.
## Features available in GitLab Duo Self-Hosted
Your organization can use [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md)
to self-host the AI gateway and language models if you:
- Have the GitLab Duo Enterprise add-on.
- Are a GitLab Self-Managed customer.
To check which GitLab Duo features are available for use with GitLab Duo Self-Hosted,
and the status of those features, see the
[supported GitLab Duo features for GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md#supported-gitlab-duo-features).
## Amazon Q Developer Pro included with GitLab Duo With Amazon Q
License credits for [Amazon Q Developer Pro](https://aws.amazon.com/q/developer/) are included with a subscription to GitLab Duo with Amazon Q.
This subscription includes:
- [Amazon Q Developer in the IDE](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE.html), including Visual Studio, VS Code, JetBrains, and Eclipse.
- [Amazon Q Developer on the command line](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line.html).
- [Amazon Q Developer in the AWS Management Console](https://aws.amazon.com/q/developer/operate/).
For more information about the capabilities of Amazon Q Developer, see the [AWS website](https://aws.amazon.com/q/developer/).
|
https://docs.gitlab.com/user/troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/troubleshooting.md
|
2025-08-13
|
doc/user/gitlab_duo
|
[
"doc",
"user",
"gitlab_duo"
] |
troubleshooting.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting GitLab Duo
| null |
When working with GitLab Duo, you might encounter issues.
Start by [running a health check](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo)
to determine if your instance meets the requirements to use GitLab Duo.
For more information on troubleshooting GitLab Duo, see:
- [Troubleshooting Code Suggestions](../project/repository/code_suggestions/troubleshooting.md).
- [GitLab Duo Chat troubleshooting](../gitlab_duo_chat/troubleshooting.md).
- [Troubleshooting GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/troubleshooting.md).
If the health check does not resolve your problem, review these troubleshooting steps.
## GitLab Duo features do not work on self-managed
In addition to [ensuring GitLab Duo features are turned on](turn_on_off.md),
you can also do the following:
1. As administrator, run a health check for GitLab Duo.
{{< tabs >}}
{{< tab title="In 17.5 and later" >}}
In GitLab 17.5 and later, you can use the UI to run health checks and download a detailed report that helps identify and troubleshoot issues.
{{< /tab >}}
{{< tab title="In 17.4" >}}
In GitLab 17.4, you can run the health check Rake task to generate a detailed report that helps identify and troubleshoot issues.
```shell
sudo gitlab-rails 'cloud_connector:health_check(root,report.json)'
```
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, you can download and run the `health_check` script to generate a detailed report that helps identify and troubleshoot issues.
1. Download the health check script:
```shell
wget https://gitlab.com/gitlab-org/gitlab/-/snippets/3734617/raw/main/health_check.rb
```
1. Run the script using Rails Runner:
```shell
gitlab-rails runner [full_path/to/health_check.rb] --debug --username [username] --output-file [report.txt]
```
```shell
Usage: gitlab-rails runner full_path/to/health_check.rb
--debug Enable debug mode
--output-file FILE Write a report to FILE
--username USERNAME Provide a username to test seat assignments
--skip [CHECK] Skip specific check (options: access_data, token, license, host, features, end_to_end)
```
{{< /tab >}}
{{< /tabs >}}
1. Verify that the GitLab instance can reach the [required GitLab.com endpoints](setup.md).
You can use command-line tools such as `curl` to verify the connectivity.
```shell
curl --verbose "https://cloud.gitlab.com"
curl --verbose "https://customers.gitlab.com"
```
If an HTTP/S proxy is configured for the GitLab instance, include the `proxy` parameter in the `curl` command.
```shell
# https proxy for curl
curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://cloud.gitlab.com"
curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://customers.gitlab.com"
```
1. Optional. If you are using a [proxy server](../../administration/gitlab_duo/setup.md#allow-outbound-connections-from-the-gitlab-instance) between the GitLab
application and the public internet,
[disable DNS rebinding protection](../../security/webhooks.md#enforce-dns-rebinding-attack-protection).
1. [Manually synchronize subscription data](../../subscriptions/manage_subscription.md#manually-synchronize-subscription-data).
- Verify that the GitLab instance [synchronizes your subscription data with GitLab](https://about.gitlab.com/pricing/licensing-faq/cloud-licensing/).
## GitLab Duo features not available for users
In addition to [turning on GitLab Duo features](turn_on_off.md),
you can also do the following:
- If you have GitLab Duo Core, verify that you have:
- A Premium or Ultimate subscription.
- [Turned on IDE features](turn_on_off.md#turn-gitlab-duo-core-on-or-off).
- If you have GitLab Duo Pro or Enterprise:
- Verify that [a subscription add-on has been purchased](../../subscriptions/subscription-add-ons.md#purchase-gitlab-duo).
- Ensure that [seats are assigned to users](../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
- For your IDE:
- Verify that the [extension](../project/repository/code_suggestions/set_up.md#configure-editor-extension)
or plugin is up-to-date.
- Run health checks, and test the authentication.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting GitLab Duo
breadcrumbs:
- doc
- user
- gitlab_duo
---
When working with GitLab Duo, you might encounter issues.
Start by [running a health check](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo)
to determine if your instance meets the requirements to use GitLab Duo.
For more information on troubleshooting GitLab Duo, see:
- [Troubleshooting Code Suggestions](../project/repository/code_suggestions/troubleshooting.md).
- [GitLab Duo Chat troubleshooting](../gitlab_duo_chat/troubleshooting.md).
- [Troubleshooting GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/troubleshooting.md).
If the health check does not resolve your problem, review these troubleshooting steps.
## GitLab Duo features do not work on self-managed
In addition to [ensuring GitLab Duo features are turned on](turn_on_off.md),
you can also do the following:
1. As administrator, run a health check for GitLab Duo.
{{< tabs >}}
{{< tab title="In 17.5 and later" >}}
In GitLab 17.5 and later, you can use the UI to run health checks and download a detailed report that helps identify and troubleshoot issues.
{{< /tab >}}
{{< tab title="In 17.4" >}}
In GitLab 17.4, you can run the health check Rake task to generate a detailed report that helps identify and troubleshoot issues.
```shell
sudo gitlab-rails 'cloud_connector:health_check(root,report.json)'
```
{{< /tab >}}
{{< tab title="In 17.3 and earlier" >}}
In GitLab 17.3 and earlier, you can download and run the `health_check` script to generate a detailed report that helps identify and troubleshoot issues.
1. Download the health check script:
```shell
wget https://gitlab.com/gitlab-org/gitlab/-/snippets/3734617/raw/main/health_check.rb
```
1. Run the script using Rails Runner:
```shell
gitlab-rails runner [full_path/to/health_check.rb] --debug --username [username] --output-file [report.txt]
```
```shell
Usage: gitlab-rails runner full_path/to/health_check.rb
--debug Enable debug mode
--output-file FILE Write a report to FILE
--username USERNAME Provide a username to test seat assignments
--skip [CHECK] Skip specific check (options: access_data, token, license, host, features, end_to_end)
```
{{< /tab >}}
{{< /tabs >}}
1. Verify that the GitLab instance can reach the [required GitLab.com endpoints](setup.md).
You can use command-line tools such as `curl` to verify the connectivity.
```shell
curl --verbose "https://cloud.gitlab.com"
curl --verbose "https://customers.gitlab.com"
```
If an HTTP/S proxy is configured for the GitLab instance, include the `proxy` parameter in the `curl` command.
```shell
# https proxy for curl
curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://cloud.gitlab.com"
curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://customers.gitlab.com"
```
1. Optional. If you are using a [proxy server](../../administration/gitlab_duo/setup.md#allow-outbound-connections-from-the-gitlab-instance) between the GitLab
application and the public internet,
[disable DNS rebinding protection](../../security/webhooks.md#enforce-dns-rebinding-attack-protection).
1. [Manually synchronize subscription data](../../subscriptions/manage_subscription.md#manually-synchronize-subscription-data).
- Verify that the GitLab instance [synchronizes your subscription data with GitLab](https://about.gitlab.com/pricing/licensing-faq/cloud-licensing/).
## GitLab Duo features not available for users
In addition to [turning on GitLab Duo features](turn_on_off.md),
you can also do the following:
- If you have GitLab Duo Core, verify that you have:
- A Premium or Ultimate subscription.
- [Turned on IDE features](turn_on_off.md#turn-gitlab-duo-core-on-or-off).
- If you have GitLab Duo Pro or Enterprise:
- Verify that [a subscription add-on has been purchased](../../subscriptions/subscription-add-ons.md#purchase-gitlab-duo).
- Ensure that [seats are assigned to users](../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats).
- For your IDE:
- Verify that the [extension](../project/repository/code_suggestions/set_up.md#configure-editor-extension)
or plugin is up-to-date.
- Run health checks, and test the authentication.
|
https://docs.gitlab.com/user/gitlab_duo/model_context_protocol
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/_index.md
|
2025-08-13
|
doc/user/gitlab_duo/model_context_protocol
|
[
"doc",
"user",
"gitlab_duo",
"model_context_protocol"
] |
_index.md
|
AI-powered
|
Duo Workflow
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Use Model Context Protocol with AI-native features
|
Describes Model Context Protocol and how to use it
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/519938) in GitLab 18.1 [with a flag](../../../administration/feature_flags/_index.md) named `duo_workflow_mcp_support`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/545956) in GitLab 18.2. Feature flag `duo_workflow_mcp_support` removed.
{{< /history >}}
The Model Context Protocol (MCP) provides a standardized way for GitLab Duo features
to securely connect to different external data sources and tools.
The following features can act as MCP clients, and connect to and run
external tools from MCP servers:
- [GitLab Duo Agentic Chat](../../../user/gitlab_duo_chat/agentic_chat.md)
- The [software development flow](../../../user/duo_agent_platform/flows/software_development.md)
This connectivity means these features can now use context and information external to GitLab to
generate more powerful answers for customers.
To use a feature with MCP:
- Turn on MCP for your group.
- Configure the MCP servers you want the feature to connect to.
For a click-through demo, see [Duo Agent Platform - MCP integration](https://gitlab.navattic.com/mcp). <!-- Demo published on 2025-08-05 -->
## Prerequisites
Before using a GitLab Duo feature with MCP, you must:
- Install [Visual Studio Code](https://code.visualstudio.com/download) (VS Code).
- Set up the [GitLab Workflow extension for VS Code](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#setup).
- MCP support requires version 6.28.2 and later.
- Workspace and user configuration features require version 6.35.6 and later.
- Meet the feature prerequisites as required:
- [Agentic Chat prerequisites](../../../user/gitlab_duo_chat/agentic_chat.md#use-agentic-chat-in-vs-code).
- [Software development flow prerequisites](../../../user/duo_agent_platform/flows/software_development.md#prerequisites).
## Turn on MCP for your group
To turn MCP on or off for your group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **Model Context Protocol**, select or clear the
**Turn on Model Context Protocol (MCP) support** checkbox.
1. Select **Save changes**.
## Configure MCP servers
To integrate MCP with the Language Server, set up workspace configuration, user configuration, or both.
The GitLab Language Server loads and merges the configuration files.
### Version compatibility
| GitLab Workflow extension version | MCP features available |
|-----------------------------------|------------------------|
| 6.28.2 - 6.35.5 | Basic MCP support, with no workspace or user configuration |
| 6.35.6 and later | Full MCP support, including workspace and user configuration |
### Create workspace configuration
Workspace configuration applies to this project only, and overrides any user configuration for the
same server.
To set up workspace configuration:
1. In your project workspace, create the file `<workspace>/.gitlab/duo/mcp.json`.
1. Using the [configuration format](#configuration-format), add information about the MCP servers
your feature connects to.
1. Save the file.
### Create user configuration
User configuration settings are good for personal tools and commonly-used servers. They apply to all
workspaces, but any workspace settings for the same server override the user configuration.
To set up user configuration:
1. In VS Code, open the Command Palette by pressing
<kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or
</kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
1. Run the command `GitLab MCP: Open User Settings (JSON)` to create and open the user configuration file.
1. Using the [configuration format](#configuration-format), add information about the MCP servers
your feature connects to.
1. Save the file.
Alternatively, manually create the file in this location:
- Windows: `C:\Users\<username>\AppData\Roaming\GitLab\duo\mcp.json`
- All other operating systems: `~/.gitlab/duo/mcp.json`
### Configuration format
Both configuration files use the same JSON format:
```json
{
"mcpServers": {
"server-name": {
"command": "path/to/server",
"args": ["--arg1", "value1"],
"env": {
"ENV_VAR": "value"
}
},
"http-server": {
"url": "http://localhost:3000/mcp"
}
}
}
```
### Example MCP server configurations
Use the following code examples to help you create your MCP server configuration file.
For more information and examples, see the [MCP example servers documentation](https://modelcontextprotocol.io/examples).
Other example servers are [Smithery.ai](https://smithery.ai/) and [Awesome MCP Servers](https://mcpservers.org/).
#### Local server
```json
{
"mcpServers": {
"enterprise-data-v2": {
"command": "node",
"args": ["src/server.js"],
"cwd": "</path/to/your-mcp-server>"
}
}
}
```
#### Remote server
```json
{
"mcpServers": {
"aws-knowledge": {
"command": "npx",
"args": [
"mcp-remote",
"https://knowledge-mcp.global.api.aws"
]
}
}
}
```
#### HTTP server
```json
{
"mcpServers": {
"local-http-server": {
"url": "http://localhost:3000/mcp"
}
}
}
```
## Use GitLab Duo features with MCP
When a GitLab Duo feature wants to call an external tool to answer
the question you have asked, you must review the tool before
the feature can use that tool:
1. Open VS Code.
1. On the left sidebar, select **GitLab Duo Agent Platform (Beta)** ({{< icon name="duo-agentic-chat" >}}).
1. Select the **Chat** or **Flows** tab.
1. In the text box, enter a question or specify a code task.
1. Submit the question or code task.
1. The **Tool Approval Required** dialog appears.
You must review a tool every time a GitLab Duo feature tries to connect
to that tool, even if you have previously reviewed that tool.
1. Approve or deny the tool:
- If you approve the tool, the feature connects to the tool and generates an answer.
- Optional: For Agentic Chat, if you deny the tool, the **Provide Rejection Reason**
dialog appears. Enter a rejection reason into the text box, and select
**Submit Rejection**.
## Feedback
This feature is experimental. Your feedback is valuable in helping us
to improve it. Share your experiences, suggestions, or issues in
[issue 552164](https://gitlab.com/gitlab-org/gitlab/-/issues/552164).
## Related topics
- [Get started with the Model Context Protocol](https://modelcontextprotocol.io/introduction)
- [Demo - Agentic Chat MCP Tool Call Approval](https://www.youtube.com/watch?v=_cHoTmG8Yj8)
## Troubleshooting
For troubleshooting information, see [troubleshooting the GitLab Workflow extension for VS Code](../../../editor_extensions/visual_studio_code/troubleshooting.md).
|
---
stage: AI-powered
group: Duo Workflow
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Describes Model Context Protocol and how to use it
title: Use Model Context Protocol with AI-native features
breadcrumbs:
- doc
- user
- gitlab_duo
- model_context_protocol
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
- Available on GitLab Duo with self-hosted models: Not supported
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/519938) in GitLab 18.1 [with a flag](../../../administration/feature_flags/_index.md) named `duo_workflow_mcp_support`. Disabled by default.
- [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/issues/545956) in GitLab 18.2. Feature flag `duo_workflow_mcp_support` removed.
{{< /history >}}
The Model Context Protocol (MCP) provides a standardized way for GitLab Duo features
to securely connect to different external data sources and tools.
The following features can act as MCP clients, and connect to and run
external tools from MCP servers:
- [GitLab Duo Agentic Chat](../../../user/gitlab_duo_chat/agentic_chat.md)
- The [software development flow](../../../user/duo_agent_platform/flows/software_development.md)
This connectivity means these features can now use context and information external to GitLab to
generate more powerful answers for customers.
To use a feature with MCP:
- Turn on MCP for your group.
- Configure the MCP servers you want the feature to connect to.
For a click-through demo, see [Duo Agent Platform - MCP integration](https://gitlab.navattic.com/mcp). <!-- Demo published on 2025-08-05 -->
## Prerequisites
Before using a GitLab Duo feature with MCP, you must:
- Install [Visual Studio Code](https://code.visualstudio.com/download) (VS Code).
- Set up the [GitLab Workflow extension for VS Code](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#setup).
- MCP support requires version 6.28.2 and later.
- Workspace and user configuration features require version 6.35.6 and later.
- Meet the feature prerequisites as required:
- [Agentic Chat prerequisites](../../../user/gitlab_duo_chat/agentic_chat.md#use-agentic-chat-in-vs-code).
- [Software development flow prerequisites](../../../user/duo_agent_platform/flows/software_development.md#prerequisites).
## Turn on MCP for your group
To turn MCP on or off for your group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > GitLab Duo**.
1. Select **Change configuration**.
1. Under **Model Context Protocol**, select or clear the
**Turn on Model Context Protocol (MCP) support** checkbox.
1. Select **Save changes**.
## Configure MCP servers
To integrate MCP with the Language Server, set up workspace configuration, user configuration, or both.
The GitLab Language Server loads and merges the configuration files.
### Version compatibility
| GitLab Workflow extension version | MCP features available |
|-----------------------------------|------------------------|
| 6.28.2 - 6.35.5 | Basic MCP support, with no workspace or user configuration |
| 6.35.6 and later | Full MCP support, including workspace and user configuration |
### Create workspace configuration
Workspace configuration applies to this project only, and overrides any user configuration for the
same server.
To set up workspace configuration:
1. In your project workspace, create the file `<workspace>/.gitlab/duo/mcp.json`.
1. Using the [configuration format](#configuration-format), add information about the MCP servers
your feature connects to.
1. Save the file.
### Create user configuration
User configuration settings are good for personal tools and commonly-used servers. They apply to all
workspaces, but any workspace settings for the same server override the user configuration.
To set up user configuration:
1. In VS Code, open the Command Palette by pressing
<kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or
</kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
1. Run the command `GitLab MCP: Open User Settings (JSON)` to create and open the user configuration file.
1. Using the [configuration format](#configuration-format), add information about the MCP servers
your feature connects to.
1. Save the file.
Alternatively, manually create the file in this location:
- Windows: `C:\Users\<username>\AppData\Roaming\GitLab\duo\mcp.json`
- All other operating systems: `~/.gitlab/duo/mcp.json`
### Configuration format
Both configuration files use the same JSON format:
```json
{
"mcpServers": {
"server-name": {
"command": "path/to/server",
"args": ["--arg1", "value1"],
"env": {
"ENV_VAR": "value"
}
},
"http-server": {
"url": "http://localhost:3000/mcp"
}
}
}
```
### Example MCP server configurations
Use the following code examples to help you create your MCP server configuration file.
For more information and examples, see the [MCP example servers documentation](https://modelcontextprotocol.io/examples).
Other example servers are [Smithery.ai](https://smithery.ai/) and [Awesome MCP Servers](https://mcpservers.org/).
#### Local server
```json
{
"mcpServers": {
"enterprise-data-v2": {
"command": "node",
"args": ["src/server.js"],
"cwd": "</path/to/your-mcp-server>"
}
}
}
```
#### Remote server
```json
{
"mcpServers": {
"aws-knowledge": {
"command": "npx",
"args": [
"mcp-remote",
"https://knowledge-mcp.global.api.aws"
]
}
}
}
```
#### HTTP server
```json
{
"mcpServers": {
"local-http-server": {
"url": "http://localhost:3000/mcp"
}
}
}
```
## Use GitLab Duo features with MCP
When a GitLab Duo feature wants to call an external tool to answer
the question you have asked, you must review the tool before
the feature can use that tool:
1. Open VS Code.
1. On the left sidebar, select **GitLab Duo Agent Platform (Beta)** ({{< icon name="duo-agentic-chat" >}}).
1. Select the **Chat** or **Flows** tab.
1. In the text box, enter a question or specify a code task.
1. Submit the question or code task.
1. The **Tool Approval Required** dialog appears.
You must review a tool every time a GitLab Duo feature tries to connect
to that tool, even if you have previously reviewed that tool.
1. Approve or deny the tool:
- If you approve the tool, the feature connects to the tool and generates an answer.
- Optional: For Agentic Chat, if you deny the tool, the **Provide Rejection Reason**
dialog appears. Enter a rejection reason into the text box, and select
**Submit Rejection**.
## Feedback
This feature is experimental. Your feedback is valuable in helping us
to improve it. Share your experiences, suggestions, or issues in
[issue 552164](https://gitlab.com/gitlab-org/gitlab/-/issues/552164).
## Related topics
- [Get started with the Model Context Protocol](https://modelcontextprotocol.io/introduction)
- [Demo - Agentic Chat MCP Tool Call Approval](https://www.youtube.com/watch?v=_cHoTmG8Yj8)
## Troubleshooting
For troubleshooting information, see [troubleshooting the GitLab Workflow extension for VS Code](../../../editor_extensions/visual_studio_code/troubleshooting.md).
|
https://docs.gitlab.com/user/gitlab_duo/debug_failing_code
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/debug_failing_code.md
|
2025-08-13
|
doc/user/gitlab_duo/prompt_examples
|
[
"doc",
"user",
"gitlab_duo",
"prompt_examples"
] |
debug_failing_code.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Debug failing code
|
Identify and fix bugs in failing code or tests.
|
Follow these guidelines when you have code that isn't working as expected or tests that are failing.
- Time estimate: 10-25 minutes
- Level: Beginner
- Prerequisites: Error messages or failing code available, GitLab Duo Chat available in IDE
## The challenge
Quickly identify the root cause of bugs or test failures and implement effective fixes without spending hours debugging manually.
## The approach
Analyze errors, identify causes, and implement fixes by using GitLab Duo Chat.
### Step 1: Analyze
Copy the error message and relevant code. Then ask GitLab Duo Chat to explain the error.
```plaintext
Explain what's causing this error and help me fix it:
Error: [paste_error_message]
Context: [brief_description_of_what_you_were_trying_to_do]
Here's the relevant code:
[paste_problematic_code]
```
Expected outcome: Clear explanation of the error cause and specific fix recommendations.
### Step 2: Implement
Ask Chat to provide the corrected code.
```plaintext
Based on your analysis, please provide the corrected version of this code:
[paste_original_code]
Make sure the fix addresses [specific_error] and follows [language/framework] best practices.
```
Expected outcome: Working code that fixes the identified issue.
### Step 3: Prevent
Ask for guidance on how to avoid similar issues.
```plaintext
How can I prevent this type of error in the future?
What are the warning signs to watch for with [error_type] in [language/framework]?
Include any best practices or common patterns I should follow.
```
Expected outcome: Preventive guidance and best practices to avoid similar bugs.
## Tips
- Include the full error message, not just a summary.
- Provide context about what you were trying to accomplish.
- Start by copying only the specific code section that's failing. Add more code from the file if Chat requires more context.
- Ask Chat to explain the fix so you understand the underlying issue.
- If the first suggestion doesn't work, tell Chat what happened when you tried it.
## Verify
Ensure that:
- The error no longer occurs when you run the code.
- The fix addresses the root cause, not just the symptoms.
- The solution follows your project's coding standards.
- You understand why the error occurred and how the fix works.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Identify and fix bugs in failing code or tests.
title: Debug failing code
breadcrumbs:
- doc
- user
- gitlab_duo
- prompt_examples
---
Follow these guidelines when you have code that isn't working as expected or tests that are failing.
- Time estimate: 10-25 minutes
- Level: Beginner
- Prerequisites: Error messages or failing code available, GitLab Duo Chat available in IDE
## The challenge
Quickly identify the root cause of bugs or test failures and implement effective fixes without spending hours debugging manually.
## The approach
Analyze errors, identify causes, and implement fixes by using GitLab Duo Chat.
### Step 1: Analyze
Copy the error message and relevant code. Then ask GitLab Duo Chat to explain the error.
```plaintext
Explain what's causing this error and help me fix it:
Error: [paste_error_message]
Context: [brief_description_of_what_you_were_trying_to_do]
Here's the relevant code:
[paste_problematic_code]
```
Expected outcome: Clear explanation of the error cause and specific fix recommendations.
### Step 2: Implement
Ask Chat to provide the corrected code.
```plaintext
Based on your analysis, please provide the corrected version of this code:
[paste_original_code]
Make sure the fix addresses [specific_error] and follows [language/framework] best practices.
```
Expected outcome: Working code that fixes the identified issue.
### Step 3: Prevent
Ask for guidance on how to avoid similar issues.
```plaintext
How can I prevent this type of error in the future?
What are the warning signs to watch for with [error_type] in [language/framework]?
Include any best practices or common patterns I should follow.
```
Expected outcome: Preventive guidance and best practices to avoid similar bugs.
## Tips
- Include the full error message, not just a summary.
- Provide context about what you were trying to accomplish.
- Start by copying only the specific code section that's failing. Add more code from the file if Chat requires more context.
- Ask Chat to explain the fix so you understand the underlying issue.
- If the first suggestion doesn't work, tell Chat what happened when you tried it.
## Verify
Ensure that:
- The error no longer occurs when you run the code.
- The fix addresses the root cause, not just the symptoms.
- The solution follows your project's coding standards.
- You understand why the error occurred and how the fix works.
|
https://docs.gitlab.com/user/gitlab_duo/prompt_examples
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/_index.md
|
2025-08-13
|
doc/user/gitlab_duo/prompt_examples
|
[
"doc",
"user",
"gitlab_duo",
"prompt_examples"
] |
_index.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo prompt examples
|
Prompt examples.
|
GitLab Duo can help you accomplish a variety of development tasks.
Use these examples to instruct GitLab Duo.
{{< cards >}}
- [Refactor legacy code](refactor_legacy_code.md)
- [Generate tests](generate_tests.md)
- [Debug failing code](debug_failing_code.md)
- [Analyze security vulnerabilities](analyze_vulnerabilities.md)
{{< /cards >}}
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Prompt examples.
title: GitLab Duo prompt examples
breadcrumbs:
- doc
- user
- gitlab_duo
- prompt_examples
---
GitLab Duo can help you accomplish a variety of development tasks.
Use these examples to instruct GitLab Duo.
{{< cards >}}
- [Refactor legacy code](refactor_legacy_code.md)
- [Generate tests](generate_tests.md)
- [Debug failing code](debug_failing_code.md)
- [Analyze security vulnerabilities](analyze_vulnerabilities.md)
{{< /cards >}}
|
https://docs.gitlab.com/user/gitlab_duo/refactor_legacy_code
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/refactor_legacy_code.md
|
2025-08-13
|
doc/user/gitlab_duo/prompt_examples
|
[
"doc",
"user",
"gitlab_duo",
"prompt_examples"
] |
refactor_legacy_code.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Refactor legacy code
|
Refactor legacy code in your repository.
|
Follow these guidelines when you need to improve performance, readability, or maintainability of existing code.
- Time estimate: 15-30 minutes
- Level: Intermediate
- Prerequisites: Code file open in IDE, GitLab Duo Chat available
## The challenge
Transform complex, hard-to-maintain code into clean, testable components without breaking functionality.
## The approach
Analyze, plan, and implement by using GitLab Duo Chat and Code Suggestions.
### Step 1: Analyze
Use GitLab Duo Chat to understand the current state. Select the code you want to refactor, then ask:
```plaintext
Analyze the [ClassName] in [file_path]. Focus on:
1. Current methods and their complexity
2. Performance bottlenecks
3. Areas where readability can be improved
4. Potential design patterns that could be applied
Provide specific examples from the code and suggest applicable refactoring patterns.
```
Expected outcome: Detailed analysis with specific improvement suggestions.
### Step 2: Plan
Use GitLab Duo Chat to create a structured proposal.
```plaintext
Based on your analysis of [ClassName], create a refactoring plan:
1. Outline the new structure
2. Suggest new method names and their purposes
3. Identify any new classes or modules needed
4. Explain how this improves [performance/readability/maintainability]
Format as a structured plan with clear before/after comparisons.
```
Expected outcome: Step-by-step refactoring roadmap.
### Step 3: Implement
Use GitLab Duo Chat to generate the refactored code. Then apply the code and use Code Suggestions to help with syntax.
```plaintext
Implement the refactoring plan for [ClassName]:
1. Create the new [language] file following our coding standards
2. Include detailed comments explaining changes
3. Update [related_file] to use the new structure
4. Write tests for the new implementation
Follow [style_guide] and document any design decisions.
```
Expected outcome: Complete refactored code with tests.
## Tips
- Start with analysis before jumping to implementation.
- Select specific code sections when asking Chat for analysis.
- Ask Chat for specific examples from your actual code.
- Reference your existing codebase patterns for consistency.
- Use incremental prompts rather than trying to do everything at once.
- Let Code Suggestions help with syntax as you implement the recommendations from Chat.
## Verify
Ensure that:
- Generated code follows your team's style guide.
- New structure actually improves the identified issues.
- Tests cover the refactored functionality.
- No functionality was lost in the refactoring.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Refactor legacy code in your repository.
title: Refactor legacy code
breadcrumbs:
- doc
- user
- gitlab_duo
- prompt_examples
---
Follow these guidelines when you need to improve performance, readability, or maintainability of existing code.
- Time estimate: 15-30 minutes
- Level: Intermediate
- Prerequisites: Code file open in IDE, GitLab Duo Chat available
## The challenge
Transform complex, hard-to-maintain code into clean, testable components without breaking functionality.
## The approach
Analyze, plan, and implement by using GitLab Duo Chat and Code Suggestions.
### Step 1: Analyze
Use GitLab Duo Chat to understand the current state. Select the code you want to refactor, then ask:
```plaintext
Analyze the [ClassName] in [file_path]. Focus on:
1. Current methods and their complexity
2. Performance bottlenecks
3. Areas where readability can be improved
4. Potential design patterns that could be applied
Provide specific examples from the code and suggest applicable refactoring patterns.
```
Expected outcome: Detailed analysis with specific improvement suggestions.
### Step 2: Plan
Use GitLab Duo Chat to create a structured proposal.
```plaintext
Based on your analysis of [ClassName], create a refactoring plan:
1. Outline the new structure
2. Suggest new method names and their purposes
3. Identify any new classes or modules needed
4. Explain how this improves [performance/readability/maintainability]
Format as a structured plan with clear before/after comparisons.
```
Expected outcome: Step-by-step refactoring roadmap.
### Step 3: Implement
Use GitLab Duo Chat to generate the refactored code. Then apply the code and use Code Suggestions to help with syntax.
```plaintext
Implement the refactoring plan for [ClassName]:
1. Create the new [language] file following our coding standards
2. Include detailed comments explaining changes
3. Update [related_file] to use the new structure
4. Write tests for the new implementation
Follow [style_guide] and document any design decisions.
```
Expected outcome: Complete refactored code with tests.
## Tips
- Start with analysis before jumping to implementation.
- Select specific code sections when asking Chat for analysis.
- Ask Chat for specific examples from your actual code.
- Reference your existing codebase patterns for consistency.
- Use incremental prompts rather than trying to do everything at once.
- Let Code Suggestions help with syntax as you implement the recommendations from Chat.
## Verify
Ensure that:
- Generated code follows your team's style guide.
- New structure actually improves the identified issues.
- Tests cover the refactored functionality.
- No functionality was lost in the refactoring.
|
https://docs.gitlab.com/user/gitlab_duo/analyze_vulnerabilities
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/analyze_vulnerabilities.md
|
2025-08-13
|
doc/user/gitlab_duo/prompt_examples
|
[
"doc",
"user",
"gitlab_duo",
"prompt_examples"
] |
analyze_vulnerabilities.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Analyze security vulnerabilities and prioritize fixes
|
Analyze security vulnerabilities and prioritize fixes based on business impact.
|
Follow these guidelines when you need to evaluate multiple security vulnerabilities
and determine which ones require immediate attention.
- Time estimate: 15-25 minutes
- Level: Intermediate
- Prerequisites: GitLab Duo Enterprise add-on, vulnerabilities available in the vulnerability report
## The challenge
Security scans often generate numerous vulnerability alerts, making it difficult
to identify false positives and determine which issues pose the greatest business risk.
## The approach
Analyze vulnerabilities, assess business impact, and create prioritized remediation plans
by using GitLab Duo Chat, Vulnerability Explanation, and Vulnerability Resolution.
### Step 1: Explain vulnerabilities
Go to the vulnerability report for your project.
For each high or critical vulnerability, use Vulnerability Explanation to explain the issue. Then, use Duo Chat to ask follow-up questions.
```plaintext
Based on the earlier vulnerability explanation:
1. What specific security risk does this pose?
2. How could this be exploited in our [application_type]?
3. What data or systems could be compromised?
4. Is this a true positive or likely false positive?
5. What is the realistic business impact?
Consider our application stack: [technology_stack] and deployment environment: [environment_details].
```
Expected outcome: Clear explanation of each vulnerability's real-world impact and how it could be exploited.
### Step 2: Prioritize risks
Use GitLab Duo Chat to analyze multiple vulnerabilities together and create a priority matrix.
```plaintext
Based on these vulnerability explanations, help me prioritize fixes:
[paste_vulnerability_summaries]
Create a priority matrix considering:
1. Exploitability (how easy to exploit)
2. Business impact (what gets compromised)
3. Exposure level (public-facing vs internal)
4. Fix complexity (simple patch vs major changes)
Rank as Critical/High/Medium/Low priority with justification.
```
Expected outcome: Prioritized vulnerability list with business-focused risk assessment.
### Step 3: Generate fix plans
For high-priority vulnerabilities, use Vulnerability Resolution or Chat to get specific remediation guidance.
```plaintext
Provide a detailed remediation plan for this [vulnerability_type]:
1. Immediate steps to reduce risk
2. Code changes needed (with examples)
3. Configuration updates required
4. Testing approach to verify the fix
5. Timeline estimate for implementation
Focus on [security_framework] compliance and our [coding_standards].
```
Expected outcome: Actionable remediation plans with specific implementation steps.
## Tips
- Start with Critical and High severity vulnerabilities first.
- Use Vulnerability Explanation to understand the context before diving into fixes.
- Consider your specific application architecture when assessing business impact.
- Ask GitLab Duo Chat to explain technical terms or attack vectors you're unfamiliar with.
- Group similar vulnerabilities together for batch analysis and consistent fixes.
- Use the Security Dashboard to track progress on remediation efforts.
## Verify
Ensure that:
- Priority rankings reflect actual business risk, not just CVSS scores.
- Remediation plans include specific code examples and testing steps.
- False positives are clearly identified and documented.
- Critical vulnerabilities have immediate mitigation strategies identified.
- Fix timelines are realistic and account for testing and deployment processes.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Analyze security vulnerabilities and prioritize fixes based on business
impact.
title: Analyze security vulnerabilities and prioritize fixes
breadcrumbs:
- doc
- user
- gitlab_duo
- prompt_examples
---
Follow these guidelines when you need to evaluate multiple security vulnerabilities
and determine which ones require immediate attention.
- Time estimate: 15-25 minutes
- Level: Intermediate
- Prerequisites: GitLab Duo Enterprise add-on, vulnerabilities available in the vulnerability report
## The challenge
Security scans often generate numerous vulnerability alerts, making it difficult
to identify false positives and determine which issues pose the greatest business risk.
## The approach
Analyze vulnerabilities, assess business impact, and create prioritized remediation plans
by using GitLab Duo Chat, Vulnerability Explanation, and Vulnerability Resolution.
### Step 1: Explain vulnerabilities
Go to the vulnerability report for your project.
For each high or critical vulnerability, use Vulnerability Explanation to explain the issue. Then, use Duo Chat to ask follow-up questions.
```plaintext
Based on the earlier vulnerability explanation:
1. What specific security risk does this pose?
2. How could this be exploited in our [application_type]?
3. What data or systems could be compromised?
4. Is this a true positive or likely false positive?
5. What is the realistic business impact?
Consider our application stack: [technology_stack] and deployment environment: [environment_details].
```
Expected outcome: Clear explanation of each vulnerability's real-world impact and how it could be exploited.
### Step 2: Prioritize risks
Use GitLab Duo Chat to analyze multiple vulnerabilities together and create a priority matrix.
```plaintext
Based on these vulnerability explanations, help me prioritize fixes:
[paste_vulnerability_summaries]
Create a priority matrix considering:
1. Exploitability (how easy to exploit)
2. Business impact (what gets compromised)
3. Exposure level (public-facing vs internal)
4. Fix complexity (simple patch vs major changes)
Rank as Critical/High/Medium/Low priority with justification.
```
Expected outcome: Prioritized vulnerability list with business-focused risk assessment.
### Step 3: Generate fix plans
For high-priority vulnerabilities, use Vulnerability Resolution or Chat to get specific remediation guidance.
```plaintext
Provide a detailed remediation plan for this [vulnerability_type]:
1. Immediate steps to reduce risk
2. Code changes needed (with examples)
3. Configuration updates required
4. Testing approach to verify the fix
5. Timeline estimate for implementation
Focus on [security_framework] compliance and our [coding_standards].
```
Expected outcome: Actionable remediation plans with specific implementation steps.
## Tips
- Start with Critical and High severity vulnerabilities first.
- Use Vulnerability Explanation to understand the context before diving into fixes.
- Consider your specific application architecture when assessing business impact.
- Ask GitLab Duo Chat to explain technical terms or attack vectors you're unfamiliar with.
- Group similar vulnerabilities together for batch analysis and consistent fixes.
- Use the Security Dashboard to track progress on remediation efforts.
## Verify
Ensure that:
- Priority rankings reflect actual business risk, not just CVSS scores.
- Remediation plans include specific code examples and testing steps.
- False positives are clearly identified and documented.
- Critical vulnerabilities have immediate mitigation strategies identified.
- Fix timelines are realistic and account for testing and deployment processes.
|
https://docs.gitlab.com/user/gitlab_duo/generate_tests
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/generate_tests.md
|
2025-08-13
|
doc/user/gitlab_duo/prompt_examples
|
[
"doc",
"user",
"gitlab_duo",
"prompt_examples"
] |
generate_tests.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Generate tests for existing code
|
Generate comprehensive tests for existing functions and classes.
|
Follow these guidelines when you need to create comprehensive test coverage for existing functions or classes.
- Time estimate: 10-20 minutes
- Level: Beginner
- Prerequisites: Code file open in IDE, GitLab Duo Chat available, existing code to test
## The challenge
Create thorough test coverage for existing code without manually writing boilerplate test cases and setup code.
## The approach
Select code, generate tests, and refine coverage by using GitLab Duo Chat and Code Suggestions.
### Step 1: Generate
Select the function or class you want to test, then use GitLab Duo Chat to generate tests.
```plaintext
Generate tests for the selected [function_name/ClassName] by using [test_framework]:
1. Include test cases for normal operation
2. Add edge cases and error conditions
3. Test boundary values and invalid inputs
4. Follow [testing_conventions] for our project
5. Include setup and teardown if needed
Make the tests comprehensive but readable.
```
Expected outcome: Complete test file with multiple test cases covering different scenarios.
### Step 2: Refine
Review the generated tests and ask for specific improvements.
```plaintext
Review the generated tests and:
1. Add any missing edge cases for [specific_functionality]
2. Improve test names to be more descriptive
3. Add comments explaining complex test scenarios
4. Ensure tests follow [specific_style_guide]
Focus on making tests maintainable and clear.
```
Expected outcome: Polished test file with clear, comprehensive coverage.
### Step 3: Extend
Use Code Suggestions to add additional test cases. Type this text in your file.
```plaintext
// Test [specific_edge_case_scenario]
// Test [error_condition]
// Test [boundary_condition]
```
Expected outcome: Code Suggestions helps complete additional test cases.
## Tips
- Select specific functions or classes rather than entire files for better results.
- Be specific about your testing framework (for example, Jest, pytest, RSpec).
- Ask Chat to explain the reasoning behind test cases if you're learning.
- Use Code Suggestions to quickly add similar test patterns.
- Request both positive and negative test cases for thorough coverage.
## Verify
Ensure that:
- Tests cover the main functionality and common edge cases.
- Test names clearly describe what is being tested.
- Tests follow your project's testing conventions and style.
- All tests pass when run against the existing code.
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Generate comprehensive tests for existing functions and classes.
title: Generate tests for existing code
breadcrumbs:
- doc
- user
- gitlab_duo
- prompt_examples
---
Follow these guidelines when you need to create comprehensive test coverage for existing functions or classes.
- Time estimate: 10-20 minutes
- Level: Beginner
- Prerequisites: Code file open in IDE, GitLab Duo Chat available, existing code to test
## The challenge
Create thorough test coverage for existing code without manually writing boilerplate test cases and setup code.
## The approach
Select code, generate tests, and refine coverage by using GitLab Duo Chat and Code Suggestions.
### Step 1: Generate
Select the function or class you want to test, then use GitLab Duo Chat to generate tests.
```plaintext
Generate tests for the selected [function_name/ClassName] by using [test_framework]:
1. Include test cases for normal operation
2. Add edge cases and error conditions
3. Test boundary values and invalid inputs
4. Follow [testing_conventions] for our project
5. Include setup and teardown if needed
Make the tests comprehensive but readable.
```
Expected outcome: Complete test file with multiple test cases covering different scenarios.
### Step 2: Refine
Review the generated tests and ask for specific improvements.
```plaintext
Review the generated tests and:
1. Add any missing edge cases for [specific_functionality]
2. Improve test names to be more descriptive
3. Add comments explaining complex test scenarios
4. Ensure tests follow [specific_style_guide]
Focus on making tests maintainable and clear.
```
Expected outcome: Polished test file with clear, comprehensive coverage.
### Step 3: Extend
Use Code Suggestions to add additional test cases. Type this text in your file.
```plaintext
// Test [specific_edge_case_scenario]
// Test [error_condition]
// Test [boundary_condition]
```
Expected outcome: Code Suggestions helps complete additional test cases.
## Tips
- Select specific functions or classes rather than entire files for better results.
- Be specific about your testing framework (for example, Jest, pytest, RSpec).
- Ask Chat to explain the reasoning behind test cases if you're learning.
- Use Code Suggestions to quickly add similar test patterns.
- Request both positive and negative test cases for thorough coverage.
## Verify
Ensure that:
- Tests cover the main functionality and common edge cases.
- Test names clearly describe what is being tested.
- Tests follow your project's testing conventions and style.
- All tests pass when run against the existing code.
|
https://docs.gitlab.com/user/gitlab_duo/fix_code_python_shop
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/fix_code_python_shop.md
|
2025-08-13
|
doc/user/gitlab_duo/tutorials
|
[
"doc",
"user",
"gitlab_duo",
"tutorials"
] |
fix_code_python_shop.md
|
none
|
Tutorials
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Tutorial: Use GitLab Duo to create a shop application in Python
|
Tutorial on how to create a shop application in Python with GitLab Duo.
|
<!-- vale gitlab_base.FutureTense = NO -->
You have been hired as a developer at an online bookstore. The current system for
managing inventory is a mix of spreadsheets and manual processes, leading to inventory
errors and delayed updates. Your team needs to create a web application that can:
- Track book inventory in real time.
- Enable staff to add new books as they arrive.
- Prevent common data entry errors, like negative prices or quantities.
- Provide a foundation for future customer-facing features.
This tutorial is part one in a series, and guides you through creating and debugging
a [Python](https://www.python.org/) web application with a database backend
that meets these requirements.
You'll use [GitLab Duo Chat](../../gitlab_duo_chat/_index.md)
and [GitLab Duo Code Suggestions](../../project/repository/code_suggestions/_index.md)
to help you:
- Set up an organized Python project with standard directories and essential files.
- Configure the Python virtual environment.
- Install the [Flask](https://flask.palletsprojects.com/en/stable/) framework as the foundation
for the web application.
- Install required dependencies, and prepare the project for development.
- Set up the Python configuration file and environment variables for Flask application
development.
- Implement core features, including article models, database operations,
API routes, and inventory management features.
- Test that the application works as intended, comparing your code with example code files.
## Before you begin
- [Install the latest version of Python](https://www.python.org/downloads/) on your system.
You can ask Chat how to do that for your operating system.
- Confirm with an administrator, group owner, or project owner that you have access to GitLab Duo.
- Install an extension in your preferred IDE:
- [Web IDE](../../project/web_ide/_index.md): Access through your GitLab instance
- [VS Code](../../../editor_extensions/visual_studio_code/setup.md)
- [Visual Studio](../../../editor_extensions/visual_studio/setup.md)
- [JetBrains IDE](../../../editor_extensions/jetbrains_ide/_index.md)
- [Neovim](../../../editor_extensions/neovim/setup.md)
- Authenticate with GitLab from the IDE, using either
[OAuth](../../../integration/google.md) or a
[personal access token with the `api` scope](../../profile/personal_access_tokens.md#create-a-personal-access-token).
## Use GitLab Duo Chat and Code Suggestions
In this tutorial, you will use Chat and Code Suggestions to create the Python
web application. Multiple ways exist to use these features.
### Use GitLab Duo Chat
Depending on your subscription add-on, you can use Chat in the GitLab UI, the Web IDE, or your IDE.
#### Use Chat in the GitLab UI
1. In the upper-right corner, select **GitLab Duo Chat**. A drawer opens on the
right side of your browser tab.
1. Enter your question in the chat input box. Press **Enter**, or select **Send**.
It might take a few seconds for the interactive AI chat to produce an answer.
#### Use Chat in the Web IDE
1. Open the Web IDE:
1. In the GitLab UI, on the left sidebar, select **Search or go to** and find your project.
1. Select a file. Then in the upper right, select **Edit > Open in Web IDE**.
1. Open Chat by using one of these methods:
- On the left sidebar, select **GitLab Duo Chat**.
- In the file that you have open in the editor, select some code.
1. Right-click and select **GitLab Duo Chat**.
1. Select **Explain selected code**, **Generate Tests**, or **Refactor**.
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or
<kbd>Option</kbd>+<kbd>d</kbd> (on Mac).
1. In the message box, enter your question. Press **Enter**, or select **Send**.
#### Use Chat in your IDE
How you use Chat in your IDE differs depending on which IDE you use.
{{< tabs >}}
{{< tab title="VS Code" >}}
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
1. On the left sidebar, select **GitLab Duo Chat** ({{< icon name="duo-chat" >}}).
1. In the message box, enter your question. Press **Enter**, or select **Send**.
1. In the chat pane, on the top right corner, select **Show Status** to show information
in the Command Palette.
You can also interact with Duo Chat while you're working with a subset of code.
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
1. In the file, select some code.
1. Right-click and select **GitLab Duo Chat**.
1. Select an option, or **Open Quick Chat** and ask a question, like
`Can you simplify this code?` and press <kbd>Enter</kbd>.
For more information, see [Use GitLab Duo Chat in VS Code](../../gitlab_duo_chat/_index.md#use-gitlab-duo-chat-in-vs-code).
{{< /tab >}}
{{< tab title="JetBrains IDEs" >}}
1. Open a project in a JetBrains IDE that supports Python, such as
[PyCharm](https://www.jetbrains.com/pycharm/), or [IntelliJ IDEA](https://www.jetbrains.com/idea/).
1. Open GitLab Duo Chat in either a [chat window](../../gitlab_duo_chat/_index.md#in-a-chat-window)
or an [editor window](../../gitlab_duo_chat/_index.md#use-chat-while-working-in-the-editor-window).
For more information, see [Use GitLab Duo Chat in JetBrains IDEs](../../gitlab_duo_chat/_index.md#use-gitlab-duo-chat-in-jetbrains-ides).
{{< /tab >}}
{{< /tabs >}}
### Use Code Suggestions
To use Code Suggestions:
1. Open your Git project in a
[supported IDE](../../project/repository/code_suggestions/supported_extensions.md#supported-editor-extensions).
1. Add the project as a remote of your local repository using
[`git remote add`](../../../topics/git/commands.md#git-remote-add).
1. Add your project directory, including the hidden `.git/` folder, to your IDE workspace or project.
1. Author your code.
As you type, suggestions are displayed. Code Suggestions provides code snippets
or completes the current line, depending on the cursor position.
1. Describe the requirements in natural language.
Code Suggestions generates functions and code snippets based on the context provided.
1. When you receive a suggestion, you can do any of the following:
- To accept a suggestion, press <kbd>Tab</kbd>.
- To accept a partial suggestion, press either <kbd>Control</kbd>+<kbd>Right arrow</kbd> or
<kbd>Command</kbd>+<kbd>Right arrow</kbd>.
- To reject a suggestion, press <kbd>Esc</kbd>.
- To ignore a suggestion, keep typing as you usually would.
For more information, see the [Code Suggestions documentation](../../project/repository/code_suggestions/_index.md).
Now that you know how to use Chat and Code Suggestions, let's start building the
web application. First, you will create an organized Python project structure.
## Create the project structure
To start with, you need a well-organized project structure that follows
Python best practices. A proper structure makes your code more maintainable, testable,
and easier for other developers to understand.
You can use Chat to help you understand Python project organization conventions
and generate the appropriate files. This saves you time researching best practices, and
ensures you do not miss critical components.
1. Open Chat in your IDE and enter:
```plaintext
What is the recommended project structure for a Python web application? Include
common files, and explain the purpose of each file.
```
This prompt helps you understand Python project organization before creating files.
1. Create a new folder for the Python project and create a directory and file structure
based on Chat's response. It will probably be similar to the following:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
1. You must populate the `.gitignore` file. Enter the following into Chat:
```plaintext
Generate a .gitignore file for a Python project that uses Flask, SQLite, and
virtual environments. Include common IDE files.
```
1. Copy the response into the `.gitignore` file.
1. For the `README` file, enter the following into Chat:
```plaintext
Generate a README.md file for a Python web application that manages a bookstore
inventory. Make sure that it includes all sections for requirements, setup, and usage.
```
You have now created a properly-structured Python project that follows industry
best practices. This organization makes your code easier to maintain and test.
Next, you'll set up your development environment to start writing code.
## Set up the development environment
A properly isolated development environment prevents dependency conflicts and makes
your application deployable.
You will use Chat to help you set up a Python virtual environment and create a
`requirements.txt` file with the right dependencies. This ensures you have a stable
foundation for development.
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt <= File you are updating
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
1. Optional. Ask Chat about how Python and Flask work together to produce
web applications.
1. Use Chat to understand the best practices for setting up a Python environment:
```plaintext
What are the recommended steps for setting up a Python virtual environment with
Flask? Include information about requirements.txt and pip.
```
Ask any follow-up questions that you need to. For example:
```plaintext
What does the requirements.txt do in a Python web app?
```
1. Based on the response, first create and activate a virtual environment
(for example, on MacOS using Homebrew's `python3` package):
```plaintext
python3 -m venv myenv
source myenv/bin/activate
```
1. You must also create a `requirements.txt` file. Ask Chat the following:
```plaintext
What should be included in requirements.txt for a Flask web application with
SQLite database and testing capabilities? Include specific version numbers.
```
Copy the response to the `requirements.txt` file.
1. Install the dependencies named in the `requirements.txt` file:
```plaintext
pip install -r requirements.txt
```
Your development environment is now configured with all necessary dependencies
isolated in a virtual environment to prevent conflicts. Next, you'll configure
the project's package and environment settings.
## Configure the project
Proper configuration, including environment variables, enables your application
to run consistently across different environments.
You'll use Code Suggestions to help generate and refine the configuration.
Then, you'll ask Chat to explain the purpose of each setting, so you understand
what you're configuring and why.
1. You have already created a Python configuration file called `setup.py` in your
project folder:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py <= File you are updating
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
Open this file, and enter this comment at the top of the file:
```plaintext
# Populate this setup.py configuration file for a Flask web application
# Include dependencies for Flask, testing, and database functionality
# Use semantic versioning
```
Code Suggestions generates the configuration for you.
1. Optional. Select the generated configuration code and use the following
[slash commands](../../gitlab_duo_chat/examples.md#gitlab-duo-chat-slash-commands):
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand what each configuration setting does.
- Use [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements in the configuration structure.
1. Review and adjust the generated code as needed.
If you are not sure what you can adjust in the configuration file, ask Chat.
If you want to ask Chat what to adjust, do so in the IDE in the `setup.py`
file, instead of in the GitLab UI. This provides Chat with
[the context you're working in](../../gitlab_duo/context.md#gitlab-duo-chat),
including the `setup.py` file you just created.
```plaintext
You have used Code Suggestions to generate a Python configuration file, `setup.py`,
for a Flask web application. This file includes dependencies for Flask, testing,
and database functionality. If I were to review this file, what might I want
to change and adjust?
```
1. Save the file.
### Set the environment variables
Next, you're going to use both Chat and Code Suggestions to set the environment variables.
1. In Chat, ask the following:
```plaintext
In a Python project, what environment variables should be set for a Flask application in development mode? Include database configuration.
```
1. You have already created a `.env` file to store environment variables.
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env <= File you are updating
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
Open this file, and enter the following comment at the top of the file, including
the environment variables that Chat recommended:
```plaintext
# Populate this .env file to store environment variables
# Include the following
# ...
# Use semantic versioning
```
1. Review and adjust the generated code as needed, and save the file.
You have configured your project and set the environment variables. This ensures
your application can be deployed consistently across different environments. Next,
you'll create the application code for the inventory system.
## Create the application code
The Flask web framework has three core components:
- Models: Contains the data and business logic, and the database model. Specified in the `article.py` file.
- Views: Handles HTTP requests and responses. Specified in the `shop.py` file.
- Controller: Manages data storage and retrieval. Specified in the `database.py` file.
You will use Chat and Code Suggestions to help you define each of these three components
in three files in your Python project structure:
- `article.py` defines the models component, specifically the database model.
- `shop.py` defines the views component, specifically the API routes.
- `database.py` defines the controller component.
### Create the article file to define the database model
Your bookstore needs database models and operations to manage inventory effectively.
To create the application code for the bookstore inventory system, you will
use an article file to define the database model for articles.
You will use Code Suggestions to help generate the code, and Chat to
implement best practices for data modeling and database management.
1. You have already created an `article.py` file:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py <= File you are updating
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
In this file, use Code Suggestions
and enter the following:
```plaintext
# Create an Article class for a bookstore inventory system
# Include fields for: name, price, quantity
# Add data validation for each field
# Add methods to convert to/from dictionary format
```
1. Optional. Use the following [slash commands](../../gitlab_duo_chat/examples.md#gitlab-duo-chat-slash-commands):
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand how the article class works and its design patterns.
- Use, [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements in the class structure and methods.
1. Review and adjust the generated code as needed, and save the file.
Next you will define the API routes.
### Create the shop file to define the API routes
Now that you have created the article file to define the database model, you will
create the API routes.
API routes are crucial for a web application because they:
- Define the public API for clients to interact with your application.
- Map HTTP requests to the appropriate code in your application.
- Handle input validation and error responses.
- Transform data between your internal models and the JSON format expected by API clients.
For your bookstore inventory system, these routes will allow staff to:
- View all books in inventory.
- Look up specific books by ID.
- Add new books as they arrive.
- Update book information such as price or quantity.
- Remove books that are no longer needed.
In Flask, routes are functions that handle requests to specific URL endpoints.
For example, a route for `GET /books` would return a list of all books, while
`POST /books` would add a new book to the inventory.
You will use Chat and Code Suggestions to create these routes in the `shop.py`
file that you've already set up in your project structure:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py <= File you are updating
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
#### Create the Flask application and routes
1. Open the `shop.py` file. To use Code Suggestions, enter this comment
at the top of the file:
```plaintext
# Create Flask routes for a bookstore inventory system
# Include routes for:
# - Getting all books (GET /books)
# - Getting a single book by ID (GET /books/<id>)
# - Adding a new book (POST /books)
# - Updating a book (PUT /books/<id>)
# - Deleting a book (DELETE /books/<id>)
# Use the Article class from models.article and database from database.py
# Include proper error handling and HTTP status codes
```
1. Review the generated code. It should include:
- Import statements for Flask, request, and `jsonify`.
- Import statements for your Article class and database module.
- Route definitions for all CRUD operations (Create, Read, Update, Delete).
- Proper error handling and HTTP status codes.
1. Optional. Use these slash commands:
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand how the Flask routing works.
- Use [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements.
1. If the generated code doesn't fully meet your needs, or you want to understand
how to improve it, you can ask Chat from within the `shop.py` file:
```plaintext
Can you suggest improvements for my Flask routes in this shop.py file?
I want to ensure that:
1. The routes follow RESTful API design principles
2. Responses include appropriate HTTP status codes
3. Input validation is handled properly
4. The code follows Flask best practices
```
1. You also need to create the Flask application instance in the `__init__.py`
file inside the `app` directory. Open this file and use Code Suggestions to
generate the appropriate code:
```plaintext
# Create a Flask application factory
# Configure the app with settings from environment variables
# Register the shop blueprint
# Return the configured app
```
1. Save both files.
### Create the database file to manage data storage and retrieval
Finally, you will create the database operations code. You have already created
a `database.py` file:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py <= File you are updating
└── tests/
├── __init__.py
└── test_shop.py
```
1. Enter the following into Chat:
```plaintext
Generate a Python class that manages SQLite database operations for a bookstore inventory. Include:
- Context manager for connections
- Table creation
- CRUD operations
- Error handling
Show the complete code with comments.
```
1. Review and adjust the generated code as needed, and save the file.
You have successfully created the foundational code for your inventory
management system and defined the core components
of a Python web application built using the Flask framework.
Next you'll check your created code against example code files.
## Check your code against example code files
The following examples show complete, working code that should be similar to the
code you end up with after following the tutorial.
{{< tabs >}}
{{< tab title=".gitignore" >}}
This file shows standard Python project exclusions:
```plaintext
# Virtual Environment
myenv/
venv/
ENV/
env/
.venv/
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# SQLite database files
*.db
*.sqlite
*.sqlite3
# Environment variables
.env
.env.local
.env.*.local
# IDE specific files
.idea/
.vscode/
*.swp
*.swo
.DS_Store
```
{{< /tab >}}
{{< tab title="README.md" >}}
<!-- markdownlint-disable MD029 -->
A comprehensive `README` file with setup and usage instructions.
````markdown
# Bookstore Inventory Management System
A Python web application for managing bookstore inventory, built with Flask and SQLite.
## Features
- Track book inventory in real time.
- Add, update, and remove books.
- Data validation to prevent common errors.
- RESTful API for inventory management.
## Requirements
- Python 3.8 or higher.
- Flask 2.2.0 or higher.
- SQLite 3.
## Installation
1. Clone the repository:
```shell
git clone https://gitlab.com/your-username/python-shop-app.git
cd python-shop-app
```
2. Create and activate a virtual environment:
```shell
python -m venv myenv
source myenv/bin/activate # On Windows: myenv\Scripts\activate
```
3. Install dependencies:
```shell
pip install -r requirements.txt
```
4. Set up environment variables:
Copy `.env.example` to `.env` and modify as needed.
## Usage
1. Start the Flask application:
```shell
flask run
```
2. The API will be available at `http://localhost:5000/`
## API Endpoints
- `GET /books` - Get all books
- `GET /books/<id>` - Get a specific book
- `POST /books` - Add a new book
- `PUT /books/<id>` - Update a book
- `DELETE /books/<id>` - Delete a book
## Testing
Run tests with `pytest`:
```python
python -m pytest
```
````
<!-- markdownlint-enable MD029 -->
{{< /tab >}}
{{< tab title="requirements.txt" >}}
Lists all required Python packages with versions.
```plaintext
Flask==2.2.3
pytest==7.3.1
pytest-flask==1.2.0
Flask-SQLAlchemy==3.0.3
SQLAlchemy==2.0.9
python-dotenv==1.0.0
Werkzeug==2.2.3
requests==2.28.2
```
{{< /tab >}}
{{< tab title="setup.py" >}}
Project configuration for packaging.
```python
from setuptools import setup, find_packages
setup(
name="bookstore-inventory",
version="0.1.0",
packages=find_packages(),
include_package_data=True,
install_requires=[
"Flask>=2.2.0",
"Flask-SQLAlchemy>=3.0.0",
"SQLAlchemy>=2.0.0",
"pytest>=7.0.0",
"pytest-flask>=1.2.0",
"python-dotenv>=1.0.0",
],
python_requires=">=3.8",
author="Your Name",
author_email="your.email@example.com",
description="A Flask web application for managing bookstore inventory",
keywords="flask, inventory, bookstore",
url="https://gitlab.com/your-username/python-shop-app",
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
```
{{< /tab >}}
{{< tab title=".env" >}}
Contains environment variables for the application.
```plaintext
# Flask configuration
FLASK_APP=app
FLASK_ENV=development
FLASK_DEBUG=1
SECRET_KEY=your-secret-key-change-in-production
# Database configuration
DATABASE_URL=sqlite:///bookstore.db
TEST_DATABASE_URL=sqlite:///test_bookstore.db
# Application settings
BOOK_TITLE_MAX_LENGTH=100
MAX_PRICE=1000.00
MAX_QUANTITY=1000
```
{{< /tab >}}
{{< tab title="app/models/article.py" >}}
Article class with full validation.
```python
class Article:
"""Article class for a bookstore inventory system."""
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article with validation.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
Raises:
ValueError: If any of the fields fail validation
"""
self.id = article_id
self.set_name(name)
self.set_price(price)
self.set_quantity(quantity)
def set_name(self, name):
"""
Set the name with validation.
Args:
name (str): The name/title of the book
Raises:
ValueError: If name is empty or too long
"""
if not name or not isinstance(name, str):
raise ValueError("Book title cannot be empty and must be a string")
if len(name) > 100: # Max length validation
raise ValueError("Book title cannot exceed 100 characters")
self.name = name.strip()
def set_price(self, price):
"""
Set the price with validation.
Args:
price (float): The price of the book
Raises:
ValueError: If price is negative or not a number
"""
try:
price_float = float(price)
except (ValueError, TypeError):
raise ValueError("Price must be a number")
if price_float < 0:
raise ValueError("Price cannot be negative")
if price_float > 1000: # Max price validation
raise ValueError("Price cannot exceed 1000")
# Ensure price has at most 2 decimal places
self.price = round(price_float, 2)
def set_quantity(self, quantity):
"""
Set the quantity with validation.
Args:
quantity (int): The quantity in stock
Raises:
ValueError: If quantity is negative or not an integer
"""
try:
quantity_int = int(quantity)
except (ValueError, TypeError):
raise ValueError("Quantity must be an integer")
if quantity_int < 0:
raise ValueError("Quantity cannot be negative")
if quantity_int > 1000: # Max quantity validation
raise ValueError("Quantity cannot exceed 1000")
self.quantity = quantity_int
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
"""
article_id = data.get("id")
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
{{< /tab >}}
{{< tab title="app/routes/shop.py" >}}
Complete API endpoints with error handling.
```python
from flask import Blueprint, request, jsonify, current_app
from app.models.article import Article
from app import database
import logging
# Create a blueprint for the shop routes
shop_bp = Blueprint('shop', __name__, url_prefix='/books')
# Set up logging
logger = logging.getLogger(__name__)
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
try:
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books]), 200
except Exception as e:
logger.error(f"Error getting all books: {str(e)}")
return jsonify({"error": "Failed to retrieve books"}), 500
@shop_bp.route('/<int:book_id>', methods=['GET'])
def get_book(book_id):
"""Get a specific book by ID."""
try:
book = database.get_article_by_id(book_id)
if book:
return jsonify(book.to_dict()), 200
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
except Exception as e:
logger.error(f"Error getting book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to retrieve book {book_id}"}), 500
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
data = request.get_json()
if not data:
return jsonify({"error": "No data provided"}), 400
required_fields = ['name', 'price', 'quantity']
for field in required_fields:
if field not in data:
return jsonify({"error": f"Missing required field: {field}"}), 400
try:
# Validate data by creating an Article object
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
# Save to database
book_id = database.add_article(new_book)
# Return the created book
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
except ValueError as e:
return jsonify({"error": str(e)}), 400
except Exception as e:
logger.error(f"Error adding book: {str(e)}")
return jsonify({"error": "Failed to add book"}), 500
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
data = request.get_json()
if not data:
return jsonify({"error": "No data provided"}), 400
try:
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
# Update book properties
if 'name' in data:
existing_book.set_name(data['name'])
if 'price' in data:
existing_book.set_price(data['price'])
if 'quantity' in data:
existing_book.set_quantity(data['quantity'])
# Save updated book
database.update_article(existing_book)
# Return the updated book
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict()), 200
except ValueError as e:
return jsonify({"error": str(e)}), 400
except Exception as e:
logger.error(f"Error updating book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to update book {book_id}"}), 500
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
try:
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
# Delete the book
database.delete_article(book_id)
return jsonify({"message": f"Book with ID {book_id} deleted successfully"}), 200
except Exception as e:
logger.error(f"Error deleting book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to delete book {book_id}"}), 500
```
{{< /tab >}}
{{< tab title="app/database.py" >}}
Database operations with connection management.
```python
import sqlite3
import os
import logging
from contextlib import contextmanager
from app.models.article import Article
# Set up logging
logger = logging.getLogger(__name__)
# Get database path from environment variable or use default
DATABASE_PATH = os.environ.get('DATABASE_PATH', 'bookstore.db')
@contextmanager
def get_db_connection():
"""
Context manager for database connections.
Automatically handles connection opening, committing, and closing.
Yields:
sqlite3.Connection: Database connection object
"""
conn = None
try:
conn = sqlite3.connect(DATABASE_PATH)
# Configure connection to return rows as dictionaries
conn.row_factory = sqlite3.Row
yield conn
conn.commit()
except sqlite3.Error as e:
if conn:
conn.rollback()
logger.error(f"Database error: {str(e)}")
raise
finally:
if conn:
conn.close()
def initialize_database():
"""
Initialize the database by creating the articles table if it doesn't exist.
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
# Create articles table
cursor.execute('''
CREATE TABLE IF NOT EXISTS articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
quantity INTEGER NOT NULL
)
''')
logger.info("Database initialized successfully")
except sqlite3.Error as e:
logger.error(f"Failed to initialize database: {str(e)}")
raise
def add_article(article):
"""
Add a new article to the database.
Args:
article (Article): Article object to add
Returns:
int: ID of the newly added article
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
(article.name, article.price, article.quantity)
)
# Get the ID of the newly inserted article
article_id = cursor.lastrowid
logger.info(f"Added article with ID {article_id}")
return article_id
except sqlite3.Error as e:
logger.error(f"Failed to add article: {str(e)}")
raise
def get_article_by_id(article_id):
"""
Get an article by its ID.
Args:
article_id (int): ID of the article to retrieve
Returns:
Article: Article object if found, None otherwise
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles WHERE id = ?", (article_id,))
row = cursor.fetchone()
if row:
return Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
return None
except sqlite3.Error as e:
logger.error(f"Failed to get article {article_id}: {str(e)}")
raise
def get_all_articles():
"""
Get all articles from the database.
Returns:
list: List of Article objects
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles")
rows = cursor.fetchall()
articles = []
for row in rows:
article = Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
articles.append(article)
return articles
except sqlite3.Error as e:
logger.error(f"Failed to get all articles: {str(e)}")
raise
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
Returns:
bool: True if successful, False if article not found
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
# Check if an article was actually updated
if cursor.rowcount == 0:
logger.warning(f"No article found with ID {article.id}")
return False
logger.info(f"Updated article with ID {article.id}")
return True
except sqlite3.Error as e:
logger.error(f"Failed to update article {article.id}: {str(e)}")
raise
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
Returns:
bool: True if successful, False if article not found
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
# Check if an article was actually deleted
if cursor.rowcount == 0:
logger.warning(f"No article found with ID {article_id}")
return False
logger.info(f"Deleted article with ID {article_id}")
return True
except sqlite3.Error as e:
logger.error(f"Failed to delete article {article_id}: {str(e)}")
raise
```
{{< /tab >}}
<!-- markdownlint-disable -->
{{< tab title="app/__init__.py" >}}
<!-- markdownlint-enable -->
Flask application factory.
```python
import os
from flask import Flask
from dotenv import load_dotenv
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Load environment variables from .env file
load_dotenv()
# Create and configure the app
app = Flask(__name__, instance_relative_config=True)
# Set default configuration
app.config.from_mapping(
SECRET_KEY=os.environ.get('SECRET_KEY', 'dev'),
DATABASE_PATH=os.environ.get('DATABASE_URL', 'bookstore.db'),
BOOK_TITLE_MAX_LENGTH=int(os.environ.get('BOOK_TITLE_MAX_LENGTH', 100)),
MAX_PRICE=float(os.environ.get('MAX_PRICE', 1000.00)),
MAX_QUANTITY=int(os.environ.get('MAX_QUANTITY', 1000))
)
# Override config with test config if provided
if test_config:
app.config.update(test_config)
# Ensure the instance folder exists
os.makedirs(app.instance_path, exist_ok=True)
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API",
"endpoints": {
"books": "/books",
"book_by_id": "/books/<id>"
}
}
return app
```
{{< /tab >}}
{{< /tabs >}}
1. Check your code files against these examples.
1. To verify if your code works, ask Chat how to start a local application server:
```plaintext
How do I start a local application server for my Python web application?
```
1. Follow the instructions, and check if your application is working.
If your application is working, congratulations! You have successfully used
GitLab Duo Chat and Code Suggestions to build working online shop application.
If it is not working, then you need to find out why. Chat and Code Suggestions
can help you create tests to ensure your application works as expected and
identify any issues that need to be fixed.
<!-- markdownlint-disable -->
<i class="fa-youtube-play" aria-hidden="true"></i>
For more information, see [Using Duo /fix](https://youtu.be/agTqx__j6Ko?si=vpLfVvmFVcBivB1g).
<!-- Video published on 2025-02-13 -->
## Related topics
- [GitLab Duo use cases](../use_cases.md)
- [Get started with GitLab Duo](../../get_started/getting_started_gitlab_duo.md).
- Blog post: [Streamline DevSecOps engineering workflows with GitLab Duo](https://about.gitlab.com/blog/2024/12/05/streamline-devsecops-engineering-workflows-with-gitlab-duo/)
<!-- markdownlint-disable -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Chat](https://youtu.be/ZQBAuf-CTAY?si=0o9-xJ_ATTsL1oew)
<!-- Video published on 2024-04-18 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Code Suggestions](https://youtu.be/ds7SG1wgcVM?si=MfbzPIDpikGhoPh7)
<!-- Video published on 2024-01-24 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[Application modernization with GitLab Duo (C++ to Java)](https://youtu.be/FjoAmt5eeXA?si=SLv9Mv8eSUAVwW5Z)
<!-- Video published on 2025-03-18 -->
<!-- markdownlint-enable -->
|
---
stage: none
group: Tutorials
description: Tutorial on how to create a shop application in Python with GitLab Duo.
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: 'Tutorial: Use GitLab Duo to create a shop application in Python'
breadcrumbs:
- doc
- user
- gitlab_duo
- tutorials
---
<!-- vale gitlab_base.FutureTense = NO -->
You have been hired as a developer at an online bookstore. The current system for
managing inventory is a mix of spreadsheets and manual processes, leading to inventory
errors and delayed updates. Your team needs to create a web application that can:
- Track book inventory in real time.
- Enable staff to add new books as they arrive.
- Prevent common data entry errors, like negative prices or quantities.
- Provide a foundation for future customer-facing features.
This tutorial is part one in a series, and guides you through creating and debugging
a [Python](https://www.python.org/) web application with a database backend
that meets these requirements.
You'll use [GitLab Duo Chat](../../gitlab_duo_chat/_index.md)
and [GitLab Duo Code Suggestions](../../project/repository/code_suggestions/_index.md)
to help you:
- Set up an organized Python project with standard directories and essential files.
- Configure the Python virtual environment.
- Install the [Flask](https://flask.palletsprojects.com/en/stable/) framework as the foundation
for the web application.
- Install required dependencies, and prepare the project for development.
- Set up the Python configuration file and environment variables for Flask application
development.
- Implement core features, including article models, database operations,
API routes, and inventory management features.
- Test that the application works as intended, comparing your code with example code files.
## Before you begin
- [Install the latest version of Python](https://www.python.org/downloads/) on your system.
You can ask Chat how to do that for your operating system.
- Confirm with an administrator, group owner, or project owner that you have access to GitLab Duo.
- Install an extension in your preferred IDE:
- [Web IDE](../../project/web_ide/_index.md): Access through your GitLab instance
- [VS Code](../../../editor_extensions/visual_studio_code/setup.md)
- [Visual Studio](../../../editor_extensions/visual_studio/setup.md)
- [JetBrains IDE](../../../editor_extensions/jetbrains_ide/_index.md)
- [Neovim](../../../editor_extensions/neovim/setup.md)
- Authenticate with GitLab from the IDE, using either
[OAuth](../../../integration/google.md) or a
[personal access token with the `api` scope](../../profile/personal_access_tokens.md#create-a-personal-access-token).
## Use GitLab Duo Chat and Code Suggestions
In this tutorial, you will use Chat and Code Suggestions to create the Python
web application. Multiple ways exist to use these features.
### Use GitLab Duo Chat
Depending on your subscription add-on, you can use Chat in the GitLab UI, the Web IDE, or your IDE.
#### Use Chat in the GitLab UI
1. In the upper-right corner, select **GitLab Duo Chat**. A drawer opens on the
right side of your browser tab.
1. Enter your question in the chat input box. Press **Enter**, or select **Send**.
It might take a few seconds for the interactive AI chat to produce an answer.
#### Use Chat in the Web IDE
1. Open the Web IDE:
1. In the GitLab UI, on the left sidebar, select **Search or go to** and find your project.
1. Select a file. Then in the upper right, select **Edit > Open in Web IDE**.
1. Open Chat by using one of these methods:
- On the left sidebar, select **GitLab Duo Chat**.
- In the file that you have open in the editor, select some code.
1. Right-click and select **GitLab Duo Chat**.
1. Select **Explain selected code**, **Generate Tests**, or **Refactor**.
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or
<kbd>Option</kbd>+<kbd>d</kbd> (on Mac).
1. In the message box, enter your question. Press **Enter**, or select **Send**.
#### Use Chat in your IDE
How you use Chat in your IDE differs depending on which IDE you use.
{{< tabs >}}
{{< tab title="VS Code" >}}
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
1. On the left sidebar, select **GitLab Duo Chat** ({{< icon name="duo-chat" >}}).
1. In the message box, enter your question. Press **Enter**, or select **Send**.
1. In the chat pane, on the top right corner, select **Show Status** to show information
in the Command Palette.
You can also interact with Duo Chat while you're working with a subset of code.
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
1. In the file, select some code.
1. Right-click and select **GitLab Duo Chat**.
1. Select an option, or **Open Quick Chat** and ask a question, like
`Can you simplify this code?` and press <kbd>Enter</kbd>.
For more information, see [Use GitLab Duo Chat in VS Code](../../gitlab_duo_chat/_index.md#use-gitlab-duo-chat-in-vs-code).
{{< /tab >}}
{{< tab title="JetBrains IDEs" >}}
1. Open a project in a JetBrains IDE that supports Python, such as
[PyCharm](https://www.jetbrains.com/pycharm/), or [IntelliJ IDEA](https://www.jetbrains.com/idea/).
1. Open GitLab Duo Chat in either a [chat window](../../gitlab_duo_chat/_index.md#in-a-chat-window)
or an [editor window](../../gitlab_duo_chat/_index.md#use-chat-while-working-in-the-editor-window).
For more information, see [Use GitLab Duo Chat in JetBrains IDEs](../../gitlab_duo_chat/_index.md#use-gitlab-duo-chat-in-jetbrains-ides).
{{< /tab >}}
{{< /tabs >}}
### Use Code Suggestions
To use Code Suggestions:
1. Open your Git project in a
[supported IDE](../../project/repository/code_suggestions/supported_extensions.md#supported-editor-extensions).
1. Add the project as a remote of your local repository using
[`git remote add`](../../../topics/git/commands.md#git-remote-add).
1. Add your project directory, including the hidden `.git/` folder, to your IDE workspace or project.
1. Author your code.
As you type, suggestions are displayed. Code Suggestions provides code snippets
or completes the current line, depending on the cursor position.
1. Describe the requirements in natural language.
Code Suggestions generates functions and code snippets based on the context provided.
1. When you receive a suggestion, you can do any of the following:
- To accept a suggestion, press <kbd>Tab</kbd>.
- To accept a partial suggestion, press either <kbd>Control</kbd>+<kbd>Right arrow</kbd> or
<kbd>Command</kbd>+<kbd>Right arrow</kbd>.
- To reject a suggestion, press <kbd>Esc</kbd>.
- To ignore a suggestion, keep typing as you usually would.
For more information, see the [Code Suggestions documentation](../../project/repository/code_suggestions/_index.md).
Now that you know how to use Chat and Code Suggestions, let's start building the
web application. First, you will create an organized Python project structure.
## Create the project structure
To start with, you need a well-organized project structure that follows
Python best practices. A proper structure makes your code more maintainable, testable,
and easier for other developers to understand.
You can use Chat to help you understand Python project organization conventions
and generate the appropriate files. This saves you time researching best practices, and
ensures you do not miss critical components.
1. Open Chat in your IDE and enter:
```plaintext
What is the recommended project structure for a Python web application? Include
common files, and explain the purpose of each file.
```
This prompt helps you understand Python project organization before creating files.
1. Create a new folder for the Python project and create a directory and file structure
based on Chat's response. It will probably be similar to the following:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
1. You must populate the `.gitignore` file. Enter the following into Chat:
```plaintext
Generate a .gitignore file for a Python project that uses Flask, SQLite, and
virtual environments. Include common IDE files.
```
1. Copy the response into the `.gitignore` file.
1. For the `README` file, enter the following into Chat:
```plaintext
Generate a README.md file for a Python web application that manages a bookstore
inventory. Make sure that it includes all sections for requirements, setup, and usage.
```
You have now created a properly-structured Python project that follows industry
best practices. This organization makes your code easier to maintain and test.
Next, you'll set up your development environment to start writing code.
## Set up the development environment
A properly isolated development environment prevents dependency conflicts and makes
your application deployable.
You will use Chat to help you set up a Python virtual environment and create a
`requirements.txt` file with the right dependencies. This ensures you have a stable
foundation for development.
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt <= File you are updating
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
1. Optional. Ask Chat about how Python and Flask work together to produce
web applications.
1. Use Chat to understand the best practices for setting up a Python environment:
```plaintext
What are the recommended steps for setting up a Python virtual environment with
Flask? Include information about requirements.txt and pip.
```
Ask any follow-up questions that you need to. For example:
```plaintext
What does the requirements.txt do in a Python web app?
```
1. Based on the response, first create and activate a virtual environment
(for example, on MacOS using Homebrew's `python3` package):
```plaintext
python3 -m venv myenv
source myenv/bin/activate
```
1. You must also create a `requirements.txt` file. Ask Chat the following:
```plaintext
What should be included in requirements.txt for a Flask web application with
SQLite database and testing capabilities? Include specific version numbers.
```
Copy the response to the `requirements.txt` file.
1. Install the dependencies named in the `requirements.txt` file:
```plaintext
pip install -r requirements.txt
```
Your development environment is now configured with all necessary dependencies
isolated in a virtual environment to prevent conflicts. Next, you'll configure
the project's package and environment settings.
## Configure the project
Proper configuration, including environment variables, enables your application
to run consistently across different environments.
You'll use Code Suggestions to help generate and refine the configuration.
Then, you'll ask Chat to explain the purpose of each setting, so you understand
what you're configuring and why.
1. You have already created a Python configuration file called `setup.py` in your
project folder:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py <= File you are updating
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
Open this file, and enter this comment at the top of the file:
```plaintext
# Populate this setup.py configuration file for a Flask web application
# Include dependencies for Flask, testing, and database functionality
# Use semantic versioning
```
Code Suggestions generates the configuration for you.
1. Optional. Select the generated configuration code and use the following
[slash commands](../../gitlab_duo_chat/examples.md#gitlab-duo-chat-slash-commands):
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand what each configuration setting does.
- Use [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements in the configuration structure.
1. Review and adjust the generated code as needed.
If you are not sure what you can adjust in the configuration file, ask Chat.
If you want to ask Chat what to adjust, do so in the IDE in the `setup.py`
file, instead of in the GitLab UI. This provides Chat with
[the context you're working in](../../gitlab_duo/context.md#gitlab-duo-chat),
including the `setup.py` file you just created.
```plaintext
You have used Code Suggestions to generate a Python configuration file, `setup.py`,
for a Flask web application. This file includes dependencies for Flask, testing,
and database functionality. If I were to review this file, what might I want
to change and adjust?
```
1. Save the file.
### Set the environment variables
Next, you're going to use both Chat and Code Suggestions to set the environment variables.
1. In Chat, ask the following:
```plaintext
In a Python project, what environment variables should be set for a Flask application in development mode? Include database configuration.
```
1. You have already created a `.env` file to store environment variables.
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env <= File you are updating
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
Open this file, and enter the following comment at the top of the file, including
the environment variables that Chat recommended:
```plaintext
# Populate this .env file to store environment variables
# Include the following
# ...
# Use semantic versioning
```
1. Review and adjust the generated code as needed, and save the file.
You have configured your project and set the environment variables. This ensures
your application can be deployed consistently across different environments. Next,
you'll create the application code for the inventory system.
## Create the application code
The Flask web framework has three core components:
- Models: Contains the data and business logic, and the database model. Specified in the `article.py` file.
- Views: Handles HTTP requests and responses. Specified in the `shop.py` file.
- Controller: Manages data storage and retrieval. Specified in the `database.py` file.
You will use Chat and Code Suggestions to help you define each of these three components
in three files in your Python project structure:
- `article.py` defines the models component, specifically the database model.
- `shop.py` defines the views component, specifically the API routes.
- `database.py` defines the controller component.
### Create the article file to define the database model
Your bookstore needs database models and operations to manage inventory effectively.
To create the application code for the bookstore inventory system, you will
use an article file to define the database model for articles.
You will use Code Suggestions to help generate the code, and Chat to
implement best practices for data modeling and database management.
1. You have already created an `article.py` file:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py <= File you are updating
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
In this file, use Code Suggestions
and enter the following:
```plaintext
# Create an Article class for a bookstore inventory system
# Include fields for: name, price, quantity
# Add data validation for each field
# Add methods to convert to/from dictionary format
```
1. Optional. Use the following [slash commands](../../gitlab_duo_chat/examples.md#gitlab-duo-chat-slash-commands):
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand how the article class works and its design patterns.
- Use, [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements in the class structure and methods.
1. Review and adjust the generated code as needed, and save the file.
Next you will define the API routes.
### Create the shop file to define the API routes
Now that you have created the article file to define the database model, you will
create the API routes.
API routes are crucial for a web application because they:
- Define the public API for clients to interact with your application.
- Map HTTP requests to the appropriate code in your application.
- Handle input validation and error responses.
- Transform data between your internal models and the JSON format expected by API clients.
For your bookstore inventory system, these routes will allow staff to:
- View all books in inventory.
- Look up specific books by ID.
- Add new books as they arrive.
- Update book information such as price or quantity.
- Remove books that are no longer needed.
In Flask, routes are functions that handle requests to specific URL endpoints.
For example, a route for `GET /books` would return a list of all books, while
`POST /books` would add a new book to the inventory.
You will use Chat and Code Suggestions to create these routes in the `shop.py`
file that you've already set up in your project structure:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py <= File you are updating
│ └── database.py
└── tests/
├── __init__.py
└── test_shop.py
```
#### Create the Flask application and routes
1. Open the `shop.py` file. To use Code Suggestions, enter this comment
at the top of the file:
```plaintext
# Create Flask routes for a bookstore inventory system
# Include routes for:
# - Getting all books (GET /books)
# - Getting a single book by ID (GET /books/<id>)
# - Adding a new book (POST /books)
# - Updating a book (PUT /books/<id>)
# - Deleting a book (DELETE /books/<id>)
# Use the Article class from models.article and database from database.py
# Include proper error handling and HTTP status codes
```
1. Review the generated code. It should include:
- Import statements for Flask, request, and `jsonify`.
- Import statements for your Article class and database module.
- Route definitions for all CRUD operations (Create, Read, Update, Delete).
- Proper error handling and HTTP status codes.
1. Optional. Use these slash commands:
- Use [`/explain`](../../gitlab_duo_chat/examples.md#explain-selected-code)
to understand how the Flask routing works.
- Use [`/refactor`](../../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
to identify potential improvements.
1. If the generated code doesn't fully meet your needs, or you want to understand
how to improve it, you can ask Chat from within the `shop.py` file:
```plaintext
Can you suggest improvements for my Flask routes in this shop.py file?
I want to ensure that:
1. The routes follow RESTful API design principles
2. Responses include appropriate HTTP status codes
3. Input validation is handled properly
4. The code follows Flask best practices
```
1. You also need to create the Flask application instance in the `__init__.py`
file inside the `app` directory. Open this file and use Code Suggestions to
generate the appropriate code:
```plaintext
# Create a Flask application factory
# Configure the app with settings from environment variables
# Register the shop blueprint
# Return the configured app
```
1. Save both files.
### Create the database file to manage data storage and retrieval
Finally, you will create the database operations code. You have already created
a `database.py` file:
```plaintext
python-shop-app/
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
├── .gitignore
├── .env
├── app/
│ ├── __init__.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── article.py
│ ├── routes/
│ │ ├── __init__.py
│ │ └── shop.py
│ └── database.py <= File you are updating
└── tests/
├── __init__.py
└── test_shop.py
```
1. Enter the following into Chat:
```plaintext
Generate a Python class that manages SQLite database operations for a bookstore inventory. Include:
- Context manager for connections
- Table creation
- CRUD operations
- Error handling
Show the complete code with comments.
```
1. Review and adjust the generated code as needed, and save the file.
You have successfully created the foundational code for your inventory
management system and defined the core components
of a Python web application built using the Flask framework.
Next you'll check your created code against example code files.
## Check your code against example code files
The following examples show complete, working code that should be similar to the
code you end up with after following the tutorial.
{{< tabs >}}
{{< tab title=".gitignore" >}}
This file shows standard Python project exclusions:
```plaintext
# Virtual Environment
myenv/
venv/
ENV/
env/
.venv/
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# SQLite database files
*.db
*.sqlite
*.sqlite3
# Environment variables
.env
.env.local
.env.*.local
# IDE specific files
.idea/
.vscode/
*.swp
*.swo
.DS_Store
```
{{< /tab >}}
{{< tab title="README.md" >}}
<!-- markdownlint-disable MD029 -->
A comprehensive `README` file with setup and usage instructions.
````markdown
# Bookstore Inventory Management System
A Python web application for managing bookstore inventory, built with Flask and SQLite.
## Features
- Track book inventory in real time.
- Add, update, and remove books.
- Data validation to prevent common errors.
- RESTful API for inventory management.
## Requirements
- Python 3.8 or higher.
- Flask 2.2.0 or higher.
- SQLite 3.
## Installation
1. Clone the repository:
```shell
git clone https://gitlab.com/your-username/python-shop-app.git
cd python-shop-app
```
2. Create and activate a virtual environment:
```shell
python -m venv myenv
source myenv/bin/activate # On Windows: myenv\Scripts\activate
```
3. Install dependencies:
```shell
pip install -r requirements.txt
```
4. Set up environment variables:
Copy `.env.example` to `.env` and modify as needed.
## Usage
1. Start the Flask application:
```shell
flask run
```
2. The API will be available at `http://localhost:5000/`
## API Endpoints
- `GET /books` - Get all books
- `GET /books/<id>` - Get a specific book
- `POST /books` - Add a new book
- `PUT /books/<id>` - Update a book
- `DELETE /books/<id>` - Delete a book
## Testing
Run tests with `pytest`:
```python
python -m pytest
```
````
<!-- markdownlint-enable MD029 -->
{{< /tab >}}
{{< tab title="requirements.txt" >}}
Lists all required Python packages with versions.
```plaintext
Flask==2.2.3
pytest==7.3.1
pytest-flask==1.2.0
Flask-SQLAlchemy==3.0.3
SQLAlchemy==2.0.9
python-dotenv==1.0.0
Werkzeug==2.2.3
requests==2.28.2
```
{{< /tab >}}
{{< tab title="setup.py" >}}
Project configuration for packaging.
```python
from setuptools import setup, find_packages
setup(
name="bookstore-inventory",
version="0.1.0",
packages=find_packages(),
include_package_data=True,
install_requires=[
"Flask>=2.2.0",
"Flask-SQLAlchemy>=3.0.0",
"SQLAlchemy>=2.0.0",
"pytest>=7.0.0",
"pytest-flask>=1.2.0",
"python-dotenv>=1.0.0",
],
python_requires=">=3.8",
author="Your Name",
author_email="your.email@example.com",
description="A Flask web application for managing bookstore inventory",
keywords="flask, inventory, bookstore",
url="https://gitlab.com/your-username/python-shop-app",
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
```
{{< /tab >}}
{{< tab title=".env" >}}
Contains environment variables for the application.
```plaintext
# Flask configuration
FLASK_APP=app
FLASK_ENV=development
FLASK_DEBUG=1
SECRET_KEY=your-secret-key-change-in-production
# Database configuration
DATABASE_URL=sqlite:///bookstore.db
TEST_DATABASE_URL=sqlite:///test_bookstore.db
# Application settings
BOOK_TITLE_MAX_LENGTH=100
MAX_PRICE=1000.00
MAX_QUANTITY=1000
```
{{< /tab >}}
{{< tab title="app/models/article.py" >}}
Article class with full validation.
```python
class Article:
"""Article class for a bookstore inventory system."""
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article with validation.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
Raises:
ValueError: If any of the fields fail validation
"""
self.id = article_id
self.set_name(name)
self.set_price(price)
self.set_quantity(quantity)
def set_name(self, name):
"""
Set the name with validation.
Args:
name (str): The name/title of the book
Raises:
ValueError: If name is empty or too long
"""
if not name or not isinstance(name, str):
raise ValueError("Book title cannot be empty and must be a string")
if len(name) > 100: # Max length validation
raise ValueError("Book title cannot exceed 100 characters")
self.name = name.strip()
def set_price(self, price):
"""
Set the price with validation.
Args:
price (float): The price of the book
Raises:
ValueError: If price is negative or not a number
"""
try:
price_float = float(price)
except (ValueError, TypeError):
raise ValueError("Price must be a number")
if price_float < 0:
raise ValueError("Price cannot be negative")
if price_float > 1000: # Max price validation
raise ValueError("Price cannot exceed 1000")
# Ensure price has at most 2 decimal places
self.price = round(price_float, 2)
def set_quantity(self, quantity):
"""
Set the quantity with validation.
Args:
quantity (int): The quantity in stock
Raises:
ValueError: If quantity is negative or not an integer
"""
try:
quantity_int = int(quantity)
except (ValueError, TypeError):
raise ValueError("Quantity must be an integer")
if quantity_int < 0:
raise ValueError("Quantity cannot be negative")
if quantity_int > 1000: # Max quantity validation
raise ValueError("Quantity cannot exceed 1000")
self.quantity = quantity_int
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
"""
article_id = data.get("id")
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
{{< /tab >}}
{{< tab title="app/routes/shop.py" >}}
Complete API endpoints with error handling.
```python
from flask import Blueprint, request, jsonify, current_app
from app.models.article import Article
from app import database
import logging
# Create a blueprint for the shop routes
shop_bp = Blueprint('shop', __name__, url_prefix='/books')
# Set up logging
logger = logging.getLogger(__name__)
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
try:
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books]), 200
except Exception as e:
logger.error(f"Error getting all books: {str(e)}")
return jsonify({"error": "Failed to retrieve books"}), 500
@shop_bp.route('/<int:book_id>', methods=['GET'])
def get_book(book_id):
"""Get a specific book by ID."""
try:
book = database.get_article_by_id(book_id)
if book:
return jsonify(book.to_dict()), 200
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
except Exception as e:
logger.error(f"Error getting book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to retrieve book {book_id}"}), 500
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
data = request.get_json()
if not data:
return jsonify({"error": "No data provided"}), 400
required_fields = ['name', 'price', 'quantity']
for field in required_fields:
if field not in data:
return jsonify({"error": f"Missing required field: {field}"}), 400
try:
# Validate data by creating an Article object
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
# Save to database
book_id = database.add_article(new_book)
# Return the created book
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
except ValueError as e:
return jsonify({"error": str(e)}), 400
except Exception as e:
logger.error(f"Error adding book: {str(e)}")
return jsonify({"error": "Failed to add book"}), 500
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
data = request.get_json()
if not data:
return jsonify({"error": "No data provided"}), 400
try:
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
# Update book properties
if 'name' in data:
existing_book.set_name(data['name'])
if 'price' in data:
existing_book.set_price(data['price'])
if 'quantity' in data:
existing_book.set_quantity(data['quantity'])
# Save updated book
database.update_article(existing_book)
# Return the updated book
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict()), 200
except ValueError as e:
return jsonify({"error": str(e)}), 400
except Exception as e:
logger.error(f"Error updating book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to update book {book_id}"}), 500
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
try:
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": f"Book with ID {book_id} not found"}), 404
# Delete the book
database.delete_article(book_id)
return jsonify({"message": f"Book with ID {book_id} deleted successfully"}), 200
except Exception as e:
logger.error(f"Error deleting book {book_id}: {str(e)}")
return jsonify({"error": f"Failed to delete book {book_id}"}), 500
```
{{< /tab >}}
{{< tab title="app/database.py" >}}
Database operations with connection management.
```python
import sqlite3
import os
import logging
from contextlib import contextmanager
from app.models.article import Article
# Set up logging
logger = logging.getLogger(__name__)
# Get database path from environment variable or use default
DATABASE_PATH = os.environ.get('DATABASE_PATH', 'bookstore.db')
@contextmanager
def get_db_connection():
"""
Context manager for database connections.
Automatically handles connection opening, committing, and closing.
Yields:
sqlite3.Connection: Database connection object
"""
conn = None
try:
conn = sqlite3.connect(DATABASE_PATH)
# Configure connection to return rows as dictionaries
conn.row_factory = sqlite3.Row
yield conn
conn.commit()
except sqlite3.Error as e:
if conn:
conn.rollback()
logger.error(f"Database error: {str(e)}")
raise
finally:
if conn:
conn.close()
def initialize_database():
"""
Initialize the database by creating the articles table if it doesn't exist.
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
# Create articles table
cursor.execute('''
CREATE TABLE IF NOT EXISTS articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
quantity INTEGER NOT NULL
)
''')
logger.info("Database initialized successfully")
except sqlite3.Error as e:
logger.error(f"Failed to initialize database: {str(e)}")
raise
def add_article(article):
"""
Add a new article to the database.
Args:
article (Article): Article object to add
Returns:
int: ID of the newly added article
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
(article.name, article.price, article.quantity)
)
# Get the ID of the newly inserted article
article_id = cursor.lastrowid
logger.info(f"Added article with ID {article_id}")
return article_id
except sqlite3.Error as e:
logger.error(f"Failed to add article: {str(e)}")
raise
def get_article_by_id(article_id):
"""
Get an article by its ID.
Args:
article_id (int): ID of the article to retrieve
Returns:
Article: Article object if found, None otherwise
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles WHERE id = ?", (article_id,))
row = cursor.fetchone()
if row:
return Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
return None
except sqlite3.Error as e:
logger.error(f"Failed to get article {article_id}: {str(e)}")
raise
def get_all_articles():
"""
Get all articles from the database.
Returns:
list: List of Article objects
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles")
rows = cursor.fetchall()
articles = []
for row in rows:
article = Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
articles.append(article)
return articles
except sqlite3.Error as e:
logger.error(f"Failed to get all articles: {str(e)}")
raise
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
Returns:
bool: True if successful, False if article not found
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
# Check if an article was actually updated
if cursor.rowcount == 0:
logger.warning(f"No article found with ID {article.id}")
return False
logger.info(f"Updated article with ID {article.id}")
return True
except sqlite3.Error as e:
logger.error(f"Failed to update article {article.id}: {str(e)}")
raise
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
Returns:
bool: True if successful, False if article not found
"""
try:
with get_db_connection() as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
# Check if an article was actually deleted
if cursor.rowcount == 0:
logger.warning(f"No article found with ID {article_id}")
return False
logger.info(f"Deleted article with ID {article_id}")
return True
except sqlite3.Error as e:
logger.error(f"Failed to delete article {article_id}: {str(e)}")
raise
```
{{< /tab >}}
<!-- markdownlint-disable -->
{{< tab title="app/__init__.py" >}}
<!-- markdownlint-enable -->
Flask application factory.
```python
import os
from flask import Flask
from dotenv import load_dotenv
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Load environment variables from .env file
load_dotenv()
# Create and configure the app
app = Flask(__name__, instance_relative_config=True)
# Set default configuration
app.config.from_mapping(
SECRET_KEY=os.environ.get('SECRET_KEY', 'dev'),
DATABASE_PATH=os.environ.get('DATABASE_URL', 'bookstore.db'),
BOOK_TITLE_MAX_LENGTH=int(os.environ.get('BOOK_TITLE_MAX_LENGTH', 100)),
MAX_PRICE=float(os.environ.get('MAX_PRICE', 1000.00)),
MAX_QUANTITY=int(os.environ.get('MAX_QUANTITY', 1000))
)
# Override config with test config if provided
if test_config:
app.config.update(test_config)
# Ensure the instance folder exists
os.makedirs(app.instance_path, exist_ok=True)
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API",
"endpoints": {
"books": "/books",
"book_by_id": "/books/<id>"
}
}
return app
```
{{< /tab >}}
{{< /tabs >}}
1. Check your code files against these examples.
1. To verify if your code works, ask Chat how to start a local application server:
```plaintext
How do I start a local application server for my Python web application?
```
1. Follow the instructions, and check if your application is working.
If your application is working, congratulations! You have successfully used
GitLab Duo Chat and Code Suggestions to build working online shop application.
If it is not working, then you need to find out why. Chat and Code Suggestions
can help you create tests to ensure your application works as expected and
identify any issues that need to be fixed.
<!-- markdownlint-disable -->
<i class="fa-youtube-play" aria-hidden="true"></i>
For more information, see [Using Duo /fix](https://youtu.be/agTqx__j6Ko?si=vpLfVvmFVcBivB1g).
<!-- Video published on 2025-02-13 -->
## Related topics
- [GitLab Duo use cases](../use_cases.md)
- [Get started with GitLab Duo](../../get_started/getting_started_gitlab_duo.md).
- Blog post: [Streamline DevSecOps engineering workflows with GitLab Duo](https://about.gitlab.com/blog/2024/12/05/streamline-devsecops-engineering-workflows-with-gitlab-duo/)
<!-- markdownlint-disable -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Chat](https://youtu.be/ZQBAuf-CTAY?si=0o9-xJ_ATTsL1oew)
<!-- Video published on 2024-04-18 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Code Suggestions](https://youtu.be/ds7SG1wgcVM?si=MfbzPIDpikGhoPh7)
<!-- Video published on 2024-01-24 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[Application modernization with GitLab Duo (C++ to Java)](https://youtu.be/FjoAmt5eeXA?si=SLv9Mv8eSUAVwW5Z)
<!-- Video published on 2025-03-18 -->
<!-- markdownlint-enable -->
|
https://docs.gitlab.com/user/gitlab_duo/python_code_files
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/python_code_files.md
|
2025-08-13
|
doc/user/gitlab_duo/tutorials
|
[
"doc",
"user",
"gitlab_duo",
"tutorials"
] |
python_code_files.md
|
none
|
Tutorials
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab Duo fix errors tutorial Python code files
|
Tutorial on how to fix errors in a shop application in Python with GitLab Duo.
|
Tutorial: Use GitLab Duo to fix errors in a Python shop application
For the [Tutorial on using GitLab Duo to fix errors in a Python shop application](duo_python_fix_errors.md),
your Python web application is made up of the following files.
{{< tabs >}}
{{< tab title="app/models/article.py" >}}
```python
class Article:
"""Article class for a bookstore inventory system."""
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
"""
self.id = article_id
self.name = name # Missing validation
self.price = float(price) # Missing proper validation
self.quantity = int(quantity) # Missing proper validation
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
"""
article_id = data.get("id")
# Missing data validation before creating object
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
{{< /tab >}}
{{< tab title="app/database.py" >}}
```python
import sqlite3
import os
from app.models.article import Article
# Hard coded database path instead of using environment variables
DATABASE_PATH = 'bookstore.db'
def get_db_connection():
"""
Get a database connection.
Returns:
sqlite3.Connection: Database connection object
"""
# Missing error handling
# Missing connection management
conn = sqlite3.connect(DATABASE_PATH)
conn.row_factory = sqlite3.Row
return conn
def initialize_database():
"""
Initialize the database by creating the articles table if it doesn't exist.
"""
conn = get_db_connection()
cursor = conn.cursor()
# Create articles table
cursor.execute('''
CREATE TABLE IF NOT EXISTS articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
quantity INTEGER NOT NULL
)
''')
conn.commit()
conn.close()
def add_article(article):
"""
Add a new article to the database.
Args:
article (Article): Article object to add
Returns:
int: ID of the newly added article
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
(article.name, article.price, article.quantity)
)
# Get the ID of the newly inserted article
article_id = cursor.lastrowid
conn.commit()
conn.close()
return article_id
def get_article_by_id(article_id):
"""
Get an article by its ID.
Args:
article_id (int): ID of the article to retrieve
Returns:
Article: Article object if found, None otherwise
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles WHERE id = ?", (article_id,))
row = cursor.fetchone()
conn.close()
if row:
return Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
return None
def get_all_articles():
"""
Get all articles from the database.
Returns:
list: List of Article objects
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles")
rows = cursor.fetchall()
conn.close()
articles = []
for row in rows:
article = Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
articles.append(article)
return articles
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
conn.commit()
conn.close()
# Missing return value and error checking
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
conn.commit()
conn.close()
# Missing return value and error checking
```
{{< /tab >}}
{{< tab title="app/routes/shop.py" >}}
```python
from flask import Blueprint, request, jsonify
from app.models.article import Article
from app import database
# Create a blueprint for the shop routes
shop_bp = Blueprint('shop', __name__, url_prefix='/books')
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books]) # Missing error handling
@shop_bp.route('/<int:book_id>', methods=['GET'])
def get_book(book_id):
"""Get a specific book by ID."""
book = database.get_article_by_id(book_id)
if book:
return jsonify(book.to_dict())
return jsonify({"message": "Book not found"}), 404 # Incorrect error format
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
data = request.get_json()
# Missing input validation
# Directly using input without validation
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
book_id = database.add_article(new_book)
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
data = request.get_json()
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"message": "Book not found"}), 404
# Update book properties without validation
if 'name' in data:
existing_book.name = data['name']
if 'price' in data:
existing_book.price = float(data['price'])
if 'quantity' in data:
existing_book.quantity = int(data['quantity'])
# Save updated book
database.update_article(existing_book)
# Missing error handling for the update operation
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict())
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
# Missing check if book exists before deletion
database.delete_article(book_id)
return jsonify({"message": "Book deleted"}), 200
```
{{< /tab >}}
{{< tab title="tests/test_shop.py" >}}
```python
# Missing comprehensive test cases
import pytest
def test_dummy():
"""A dummy test that always passes."""
assert True
```
{{< /tab >}}
{{< tab title="app/__init__.py" >}}
```python
from flask import Flask
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY='dev', # Hard coded secret key
)
# Missing configuration from environment variables
# Missing test config handling
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API"
}
return app
```
{{< /tab >}}
{{< tab title=".env" >}}
```plaintext
# Missing many important environment variables
FLASK_APP=app
FLASK_ENV=development
```
{{< /tab >}}
{{< /tabs >}}
You will use Chat and Code Suggestions to identify and fix issues in these files.
|
---
stage: none
group: Tutorials
description: Tutorial on how to fix errors in a shop application in Python with GitLab
Duo.
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab Duo fix errors tutorial Python code files
breadcrumbs:
- doc
- user
- gitlab_duo
- tutorials
---
Tutorial: Use GitLab Duo to fix errors in a Python shop application
For the [Tutorial on using GitLab Duo to fix errors in a Python shop application](duo_python_fix_errors.md),
your Python web application is made up of the following files.
{{< tabs >}}
{{< tab title="app/models/article.py" >}}
```python
class Article:
"""Article class for a bookstore inventory system."""
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
"""
self.id = article_id
self.name = name # Missing validation
self.price = float(price) # Missing proper validation
self.quantity = int(quantity) # Missing proper validation
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
"""
article_id = data.get("id")
# Missing data validation before creating object
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
{{< /tab >}}
{{< tab title="app/database.py" >}}
```python
import sqlite3
import os
from app.models.article import Article
# Hard coded database path instead of using environment variables
DATABASE_PATH = 'bookstore.db'
def get_db_connection():
"""
Get a database connection.
Returns:
sqlite3.Connection: Database connection object
"""
# Missing error handling
# Missing connection management
conn = sqlite3.connect(DATABASE_PATH)
conn.row_factory = sqlite3.Row
return conn
def initialize_database():
"""
Initialize the database by creating the articles table if it doesn't exist.
"""
conn = get_db_connection()
cursor = conn.cursor()
# Create articles table
cursor.execute('''
CREATE TABLE IF NOT EXISTS articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
quantity INTEGER NOT NULL
)
''')
conn.commit()
conn.close()
def add_article(article):
"""
Add a new article to the database.
Args:
article (Article): Article object to add
Returns:
int: ID of the newly added article
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
(article.name, article.price, article.quantity)
)
# Get the ID of the newly inserted article
article_id = cursor.lastrowid
conn.commit()
conn.close()
return article_id
def get_article_by_id(article_id):
"""
Get an article by its ID.
Args:
article_id (int): ID of the article to retrieve
Returns:
Article: Article object if found, None otherwise
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles WHERE id = ?", (article_id,))
row = cursor.fetchone()
conn.close()
if row:
return Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
return None
def get_all_articles():
"""
Get all articles from the database.
Returns:
list: List of Article objects
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM articles")
rows = cursor.fetchall()
conn.close()
articles = []
for row in rows:
article = Article(
name=row['name'],
price=row['price'],
quantity=row['quantity'],
article_id=row['id']
)
articles.append(article)
return articles
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
conn.commit()
conn.close()
# Missing return value and error checking
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
"""
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
conn.commit()
conn.close()
# Missing return value and error checking
```
{{< /tab >}}
{{< tab title="app/routes/shop.py" >}}
```python
from flask import Blueprint, request, jsonify
from app.models.article import Article
from app import database
# Create a blueprint for the shop routes
shop_bp = Blueprint('shop', __name__, url_prefix='/books')
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books]) # Missing error handling
@shop_bp.route('/<int:book_id>', methods=['GET'])
def get_book(book_id):
"""Get a specific book by ID."""
book = database.get_article_by_id(book_id)
if book:
return jsonify(book.to_dict())
return jsonify({"message": "Book not found"}), 404 # Incorrect error format
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
data = request.get_json()
# Missing input validation
# Directly using input without validation
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
book_id = database.add_article(new_book)
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
data = request.get_json()
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"message": "Book not found"}), 404
# Update book properties without validation
if 'name' in data:
existing_book.name = data['name']
if 'price' in data:
existing_book.price = float(data['price'])
if 'quantity' in data:
existing_book.quantity = int(data['quantity'])
# Save updated book
database.update_article(existing_book)
# Missing error handling for the update operation
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict())
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
# Missing check if book exists before deletion
database.delete_article(book_id)
return jsonify({"message": "Book deleted"}), 200
```
{{< /tab >}}
{{< tab title="tests/test_shop.py" >}}
```python
# Missing comprehensive test cases
import pytest
def test_dummy():
"""A dummy test that always passes."""
assert True
```
{{< /tab >}}
{{< tab title="app/__init__.py" >}}
```python
from flask import Flask
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY='dev', # Hard coded secret key
)
# Missing configuration from environment variables
# Missing test config handling
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API"
}
return app
```
{{< /tab >}}
{{< tab title=".env" >}}
```plaintext
# Missing many important environment variables
FLASK_APP=app
FLASK_ENV=development
```
{{< /tab >}}
{{< /tabs >}}
You will use Chat and Code Suggestions to identify and fix issues in these files.
|
https://docs.gitlab.com/user/gitlab_duo/duo_python_fix_errors
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/gitlab_duo/duo_python_fix_errors.md
|
2025-08-13
|
doc/user/gitlab_duo/tutorials
|
[
"doc",
"user",
"gitlab_duo",
"tutorials"
] |
duo_python_fix_errors.md
|
none
|
Tutorials
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Tutorial: Use GitLab Duo to fix errors in a Python shop application
|
Tutorial on how to fix errors in a shop application in Python with GitLab Duo.
|
<!-- vale gitlab_base.FutureTense = NO -->
This tutorial is part two in a series. In the first tutorial, you
[used GitLab Duo to create a shop application in Python](fix_code_python_shop.md).
If you followed the first tutorial and your code is working perfectly, introduce some common errors
by removing error handling from your routes. For example, remove `try` and `catch` blocks and input validation.
Then follow this tutorial to add them back with the help of GitLab Duo.
In this tutorial, you will:
- Write comprehensive test cases, run tests, and identify issues that need to be fixed.
- Improve database error handling and connection management.
- Implement data validation.
- Add robust error handling in routes.
- Improve the Flask application configuration.
- Verify the application works correctly.
## Write test cases
To start with, you will use Chat to generate comprehensive test cases for our
web application.
Well-written, comprehensive test cases:
- Systematically identify where code is not working.
- Help users to think through exactly how each part of the code should behave in both
standard and error conditions.
- Create a prioritized list of issues that need fixing.
- Allow users to immediately validate if a fix is working
To write the test cases:
1. Open Chat in your IDE and enter:
```plaintext
I need to write comprehensive tests for a Flask API for a bookstore inventory.
Here's the current minimal test file:
import pytest
def test_dummy():
"""A dummy test that always passes."""
assert True
Can you help me write proper tests for the application? The API has routes for:
- GET /books - Get all books
- GET /books/<id> - Get a specific book
- POST /books - Add a new book
- PUT /books/<id> - Update a book
- DELETE /books/<id> - Delete a book
I want to test both successful operations and error handling.
```
1. Review the response from Chat. You should receive a comprehensive
test plan including setup code, fixture definitions, and test functions for each route.
1. After reviewing Chat's response, consider asking follow-up questions:
- Try to get a better understanding of the test fixture design:
```plaintext
Can you explain why you're using these specific fixtures? What's the benefit of
separating the app fixture from the client fixture?
```
- Ask Chat to help you understand how to test specific error conditions:
```plaintext
I'm particularly concerned about error handling for the POST and PUT routes.
Can you enhance the tests to include more edge cases like invalid data types
and missing required fields?
```
- For more specific guidance on Flask testing, use the `/help` command:
```plaintext
/help Flask testing with pytest
```
- Ask Chat to suggest a way to make the tests run faster:
```plaintext
These tests seem comprehensive but might be slow when running the full suite.
Are there any optimizations you'd suggest for the test setup?
```
1. Amend the test plan as needed. After you are happy with the plan, ask Chat for
a complete implementation of the test file:
```plaintext
Based on the test plan, provide a complete implementation of the test_shop.py file that includes:
1. Fixtures for setting up a test client and database
2. Tests for each endpoint with both successful and error cases
3. Proper cleanup after tests
```
1. Copy the suggested implementation into your `tests/test_shop.py` file. Depending
on how you amended the test plan, the implementation should look similar to the following:
```python
import pytest
import json
from app import create_app
from app.database import initialize_database, get_db_connection
@pytest.fixture
def app():
"""Create and configure a Flask app for testing."""
app = create_app({"TESTING": True, "DATABASE": "test_bookstore.db"})
# Initialize the test database
with app.app_context():
initialize_database()
yield app
# Clean up the test database
import os
if os.path.exists("test_bookstore.db"):
os.remove("test_bookstore.db")
@pytest.fixture
def client(app):
"""A test client for the app."""
return app.test_client()
@pytest.fixture
def init_database(app):
"""Initialize the database with test data."""
conn = get_db_connection()
cursor = conn.cursor()
# Add test books
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
("Test Book 1", 10.99, 5)
)
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
("Test Book 2", 15.99, 10)
)
conn.commit()
conn.close()
def test_get_all_books(client, init_database):
"""Test retrieving all books."""
response = client.get('/books')
assert response.status_code == 200
data = json.loads(response.data)
assert len(data) == 2
assert data[0]['name'] == 'Test Book 1'
assert data[1]['name'] == 'Test Book 2'
def test_get_book_by_id(client, init_database):
"""Test retrieving a specific book by ID."""
# Test successful retrieval
response = client.get('/books/1')
assert response.status_code == 200
data = json.loads(response.data)
assert data['name'] == 'Test Book 1'
assert data['price'] == 10.99
# Test book not found
response = client.get('/books/999')
assert response.status_code == 404
def test_add_book(client):
"""Test adding a new book."""
new_book = {
'name': 'New Test Book',
'price': 20.99,
'quantity': 15
}
response = client.post('/books',
data=json.dumps(new_book),
content_type='application/json')
assert response.status_code == 201
data = json.loads(response.data)
assert data['name'] == 'New Test Book'
assert data['price'] == 20.99
assert data['quantity'] == 15
assert 'id' in data
def test_update_book(client, init_database):
"""Test updating an existing book."""
update_data = {
'price': 12.99,
'quantity': 8
}
# Test successful update
response = client.put('/books/1',
data=json.dumps(update_data),
content_type='application/json')
assert response.status_code == 200
data = json.loads(response.data)
assert data['name'] == 'Test Book 1' # Name unchanged
assert data['price'] == 12.99 # Price updated
assert data['quantity'] == 8 # Quantity updated
# Test update for non-existent book
response = client.put('/books/999',
data=json.dumps(update_data),
content_type='application/json')
assert response.status_code == 404
def test_delete_book(client, init_database):
"""Test deleting a book."""
# Test successful deletion
response = client.delete('/books/1')
assert response.status_code == 200
# Verify book was deleted
response = client.get('/books/1')
assert response.status_code == 404
# Test deletion of non-existent book
response = client.delete('/books/999')
assert response.status_code == 404 # This might fail with current implementation
```
You have now created comprehensive test cases for your Python web application.
Next you will run the tests to identify the issues in the application.
## Run tests to identify application issues
Run the tests you created in the previous section to identify issues in the application:
```python
pytest -v tests/test_shop.py
```
Review the failing tests to identify issues that you must fix.
The failing test results will be similar to the following.
### `test_delete_book` - failure
This test attempts to delete a book, then tries to delete a non-existent book (with
ID `999`). The test expects the following behavior:
- Successful deletion returns a `200` status code
- Trying to delete a non-existent book returns a `404` status code
This test fails because:
- The `delete_article` function in `app/database.py` does not return any status.
- The `delete_book` route does not:
- Check if the book exists before deletion.
- Handle the case of a non-existent book, so it would return a `200` status code
even for non-existent books.
### `test_update_book` - partial failure
This test updates an existing book and then tries to update a non-existent book.
The non-existent book part might pass, but there are issues:
- The `update_article` function in `database.py` does not return a status.
- No validation occurs on the input data.
- Error handling is missing.
### `test_add_book` - potential failure
This test adds a new book and checks if the response has status code 201. This
test might fail because:
- No input validation in the `add_book` route.
- No error handling if data is missing or invalid.
- The `Article` class does not validate inputs like negative prices.
### Test client setup - potential failure
The test fixtures might fail because the:
- Application does not properly handle test configuration.
- `create_app` function does not use the test configuration provided.
- Database path is hard coded, making it difficult to use a test database.
### General issues affecting all tests
Several issues in the codebase affect all tests:
- No error handling in database operations.
- No input validation throughout the application.
- Hard coded configuration values.
- Missing important environment variables.
- No connection management in database functions.
You must address these issues to make the application robust and testable.
### Next steps after identifying failing tests
After seeing which tests fail, you'll use Chat and Code Suggestions to systematically
address these issues by:
- Improving database error handling and connection management.
- Implementing data validation in the Article class.
- Adding proper error handling to route functions.
- Improving application configuration.
- Testing and verifying the fixes.
## Improve database error handling and connection management
Now, you will use Code Suggestions (specifically code generation) to improve the
database error handling and connection management:
1. Open the `app/database.py` file in your IDE.
1. First, fix the hard coded database path. Position your cursor at the line
where `DATABASE_PATH` is defined, and enter the following:
```python
# Replace the hard coded database path with an environment variable for database path with a fallback
DATABASE_PATH = 'bookstore.db'
```
1. Review and adjust the generated code as needed. It should be similar to the following:
```python
import os
from dotenv import load_dotenv
load_dotenv()
# Use environment variable for database path with a fallback
DATABASE_PATH = os.getenv('DATABASE_PATH', 'bookstore.db')
```
1. Next, improve the `get_db_connection()` function with error handling. Position
your cursor at the end of the function and enter the following:
```plaintext
# Add in missing error handling and connection management.
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def get_db_connection():
"""
Get a database connection.
Returns:
sqlite3.Connection: Database connection object
Raises:
sqlite3.Error: If connection to database fails
"""
try:
conn = sqlite3.connect(DATABASE_PATH)
conn.row_factory = sqlite3.Row
return conn
except sqlite3.Error as e:
# Log the error
print(f"Database connection error: {e}")
raise
```
1. Improve the `delete_article` function to check if a record was actually
deleted and return a status:
```plaintext
# Modify the `delete_article` to return a boolean indicating success if article
# was deleted, or failure if article was not found
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
Returns:
bool: True if article was deleted, False if article was not found
"""
try:
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
deleted = cursor.rowcount > 0
conn.commit()
conn.close()
return deleted
except sqlite3.Error as e:
print(f"Error deleting article: {e}")
return False
```
1. Finally, improve the `update_article` function to return a status indicating success:
```plaintext
# Modify the update_article function to return a boolean indicating success if article
# was deleted, or failure if article was not found
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
Returns:
bool: True if article was updated, False if article was not found
"""
try:
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
updated = cursor.rowcount > 0
conn.commit()
conn.close()
return updated
except sqlite3.Error as e:
print(f"Error updating article: {e}")
return False
```
Well done, you've used Code Suggestions to improve database error handling and
connection management. Next, you'll use Chat to implement data validation for the
`Article` class.
## Implement data validation
Now, you will use Chat to help implement validation rules for the `Article` class:
1. Open Chat in your IDE and enter:
```plaintext
How can I implement data validation rules for the Article class? I need to
validate name as a non-empty string, price as a positive integer, quantity as
a non-negative integer, and handle any validation errors.
```
1. Review the response. Consider asking follow-up questions to iterate the reponse:
- Ask Chat to explain a specific part of the validation implementation:
```plaintext
Can you explain how the ValidationError class works in this implementation?
Why is it defined as an inner class rather than separately?
```
- Request Chat to suggest a more efficient approach to validation:
```plaintext
The validation logic in the constructor feels verbose. Is there a more efficient
way to handle the validation, perhaps using Python decorators or a validation library?
```
- Ask Chat to refactor the validation code:
```plaintext
Can you refactor the validation code to make it more maintainable? Perhaps
extract the validation logic into separate methods?
```
1. Review the refactored code response and implement the improved Article class.
It should be similar to the following:
```python
class Article:
"""Article class for a bookstore inventory system."""
class ValidationError(Exception):
"""Exception raised for validation errors in article attributes."""
pass
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
Raises:
ValidationError: If any of the inputs fail validation
"""
self.id = article_id
# Validate name
if not name or not isinstance(name, str) or len(name.strip()) == 0:
raise self.ValidationError("Article name must be a non-empty string")
self.name = name.strip()
# Validate price
try:
price_float = float(price)
if price_float <= 0:
raise self.ValidationError("Price must be a positive number")
self.price = price_float
except (ValueError, TypeError):
raise self.ValidationError("Price must be a valid number")
# Validate quantity
try:
quantity_int = int(quantity)
if quantity_int < 0:
raise self.ValidationError("Quantity cannot be negative")
self.quantity = quantity_int
except (ValueError, TypeError):
raise self.ValidationError("Quantity must be a valid integer")
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
Raises:
ValidationError: If the dictionary is missing required fields or data fails validation
KeyError: If a required key is missing from the dictionary
"""
# Validate required fields
required_fields = ["name", "price", "quantity"]
for field in required_fields:
if field not in data:
raise cls.ValidationError(f"Missing required field: {field}")
article_id = data.get("id")
# Create and return new article with validation
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
1. Optional. For more specialized validation, ask Chat about additional Python
data validation techniques beyond basic type checking.
If needed, use the `/explain` Slash command to understand any additional techniques.
You've used Duo Chat to implement data validation for the `Article` class.
Next you'll use Code Suggestions to improve error handling in the routes.
## Implement error handling in routes
Now, you'll use Code Suggestions to improve error handling in the routes:
1. Open the `app/routes/shop.py` file in your IDE.
1. First, let's add better error handling to the GET routes. Position your cursor
at the beginning of the `get_all_books` function, and enter the following:
```plaintext
# Implement error handling in the get_all_books function
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
try:
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books])
except Exception as e:
# Log the error
print(f"Error retrieving books: {e}")
return jsonify({"error": "Failed to retrieve books", "details": str(e)}), 500
```
1. Next, use Code Suggestions to update the `add_book` function with proper
validation and error handling. At the start of the `add_book` function, enter
the following:
```plaintext
# Add validation for input data in the `add_book` route, implement proper
# error handling, and enhance the `Article` class with validation for name,
# price, and quantity
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
try:
# Check if request contains JSON data
if not request.is_json:
return jsonify({"error": "Request must be JSON"}), 400
data = request.get_json()
# Validate required fields
required_fields = ["name", "price", "quantity"]
for field in required_fields:
if field not in data:
return jsonify({"error": f"Missing required field: {field}"}), 400
# Create new book with validation
try:
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
except Article.ValidationError as e:
return jsonify({"error": "Validation error", "details": str(e)}), 400
# Add to database
book_id = database.add_article(new_book)
if book_id:
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
else:
return jsonify({"error": "Failed to add book to database"}), 500
except Exception as e:
# Log the error
print(f"Error adding book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
1. Update the `delete_book` function to check if the book exists and handle errors
properly. At the start of the `delete_book` function, enter the following:
```plaintext
# Update the `delete_book` route to check if the book exists before deletion,
# and return a 404 status code if the book does not exist
```
1. Check the generated code as adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
try:
# Check if book exists before deletion
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": "Book not found"}), 404
# Delete the book
success = database.delete_article(book_id)
if success:
return jsonify({"message": "Book deleted successfully"}), 200
else:
return jsonify({"error": "Failed to delete book"}), 500
except Exception as e:
# Log the error
print(f"Error deleting book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
1. Finally, use Code Suggestions to improve the error handling for the `update_book`
function. At the start of the `update_book` function, enter the following:
```plaintext
# Update the `update_book` route to check if the book exists before updating,
# update the book with price and quantity validation, save the updated book,
# and return a 500 status code if the book does not exist
```
1. Check the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
try:
# Check if request contains JSON data
if not request.is_json:
return jsonify({"error": "Request must be JSON"}), 400
data = request.get_json()
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": "Book not found"}), 404
# Update book properties with validation
try:
if 'name' in data:
existing_book.name = data['name']
if 'price' in data:
existing_book.price = float(data['price'])
if existing_book.price <= 0:
return jsonify({"error": "Price must be a positive number"}), 400
if 'quantity' in data:
existing_book.quantity = int(data['quantity'])
if existing_book.quantity < 0:
return jsonify({"error": "Quantity cannot be negative"}), 400
except (ValueError, TypeError) as e:
return jsonify({"error": "Invalid data format", "details": str(e)}), 400
except Article.ValidationError as e:
return jsonify({"error": "Validation error", "details": str(e)}), 400
# Save updated book
success = database.update_article(existing_book)
if success:
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict()), 200
else:
return jsonify({"error": "Failed to update book"}), 500
except Exception as e:
# Log the error
print(f"Error updating book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
Well done, you have successfully improved error handling in the routes.
Next, you will use Chat to improve the Flask application configuration.
## Improve Flask application configuration
The final improvement you're going to make is to use Chat to improve the Flask
application configuration.
1. Open the `app/__init__.py` file in your IDE.
1. Open Chat in your IDE and enter:
```plaintext
I need to improve this Flask application initialization code, specifically
the security configuration and environment variable handling defined in the
`create_app` function.
```
1. Review the response. Consider asking follow-up questions to improve the `create_app` function:
- Ask for specific security improvements:
```plaintext
What are the best practices for handling secret keys in a Flask application?
How should I generate and manage them differently between development and production environments?
```
- Ask about Flask application structure best practices:
```plaintext
Are there any architectural improvements you'd suggest for this Flask application
beyond configuration handling? How would professional Flask applications structure
this differently?
```
- Ask for an explanation of the implications of the configuration choices:
```plaintext
Can you explain the security implications of these configuration choices?
What other Flask configurationsettings should I be aware of for a secure deployment?
```
1. Based on the response, improve the `create_app` function. Depending on the follow-up
questions you asked, the function should look similar to the following:
```python
from flask import Flask
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY='dev', # Hard coded secret key
)
# Missing configuration from environment variables
# Missing test config handling
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API"
}
return app
```
1. Next, you'll update `create_app` to properly handle test configuration by using
environment variables for the database path instead of hardcoding it. Enter the
following into Chat.
```plaintext
How can I update create_app to properly handle test configuration and use
environment variables
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
import os
from flask import Flask
from dotenv import load_dotenv
load_dotenv() # Load environment variables from .env file
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY=os.getenv('SECRET_KEY', 'dev'),
DATABASE_PATH=os.getenv('DATABASE_PATH', 'bookstore.db'),
DEBUG=os.getenv('FLASK_ENV') == 'development',
)
# Override config with test config if provided
if test_config:
app.config.update(test_config)
# Ensure instance folder exists
os.makedirs(app.instance_path, exist_ok=True)
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API",
"version": "1.0",
"endpoints": {
"GET /books": "Get all books",
"GET /books/<id>": "Get a specific book",
"POST /books": "Add a new book",
"PUT /books/<id>": "Update a book",
"DELETE /books/<id>": "Delete a book"
}
}
# Add error handlers
@app.errorhandler(404)
def not_found(e):
return {"error": "Not found"}, 404
@app.errorhandler(500)
def server_error(e):
return {"error": "Internal server error"}, 500
return app
```
1. Finally, create an improved `.env` file with proper configuration:
```python
FLASK_APP=app
FLASK_ENV=development
SECRET_KEY=your_secure_secret_key_for_development
DATABASE_PATH=bookstore.db
```
1. Optional. Ask Chat for security best practices regarding environment variables
to further improve the configuration handling:
```plaintext
/security What are the best practices for handling environment variables and
sensitive configuration in a Flask application?
```
Use the provided guidance to further improve your configuration handling.
## Run tests again and verify the application works
Now that you've fixed the issues and implemented improvements, let's verify that
everything works correctly:
1. Run the tests again to make sure all tests pass:
```python
pytest -v tests/test_shop.py
```
1. Start the Flask application:
```python
flask run
```
1. Test the API endpoints with both valid and invalid inputs. To do this,
use an API development tool like [Postman](https://www.postman.com/) or
[curl](https://curl.se/) on the following endpoints.
- `GET /books` with a valid request.
- `GET /books/1` with a valid ID.
- `GET /books/999` with an invalid ID.
- `POST /books` with valid and invalid (for example, missing fields, negative price) data.
- `PUT /books/1` with valid and invalid data.
- `DELETE /books/1`.
- `DELETE /books/999` with a non-existent ID.
1. Validate that the error handling works correctly for all error cases.
1. Optional. Ask Chat how to validate that the error handling works correctly.
## Summary
In this tutorial, you've used Chat and Code Suggestions to:
- Write comprehensive test cases, run tests, and identify issues that need to be fixed.
- Improve database error handling and connection management.
- Implement data validation.
- Add robust error handling in routes.
- Improve the Flask application configuration.
- Verify the application works correctly.
These improvements have made the application more reliable, secure, and maintainable.
## Related topics
- [GitLab Duo use cases](../use_cases.md)
- [Get started with GitLab Duo](../../get_started/getting_started_gitlab_duo.md).
- Blog post: [Streamline DevSecOps engineering workflows with GitLab Duo](https://about.gitlab.com/blog/2024/12/05/streamline-devsecops-engineering-workflows-with-gitlab-duo/)
<!-- markdownlint-disable -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Chat](https://youtu.be/ZQBAuf-CTAY?si=0o9-xJ_ATTsL1oew)
<!-- Video published on 2024-04-18 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Code Suggestions](https://youtu.be/ds7SG1wgcVM?si=MfbzPIDpikGhoPh7)
<!-- Video published on 2024-01-24 -->
<!-- markdownlint-enable -->
|
---
stage: none
group: Tutorials
description: Tutorial on how to fix errors in a shop application in Python with GitLab
Duo.
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: 'Tutorial: Use GitLab Duo to fix errors in a Python shop application'
breadcrumbs:
- doc
- user
- gitlab_duo
- tutorials
---
<!-- vale gitlab_base.FutureTense = NO -->
This tutorial is part two in a series. In the first tutorial, you
[used GitLab Duo to create a shop application in Python](fix_code_python_shop.md).
If you followed the first tutorial and your code is working perfectly, introduce some common errors
by removing error handling from your routes. For example, remove `try` and `catch` blocks and input validation.
Then follow this tutorial to add them back with the help of GitLab Duo.
In this tutorial, you will:
- Write comprehensive test cases, run tests, and identify issues that need to be fixed.
- Improve database error handling and connection management.
- Implement data validation.
- Add robust error handling in routes.
- Improve the Flask application configuration.
- Verify the application works correctly.
## Write test cases
To start with, you will use Chat to generate comprehensive test cases for our
web application.
Well-written, comprehensive test cases:
- Systematically identify where code is not working.
- Help users to think through exactly how each part of the code should behave in both
standard and error conditions.
- Create a prioritized list of issues that need fixing.
- Allow users to immediately validate if a fix is working
To write the test cases:
1. Open Chat in your IDE and enter:
```plaintext
I need to write comprehensive tests for a Flask API for a bookstore inventory.
Here's the current minimal test file:
import pytest
def test_dummy():
"""A dummy test that always passes."""
assert True
Can you help me write proper tests for the application? The API has routes for:
- GET /books - Get all books
- GET /books/<id> - Get a specific book
- POST /books - Add a new book
- PUT /books/<id> - Update a book
- DELETE /books/<id> - Delete a book
I want to test both successful operations and error handling.
```
1. Review the response from Chat. You should receive a comprehensive
test plan including setup code, fixture definitions, and test functions for each route.
1. After reviewing Chat's response, consider asking follow-up questions:
- Try to get a better understanding of the test fixture design:
```plaintext
Can you explain why you're using these specific fixtures? What's the benefit of
separating the app fixture from the client fixture?
```
- Ask Chat to help you understand how to test specific error conditions:
```plaintext
I'm particularly concerned about error handling for the POST and PUT routes.
Can you enhance the tests to include more edge cases like invalid data types
and missing required fields?
```
- For more specific guidance on Flask testing, use the `/help` command:
```plaintext
/help Flask testing with pytest
```
- Ask Chat to suggest a way to make the tests run faster:
```plaintext
These tests seem comprehensive but might be slow when running the full suite.
Are there any optimizations you'd suggest for the test setup?
```
1. Amend the test plan as needed. After you are happy with the plan, ask Chat for
a complete implementation of the test file:
```plaintext
Based on the test plan, provide a complete implementation of the test_shop.py file that includes:
1. Fixtures for setting up a test client and database
2. Tests for each endpoint with both successful and error cases
3. Proper cleanup after tests
```
1. Copy the suggested implementation into your `tests/test_shop.py` file. Depending
on how you amended the test plan, the implementation should look similar to the following:
```python
import pytest
import json
from app import create_app
from app.database import initialize_database, get_db_connection
@pytest.fixture
def app():
"""Create and configure a Flask app for testing."""
app = create_app({"TESTING": True, "DATABASE": "test_bookstore.db"})
# Initialize the test database
with app.app_context():
initialize_database()
yield app
# Clean up the test database
import os
if os.path.exists("test_bookstore.db"):
os.remove("test_bookstore.db")
@pytest.fixture
def client(app):
"""A test client for the app."""
return app.test_client()
@pytest.fixture
def init_database(app):
"""Initialize the database with test data."""
conn = get_db_connection()
cursor = conn.cursor()
# Add test books
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
("Test Book 1", 10.99, 5)
)
cursor.execute(
"INSERT INTO articles (name, price, quantity) VALUES (?, ?, ?)",
("Test Book 2", 15.99, 10)
)
conn.commit()
conn.close()
def test_get_all_books(client, init_database):
"""Test retrieving all books."""
response = client.get('/books')
assert response.status_code == 200
data = json.loads(response.data)
assert len(data) == 2
assert data[0]['name'] == 'Test Book 1'
assert data[1]['name'] == 'Test Book 2'
def test_get_book_by_id(client, init_database):
"""Test retrieving a specific book by ID."""
# Test successful retrieval
response = client.get('/books/1')
assert response.status_code == 200
data = json.loads(response.data)
assert data['name'] == 'Test Book 1'
assert data['price'] == 10.99
# Test book not found
response = client.get('/books/999')
assert response.status_code == 404
def test_add_book(client):
"""Test adding a new book."""
new_book = {
'name': 'New Test Book',
'price': 20.99,
'quantity': 15
}
response = client.post('/books',
data=json.dumps(new_book),
content_type='application/json')
assert response.status_code == 201
data = json.loads(response.data)
assert data['name'] == 'New Test Book'
assert data['price'] == 20.99
assert data['quantity'] == 15
assert 'id' in data
def test_update_book(client, init_database):
"""Test updating an existing book."""
update_data = {
'price': 12.99,
'quantity': 8
}
# Test successful update
response = client.put('/books/1',
data=json.dumps(update_data),
content_type='application/json')
assert response.status_code == 200
data = json.loads(response.data)
assert data['name'] == 'Test Book 1' # Name unchanged
assert data['price'] == 12.99 # Price updated
assert data['quantity'] == 8 # Quantity updated
# Test update for non-existent book
response = client.put('/books/999',
data=json.dumps(update_data),
content_type='application/json')
assert response.status_code == 404
def test_delete_book(client, init_database):
"""Test deleting a book."""
# Test successful deletion
response = client.delete('/books/1')
assert response.status_code == 200
# Verify book was deleted
response = client.get('/books/1')
assert response.status_code == 404
# Test deletion of non-existent book
response = client.delete('/books/999')
assert response.status_code == 404 # This might fail with current implementation
```
You have now created comprehensive test cases for your Python web application.
Next you will run the tests to identify the issues in the application.
## Run tests to identify application issues
Run the tests you created in the previous section to identify issues in the application:
```python
pytest -v tests/test_shop.py
```
Review the failing tests to identify issues that you must fix.
The failing test results will be similar to the following.
### `test_delete_book` - failure
This test attempts to delete a book, then tries to delete a non-existent book (with
ID `999`). The test expects the following behavior:
- Successful deletion returns a `200` status code
- Trying to delete a non-existent book returns a `404` status code
This test fails because:
- The `delete_article` function in `app/database.py` does not return any status.
- The `delete_book` route does not:
- Check if the book exists before deletion.
- Handle the case of a non-existent book, so it would return a `200` status code
even for non-existent books.
### `test_update_book` - partial failure
This test updates an existing book and then tries to update a non-existent book.
The non-existent book part might pass, but there are issues:
- The `update_article` function in `database.py` does not return a status.
- No validation occurs on the input data.
- Error handling is missing.
### `test_add_book` - potential failure
This test adds a new book and checks if the response has status code 201. This
test might fail because:
- No input validation in the `add_book` route.
- No error handling if data is missing or invalid.
- The `Article` class does not validate inputs like negative prices.
### Test client setup - potential failure
The test fixtures might fail because the:
- Application does not properly handle test configuration.
- `create_app` function does not use the test configuration provided.
- Database path is hard coded, making it difficult to use a test database.
### General issues affecting all tests
Several issues in the codebase affect all tests:
- No error handling in database operations.
- No input validation throughout the application.
- Hard coded configuration values.
- Missing important environment variables.
- No connection management in database functions.
You must address these issues to make the application robust and testable.
### Next steps after identifying failing tests
After seeing which tests fail, you'll use Chat and Code Suggestions to systematically
address these issues by:
- Improving database error handling and connection management.
- Implementing data validation in the Article class.
- Adding proper error handling to route functions.
- Improving application configuration.
- Testing and verifying the fixes.
## Improve database error handling and connection management
Now, you will use Code Suggestions (specifically code generation) to improve the
database error handling and connection management:
1. Open the `app/database.py` file in your IDE.
1. First, fix the hard coded database path. Position your cursor at the line
where `DATABASE_PATH` is defined, and enter the following:
```python
# Replace the hard coded database path with an environment variable for database path with a fallback
DATABASE_PATH = 'bookstore.db'
```
1. Review and adjust the generated code as needed. It should be similar to the following:
```python
import os
from dotenv import load_dotenv
load_dotenv()
# Use environment variable for database path with a fallback
DATABASE_PATH = os.getenv('DATABASE_PATH', 'bookstore.db')
```
1. Next, improve the `get_db_connection()` function with error handling. Position
your cursor at the end of the function and enter the following:
```plaintext
# Add in missing error handling and connection management.
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def get_db_connection():
"""
Get a database connection.
Returns:
sqlite3.Connection: Database connection object
Raises:
sqlite3.Error: If connection to database fails
"""
try:
conn = sqlite3.connect(DATABASE_PATH)
conn.row_factory = sqlite3.Row
return conn
except sqlite3.Error as e:
# Log the error
print(f"Database connection error: {e}")
raise
```
1. Improve the `delete_article` function to check if a record was actually
deleted and return a status:
```plaintext
# Modify the `delete_article` to return a boolean indicating success if article
# was deleted, or failure if article was not found
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def delete_article(article_id):
"""
Delete an article from the database.
Args:
article_id (int): ID of the article to delete
Returns:
bool: True if article was deleted, False if article was not found
"""
try:
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM articles WHERE id = ?", (article_id,))
deleted = cursor.rowcount > 0
conn.commit()
conn.close()
return deleted
except sqlite3.Error as e:
print(f"Error deleting article: {e}")
return False
```
1. Finally, improve the `update_article` function to return a status indicating success:
```plaintext
# Modify the update_article function to return a boolean indicating success if article
# was deleted, or failure if article was not found
```
1. Review the generated code and adjust as needed. It should be similar to the
following:
```python
def update_article(article):
"""
Update an existing article in the database.
Args:
article (Article): Article object with updated values
Returns:
bool: True if article was updated, False if article was not found
"""
try:
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute(
"UPDATE articles SET name = ?, price = ?, quantity = ? WHERE id = ?",
(article.name, article.price, article.quantity, article.id)
)
updated = cursor.rowcount > 0
conn.commit()
conn.close()
return updated
except sqlite3.Error as e:
print(f"Error updating article: {e}")
return False
```
Well done, you've used Code Suggestions to improve database error handling and
connection management. Next, you'll use Chat to implement data validation for the
`Article` class.
## Implement data validation
Now, you will use Chat to help implement validation rules for the `Article` class:
1. Open Chat in your IDE and enter:
```plaintext
How can I implement data validation rules for the Article class? I need to
validate name as a non-empty string, price as a positive integer, quantity as
a non-negative integer, and handle any validation errors.
```
1. Review the response. Consider asking follow-up questions to iterate the reponse:
- Ask Chat to explain a specific part of the validation implementation:
```plaintext
Can you explain how the ValidationError class works in this implementation?
Why is it defined as an inner class rather than separately?
```
- Request Chat to suggest a more efficient approach to validation:
```plaintext
The validation logic in the constructor feels verbose. Is there a more efficient
way to handle the validation, perhaps using Python decorators or a validation library?
```
- Ask Chat to refactor the validation code:
```plaintext
Can you refactor the validation code to make it more maintainable? Perhaps
extract the validation logic into separate methods?
```
1. Review the refactored code response and implement the improved Article class.
It should be similar to the following:
```python
class Article:
"""Article class for a bookstore inventory system."""
class ValidationError(Exception):
"""Exception raised for validation errors in article attributes."""
pass
def __init__(self, name, price, quantity, article_id=None):
"""
Initialize an article.
Args:
name (str): The name/title of the book
price (float): The price of the book
quantity (int): The quantity in stock
article_id (int, optional): The unique identifier for the article
Raises:
ValidationError: If any of the inputs fail validation
"""
self.id = article_id
# Validate name
if not name or not isinstance(name, str) or len(name.strip()) == 0:
raise self.ValidationError("Article name must be a non-empty string")
self.name = name.strip()
# Validate price
try:
price_float = float(price)
if price_float <= 0:
raise self.ValidationError("Price must be a positive number")
self.price = price_float
except (ValueError, TypeError):
raise self.ValidationError("Price must be a valid number")
# Validate quantity
try:
quantity_int = int(quantity)
if quantity_int < 0:
raise self.ValidationError("Quantity cannot be negative")
self.quantity = quantity_int
except (ValueError, TypeError):
raise self.ValidationError("Quantity must be a valid integer")
def to_dict(self):
"""
Convert the article to a dictionary.
Returns:
dict: Dictionary representation of the article
"""
return {
"id": self.id,
"name": self.name,
"price": self.price,
"quantity": self.quantity
}
@classmethod
def from_dict(cls, data):
"""
Create an article from a dictionary.
Args:
data (dict): Dictionary with article data
Returns:
Article: New article instance
Raises:
ValidationError: If the dictionary is missing required fields or data fails validation
KeyError: If a required key is missing from the dictionary
"""
# Validate required fields
required_fields = ["name", "price", "quantity"]
for field in required_fields:
if field not in data:
raise cls.ValidationError(f"Missing required field: {field}")
article_id = data.get("id")
# Create and return new article with validation
return cls(
name=data["name"],
price=data["price"],
quantity=data["quantity"],
article_id=article_id
)
```
1. Optional. For more specialized validation, ask Chat about additional Python
data validation techniques beyond basic type checking.
If needed, use the `/explain` Slash command to understand any additional techniques.
You've used Duo Chat to implement data validation for the `Article` class.
Next you'll use Code Suggestions to improve error handling in the routes.
## Implement error handling in routes
Now, you'll use Code Suggestions to improve error handling in the routes:
1. Open the `app/routes/shop.py` file in your IDE.
1. First, let's add better error handling to the GET routes. Position your cursor
at the beginning of the `get_all_books` function, and enter the following:
```plaintext
# Implement error handling in the get_all_books function
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('', methods=['GET'])
def get_all_books():
"""Get all books from the inventory."""
try:
books = database.get_all_articles()
return jsonify([book.to_dict() for book in books])
except Exception as e:
# Log the error
print(f"Error retrieving books: {e}")
return jsonify({"error": "Failed to retrieve books", "details": str(e)}), 500
```
1. Next, use Code Suggestions to update the `add_book` function with proper
validation and error handling. At the start of the `add_book` function, enter
the following:
```plaintext
# Add validation for input data in the `add_book` route, implement proper
# error handling, and enhance the `Article` class with validation for name,
# price, and quantity
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('', methods=['POST'])
def add_book():
"""Add a new book to the inventory."""
try:
# Check if request contains JSON data
if not request.is_json:
return jsonify({"error": "Request must be JSON"}), 400
data = request.get_json()
# Validate required fields
required_fields = ["name", "price", "quantity"]
for field in required_fields:
if field not in data:
return jsonify({"error": f"Missing required field: {field}"}), 400
# Create new book with validation
try:
new_book = Article(
name=data['name'],
price=data['price'],
quantity=data['quantity']
)
except Article.ValidationError as e:
return jsonify({"error": "Validation error", "details": str(e)}), 400
# Add to database
book_id = database.add_article(new_book)
if book_id:
created_book = database.get_article_by_id(book_id)
return jsonify(created_book.to_dict()), 201
else:
return jsonify({"error": "Failed to add book to database"}), 500
except Exception as e:
# Log the error
print(f"Error adding book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
1. Update the `delete_book` function to check if the book exists and handle errors
properly. At the start of the `delete_book` function, enter the following:
```plaintext
# Update the `delete_book` route to check if the book exists before deletion,
# and return a 404 status code if the book does not exist
```
1. Check the generated code as adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('/<int:book_id>', methods=['DELETE'])
def delete_book(book_id):
"""Delete a book from the inventory."""
try:
# Check if book exists before deletion
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": "Book not found"}), 404
# Delete the book
success = database.delete_article(book_id)
if success:
return jsonify({"message": "Book deleted successfully"}), 200
else:
return jsonify({"error": "Failed to delete book"}), 500
except Exception as e:
# Log the error
print(f"Error deleting book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
1. Finally, use Code Suggestions to improve the error handling for the `update_book`
function. At the start of the `update_book` function, enter the following:
```plaintext
# Update the `update_book` route to check if the book exists before updating,
# update the book with price and quantity validation, save the updated book,
# and return a 500 status code if the book does not exist
```
1. Check the generated code and adjust as necessary. It should look similar to
the following:
```python
@shop_bp.route('/<int:book_id>', methods=['PUT'])
def update_book(book_id):
"""Update an existing book."""
try:
# Check if request contains JSON data
if not request.is_json:
return jsonify({"error": "Request must be JSON"}), 400
data = request.get_json()
# Check if book exists
existing_book = database.get_article_by_id(book_id)
if not existing_book:
return jsonify({"error": "Book not found"}), 404
# Update book properties with validation
try:
if 'name' in data:
existing_book.name = data['name']
if 'price' in data:
existing_book.price = float(data['price'])
if existing_book.price <= 0:
return jsonify({"error": "Price must be a positive number"}), 400
if 'quantity' in data:
existing_book.quantity = int(data['quantity'])
if existing_book.quantity < 0:
return jsonify({"error": "Quantity cannot be negative"}), 400
except (ValueError, TypeError) as e:
return jsonify({"error": "Invalid data format", "details": str(e)}), 400
except Article.ValidationError as e:
return jsonify({"error": "Validation error", "details": str(e)}), 400
# Save updated book
success = database.update_article(existing_book)
if success:
updated_book = database.get_article_by_id(book_id)
return jsonify(updated_book.to_dict()), 200
else:
return jsonify({"error": "Failed to update book"}), 500
except Exception as e:
# Log the error
print(f"Error updating book: {e}")
return jsonify({"error": "Internal server error", "details": str(e)}), 500
```
Well done, you have successfully improved error handling in the routes.
Next, you will use Chat to improve the Flask application configuration.
## Improve Flask application configuration
The final improvement you're going to make is to use Chat to improve the Flask
application configuration.
1. Open the `app/__init__.py` file in your IDE.
1. Open Chat in your IDE and enter:
```plaintext
I need to improve this Flask application initialization code, specifically
the security configuration and environment variable handling defined in the
`create_app` function.
```
1. Review the response. Consider asking follow-up questions to improve the `create_app` function:
- Ask for specific security improvements:
```plaintext
What are the best practices for handling secret keys in a Flask application?
How should I generate and manage them differently between development and production environments?
```
- Ask about Flask application structure best practices:
```plaintext
Are there any architectural improvements you'd suggest for this Flask application
beyond configuration handling? How would professional Flask applications structure
this differently?
```
- Ask for an explanation of the implications of the configuration choices:
```plaintext
Can you explain the security implications of these configuration choices?
What other Flask configurationsettings should I be aware of for a secure deployment?
```
1. Based on the response, improve the `create_app` function. Depending on the follow-up
questions you asked, the function should look similar to the following:
```python
from flask import Flask
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY='dev', # Hard coded secret key
)
# Missing configuration from environment variables
# Missing test config handling
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API"
}
return app
```
1. Next, you'll update `create_app` to properly handle test configuration by using
environment variables for the database path instead of hardcoding it. Enter the
following into Chat.
```plaintext
How can I update create_app to properly handle test configuration and use
environment variables
```
1. Review the generated code and adjust as necessary. It should look similar to
the following:
```python
import os
from flask import Flask
from dotenv import load_dotenv
load_dotenv() # Load environment variables from .env file
def create_app(test_config=None):
"""
Application factory for creating the Flask app.
Args:
test_config (dict, optional): Test configuration to override default config
Returns:
Flask: Configured Flask application
"""
# Create and configure the app
app = Flask(__name__)
# Set default configuration
app.config.from_mapping(
SECRET_KEY=os.getenv('SECRET_KEY', 'dev'),
DATABASE_PATH=os.getenv('DATABASE_PATH', 'bookstore.db'),
DEBUG=os.getenv('FLASK_ENV') == 'development',
)
# Override config with test config if provided
if test_config:
app.config.update(test_config)
# Ensure instance folder exists
os.makedirs(app.instance_path, exist_ok=True)
# Initialize database
from app import database
database.initialize_database()
# Register blueprints
from app.routes.shop import shop_bp
app.register_blueprint(shop_bp)
# Add a simple index route
@app.route('/')
def index():
return {
"message": "Welcome to the Bookstore Inventory API",
"version": "1.0",
"endpoints": {
"GET /books": "Get all books",
"GET /books/<id>": "Get a specific book",
"POST /books": "Add a new book",
"PUT /books/<id>": "Update a book",
"DELETE /books/<id>": "Delete a book"
}
}
# Add error handlers
@app.errorhandler(404)
def not_found(e):
return {"error": "Not found"}, 404
@app.errorhandler(500)
def server_error(e):
return {"error": "Internal server error"}, 500
return app
```
1. Finally, create an improved `.env` file with proper configuration:
```python
FLASK_APP=app
FLASK_ENV=development
SECRET_KEY=your_secure_secret_key_for_development
DATABASE_PATH=bookstore.db
```
1. Optional. Ask Chat for security best practices regarding environment variables
to further improve the configuration handling:
```plaintext
/security What are the best practices for handling environment variables and
sensitive configuration in a Flask application?
```
Use the provided guidance to further improve your configuration handling.
## Run tests again and verify the application works
Now that you've fixed the issues and implemented improvements, let's verify that
everything works correctly:
1. Run the tests again to make sure all tests pass:
```python
pytest -v tests/test_shop.py
```
1. Start the Flask application:
```python
flask run
```
1. Test the API endpoints with both valid and invalid inputs. To do this,
use an API development tool like [Postman](https://www.postman.com/) or
[curl](https://curl.se/) on the following endpoints.
- `GET /books` with a valid request.
- `GET /books/1` with a valid ID.
- `GET /books/999` with an invalid ID.
- `POST /books` with valid and invalid (for example, missing fields, negative price) data.
- `PUT /books/1` with valid and invalid data.
- `DELETE /books/1`.
- `DELETE /books/999` with a non-existent ID.
1. Validate that the error handling works correctly for all error cases.
1. Optional. Ask Chat how to validate that the error handling works correctly.
## Summary
In this tutorial, you've used Chat and Code Suggestions to:
- Write comprehensive test cases, run tests, and identify issues that need to be fixed.
- Improve database error handling and connection management.
- Implement data validation.
- Add robust error handling in routes.
- Improve the Flask application configuration.
- Verify the application works correctly.
These improvements have made the application more reliable, secure, and maintainable.
## Related topics
- [GitLab Duo use cases](../use_cases.md)
- [Get started with GitLab Duo](../../get_started/getting_started_gitlab_duo.md).
- Blog post: [Streamline DevSecOps engineering workflows with GitLab Duo](https://about.gitlab.com/blog/2024/12/05/streamline-devsecops-engineering-workflows-with-gitlab-duo/)
<!-- markdownlint-disable -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Chat](https://youtu.be/ZQBAuf-CTAY?si=0o9-xJ_ATTsL1oew)
<!-- Video published on 2024-04-18 -->
- <i class="fa-youtube-play" aria-hidden="true"></i>
[GitLab Duo Code Suggestions](https://youtu.be/ds7SG1wgcVM?si=MfbzPIDpikGhoPh7)
<!-- Video published on 2024-01-24 -->
<!-- markdownlint-enable -->
|
https://docs.gitlab.com/user/operations_dashboard
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/operations_dashboard
|
[
"doc",
"user",
"operations_dashboard"
] |
_index.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Operations Dashboard
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The Operations Dashboard provides a summary of each project's operational health,
including pipeline and alert status.
To access the dashboard:
1. On the left sidebar, select **Search or go to**.
1. Select **Your work**.
1. Select **Operations**.
## Adding a project to the dashboard
To add a project to the dashboard:
1. Ensure your alerts populate the `gitlab_environment_name` label on the [alerts you set up in Prometheus](../../operations/incident_management/integrations.md#expected-prometheus-request-attributes).
The value of this should match the name of your environment in GitLab.
You can display alerts for the `production` environment only.
1. Select **Add projects** in the home screen of the dashboard.
1. Search and add one or more projects using the **Search your projects** field.
1. Select **Add projects**.
Once added, the dashboard displays the project's number of active alerts,
last commit, pipeline status, and when it was last deployed.
The Operations and [Environments](../../ci/environments/environments_dashboard.md) dashboards share the same list of projects. Adding or removing a project from one adds or removes the project from the other.

## Arranging projects on a dashboard
You can drag project cards to change their order. The card order is currently only saved to your browser, so it doesn't change the dashboard for other people.
## Making it the default dashboard when you sign in
The Operations Dashboard can also be made the default GitLab dashboard shown when
you sign in. To make it the default, see [Profile preferences](../profile/preferences.md).
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Operations Dashboard
breadcrumbs:
- doc
- user
- operations_dashboard
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The Operations Dashboard provides a summary of each project's operational health,
including pipeline and alert status.
To access the dashboard:
1. On the left sidebar, select **Search or go to**.
1. Select **Your work**.
1. Select **Operations**.
## Adding a project to the dashboard
To add a project to the dashboard:
1. Ensure your alerts populate the `gitlab_environment_name` label on the [alerts you set up in Prometheus](../../operations/incident_management/integrations.md#expected-prometheus-request-attributes).
The value of this should match the name of your environment in GitLab.
You can display alerts for the `production` environment only.
1. Select **Add projects** in the home screen of the dashboard.
1. Search and add one or more projects using the **Search your projects** field.
1. Select **Add projects**.
Once added, the dashboard displays the project's number of active alerts,
last commit, pipeline status, and when it was last deployed.
The Operations and [Environments](../../ci/environments/environments_dashboard.md) dashboards share the same list of projects. Adding or removing a project from one adds or removes the project from the other.

## Arranging projects on a dashboard
You can drag project cards to change their order. The card order is currently only saved to your browser, so it doesn't change the dashboard for other people.
## Making it the default dashboard when you sign in
The Operations Dashboard can also be made the default GitLab dashboard shown when
you sign in. To make it the default, see [Profile preferences](../profile/preferences.md).
|
https://docs.gitlab.com/user/custom_fields
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/custom_fields.md
|
2025-08-13
|
doc/user/work_items
|
[
"doc",
"user",
"work_items"
] |
custom_fields.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Custom fields
|
Create and use custom fields for work items to track specific information unique to your workflow. Configure field types to enhance planning and reporting capabilities.
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/479571) in GitLab 17.11 [with a flag](../../administration/feature_flags/_index.md) named `custom_fields_feature`.
Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/479571) in GitLab 18.0. Feature flag `custom_fields_feature` removed.
{{< /history >}}
Custom fields add specialized information to work items, such as issues and epics, that match your specific planning needs.
Configure custom fields for a group to track data points like business value, risk assessment, priority ranking, or team attributes.
These fields appear in all work items across the group, its subgroups, and projects.
Custom fields help teams standardize how they record and report information across the entire workflow.
This standardization creates consistency across projects and supports more powerful filtering and reporting capabilities.
Choose from various field types to accommodate different data requirements and planning scenarios:
- Single-select
- Multi-select
- Number
- Text
## Configure custom fields for a group
Configure custom fields for top-level groups to make them available for work items in that group,
its subgroups, and projects.
### Create a custom field
Create custom fields to capture the specific information your team needs to track.
You can configure each field for one or more work item types, tailoring your workflow to
your organization's requirements.
Keep these limits in mind:
- A top-level group can have at most 50 active custom fields.
- A work item type can have at most 10 custom fields assigned to it.
Prerequisites:
- You must have at least the Maintainer role for the group.
To create a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Select **Create field**.
1. Complete the fields:
- In **Type**, select what type the field should be:
- Single-select
- Multi-select
- Number
- Text field
The field type cannot be changed after you create the field.
- In **Use on**, select the work item types where you want this field to be available.
- In **Options** (on single-select and multi-select fields), enter the possible select options.
A single-select or multi-select field can have at most 50 select options.
- Reorder options by dragging the grip icon ({{< icon name="grip" >}}) to the left of each option.
- To add multiple options at once, select the input and paste a list of items, one per line.
1. Select **Save**.
### Edit a custom field
Edit existing custom fields to reflect changing needs in your organization.
You can modify a field's name, the work item types it applies to, and the available options without
losing existing data.
Prerequisites:
- You must have at least the Maintainer role for the group.
To edit a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Next to the field you want to edit, select **Edit `<field name>`** ({{< icon name="pencil" >}}).
1. Make changes to any of the fields.
1. Select **Update**.
### Archive a custom field
Archive custom fields that are no longer needed while preserving their historical data.
Archiving removes the field from any work items that had them.
Prerequisites:
- You must have at least the Maintainer role for the group.
To archive a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Next to the field you want to archive, select **Archive `<field name>`** ({{< icon name="archive" >}}).
### Unarchive a custom field
Restore a previously archived custom field when you need to use it again.
Work items that had values set for this field retain the same values they had before the field was archived.
Prerequisites:
- You must have at least the Maintainer role for the group.
To unarchive a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Select the **Archived** tab to list archived fields.
1. Next to the field you want to unarchive, select **Unarchive `<field name>`** ({{< icon name="redo" >}}).
## Set custom field values for a work item
Add relevant information to work items by using the custom fields configured for your group.
Prerequisites:
- You must have at least the Planner role for the work item's project or group.
- If you have the Guest role, you can set custom fields only when creating a work item.
1. Go to a work item.
1. On the right sidebar, find the section for the custom field you want to edit, and then select **Edit**.
1. Enter or select the desired value.
- A text field value can have at most 1024 characters.
1. Select any area outside the field.
## Field type selection guide
When creating custom fields, choose a field type that matches the kind of data you want to track.
The right field type improves data quality and makes reporting more effective.
### Single-select fields
Use single-select fields when:
- Users should choose exactly one option from a predefined list.
- The options are mutually exclusive.
- You want to enforce consistency and prevent free-form input.
Single-select fields work well for:
- Priority indicators (like `High`, `Medium`, `Low`)
- Category assignments
- Team assignments
- Approval states
- Priority levels
### Multi-select fields
Use multi-select fields when:
- Multiple values might apply simultaneously.
- You need to track overlapping attributes.
- Items might belong to multiple categories.
Multi-select fields work well for:
- Tags or labels
- Skills required
- Affected components
- Stakeholder groups
- Feature capabilities
### Number fields
Use number fields when:
- You need to collect quantitative data.
- You want to perform calculations or aggregations.
- The information needs to be sortable numerically.
Number fields work well for:
- Cost estimates
- Time estimates
- Business value scores
- Ranking or prioritization scores
- Percentage complete
### Text fields
Use text fields when:
- You need to capture unique information that doesn't fit predefined categories.
- The data is highly variable.
- You need to provide context or details.
Text fields work well for:
- Additional context
- External reference IDs
- Contact information
- Brief notes or comments
- URLs or links
## Naming conventions for custom fields
Consistent naming conventions for custom fields make them easier to understand and use.
Good field names improve adoption and data quality.
### General guidelines
- Keep names concise but descriptive.
- Use clear, specific language that your organization understands.
- Be consistent with capitalization (title case is recommended).
- Avoid abbreviations unless they're widely understood.
- Include the unit of measure when applicable.
### Naming single-select and multi-select fields
Start with the category name, followed by a descriptor. For example:
- `Risk Level` instead of `Risk`
- `Customer Segment` instead of `Segment`
- `Development Phase` instead of `Phase`
- `Approval Status` instead of `Status`
### Naming number fields
Include the unit of measurement in the field name. For example:
- `Effort Points` instead of `Points`
- `Budget Estimate ($)` instead of `Budget`
- `Implementation Time (days)` instead of `Time`
- `Business Value Score` instead of `Value`
### Naming text fields
Clearly indicate what information should be entered. For example:
- `External Reference ID` instead of `Reference`
- `Implementation Notes` instead of `Notes`
- `Requirements Source` instead of `Source`
### Team-specific prefixes
If multiple teams use the same GitLab instance, consider adding team prefixes to avoid confusion:
- `DEV: Sprint Priority`
- `QA: Test Environment`
- `UX: Design Status`
- `PM: Market Segment`
This approach helps teams quickly identify which fields are relevant to their work.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Create and use custom fields for work items to track specific information
unique to your workflow. Configure field types to enhance planning and reporting
capabilities.
title: Custom fields
breadcrumbs:
- doc
- user
- work_items
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/479571) in GitLab 17.11 [with a flag](../../administration/feature_flags/_index.md) named `custom_fields_feature`.
Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/479571) in GitLab 18.0. Feature flag `custom_fields_feature` removed.
{{< /history >}}
Custom fields add specialized information to work items, such as issues and epics, that match your specific planning needs.
Configure custom fields for a group to track data points like business value, risk assessment, priority ranking, or team attributes.
These fields appear in all work items across the group, its subgroups, and projects.
Custom fields help teams standardize how they record and report information across the entire workflow.
This standardization creates consistency across projects and supports more powerful filtering and reporting capabilities.
Choose from various field types to accommodate different data requirements and planning scenarios:
- Single-select
- Multi-select
- Number
- Text
## Configure custom fields for a group
Configure custom fields for top-level groups to make them available for work items in that group,
its subgroups, and projects.
### Create a custom field
Create custom fields to capture the specific information your team needs to track.
You can configure each field for one or more work item types, tailoring your workflow to
your organization's requirements.
Keep these limits in mind:
- A top-level group can have at most 50 active custom fields.
- A work item type can have at most 10 custom fields assigned to it.
Prerequisites:
- You must have at least the Maintainer role for the group.
To create a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Select **Create field**.
1. Complete the fields:
- In **Type**, select what type the field should be:
- Single-select
- Multi-select
- Number
- Text field
The field type cannot be changed after you create the field.
- In **Use on**, select the work item types where you want this field to be available.
- In **Options** (on single-select and multi-select fields), enter the possible select options.
A single-select or multi-select field can have at most 50 select options.
- Reorder options by dragging the grip icon ({{< icon name="grip" >}}) to the left of each option.
- To add multiple options at once, select the input and paste a list of items, one per line.
1. Select **Save**.
### Edit a custom field
Edit existing custom fields to reflect changing needs in your organization.
You can modify a field's name, the work item types it applies to, and the available options without
losing existing data.
Prerequisites:
- You must have at least the Maintainer role for the group.
To edit a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Next to the field you want to edit, select **Edit `<field name>`** ({{< icon name="pencil" >}}).
1. Make changes to any of the fields.
1. Select **Update**.
### Archive a custom field
Archive custom fields that are no longer needed while preserving their historical data.
Archiving removes the field from any work items that had them.
Prerequisites:
- You must have at least the Maintainer role for the group.
To archive a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Next to the field you want to archive, select **Archive `<field name>`** ({{< icon name="archive" >}}).
### Unarchive a custom field
Restore a previously archived custom field when you need to use it again.
Work items that had values set for this field retain the same values they had before the field was archived.
Prerequisites:
- You must have at least the Maintainer role for the group.
To unarchive a custom field:
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > Issues**.
1. Select the **Archived** tab to list archived fields.
1. Next to the field you want to unarchive, select **Unarchive `<field name>`** ({{< icon name="redo" >}}).
## Set custom field values for a work item
Add relevant information to work items by using the custom fields configured for your group.
Prerequisites:
- You must have at least the Planner role for the work item's project or group.
- If you have the Guest role, you can set custom fields only when creating a work item.
1. Go to a work item.
1. On the right sidebar, find the section for the custom field you want to edit, and then select **Edit**.
1. Enter or select the desired value.
- A text field value can have at most 1024 characters.
1. Select any area outside the field.
## Field type selection guide
When creating custom fields, choose a field type that matches the kind of data you want to track.
The right field type improves data quality and makes reporting more effective.
### Single-select fields
Use single-select fields when:
- Users should choose exactly one option from a predefined list.
- The options are mutually exclusive.
- You want to enforce consistency and prevent free-form input.
Single-select fields work well for:
- Priority indicators (like `High`, `Medium`, `Low`)
- Category assignments
- Team assignments
- Approval states
- Priority levels
### Multi-select fields
Use multi-select fields when:
- Multiple values might apply simultaneously.
- You need to track overlapping attributes.
- Items might belong to multiple categories.
Multi-select fields work well for:
- Tags or labels
- Skills required
- Affected components
- Stakeholder groups
- Feature capabilities
### Number fields
Use number fields when:
- You need to collect quantitative data.
- You want to perform calculations or aggregations.
- The information needs to be sortable numerically.
Number fields work well for:
- Cost estimates
- Time estimates
- Business value scores
- Ranking or prioritization scores
- Percentage complete
### Text fields
Use text fields when:
- You need to capture unique information that doesn't fit predefined categories.
- The data is highly variable.
- You need to provide context or details.
Text fields work well for:
- Additional context
- External reference IDs
- Contact information
- Brief notes or comments
- URLs or links
## Naming conventions for custom fields
Consistent naming conventions for custom fields make them easier to understand and use.
Good field names improve adoption and data quality.
### General guidelines
- Keep names concise but descriptive.
- Use clear, specific language that your organization understands.
- Be consistent with capitalization (title case is recommended).
- Avoid abbreviations unless they're widely understood.
- Include the unit of measure when applicable.
### Naming single-select and multi-select fields
Start with the category name, followed by a descriptor. For example:
- `Risk Level` instead of `Risk`
- `Customer Segment` instead of `Segment`
- `Development Phase` instead of `Phase`
- `Approval Status` instead of `Status`
### Naming number fields
Include the unit of measurement in the field name. For example:
- `Effort Points` instead of `Points`
- `Budget Estimate ($)` instead of `Budget`
- `Implementation Time (days)` instead of `Time`
- `Business Value Score` instead of `Value`
### Naming text fields
Clearly indicate what information should be entered. For example:
- `External Reference ID` instead of `Reference`
- `Implementation Notes` instead of `Notes`
- `Requirements Source` instead of `Source`
### Team-specific prefixes
If multiple teams use the same GitLab instance, consider adding team prefixes to avoid confusion:
- `DEV: Sprint Priority`
- `QA: Test Environment`
- `UX: Design Status`
- `PM: Market Segment`
This approach helps teams quickly identify which fields are relevant to their work.
|
https://docs.gitlab.com/user/work_items
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/work_items
|
[
"doc",
"user",
"work_items"
] |
_index.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Work items
|
Organize your team's work with GitLab work items. Track tasks, epics, issues, and objectives in a unified view to connect strategy with implementation and monitor progress.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Beta
{{< /details >}}
Work items are the core elements for planning and tracking work in GitLab.
Planning and tracking product development often requires breaking work into smaller, manageable parts
while maintaining connection to the bigger picture.
Work items are designed around this fundamental need, providing a unified way to represent units of
work at any level, from strategic initiatives to individual tasks.
The hierarchical nature of work items enables clear relationships between different levels of work,
helping teams understand how daily tasks contribute to larger goals and how strategic objectives break
down into actionable components.
This structure supports various planning frameworks like Scrum, Kanban, and portfolio management
approaches, while giving teams visibility into progress at every level.
With work items, you can organize your team's work using common structures that support various
planning frameworks including Scrum, Kanban, and portfolio management approaches.
## Work item types
GitLab supports the following work item types:
- [Issues](../project/issues/_index.md): Track tasks, features, and bugs.
- [Epics](../group/epics/_index.md): Manage large initiatives across multiple milestones and issues.
- [Tasks](../tasks.md): Track small units of work.
- [Objectives and key results](../okrs.md): Track strategic goals and their measurable outcomes.
- [Test cases](../../ci/test_cases/_index.md): Integrate test planning directly into your GitLab workflows.
## View all work items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/513092) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `work_item_planning_view`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
To organize work items (like issues, epics, and tasks) side-by-side, use the consolidated work items view.
This view helps you understand the full scope of work, and prioritize effectively.
When you enable this feature, it:
- Removes **Plan > Issues** and **Plan > Epics** from the left sidebar in groups and projects.
- Adds **Plan > Work items** to the left sidebar.
- Pins **Work items** on the left sidebar for projects and groups, if you had previously pinned
**Plan > Issues** or **Plan > Epics**.
Prerequisites:
- In the Free tier, your administrator must enable the [flag](../../administration/feature_flags/_index.md) named `namespace_level_work_items`.
- In the Premium and Ultimate tiers, your administrator must enable the [flag](../../administration/feature_flags/_index.md) named `work_item_epics`.
To view work items for a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Plan > Work items**.
### Filter work items
On the **Work items** page, you can use filters to narrow down the list:
1. At the top of the page, from the filter bar, select a filter, operator, and its value.
1. Optional. Add more filters.
1. Press <kbd>Enter</kbd> or select the search icon {{< icon name="search" >}}.
#### Available filters
<!-- When the feature flag work_item_planning_view is removed, move more information from
managing_issues.md#filter-the-list-of-issues here -->
These filters are available for work items:
- Assignee
- Operators: `is`, `is not one of`, `is one of`
- Author
- Operators: `is`, `is not one of`, `is one of`
- Confidential
- Values: `Yes`, `No`
- Label
- Operators: `is`, `is not one of`, `is one of`
- Milestone
- Operators: `is`, `is not`
- My reaction
- Operators: `is`, `is not`
- Search within
- Operators: `Titles`, `Descriptions`
- State
- Values: `Any`, `Open`, `Closed`
- Type
- Values: `Issue`, `Incident`, `Task`, `Epic`, `Objective`, `Key Result`, `Test case`
To access filters you've used recently, on the left side of the filter bar, select the
**Recent searches** ({{< icon name="history" >}}) dropdown list.
### Sort work items
<!-- When the feature flag work_item_planning_view is removed, move information from
sorting_issue_lists.md to this page and redirect here -->
Sort the list of work items by the following:
- Created date
- Updated date
- Start date
- Due date
- Title
To change the sorting criteria:
- On the right of the filter bar, select the **Created date** dropdown list.
To toggle the sorting order between ascending and descending:
- On the right of the filter bar, select **Sort direction** ({{< icon name="sort-lowest" >}}
or {{< icon name="sort-highest" >}}).
For more information about sorting logic, see
[Sorting and ordering issue lists](../project/issues/sorting_issue_lists.md).
## Work item Markdown reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
You can reference work items in GitLab Flavored Markdown fields with `[work_item:123]`.
For more information, see [GitLab-specific references](../markdown.md#gitlab-specific-references).
## Related topics
- [Linked issues](../project/issues/related_issues.md)
- [Linked epics](../group/epics/linked_epics.md)
- [Issue boards](../project/issue_board.md)
- [Labels](../project/labels.md)
- [Iterations](../group/iterations/_index.md)
- [Milestones](../project/milestones/_index.md)
- [Custom fields](custom_fields.md)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Organize your team's work with GitLab work items. Track tasks, epics,
issues, and objectives in a unified view to connect strategy with implementation
and monitor progress.
title: Work items
breadcrumbs:
- doc
- user
- work_items
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Beta
{{< /details >}}
Work items are the core elements for planning and tracking work in GitLab.
Planning and tracking product development often requires breaking work into smaller, manageable parts
while maintaining connection to the bigger picture.
Work items are designed around this fundamental need, providing a unified way to represent units of
work at any level, from strategic initiatives to individual tasks.
The hierarchical nature of work items enables clear relationships between different levels of work,
helping teams understand how daily tasks contribute to larger goals and how strategic objectives break
down into actionable components.
This structure supports various planning frameworks like Scrum, Kanban, and portfolio management
approaches, while giving teams visibility into progress at every level.
With work items, you can organize your team's work using common structures that support various
planning frameworks including Scrum, Kanban, and portfolio management approaches.
## Work item types
GitLab supports the following work item types:
- [Issues](../project/issues/_index.md): Track tasks, features, and bugs.
- [Epics](../group/epics/_index.md): Manage large initiatives across multiple milestones and issues.
- [Tasks](../tasks.md): Track small units of work.
- [Objectives and key results](../okrs.md): Track strategic goals and their measurable outcomes.
- [Test cases](../../ci/test_cases/_index.md): Integrate test planning directly into your GitLab workflows.
## View all work items
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/513092) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `work_item_planning_view`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
To organize work items (like issues, epics, and tasks) side-by-side, use the consolidated work items view.
This view helps you understand the full scope of work, and prioritize effectively.
When you enable this feature, it:
- Removes **Plan > Issues** and **Plan > Epics** from the left sidebar in groups and projects.
- Adds **Plan > Work items** to the left sidebar.
- Pins **Work items** on the left sidebar for projects and groups, if you had previously pinned
**Plan > Issues** or **Plan > Epics**.
Prerequisites:
- In the Free tier, your administrator must enable the [flag](../../administration/feature_flags/_index.md) named `namespace_level_work_items`.
- In the Premium and Ultimate tiers, your administrator must enable the [flag](../../administration/feature_flags/_index.md) named `work_item_epics`.
To view work items for a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Plan > Work items**.
### Filter work items
On the **Work items** page, you can use filters to narrow down the list:
1. At the top of the page, from the filter bar, select a filter, operator, and its value.
1. Optional. Add more filters.
1. Press <kbd>Enter</kbd> or select the search icon {{< icon name="search" >}}.
#### Available filters
<!-- When the feature flag work_item_planning_view is removed, move more information from
managing_issues.md#filter-the-list-of-issues here -->
These filters are available for work items:
- Assignee
- Operators: `is`, `is not one of`, `is one of`
- Author
- Operators: `is`, `is not one of`, `is one of`
- Confidential
- Values: `Yes`, `No`
- Label
- Operators: `is`, `is not one of`, `is one of`
- Milestone
- Operators: `is`, `is not`
- My reaction
- Operators: `is`, `is not`
- Search within
- Operators: `Titles`, `Descriptions`
- State
- Values: `Any`, `Open`, `Closed`
- Type
- Values: `Issue`, `Incident`, `Task`, `Epic`, `Objective`, `Key Result`, `Test case`
To access filters you've used recently, on the left side of the filter bar, select the
**Recent searches** ({{< icon name="history" >}}) dropdown list.
### Sort work items
<!-- When the feature flag work_item_planning_view is removed, move information from
sorting_issue_lists.md to this page and redirect here -->
Sort the list of work items by the following:
- Created date
- Updated date
- Start date
- Due date
- Title
To change the sorting criteria:
- On the right of the filter bar, select the **Created date** dropdown list.
To toggle the sorting order between ascending and descending:
- On the right of the filter bar, select **Sort direction** ({{< icon name="sort-lowest" >}}
or {{< icon name="sort-highest" >}}).
For more information about sorting logic, see
[Sorting and ordering issue lists](../project/issues/sorting_issue_lists.md).
## Work item Markdown reference
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/352861) in GitLab 18.1 [with a flag](../../administration/feature_flags/_index.md) named `extensible_reference_filters`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197052) in GitLab 18.2. Feature flag `extensible_reference_filters` removed.
{{< /history >}}
You can reference work items in GitLab Flavored Markdown fields with `[work_item:123]`.
For more information, see [GitLab-specific references](../markdown.md#gitlab-specific-references).
## Related topics
- [Linked issues](../project/issues/related_issues.md)
- [Linked epics](../group/epics/linked_epics.md)
- [Issue boards](../project/issue_board.md)
- [Labels](../project/labels.md)
- [Iterations](../group/iterations/_index.md)
- [Milestones](../project/milestones/_index.md)
- [Custom fields](custom_fields.md)
|
https://docs.gitlab.com/user/status
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/status.md
|
2025-08-13
|
doc/user/work_items
|
[
"doc",
"user",
"work_items"
] |
status.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Status
|
A specific step in a work item's workflow ('In progress', 'Done', 'Won't do') that belongs to a category and maps to a binary state (open/closed).
|
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
Work item status represents a specific step in a work item's workflow, such as **In progress**, **Done**, or **Won't do**.
Status provides more granular tracking than the traditional binary open/closed state system used in GitLab Free.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Configurable Status for Issues and Tasks - Complete Walkthrough (GitLab 18.2)](https://www.youtube.com/watch?v=oxN95MSo6UU).
<!-- Video published on 2025-07-11 -->
Use status to:
- Track work items through different stages of completion.
- Provide clearer visibility into work item progress.
- Replace the need for labels to manage work item lifecycles.
- Standardize workflows across teams and projects.
Status is available for tasks and issues.
For information on plans to add status to epics and other work item types, see [epic 5099](https://gitlab.com/groups/gitlab-org/-/epics/5099).
## Default statuses
GitLab provides default statuses to get you started with work item tracking.
These statuses cannot be modified.
The default statuses are:
- **To do**: Work item is ready to be started.
- **In progress**: Work item is being actively worked on.
- **Done**: Work item has been completed.
- **Won't do**: Work item will not be completed.
- **Duplicate**: Work item is a duplicate of another item.
## Status categories
Status categories are logical groupings that determine how a status affects a work item's state and icon. Each status belongs to one of five categories:
- **Triage**: For new or unprocessed work items.
- **To do**: For work items ready to be started.
- **In progress**: For work items being actively worked on.
- **Done**: For completed work items.
- **Canceled**: For work items that won't be completed.
Statuses in the **Done** and **Canceled** categories automatically set work items to closed state. All other categories maintain work items in open state.
<!-- vale gitlab_base.FutureTense = YES -->
## Lifecycles
A lifecycle is a collection of statuses that can be applied to a work item type. Lifecycles group statuses into meaningful workflows that can be reused consistently across work item types and namespaces.
Each lifecycle defines default transition statuses:
- **Default open status**: Applied when creating and reopening work items.
- **Default closed status**: Applied when closing work items.
- **Default duplicated status**: Applied when marking work items as duplicates, moved, or promoted.
## Custom statuses
Custom statuses are namespace-defined statuses that replace default statuses for all groups and projects in that namespace.
When you edit a lifecycle, custom statuses replace the default statuses for that namespace.
Custom statuses have the following limits:
- Maximum 70 statuses per namespace
- Maximum 30 statuses per lifecycle
## Configure custom statuses for a namespace
Configure custom statuses for top-level groups to make them available for work items in that group, its subgroups, and projects.
Prerequisites:
- You must have at least the Maintainer role for the group.
- This group must be at the top level.
To configure custom statuses:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Issues**.
1. In the **Statuses** section, select **Edit statuses**.
1. Add, edit, or reorder statuses for the namespace.
1. Select **Close**.
## Set status for a work item
Prerequisites:
- You must have at least the Planner role for the work item's project or group, be the author of the work item, or be assigned to the work item.
To set a status for a work item:
1. Go to an issue or task.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. Select the desired status.
1. Select any area outside the dropdown list.
The work item's status updates immediately.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: A specific step in a work item's workflow ('In progress', 'Done', 'Won't
do') that belongs to a category and maps to a binary state (open/closed).
title: Status
breadcrumbs:
- doc
- user
- work_items
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
<!-- Turn off the future tense test because of "won't do". -->
<!-- vale gitlab_base.FutureTense = NO -->
Work item status represents a specific step in a work item's workflow, such as **In progress**, **Done**, or **Won't do**.
Status provides more granular tracking than the traditional binary open/closed state system used in GitLab Free.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a video overview, see [Configurable Status for Issues and Tasks - Complete Walkthrough (GitLab 18.2)](https://www.youtube.com/watch?v=oxN95MSo6UU).
<!-- Video published on 2025-07-11 -->
Use status to:
- Track work items through different stages of completion.
- Provide clearer visibility into work item progress.
- Replace the need for labels to manage work item lifecycles.
- Standardize workflows across teams and projects.
Status is available for tasks and issues.
For information on plans to add status to epics and other work item types, see [epic 5099](https://gitlab.com/groups/gitlab-org/-/epics/5099).
## Default statuses
GitLab provides default statuses to get you started with work item tracking.
These statuses cannot be modified.
The default statuses are:
- **To do**: Work item is ready to be started.
- **In progress**: Work item is being actively worked on.
- **Done**: Work item has been completed.
- **Won't do**: Work item will not be completed.
- **Duplicate**: Work item is a duplicate of another item.
## Status categories
Status categories are logical groupings that determine how a status affects a work item's state and icon. Each status belongs to one of five categories:
- **Triage**: For new or unprocessed work items.
- **To do**: For work items ready to be started.
- **In progress**: For work items being actively worked on.
- **Done**: For completed work items.
- **Canceled**: For work items that won't be completed.
Statuses in the **Done** and **Canceled** categories automatically set work items to closed state. All other categories maintain work items in open state.
<!-- vale gitlab_base.FutureTense = YES -->
## Lifecycles
A lifecycle is a collection of statuses that can be applied to a work item type. Lifecycles group statuses into meaningful workflows that can be reused consistently across work item types and namespaces.
Each lifecycle defines default transition statuses:
- **Default open status**: Applied when creating and reopening work items.
- **Default closed status**: Applied when closing work items.
- **Default duplicated status**: Applied when marking work items as duplicates, moved, or promoted.
## Custom statuses
Custom statuses are namespace-defined statuses that replace default statuses for all groups and projects in that namespace.
When you edit a lifecycle, custom statuses replace the default statuses for that namespace.
Custom statuses have the following limits:
- Maximum 70 statuses per namespace
- Maximum 30 statuses per lifecycle
## Configure custom statuses for a namespace
Configure custom statuses for top-level groups to make them available for work items in that group, its subgroups, and projects.
Prerequisites:
- You must have at least the Maintainer role for the group.
- This group must be at the top level.
To configure custom statuses:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > Issues**.
1. In the **Statuses** section, select **Edit statuses**.
1. Add, edit, or reorder statuses for the namespace.
1. Select **Close**.
## Set status for a work item
Prerequisites:
- You must have at least the Planner role for the work item's project or group, be the author of the work item, or be assigned to the work item.
To set a status for a work item:
1. Go to an issue or task.
1. On the right sidebar, in the **Status** section, select **Edit**.
1. Select the desired status.
1. Select any area outside the dropdown list.
The work item's status updates immediately.
|
https://docs.gitlab.com/user/linked_items
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/linked_items.md
|
2025-08-13
|
doc/user/work_items
|
[
"doc",
"user",
"work_items"
] |
linked_items.md
|
Plan
|
Product Planning
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Linked items
|
Connect and track relationships between work items in GitLab. Manage dependencies, link strategic goals to execution, and coordinate cross-functional initiatives.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Linked items create bi-directional relationships between work items, helping you visualize and manage dependencies across your entire workflow.
With linked items, you can connect various work items including issues, epics, tasks, and objectives to show relationships between them.
These connections help everyone understand how individual pieces of work relate to each other and to larger strategic initiatives.
## Ways to use linked items
You can use linked items to solve several planning and coordination challenges.
The following examples show how linked items help teams work together more effectively.
### Track dependencies
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
Clearly identify work that blocks or is blocked by other items.
When you link items with a blocking relationship:
- Teams can immediately see what other work they depend on.
- Status updates flow automatically between linked items.
- Warnings appear when closing items that have open blockers.
- Teams can avoid delays by addressing dependencies proactively.
This visibility helps coordinate work across teams and reduces bottlenecks.
### Connect strategic goals with implementation details
Use linked items to connect high-level planning with day-to-day execution.
When you link strategic objectives to tactical tasks:
- Teams understand how their work contributes to larger goals.
- Stakeholders can trace progress from strategy to implementation.
- Everyone gains visibility into how individual efforts support the broader vision.
- Changes in strategy can be quickly traced to affected implementation work.
This connection between levels creates alignment and purpose across the organization.
### Organize cross-functional initiatives
Link related work across different teams and projects to coordinate complex initiatives.
When you use linked items for cross-functional work:
- Each team can work in their own area while maintaining connections to related work.
- Dependencies between specialized teams become visible.
- Status updates flow automatically between related items.
- Teams can coordinate their efforts without constant meetings.
This coordination helps break down silos and ensures all aspects of the initiative stay in sync.
## Types of linked items
GitLab supports linking various types of work items:
- [Issues](../project/issues/related_issues.md) help you track tasks, bugs, and features and can be
linked to show dependencies between discrete pieces of work.
- [Epics](../group/epics/linked_epics.md) let you manage cross-functional initiatives, show
dependencies, and connect strategic planning to execution across multiple teams or projects.
Available in the Ultimate tier.
- [Tasks](../tasks.md#linked-items-in-tasks) provide lightweight tracking for smaller units of work
and can be linked to other items to show relationships or dependencies in a project.
- [Objectives and key results](../okrs.md#linked-items-in-okrs) help connect strategic goals with
execution details, ensuring that day-to-day work remains aligned with higher-level organizational
priorities.
- [Incidents](../../operations/incident_management/incidents.md) represent service disruptions or
outages that need urgent restoration and can be linked to related work items for better tracking
of operational issues and their impact on planned work.
- [Test cases](../../ci/test_cases/_index.md) integrate test planning directly into your GitLab
workflows, letting teams document testing scenarios and track requirements in the same platform
where they manage code. Available in the Ultimate tier.
## Relationship types
When linking items, you can specify the type of relationship:
- **Relates to**: Indicates a general relationship between items.
- **Blocks**: Shows that an item prevents progress on another item.
- **Is blocked by**: Shows that an item cannot proceed until another item is resolved.
## Common tasks with linked items
Learn how to create and manage relationships between your work items with these common procedures.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the projects or groups of both items.
The general process for adding linked items is similar across all work item types:
1. Go to the work item you want to modify.
1. At the bottom of the description, find the **Linked items** section of the work item.
1. Select **Add**.
1. Select the relationship type: **relates to**, **blocks**, or **is blocked by**.
1. Enter the reference for the item to link. You can:
- Enter `#` or `&` (depending on item type) followed by the item's number.
- Enter text to search for the item by title.
- Paste the full URL of the item.
1. Select **Add** to confirm.
Alternatively, you can add linked items using [quick actions](../project/quick_actions.md):
- `/relate`
- `/blocks`
- `/blocked_by`
For detailed information specific to each work item type, see the relevant documentation:
- [Linked issues](../project/issues/related_issues.md#add-a-linked-issue)
- [Linked epics](../group/epics/linked_epics.md#add-a-linked-item)
- [Linked tasks](../tasks.md#linked-items-in-tasks)
- [Linked OKRs](../okrs.md#linked-items-in-okrs)
### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the projects or groups of both items.
To remove a linked item:
1. Go to the work item you want to modify.
1. At the bottom of the description, find the **Linked items** section of the work item.
1. For each linked item, select **Remove** ({{< icon name="close" >}}).
The bi-directional relationship is removed from both items.
Alternatively, you can remove a linked item using the `/unlink` [quick action](../project/quick_actions.md).
## Related topics
- [Work items](_index.md)
- [Issues](../project/issues/_index.md)
- [Epics](../group/epics/_index.md)
- [Tasks](../tasks.md)
- [Objectives and key results](../okrs.md)
|
---
stage: Plan
group: Product Planning
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Connect and track relationships between work items in GitLab. Manage
dependencies, link strategic goals to execution, and coordinate cross-functional
initiatives.
title: Linked items
breadcrumbs:
- doc
- user
- work_items
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Linked items create bi-directional relationships between work items, helping you visualize and manage dependencies across your entire workflow.
With linked items, you can connect various work items including issues, epics, tasks, and objectives to show relationships between them.
These connections help everyone understand how individual pieces of work relate to each other and to larger strategic initiatives.
## Ways to use linked items
You can use linked items to solve several planning and coordination challenges.
The following examples show how linked items help teams work together more effectively.
### Track dependencies
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
Clearly identify work that blocks or is blocked by other items.
When you link items with a blocking relationship:
- Teams can immediately see what other work they depend on.
- Status updates flow automatically between linked items.
- Warnings appear when closing items that have open blockers.
- Teams can avoid delays by addressing dependencies proactively.
This visibility helps coordinate work across teams and reduces bottlenecks.
### Connect strategic goals with implementation details
Use linked items to connect high-level planning with day-to-day execution.
When you link strategic objectives to tactical tasks:
- Teams understand how their work contributes to larger goals.
- Stakeholders can trace progress from strategy to implementation.
- Everyone gains visibility into how individual efforts support the broader vision.
- Changes in strategy can be quickly traced to affected implementation work.
This connection between levels creates alignment and purpose across the organization.
### Organize cross-functional initiatives
Link related work across different teams and projects to coordinate complex initiatives.
When you use linked items for cross-functional work:
- Each team can work in their own area while maintaining connections to related work.
- Dependencies between specialized teams become visible.
- Status updates flow automatically between related items.
- Teams can coordinate their efforts without constant meetings.
This coordination helps break down silos and ensures all aspects of the initiative stay in sync.
## Types of linked items
GitLab supports linking various types of work items:
- [Issues](../project/issues/related_issues.md) help you track tasks, bugs, and features and can be
linked to show dependencies between discrete pieces of work.
- [Epics](../group/epics/linked_epics.md) let you manage cross-functional initiatives, show
dependencies, and connect strategic planning to execution across multiple teams or projects.
Available in the Ultimate tier.
- [Tasks](../tasks.md#linked-items-in-tasks) provide lightweight tracking for smaller units of work
and can be linked to other items to show relationships or dependencies in a project.
- [Objectives and key results](../okrs.md#linked-items-in-okrs) help connect strategic goals with
execution details, ensuring that day-to-day work remains aligned with higher-level organizational
priorities.
- [Incidents](../../operations/incident_management/incidents.md) represent service disruptions or
outages that need urgent restoration and can be linked to related work items for better tracking
of operational issues and their impact on planned work.
- [Test cases](../../ci/test_cases/_index.md) integrate test planning directly into your GitLab
workflows, letting teams document testing scenarios and track requirements in the same platform
where they manage code. Available in the Ultimate tier.
## Relationship types
When linking items, you can specify the type of relationship:
- **Relates to**: Indicates a general relationship between items.
- **Blocks**: Shows that an item prevents progress on another item.
- **Is blocked by**: Shows that an item cannot proceed until another item is resolved.
## Common tasks with linked items
Learn how to create and manage relationships between your work items with these common procedures.
### Add a linked item
Prerequisites:
- You must have at least the Guest role for the projects or groups of both items.
The general process for adding linked items is similar across all work item types:
1. Go to the work item you want to modify.
1. At the bottom of the description, find the **Linked items** section of the work item.
1. Select **Add**.
1. Select the relationship type: **relates to**, **blocks**, or **is blocked by**.
1. Enter the reference for the item to link. You can:
- Enter `#` or `&` (depending on item type) followed by the item's number.
- Enter text to search for the item by title.
- Paste the full URL of the item.
1. Select **Add** to confirm.
Alternatively, you can add linked items using [quick actions](../project/quick_actions.md):
- `/relate`
- `/blocks`
- `/blocked_by`
For detailed information specific to each work item type, see the relevant documentation:
- [Linked issues](../project/issues/related_issues.md#add-a-linked-issue)
- [Linked epics](../group/epics/linked_epics.md#add-a-linked-item)
- [Linked tasks](../tasks.md#linked-items-in-tasks)
- [Linked OKRs](../okrs.md#linked-items-in-okrs)
### Remove a linked item
Prerequisites:
- You must have at least the Guest role for the projects or groups of both items.
To remove a linked item:
1. Go to the work item you want to modify.
1. At the bottom of the description, find the **Linked items** section of the work item.
1. For each linked item, select **Remove** ({{< icon name="close" >}}).
The bi-directional relationship is removed from both items.
Alternatively, you can remove a linked item using the `/unlink` [quick action](../project/quick_actions.md).
## Related topics
- [Work items](_index.md)
- [Issues](../project/issues/_index.md)
- [Epics](../group/epics/_index.md)
- [Tasks](../tasks.md)
- [Objectives and key results](../okrs.md)
|
https://docs.gitlab.com/user/organization
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/organization
|
[
"doc",
"user",
"organization"
] |
_index.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Organization
|
Namespace hierarchy.
|
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/409913) in GitLab 16.1 [with a flag](../../administration/feature_flags/_index.md) named `ui_for_organizations`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `ui_for_organizations`.
On GitLab.com and GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
{{< alert type="disclaimer" />}}
{{< alert type="note" >}}
Organization is in development.
{{< /alert >}}
Organization will be above the [top-level namespaces](../namespace/_index.md) for you to manage
everything you do as a GitLab administrator, including:
- Defining and applying settings to all of your groups, subgroups, and projects.
- Aggregating data from all your groups, subgroups, and projects.
For more information about the state of organization development,
see [epic 9265](https://gitlab.com/groups/gitlab-org/-/epics/9265).
## View organizations
To view the organizations you have access to:
- On the left sidebar, select **Organizations**.
## Create an organization
{{< alert type="note" >}}
Support for only private organizations is proposed for [cells 1.0](https://gitlab.com/groups/gitlab-org/-/epics/12383).
{{< /alert >}}
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New organization**.
1. In the **Organization name** text box, enter a name for the organization.
1. In the **Organization URL** text box, enter a path for the organization.
1. In the **Organization description** text box, enter a description for the organization. Supports a [limited subset of Markdown](#supported-markdown-for-organization-description).
1. In the **Organization avatar** field, select **Upload** or drag and drop an avatar.
1. Select **Create organization**.
## Edit an organization's name
1. On the left sidebar, select **Organizations** and find the organization you want to edit.
1. Select **Settings > General**.
1. In the **Organization name** text box, edit the name.
1. In the **Organization description** text box, edit the description. Supports a [limited subset of Markdown](#supported-markdown-for-organization-description).
1. In the **Organization avatar** field, if an avatar is:
- Selected, select **Remove avatar** to remove.
- Not selected, select **Upload** or drag and drop an avatar.
1. Select **Save changes**.
## Change an organization's URL
1. On the left sidebar, select **Organizations** and find the organization whose URL you want to change.
1. Select **Settings > General**.
1. Expand the **Advanced** section.
1. In the **Organization URL** text box, edit the URL.
1. Select **Change organization URL**.
## View an organization's visibility level
{{< alert type="note" >}}
Support for only private organizations is proposed for [cells 1.0](https://gitlab.com/groups/gitlab-org/-/epics/12383).
{{< /alert >}}
1. On the left sidebar, select **Organizations** and find your organization.
1. Select **Settings > General**.
1. Expand the **Visibility** section.
## Switch organizations
{{< alert type="note" >}}
Switching between organizations is not supported in cells 1.0.
Support for switching organizations is proposed for [cells 1.5](https://gitlab.com/groups/gitlab-org/-/epics/12505).
{{< /alert >}}
To switch organizations:
- On the left sidebar, in the upper corner, from the **Current organization** dropdown list select the organization you want to switch to.
## Manage groups and projects
1. On the left sidebar, select **Organizations** and find the organization you want to manage.
1. Select **Manage > Groups and projects**.
1. Optional. Filter the results:
- To search for specific groups or projects, in the search box enter your search term (minimum three characters).
- To view only groups or projects, from the **Display** dropdown list select an option.
1. Optional. To sort the results by name, date created, or date updated, from the dropdown list select an option. Then select ascending ({{< icon name="sort-lowest" >}}) or descending ({{< icon name="sort-highest" >}}) order.
## Create a group in an organization
1. On the left sidebar, select **Organizations** and find the organization you want to create a group in.
1. Select **Manage > Groups and projects**.
1. Select **New group**.
1. In the **Group name** text box, enter the name of the group. For a list of words that cannot be used as group names, see
[reserved names](../reserved_names.md).
1. In the **Group URL** text box, enter the path for the group used for the [namespace](../namespace/_index.md).
1. Select the [**Visibility level**](../public_access.md) of the group.
1. Select **Create group**.
## View users
1. On the left sidebar, select **Organizations** and find the organization you want to view.
1. Select **Manage > Users**.
## Change a user's role
Prerequisites:
- You must have the Owner role for the organization.
To change a user's role:
1. On the left sidebar, select **Organizations** and find the organization you want to manage.
1. Select **Manage > Users**.
1. Find the user whose role you want to update.
1. From the **Organization role** dropdown list, select a role.
{{< alert type="note" >}}
If you cannot select from the **Organization role** dropdown list, this user is the organization's only Owner. To change this user's role, first assign the Owner role to another user.
{{< /alert >}}
## Supported Markdown for Organization description
The Organization description field supports a limited subset of [GitLab Flavored Markdown](../markdown.md), including:
- [Emphasis](../markdown.md#emphasis)
- [Links](../markdown.md#links)
- [Superscripts / Subscripts](../markdown.md#superscripts-and-subscripts)
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Organization
description: Namespace hierarchy.
breadcrumbs:
- doc
- user
- organization
---
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/409913) in GitLab 16.1 [with a flag](../../administration/feature_flags/_index.md) named `ui_for_organizations`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `ui_for_organizations`.
On GitLab.com and GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
{{< alert type="disclaimer" />}}
{{< alert type="note" >}}
Organization is in development.
{{< /alert >}}
Organization will be above the [top-level namespaces](../namespace/_index.md) for you to manage
everything you do as a GitLab administrator, including:
- Defining and applying settings to all of your groups, subgroups, and projects.
- Aggregating data from all your groups, subgroups, and projects.
For more information about the state of organization development,
see [epic 9265](https://gitlab.com/groups/gitlab-org/-/epics/9265).
## View organizations
To view the organizations you have access to:
- On the left sidebar, select **Organizations**.
## Create an organization
{{< alert type="note" >}}
Support for only private organizations is proposed for [cells 1.0](https://gitlab.com/groups/gitlab-org/-/epics/12383).
{{< /alert >}}
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New organization**.
1. In the **Organization name** text box, enter a name for the organization.
1. In the **Organization URL** text box, enter a path for the organization.
1. In the **Organization description** text box, enter a description for the organization. Supports a [limited subset of Markdown](#supported-markdown-for-organization-description).
1. In the **Organization avatar** field, select **Upload** or drag and drop an avatar.
1. Select **Create organization**.
## Edit an organization's name
1. On the left sidebar, select **Organizations** and find the organization you want to edit.
1. Select **Settings > General**.
1. In the **Organization name** text box, edit the name.
1. In the **Organization description** text box, edit the description. Supports a [limited subset of Markdown](#supported-markdown-for-organization-description).
1. In the **Organization avatar** field, if an avatar is:
- Selected, select **Remove avatar** to remove.
- Not selected, select **Upload** or drag and drop an avatar.
1. Select **Save changes**.
## Change an organization's URL
1. On the left sidebar, select **Organizations** and find the organization whose URL you want to change.
1. Select **Settings > General**.
1. Expand the **Advanced** section.
1. In the **Organization URL** text box, edit the URL.
1. Select **Change organization URL**.
## View an organization's visibility level
{{< alert type="note" >}}
Support for only private organizations is proposed for [cells 1.0](https://gitlab.com/groups/gitlab-org/-/epics/12383).
{{< /alert >}}
1. On the left sidebar, select **Organizations** and find your organization.
1. Select **Settings > General**.
1. Expand the **Visibility** section.
## Switch organizations
{{< alert type="note" >}}
Switching between organizations is not supported in cells 1.0.
Support for switching organizations is proposed for [cells 1.5](https://gitlab.com/groups/gitlab-org/-/epics/12505).
{{< /alert >}}
To switch organizations:
- On the left sidebar, in the upper corner, from the **Current organization** dropdown list select the organization you want to switch to.
## Manage groups and projects
1. On the left sidebar, select **Organizations** and find the organization you want to manage.
1. Select **Manage > Groups and projects**.
1. Optional. Filter the results:
- To search for specific groups or projects, in the search box enter your search term (minimum three characters).
- To view only groups or projects, from the **Display** dropdown list select an option.
1. Optional. To sort the results by name, date created, or date updated, from the dropdown list select an option. Then select ascending ({{< icon name="sort-lowest" >}}) or descending ({{< icon name="sort-highest" >}}) order.
## Create a group in an organization
1. On the left sidebar, select **Organizations** and find the organization you want to create a group in.
1. Select **Manage > Groups and projects**.
1. Select **New group**.
1. In the **Group name** text box, enter the name of the group. For a list of words that cannot be used as group names, see
[reserved names](../reserved_names.md).
1. In the **Group URL** text box, enter the path for the group used for the [namespace](../namespace/_index.md).
1. Select the [**Visibility level**](../public_access.md) of the group.
1. Select **Create group**.
## View users
1. On the left sidebar, select **Organizations** and find the organization you want to view.
1. Select **Manage > Users**.
## Change a user's role
Prerequisites:
- You must have the Owner role for the organization.
To change a user's role:
1. On the left sidebar, select **Organizations** and find the organization you want to manage.
1. Select **Manage > Users**.
1. Find the user whose role you want to update.
1. From the **Organization role** dropdown list, select a role.
{{< alert type="note" >}}
If you cannot select from the **Organization role** dropdown list, this user is the organization's only Owner. To change this user's role, first assign the Owner role to another user.
{{< /alert >}}
## Supported Markdown for Organization description
The Organization description field supports a limited subset of [GitLab Flavored Markdown](../markdown.md), including:
- [Emphasis](../markdown.md#emphasis)
- [Links](../markdown.md#links)
- [Superscripts / Subscripts](../markdown.md#superscripts-and-subscripts)
|
https://docs.gitlab.com/user/get_started
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
_index.md
|
none
|
none
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started with GitLab
| null |
If you're new to GitLab, get started learning about how GitLab works.
{{< cards >}}
- [Get started with Git](../../topics/git/get_started.md)
- [Get started with GitLab Duo](getting_started_gitlab_duo.md)
- [Get started organizing work with projects](get_started_projects.md)
- [Get started planning work](get_started_planning_work.md)
- [Get started managing code](get_started_managing_code.md)
- [Get started with GitLab CI/CD](../../ci/_index.md)
- [Get started with GitLab Runner](get_started_runner.md)
- [Get started securing your application](../application_security/get-started-security.md)
- [Get started deploying and releasing your application](get_started_deploy_release.md)
- [Get started managing your infrastructure](get_started_managing_infrastructure.md)
- [Get started with monitoring your application in GitLab](get_started_monitoring.md)
- [Get started extending GitLab](../../api/get_started/get_started_extending.md)
{{< /cards >}}
|
---
stage: none
group: none
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Get started with GitLab
breadcrumbs:
- doc
- user
- get_started
---
If you're new to GitLab, get started learning about how GitLab works.
{{< cards >}}
- [Get started with Git](../../topics/git/get_started.md)
- [Get started with GitLab Duo](getting_started_gitlab_duo.md)
- [Get started organizing work with projects](get_started_projects.md)
- [Get started planning work](get_started_planning_work.md)
- [Get started managing code](get_started_managing_code.md)
- [Get started with GitLab CI/CD](../../ci/_index.md)
- [Get started with GitLab Runner](get_started_runner.md)
- [Get started securing your application](../application_security/get-started-security.md)
- [Get started deploying and releasing your application](get_started_deploy_release.md)
- [Get started managing your infrastructure](get_started_managing_infrastructure.md)
- [Get started with monitoring your application in GitLab](get_started_monitoring.md)
- [Get started extending GitLab](../../api/get_started/get_started_extending.md)
{{< /cards >}}
|
https://docs.gitlab.com/user/get_started_deploy_release
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_deploy_release.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_deploy_release.md
|
none
|
none
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started deploying and releasing your application
|
Deploy and manage dependencies.
|
Start with previewing your application, and end with deploying
it to production in front of your users. Manage containers and packages, use
continuous integration to deliver your application, and use feature flags
and incremental rollouts to release the application in a controlled manner.
These processes are part of a larger workflow:

## Step 1: Store and access your project's artifacts
Use packages and registries to store and distribute your project's dependencies,
libraries, and other artifacts securely in GitLab.
The package registry supports various package formats, including Maven,
NPM, NuGet, PyPI, and Conan. It provides a centralized location to store
and distribute packages across your projects. Integrate the package registry
with GitLab CI/CD pipelines to automate package publishing and ensure smooth
development and deployment workflows.
The container registry serves as a private registry for Docker images.
Use it to store, manage, and distribute Docker and OCI images in your organization, or publicly.
Integrate the container registry with GitLab CI/CD to build, test, and deploy containerized
applications.
For more information, see:
- [Packages and registries](../packages/_index.md)
## Step 2: Deploy your application across environments
Use environments to manage and track your application's
deployments across different stages (for example, development, staging,
and production). Each environment can have its own unique configuration,
variables, and deployment settings.
After you set up your environments, you can monitor them. While you
primarily monitor your deployments in the location where you deployed them
(for example, in AWS), GitLab also provides dashboards.
You can monitor your live cluster state in the GitLab UI if you deploy to Kubernetes.
You can also create temporary environments as part of merge requests.
Team members can then review and test changes before committing changes to
the main branch. These temporary environments are called review apps.
For more information, see:
- [Environments](../../ci/environments/_index.md)
- [Deploy to AWS](../../ci/cloud_deployment/_index.md)
- [Deploy to Kubernetes](../clusters/agent/_index.md)
- [Dashboard for Kubernetes](../../ci/environments/kubernetes_dashboard.md)
- [Environments Dashboard](../../ci/environments/environments_dashboard.md)
- [Operations Dashboard](../operations_dashboard/_index.md)
- [Review apps](../../ci/review_apps/_index.md)
## Step 3: Stay compliant with continuous delivery features
To maintain the stability and integrity of your production systems by
preventing accidental or unauthorized deployments, use protected environments.
They provide a way to secure and control deployments to critical environments like production.
By defining protected environments, you can restrict access to specific users or roles,
ensuring that only those who are authorized can deploy changes.
Deployment safety is part of the continuous delivery pipeline and helps ensure the reliability
and security of your deployments. GitLab provides built-in safety mechanisms,
like automatic rollbacks in case of deployment failures, and the ability to define custom
health checks to verify the success of a deployment.
Deployment approvals add an extra layer of control and collaboration to your deployment process.
You can define approval rules that require designated approvers to review and approve deployments
before they can proceed. Approvals can be set up based on different criteria, like the environment,
the branch, or the specific changes being deployed.
For more information, see:
- [Protected environments](../../ci/environments/protected_environments.md)
- [Deployment safety](../../ci/environments/deployment_safety.md)
- [Deployment approvals](../../ci/environments/deployment_approvals.md)
## Step 4: Ship release artifacts to the public or internal users
Use releases to package and distribute your application to end users,
including release notes, binary assets, and other relevant information.
You can create a release from any branch.
Integrate releases with environments to automatically
create a release whenever you deploy to a specific environment (for example, production).
You can get notified each time a release occurs, and specify
permissions if you want to control who is allowed to create, update, and delete releases.
For more information, see:
- [Releases](../project/releases/_index.md)
## Step 5: Roll out changes safely
To gradually deploy your application to a subset of users or servers, use incremental rollouts.
You can monitor and assess the impact on a smaller scale before rolling out to the entire user base.
Feature flags in GitLab provide a way to enable or disable specific features in your application
without requiring a full deployment. You can use feature flags to safely test new features,
perform A/B testing, or gradually introduce changes to your users.
By using feature flags, you can decouple the deployment of code from the release of features,
giving you more control over the user experience and reducing the risk of introducing bugs
or unexpected behavior.
For more information, see:
- [Incremental rollouts](../../ci/environments/incremental_rollouts.md)
- [Feature flags](../../operations/feature_flags.md)
## Step 6: Deploy a static website
With GitLab Pages, you can showcase your project's documentation, demos, or marketing pages.
Create static websites directly from a repository in GitLab. GitLab Pages supports
static site generators like Jekyll, Hugo, and Middleman, as well as plain HTML,
CSS, and JavaScript. To get started, create a new project or use an existing one,
configure the GitLab Pages settings, and push your content to the repository.
GitLab automatically builds and deploys your website whenever you push changes to the designated branch.
For more information, see:
- [GitLab Pages](../project/pages/_index.md)
## Step 7: Go opinionated with Auto Deploy
Auto Deploy is an opinionated CI template that, among other things, takes care of building
and deploying your application. You can fine-tune the Auto DevOps pipeline with environment variables.
For more information, see:
- [Auto Deploy](../../topics/autodevops/stages.md#auto-deploy)
|
---
stage: none
group: none
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Deploy and manage dependencies.
title: Get started deploying and releasing your application
breadcrumbs:
- doc
- user
- get_started
---
Start with previewing your application, and end with deploying
it to production in front of your users. Manage containers and packages, use
continuous integration to deliver your application, and use feature flags
and incremental rollouts to release the application in a controlled manner.
These processes are part of a larger workflow:

## Step 1: Store and access your project's artifacts
Use packages and registries to store and distribute your project's dependencies,
libraries, and other artifacts securely in GitLab.
The package registry supports various package formats, including Maven,
NPM, NuGet, PyPI, and Conan. It provides a centralized location to store
and distribute packages across your projects. Integrate the package registry
with GitLab CI/CD pipelines to automate package publishing and ensure smooth
development and deployment workflows.
The container registry serves as a private registry for Docker images.
Use it to store, manage, and distribute Docker and OCI images in your organization, or publicly.
Integrate the container registry with GitLab CI/CD to build, test, and deploy containerized
applications.
For more information, see:
- [Packages and registries](../packages/_index.md)
## Step 2: Deploy your application across environments
Use environments to manage and track your application's
deployments across different stages (for example, development, staging,
and production). Each environment can have its own unique configuration,
variables, and deployment settings.
After you set up your environments, you can monitor them. While you
primarily monitor your deployments in the location where you deployed them
(for example, in AWS), GitLab also provides dashboards.
You can monitor your live cluster state in the GitLab UI if you deploy to Kubernetes.
You can also create temporary environments as part of merge requests.
Team members can then review and test changes before committing changes to
the main branch. These temporary environments are called review apps.
For more information, see:
- [Environments](../../ci/environments/_index.md)
- [Deploy to AWS](../../ci/cloud_deployment/_index.md)
- [Deploy to Kubernetes](../clusters/agent/_index.md)
- [Dashboard for Kubernetes](../../ci/environments/kubernetes_dashboard.md)
- [Environments Dashboard](../../ci/environments/environments_dashboard.md)
- [Operations Dashboard](../operations_dashboard/_index.md)
- [Review apps](../../ci/review_apps/_index.md)
## Step 3: Stay compliant with continuous delivery features
To maintain the stability and integrity of your production systems by
preventing accidental or unauthorized deployments, use protected environments.
They provide a way to secure and control deployments to critical environments like production.
By defining protected environments, you can restrict access to specific users or roles,
ensuring that only those who are authorized can deploy changes.
Deployment safety is part of the continuous delivery pipeline and helps ensure the reliability
and security of your deployments. GitLab provides built-in safety mechanisms,
like automatic rollbacks in case of deployment failures, and the ability to define custom
health checks to verify the success of a deployment.
Deployment approvals add an extra layer of control and collaboration to your deployment process.
You can define approval rules that require designated approvers to review and approve deployments
before they can proceed. Approvals can be set up based on different criteria, like the environment,
the branch, or the specific changes being deployed.
For more information, see:
- [Protected environments](../../ci/environments/protected_environments.md)
- [Deployment safety](../../ci/environments/deployment_safety.md)
- [Deployment approvals](../../ci/environments/deployment_approvals.md)
## Step 4: Ship release artifacts to the public or internal users
Use releases to package and distribute your application to end users,
including release notes, binary assets, and other relevant information.
You can create a release from any branch.
Integrate releases with environments to automatically
create a release whenever you deploy to a specific environment (for example, production).
You can get notified each time a release occurs, and specify
permissions if you want to control who is allowed to create, update, and delete releases.
For more information, see:
- [Releases](../project/releases/_index.md)
## Step 5: Roll out changes safely
To gradually deploy your application to a subset of users or servers, use incremental rollouts.
You can monitor and assess the impact on a smaller scale before rolling out to the entire user base.
Feature flags in GitLab provide a way to enable or disable specific features in your application
without requiring a full deployment. You can use feature flags to safely test new features,
perform A/B testing, or gradually introduce changes to your users.
By using feature flags, you can decouple the deployment of code from the release of features,
giving you more control over the user experience and reducing the risk of introducing bugs
or unexpected behavior.
For more information, see:
- [Incremental rollouts](../../ci/environments/incremental_rollouts.md)
- [Feature flags](../../operations/feature_flags.md)
## Step 6: Deploy a static website
With GitLab Pages, you can showcase your project's documentation, demos, or marketing pages.
Create static websites directly from a repository in GitLab. GitLab Pages supports
static site generators like Jekyll, Hugo, and Middleman, as well as plain HTML,
CSS, and JavaScript. To get started, create a new project or use an existing one,
configure the GitLab Pages settings, and push your content to the repository.
GitLab automatically builds and deploys your website whenever you push changes to the designated branch.
For more information, see:
- [GitLab Pages](../project/pages/_index.md)
## Step 7: Go opinionated with Auto Deploy
Auto Deploy is an opinionated CI template that, among other things, takes care of building
and deploying your application. You can fine-tune the Auto DevOps pipeline with environment variables.
For more information, see:
- [Auto Deploy](../../topics/autodevops/stages.md#auto-deploy)
|
https://docs.gitlab.com/user/get_started_monitoring
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_monitoring.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_monitoring.md
|
Monitor
|
Platform Insights
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started with monitoring your application in GitLab
|
Monitor your app and respond to incidents.
|
Monitoring is a crucial part of maintaining and optimizing your applications.
GitLab observability features help you track errors, analyze application performance, and respond to incidents.
These capabilities are part of the larger DevOps workflow:

All of these features can be used independently. For example, you can use
tracing or incidents without using error tracking. However, for the best experience,
use all of these features together.
## Step 1: Determine which project to use
You can use the same project for monitoring that you already use to store your application's source code.
For large applications with multiple services and repositories, you should create a dedicated project
to centralize all telemetry data collected from the different components of the system.
This approach offers several benefits:
- Data is accessible to all development and operations teams, which facilitates collaboration.
- Data from different sources can be queried and correlated in one place, which accelerates investigations.
- It provides a single source of truth for all observability data, making it easier to maintain and update.
- It simplifies access management for administrators by centralizing user permissions in a single project.
To enable observability features, you need administrator or the Owner role for the project.
For more information, see:
- [Create a project](../project/_index.md)
## Step 2: Track application errors with error tracking
Error tracking helps you identify, prioritize, and debug errors in your application.
Errors generated by your application are collected by the Sentry SDK,
then stored on either GitLab or Sentry back ends.
For more information, see:
- [How error tracking works](../../operations/error_tracking.md#how-error-tracking-works)
## Step 3: Manage alerts and incidents
Set up incident management features to troubleshoot issues and resolve incidents collaboratively.
For more information, see:
- [Incident Management](../../operations/incident_management/_index.md)
## Step 4: Analyze and improve
Use the data and insights gathered to continuously improve your application and the monitoring process:
1. Create insight dashboards to analyze issues
or incidents created and closed, and assess the performance of your incident response.
1. Create executable runbooks to help engineers on-call remediate incidents autonomously.
1. Regularly review your monitoring setup and adjust sampling thresholds, or add new metrics as your application evolves.
1. Conduct post-incident reviews to identify areas for improvement in both your application and your incident response process.
1. Use the insights gained from monitoring to inform your development priorities and technical debt reduction efforts.
For more information, see:
- [Insight dashboards](../project/insights/_index.md)
- [Executable runbooks](../project/clusters/runbooks/_index.md)
|
---
stage: Monitor
group: Platform Insights
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Monitor your app and respond to incidents.
title: Get started with monitoring your application in GitLab
breadcrumbs:
- doc
- user
- get_started
---
Monitoring is a crucial part of maintaining and optimizing your applications.
GitLab observability features help you track errors, analyze application performance, and respond to incidents.
These capabilities are part of the larger DevOps workflow:

All of these features can be used independently. For example, you can use
tracing or incidents without using error tracking. However, for the best experience,
use all of these features together.
## Step 1: Determine which project to use
You can use the same project for monitoring that you already use to store your application's source code.
For large applications with multiple services and repositories, you should create a dedicated project
to centralize all telemetry data collected from the different components of the system.
This approach offers several benefits:
- Data is accessible to all development and operations teams, which facilitates collaboration.
- Data from different sources can be queried and correlated in one place, which accelerates investigations.
- It provides a single source of truth for all observability data, making it easier to maintain and update.
- It simplifies access management for administrators by centralizing user permissions in a single project.
To enable observability features, you need administrator or the Owner role for the project.
For more information, see:
- [Create a project](../project/_index.md)
## Step 2: Track application errors with error tracking
Error tracking helps you identify, prioritize, and debug errors in your application.
Errors generated by your application are collected by the Sentry SDK,
then stored on either GitLab or Sentry back ends.
For more information, see:
- [How error tracking works](../../operations/error_tracking.md#how-error-tracking-works)
## Step 3: Manage alerts and incidents
Set up incident management features to troubleshoot issues and resolve incidents collaboratively.
For more information, see:
- [Incident Management](../../operations/incident_management/_index.md)
## Step 4: Analyze and improve
Use the data and insights gathered to continuously improve your application and the monitoring process:
1. Create insight dashboards to analyze issues
or incidents created and closed, and assess the performance of your incident response.
1. Create executable runbooks to help engineers on-call remediate incidents autonomously.
1. Regularly review your monitoring setup and adjust sampling thresholds, or add new metrics as your application evolves.
1. Conduct post-incident reviews to identify areas for improvement in both your application and your incident response process.
1. Use the insights gained from monitoring to inform your development priorities and technical debt reduction efforts.
For more information, see:
- [Insight dashboards](../project/insights/_index.md)
- [Executable runbooks](../project/clusters/runbooks/_index.md)
|
https://docs.gitlab.com/user/get_started_planning_work
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_planning_work.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_planning_work.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started planning work
|
Plan and execute on work.
|
GitLab has tools to help you plan, execute, and track your work.
With planning, collaboration, documentation, time tracking, and reporting features,
you can create a workflow that promotes transparency, accountability, and efficient project management.
The process of planning work is part of a larger workflow:

## Step 1: Define timelines
Start by thinking about how your team wants to approach your project goals and tasks.
Define your releases by using milestones, like `1.0`, `2.0`, and `3.0`. Decide if you will release both major and minor
releases.
Then, if you want your team to use a standard cadence for planning, use iterations.
Iterations are time-boxed periods, similar to sprints. For example, you might want
to release every two weeks.
For more information, see:
- [Milestones](../project/milestones/_index.md)
- [Iterations](../group/iterations/_index.md)
## Step 2: Plan and organize work
After you've decided on a release cadence, you can start organizing your work.
Epics are at the highest level. They provide a broad overview of the project's major objectives
and help to align the team's efforts with the overall vision.
Then you can define issues and assign them to epics.
Issues represent specific bugs or user stories that you need to address.
Issues can be assigned to team members, labeled for categorization and prioritization,
and tracked through various stages of completion.
Then, in issues, you can use tasks to break down the work into smaller, actionable items.
And finally, to ensure that your project's objectives are aligned with the organization's goals,
you can create OKRs (objectives and key results) and associate them with epics.
By defining measurable key results, your team can track your progress
and evaluate the impact of your work on the broader organization's objectives.
For more information, see:
- [Epics](../group/epics/_index.md)
- [Issues](../project/issues/_index.md)
- [Tasks](../tasks.md)
- [OKRs](../okrs.md)
## Step 3: Visualize your workflow
Issue boards offer a visual representation of the project's workflow. They display
issues categorized by their status, such as "To Do," "In Progress," or "Done."
Use issue boards to quickly assess the current state of the project
and identify any bottlenecks or blockers.
For more information, see:
- [Issue boards](../project/issue_board.md)
## Step 4: Collaborate and communicate
To categorize and prioritize issues, making it easier for you to identify and focus
on specific areas of work, use labels. By assigning descriptive labels to issues,
like "bug," "enhancement," or "high priority," you can filter and find relevant tasks.
In issues, use comments and threads provide a centralized space for discussion,
feedback, and collaboration. Team members can ask questions, provide updates, share ideas,
and review each other's work in the context of an issue.
Also in comments, you can use mentions (`@username`) to notify others
that you'd like them involved in the discussion.
When you mention someone, they receive a notification.
For more information, see:
- [Labels](../project/labels.md)
- [Comments and threads](../discussions/_index.md)
## Step 5: Track progress
Tracking progress involves monitoring the status and completion of tasks, milestones, and overall project goals.
You can visualize the timeline and track progress of epics and milestones by using roadmaps.
Roadmaps show a strategic, long-term view of the project, so you can gauge when major
deliverables are planned and determine how they contribute to the overall project goals.
To log the time spent on each issue, helping to monitor progress and estimate future efforts,
use time tracking.
You can use milestone burndown charts to view a graphical overview of the progress towards a specific
milestone. The burndown chart shows the number of issues opened, closed, and remaining over time.
Use it to track your progress and adjust your efforts accordingly.
For more information, see:
- [Roadmaps](../group/roadmap/_index.md)
- [Time tracking](../project/time_tracking.md)
- [Milestone burnup and burndown charts](../project/milestones/burndown_and_burnup_charts.md)
## Step 6: Report and analyze
Over time, you can use analytics to gain insights into your team's performance and productivity.
Analyze issues by filtering by labels, milestones, and iterations.
Group issues by priority, category, or other custom criteria.
For more information, see:
- [Analyze GitLab usage](../analytics/_index.md)
## Step 7: Create documentation and share knowledge
Throughout the process, you can document your progress and procedures.
While you will add comments and notes in issues and merge requests,
requirements are another essential aspect of documentation in a GitLab workflow.
They define the expected outcomes, acceptance criteria, and constraints
for specific features or tasks. Requirements can be documented in issues or
wikis, providing a clear understanding of what needs to be delivered and how success is measured.
Wikis serve as the primary hub for project documentation and knowledge management.
They provide a collaborative space where team members can create, edit, and organize
content related to the project. Wikis can include a wide
range of information, like project guidelines, technical specifications, and best practices.
For more information, see:
- [Requirements](../project/requirements/_index.md)
- [Wikis](../project/wiki/_index.md)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Plan and execute on work.
title: Get started planning work
breadcrumbs:
- doc
- user
- get_started
---
GitLab has tools to help you plan, execute, and track your work.
With planning, collaboration, documentation, time tracking, and reporting features,
you can create a workflow that promotes transparency, accountability, and efficient project management.
The process of planning work is part of a larger workflow:

## Step 1: Define timelines
Start by thinking about how your team wants to approach your project goals and tasks.
Define your releases by using milestones, like `1.0`, `2.0`, and `3.0`. Decide if you will release both major and minor
releases.
Then, if you want your team to use a standard cadence for planning, use iterations.
Iterations are time-boxed periods, similar to sprints. For example, you might want
to release every two weeks.
For more information, see:
- [Milestones](../project/milestones/_index.md)
- [Iterations](../group/iterations/_index.md)
## Step 2: Plan and organize work
After you've decided on a release cadence, you can start organizing your work.
Epics are at the highest level. They provide a broad overview of the project's major objectives
and help to align the team's efforts with the overall vision.
Then you can define issues and assign them to epics.
Issues represent specific bugs or user stories that you need to address.
Issues can be assigned to team members, labeled for categorization and prioritization,
and tracked through various stages of completion.
Then, in issues, you can use tasks to break down the work into smaller, actionable items.
And finally, to ensure that your project's objectives are aligned with the organization's goals,
you can create OKRs (objectives and key results) and associate them with epics.
By defining measurable key results, your team can track your progress
and evaluate the impact of your work on the broader organization's objectives.
For more information, see:
- [Epics](../group/epics/_index.md)
- [Issues](../project/issues/_index.md)
- [Tasks](../tasks.md)
- [OKRs](../okrs.md)
## Step 3: Visualize your workflow
Issue boards offer a visual representation of the project's workflow. They display
issues categorized by their status, such as "To Do," "In Progress," or "Done."
Use issue boards to quickly assess the current state of the project
and identify any bottlenecks or blockers.
For more information, see:
- [Issue boards](../project/issue_board.md)
## Step 4: Collaborate and communicate
To categorize and prioritize issues, making it easier for you to identify and focus
on specific areas of work, use labels. By assigning descriptive labels to issues,
like "bug," "enhancement," or "high priority," you can filter and find relevant tasks.
In issues, use comments and threads provide a centralized space for discussion,
feedback, and collaboration. Team members can ask questions, provide updates, share ideas,
and review each other's work in the context of an issue.
Also in comments, you can use mentions (`@username`) to notify others
that you'd like them involved in the discussion.
When you mention someone, they receive a notification.
For more information, see:
- [Labels](../project/labels.md)
- [Comments and threads](../discussions/_index.md)
## Step 5: Track progress
Tracking progress involves monitoring the status and completion of tasks, milestones, and overall project goals.
You can visualize the timeline and track progress of epics and milestones by using roadmaps.
Roadmaps show a strategic, long-term view of the project, so you can gauge when major
deliverables are planned and determine how they contribute to the overall project goals.
To log the time spent on each issue, helping to monitor progress and estimate future efforts,
use time tracking.
You can use milestone burndown charts to view a graphical overview of the progress towards a specific
milestone. The burndown chart shows the number of issues opened, closed, and remaining over time.
Use it to track your progress and adjust your efforts accordingly.
For more information, see:
- [Roadmaps](../group/roadmap/_index.md)
- [Time tracking](../project/time_tracking.md)
- [Milestone burnup and burndown charts](../project/milestones/burndown_and_burnup_charts.md)
## Step 6: Report and analyze
Over time, you can use analytics to gain insights into your team's performance and productivity.
Analyze issues by filtering by labels, milestones, and iterations.
Group issues by priority, category, or other custom criteria.
For more information, see:
- [Analyze GitLab usage](../analytics/_index.md)
## Step 7: Create documentation and share knowledge
Throughout the process, you can document your progress and procedures.
While you will add comments and notes in issues and merge requests,
requirements are another essential aspect of documentation in a GitLab workflow.
They define the expected outcomes, acceptance criteria, and constraints
for specific features or tasks. Requirements can be documented in issues or
wikis, providing a clear understanding of what needs to be delivered and how success is measured.
Wikis serve as the primary hub for project documentation and knowledge management.
They provide a collaborative space where team members can create, edit, and organize
content related to the project. Wikis can include a wide
range of information, like project guidelines, technical specifications, and best practices.
For more information, see:
- [Requirements](../project/requirements/_index.md)
- [Wikis](../project/wiki/_index.md)
|
https://docs.gitlab.com/user/get_started_runner
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_runner.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_runner.md
|
Verify
|
Runner
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started with GitLab Runner
|
Set up and manage GitLab Runner.
|
GitLab Runner administration encompasses the complete lifecycle of managing your CI/CD job execution infrastructure:
- Deploying and registering runners
- Configuring executors for specific workloads
- Scaling capacity to match organizational growth
The process of administering runners is part of a larger workflow:

You manage runner access through scopes and tags, monitor performance, and maintain the runner fleet.
## Step 1: Install runners
Install GitLab Runner to create the application that executes CI/CD jobs.
Installation involves downloading and setting up GitLab Runner on your target infrastructure.
The installation process varies depending on the target operating system. GitLab provides binaries
and installation instructions for Linux, Windows, macOS, and z/OS. Choose your installation method
based on your platform and requirements.
For more information, see [install GitLab Runner](https://docs.gitlab.com/runner/install/).
## Step 2: Register runners
Register your runners to establish authenticated communication between your
GitLab instance and the machine where GitLab Runner is installed.
Registration connects individual runners to your GitLab instance using authentication tokens.
During registration, you specify the runner's scope, executor type, and other configuration
parameters that determine how the runner operates.
Before you register a runner, you should determine if you want to limit it to a specific GitLab group or project.
You can configure self-managed runners with different access scopes during registration to determine which projects they're available for:
- Instance runners: Available to all projects on your GitLab instance
- Group runners: Available to all projects in a specific group and its subgroups
- Project runners: Available only to a specific project
When you register a runner, add tags to it
to route jobs to appropriate runners. Assign meaningful tags and reference them
in your `.gitlab-ci.yml` files to ensure jobs run on runners with the required capabilities.
When a CI/CD job runs, it knows which runner to use by looking at the assigned tags.
Tags are the only way to filter the list of available runners for a job.
For more information, see:
- [Register a runner](https://docs.gitlab.com/runner/register/)
- [Migrate to the new runner registration workflow](../../ci/runners/new_creation_workflow.md)
- [Instance runners](../../ci/runners/runners_scope.md#instance-runners)
- [Group runners](../../ci/runners/runners_scope.md#group-runners)
- [Project runners](../../ci/runners/runners_scope.md#project-runners)
- [Tags](../../ci/yaml/_index.md#tags)
## Step 3: Choose executors
GitLab Runner executors are the different environments and methods that GitLab Runner can use to execute CI/CD jobs.
They determine how and where your pipeline jobs actually run. Proper configuration ensures jobs run in appropriate
environments with correct security boundaries.
When you register a runner, you must choose an executor.
GitLab Runner uses an executor system to determine where and how jobs run.
An executor determines the environment each job runs in.
Select executors that match your infrastructure and job requirements.
For example:
- If you want your CI/CD job to run PowerShell commands, you might install GitLab
Runner on a Windows server and then register a runner that uses the shell executor.
- If you want your CI/CD job to run commands in a custom Docker container,
you might install GitLab Runner on a Linux server and register a runner that uses
the Docker executor.
These examples are only a couple of possible configurations. You can install GitLab Runner
on a virtual machine and have it use another virtual machine as an executor.
For more information, see [executors](https://docs.gitlab.com/runner/executors/).
## Step 4: Configure runners and start running jobs
You can configure GitLab Runners by editing the `config.toml` file,
which is automatically generated when you install and register a runner.
In this file you can edit settings for a specific runner, or for all runners.
Configure it to set concurrency limits, logging levels, cache settings, CPU limits, and executor-specific parameters.
Use consistent configurations across your runner fleet.
After a runner is configured and available for your project, your CI/CD jobs can use the runner.
Runners usually process jobs on the same machine where you installed GitLab Runner.
However, you can also have a runner process jobs in a container,
in a Kubernetes cluster, or in auto-scaled instances in the cloud.
For more information, see:
- [Configure GitLab Runners](https://docs.gitlab.com/runner/configuration/advanced-configuration/)
- [CI/CD jobs](../../ci/jobs/_index.md)
## Step 5: Continue to configure, scale, and optimize your runners
Advanced runner features improve job execution efficiency and provide specialized capabilities for complex CI/CD workflows.
These optimizations reduce job runtime and enhance the developer experience through autoscaling, performance monitoring,
fleet management, and specialized configurations.
Autoscaling adjusts runner capacity automatically based on job demand, while performance optimization ensures efficient resource utilization.
These capabilities help you handle variable workloads while controlling infrastructure costs.
Fleet management provides centralized control and monitoring for multiple runners, enabling enterprise-scale runner deployments. Fleet scaling involves coordinating capacity across multiple runners and implementing operational best practices.
Use built-in Prometheus metrics to help you monitor runner health and performance.
You can track key metrics like active job count, CPU utilization, memory usage, job success rates,
and queue lengths to ensure your runners operate efficiently.
For more information, see:
- [Autoscale configuration](https://docs.gitlab.com/runner/runner_autoscale/)
- [Fleet scaling](https://docs.gitlab.com/runner/fleet_scaling/)
- [Runner fleet configuration and best practices](../../topics/runner_fleet_design_guides/_index.md)
- [Monitor runner performance](https://docs.gitlab.com/runner/monitoring/)
- [Runner fleet dashboard](../../ci/runners/runner_fleet_dashboard.md)
- [Long polling](../../ci/runners/long_polling.md)
- [Docker-in-Docker configuration](https://docs.gitlab.com/runner/executors/docker/)
- [GitLab Runner Infrastructure Toolkit (GRIT)](https://gitlab.com/gitlab-org/ci-cd/runner-tools/grit)
|
---
stage: Verify
group: Runner
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Set up and manage GitLab Runner.
title: Get started with GitLab Runner
breadcrumbs:
- doc
- user
- get_started
---
GitLab Runner administration encompasses the complete lifecycle of managing your CI/CD job execution infrastructure:
- Deploying and registering runners
- Configuring executors for specific workloads
- Scaling capacity to match organizational growth
The process of administering runners is part of a larger workflow:

You manage runner access through scopes and tags, monitor performance, and maintain the runner fleet.
## Step 1: Install runners
Install GitLab Runner to create the application that executes CI/CD jobs.
Installation involves downloading and setting up GitLab Runner on your target infrastructure.
The installation process varies depending on the target operating system. GitLab provides binaries
and installation instructions for Linux, Windows, macOS, and z/OS. Choose your installation method
based on your platform and requirements.
For more information, see [install GitLab Runner](https://docs.gitlab.com/runner/install/).
## Step 2: Register runners
Register your runners to establish authenticated communication between your
GitLab instance and the machine where GitLab Runner is installed.
Registration connects individual runners to your GitLab instance using authentication tokens.
During registration, you specify the runner's scope, executor type, and other configuration
parameters that determine how the runner operates.
Before you register a runner, you should determine if you want to limit it to a specific GitLab group or project.
You can configure self-managed runners with different access scopes during registration to determine which projects they're available for:
- Instance runners: Available to all projects on your GitLab instance
- Group runners: Available to all projects in a specific group and its subgroups
- Project runners: Available only to a specific project
When you register a runner, add tags to it
to route jobs to appropriate runners. Assign meaningful tags and reference them
in your `.gitlab-ci.yml` files to ensure jobs run on runners with the required capabilities.
When a CI/CD job runs, it knows which runner to use by looking at the assigned tags.
Tags are the only way to filter the list of available runners for a job.
For more information, see:
- [Register a runner](https://docs.gitlab.com/runner/register/)
- [Migrate to the new runner registration workflow](../../ci/runners/new_creation_workflow.md)
- [Instance runners](../../ci/runners/runners_scope.md#instance-runners)
- [Group runners](../../ci/runners/runners_scope.md#group-runners)
- [Project runners](../../ci/runners/runners_scope.md#project-runners)
- [Tags](../../ci/yaml/_index.md#tags)
## Step 3: Choose executors
GitLab Runner executors are the different environments and methods that GitLab Runner can use to execute CI/CD jobs.
They determine how and where your pipeline jobs actually run. Proper configuration ensures jobs run in appropriate
environments with correct security boundaries.
When you register a runner, you must choose an executor.
GitLab Runner uses an executor system to determine where and how jobs run.
An executor determines the environment each job runs in.
Select executors that match your infrastructure and job requirements.
For example:
- If you want your CI/CD job to run PowerShell commands, you might install GitLab
Runner on a Windows server and then register a runner that uses the shell executor.
- If you want your CI/CD job to run commands in a custom Docker container,
you might install GitLab Runner on a Linux server and register a runner that uses
the Docker executor.
These examples are only a couple of possible configurations. You can install GitLab Runner
on a virtual machine and have it use another virtual machine as an executor.
For more information, see [executors](https://docs.gitlab.com/runner/executors/).
## Step 4: Configure runners and start running jobs
You can configure GitLab Runners by editing the `config.toml` file,
which is automatically generated when you install and register a runner.
In this file you can edit settings for a specific runner, or for all runners.
Configure it to set concurrency limits, logging levels, cache settings, CPU limits, and executor-specific parameters.
Use consistent configurations across your runner fleet.
After a runner is configured and available for your project, your CI/CD jobs can use the runner.
Runners usually process jobs on the same machine where you installed GitLab Runner.
However, you can also have a runner process jobs in a container,
in a Kubernetes cluster, or in auto-scaled instances in the cloud.
For more information, see:
- [Configure GitLab Runners](https://docs.gitlab.com/runner/configuration/advanced-configuration/)
- [CI/CD jobs](../../ci/jobs/_index.md)
## Step 5: Continue to configure, scale, and optimize your runners
Advanced runner features improve job execution efficiency and provide specialized capabilities for complex CI/CD workflows.
These optimizations reduce job runtime and enhance the developer experience through autoscaling, performance monitoring,
fleet management, and specialized configurations.
Autoscaling adjusts runner capacity automatically based on job demand, while performance optimization ensures efficient resource utilization.
These capabilities help you handle variable workloads while controlling infrastructure costs.
Fleet management provides centralized control and monitoring for multiple runners, enabling enterprise-scale runner deployments. Fleet scaling involves coordinating capacity across multiple runners and implementing operational best practices.
Use built-in Prometheus metrics to help you monitor runner health and performance.
You can track key metrics like active job count, CPU utilization, memory usage, job success rates,
and queue lengths to ensure your runners operate efficiently.
For more information, see:
- [Autoscale configuration](https://docs.gitlab.com/runner/runner_autoscale/)
- [Fleet scaling](https://docs.gitlab.com/runner/fleet_scaling/)
- [Runner fleet configuration and best practices](../../topics/runner_fleet_design_guides/_index.md)
- [Monitor runner performance](https://docs.gitlab.com/runner/monitoring/)
- [Runner fleet dashboard](../../ci/runners/runner_fleet_dashboard.md)
- [Long polling](../../ci/runners/long_polling.md)
- [Docker-in-Docker configuration](https://docs.gitlab.com/runner/executors/docker/)
- [GitLab Runner Infrastructure Toolkit (GRIT)](https://gitlab.com/gitlab-org/ci-cd/runner-tools/grit)
|
https://docs.gitlab.com/user/get_started_managing_infrastructure
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_managing_infrastructure.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_managing_infrastructure.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started managing your infrastructure
|
Employ best practices for managing your infrastructure.
|
With the rise of DevOps and SRE approaches, infrastructure management has become
codified and automatable. You can now employ software development best practices
in your infrastructure management.
The daily tasks of a classical operations team
have changed and are more similar to traditional software development. At the same time, software engineers
are more likely to control their whole DevOps lifecycle, including deployments and delivery.
GitLab offers various features to speed up and simplify your infrastructure management practices.
Infrastructure management is part of a larger workflow:

## Step 1: Use code to manage your infrastructure
GitLab has deep integrations with Terraform to run Infrastructure as Code pipelines
and support various processes. Terraform is considered the standard in cloud infrastructure provisioning.
The various GitLab integrations help you:
- Get started quickly without any setup.
- Collaborate around infrastructure changes in merge requests the same as you might
with code changes.
- Scale using a module registry.
For more information, see:
- [Infrastructure as Code](../infrastructure/iac/_index.md)
## Step 2: Interact with Kubernetes clusters
The GitLab integration with Kubernetes helps you to install, configure, manage, deploy, and troubleshoot
cluster applications. With the GitLab agent for Kubernetes, you can connect clusters behind a firewall,
have real-time access to API endpoints, perform pull-based or push-based deployments for production
and non-production environments, and much more.
For more information, see:
- [Create Kubernetes clusters in the cloud](../clusters/create/_index.md)
- [Connect Kubernetes clusters with GitLab](../clusters/agent/_index.md)
## Step 3: Document procedures with runbooks
Runbooks are a collection of documented procedures that explain how to carry out a task,
like starting, stopping, debugging, or troubleshooting a system. In GitLab, runbooks are created
in Markdown. They can include a variety of elements, including text, code snippets, images, and links.
Runbook in GitLab integrate with other GitLab features, like CI/CD pipelines and issues.
You can trigger runbooks automatically based on specific events or conditions, like
when a pipeline is successful or an issue is created. In addition, users can link runbooks
to issues, merge requests, and other GitLab objects.
For more information, see:
- [How executable runbooks work in GitLab](../project/clusters/runbooks/_index.md)
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Employ best practices for managing your infrastructure.
title: Get started managing your infrastructure
breadcrumbs:
- doc
- user
- get_started
---
With the rise of DevOps and SRE approaches, infrastructure management has become
codified and automatable. You can now employ software development best practices
in your infrastructure management.
The daily tasks of a classical operations team
have changed and are more similar to traditional software development. At the same time, software engineers
are more likely to control their whole DevOps lifecycle, including deployments and delivery.
GitLab offers various features to speed up and simplify your infrastructure management practices.
Infrastructure management is part of a larger workflow:

## Step 1: Use code to manage your infrastructure
GitLab has deep integrations with Terraform to run Infrastructure as Code pipelines
and support various processes. Terraform is considered the standard in cloud infrastructure provisioning.
The various GitLab integrations help you:
- Get started quickly without any setup.
- Collaborate around infrastructure changes in merge requests the same as you might
with code changes.
- Scale using a module registry.
For more information, see:
- [Infrastructure as Code](../infrastructure/iac/_index.md)
## Step 2: Interact with Kubernetes clusters
The GitLab integration with Kubernetes helps you to install, configure, manage, deploy, and troubleshoot
cluster applications. With the GitLab agent for Kubernetes, you can connect clusters behind a firewall,
have real-time access to API endpoints, perform pull-based or push-based deployments for production
and non-production environments, and much more.
For more information, see:
- [Create Kubernetes clusters in the cloud](../clusters/create/_index.md)
- [Connect Kubernetes clusters with GitLab](../clusters/agent/_index.md)
## Step 3: Document procedures with runbooks
Runbooks are a collection of documented procedures that explain how to carry out a task,
like starting, stopping, debugging, or troubleshooting a system. In GitLab, runbooks are created
in Markdown. They can include a variety of elements, including text, code snippets, images, and links.
Runbook in GitLab integrate with other GitLab features, like CI/CD pipelines and issues.
You can trigger runbooks automatically based on specific events or conditions, like
when a pipeline is successful or an issue is created. In addition, users can link runbooks
to issues, merge requests, and other GitLab objects.
For more information, see:
- [How executable runbooks work in GitLab](../project/clusters/runbooks/_index.md)
|
https://docs.gitlab.com/user/get_started_managing_code
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_managing_code.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_managing_code.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started managing code
|
Build, track, and deliver the code for your project.
|
GitLab provides tools for the full software development lifecycle,
from code creation to delivery.
Learn more about creating and managing code in GitLab.
The process includes authoring your code, having it reviewed,
committing it with version control, and updating it over time.
This process is part of a larger workflow:

## Step 1: Create a repository
A project is a centralized location where you collaborate with others, track issues,
manage merge requests, and automate CI/CD pipelines, among many other things.
Each project contains a repository, where you can store your code, documentation,
and other files related to your software development work.
Changes made to files in the repository are tracked, so you can view a history.
While a repository focuses on version control for source code,
a project provides a comprehensive environment for the entire development lifecycle.
For details, see:
- [Create a repository](../project/repository/_index.md#create-a-repository)
## Step 2: Write your code
You have many options for how and where you write your code.
You can use the GitLab UI and develop right in your browser.
You have two options:
- The plain text editor, called the Web Editor, which you can use to edit a single file.
- A more full-featured editor, called the Web IDE, which you can use to edit multiple files.
Prefer to work locally? Use Git to clone the repository to your computer,
and develop in the IDE of your choice.
Then you can use one of the GitLab editor extensions to assist in interacting with GitLab.
Don't want to use either of the first two options?
Launch a remote development environment, and work from the cloud.
You can further split your development environment by creating separate workspaces.
Workspaces are separate development environments you use to ensure different projects
don't interfere with one another.
For details, see:
- [Create a file in the repository from the UI](../project/repository/_index.md#add-a-file-from-the-ui)
- [Open a file in the Web IDE](../project/web_ide/_index.md#from-a-file)
- [Create a remote development environment with workspaces](../workspace/_index.md)
- [Available editor extensions](../../editor_extensions/_index.md)
- [Use Code Suggestions to write code more quickly](../project/repository/code_suggestions/_index.md)
## Step 3: Save changes and push to GitLab
When your changes are ready, you should commit them to GitLab,
where you can share them with others on your team.
To commit your changes, first copy them:
- From your local computer, in your own branch
- To GitLab, on a remote computer, to the `default branch`.
To copy files between branches, you create a merge request.
How you do this depends on where you authored the code and the tools you use to create it.
But the idea is to create a merge request that takes the contents of your source branch
and proposes combining it into the target branch.
For details, see:
- [Use Git to create a merge request](../../tutorials/make_first_git_commit/_index.md)
- [Use the UI to create a merge request when you add, edit, or upload a file](../project/merge_requests/creating_merge_requests.md)
## Step 4: Have the code reviewed
After you create a merge request that proposes changes to the codebase,
you can have your proposal reviewed.
Code reviews help maintain code quality and consistency.
It's also an opportunity for knowledge sharing among team members.
The merge request shows the difference between the proposed changes
and the branch you want to merge into.
Reviewers can see the changes and leave comments on specific lines of code.
Reviewers can also suggest changes directly in the diff.
Reviewers can approve the changes or request additional changes before merging.
GitLab tracks the review status and prevents merging until necessary approvals are obtained.
For details, see:
- [Request a review of your merge request](../project/merge_requests/reviews/_index.md#request-a-review)
- [Add suggestions to a merge request](../project/merge_requests/reviews/suggestions.md#create-suggestions)
- [Merge request approvals](../project/merge_requests/approvals/_index.md)
## Step 5: Merge the merge request
Before your changes can be merged, the merge request usually needs to be approved by other people,
and to have a passing CI/CD pipeline. The requirements are custom to your organization, but
usually they include ensuring:
- The code changes adhere to your organization's guidelines.
- The commit messages are clear, and link to related issues.
Merge conflicts can occur if someone else edits a file after you created your branch,
but before you merged it into the target branch. You must resolve any conflicts before you can merge.
For details, see:
- [Merge conflicts](../project/merge_requests/conflicts.md)
- [Merge methods](../project/merge_requests/methods/_index.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Build, track, and deliver the code for your project.
title: Get started managing code
breadcrumbs:
- doc
- user
- get_started
---
GitLab provides tools for the full software development lifecycle,
from code creation to delivery.
Learn more about creating and managing code in GitLab.
The process includes authoring your code, having it reviewed,
committing it with version control, and updating it over time.
This process is part of a larger workflow:

## Step 1: Create a repository
A project is a centralized location where you collaborate with others, track issues,
manage merge requests, and automate CI/CD pipelines, among many other things.
Each project contains a repository, where you can store your code, documentation,
and other files related to your software development work.
Changes made to files in the repository are tracked, so you can view a history.
While a repository focuses on version control for source code,
a project provides a comprehensive environment for the entire development lifecycle.
For details, see:
- [Create a repository](../project/repository/_index.md#create-a-repository)
## Step 2: Write your code
You have many options for how and where you write your code.
You can use the GitLab UI and develop right in your browser.
You have two options:
- The plain text editor, called the Web Editor, which you can use to edit a single file.
- A more full-featured editor, called the Web IDE, which you can use to edit multiple files.
Prefer to work locally? Use Git to clone the repository to your computer,
and develop in the IDE of your choice.
Then you can use one of the GitLab editor extensions to assist in interacting with GitLab.
Don't want to use either of the first two options?
Launch a remote development environment, and work from the cloud.
You can further split your development environment by creating separate workspaces.
Workspaces are separate development environments you use to ensure different projects
don't interfere with one another.
For details, see:
- [Create a file in the repository from the UI](../project/repository/_index.md#add-a-file-from-the-ui)
- [Open a file in the Web IDE](../project/web_ide/_index.md#from-a-file)
- [Create a remote development environment with workspaces](../workspace/_index.md)
- [Available editor extensions](../../editor_extensions/_index.md)
- [Use Code Suggestions to write code more quickly](../project/repository/code_suggestions/_index.md)
## Step 3: Save changes and push to GitLab
When your changes are ready, you should commit them to GitLab,
where you can share them with others on your team.
To commit your changes, first copy them:
- From your local computer, in your own branch
- To GitLab, on a remote computer, to the `default branch`.
To copy files between branches, you create a merge request.
How you do this depends on where you authored the code and the tools you use to create it.
But the idea is to create a merge request that takes the contents of your source branch
and proposes combining it into the target branch.
For details, see:
- [Use Git to create a merge request](../../tutorials/make_first_git_commit/_index.md)
- [Use the UI to create a merge request when you add, edit, or upload a file](../project/merge_requests/creating_merge_requests.md)
## Step 4: Have the code reviewed
After you create a merge request that proposes changes to the codebase,
you can have your proposal reviewed.
Code reviews help maintain code quality and consistency.
It's also an opportunity for knowledge sharing among team members.
The merge request shows the difference between the proposed changes
and the branch you want to merge into.
Reviewers can see the changes and leave comments on specific lines of code.
Reviewers can also suggest changes directly in the diff.
Reviewers can approve the changes or request additional changes before merging.
GitLab tracks the review status and prevents merging until necessary approvals are obtained.
For details, see:
- [Request a review of your merge request](../project/merge_requests/reviews/_index.md#request-a-review)
- [Add suggestions to a merge request](../project/merge_requests/reviews/suggestions.md#create-suggestions)
- [Merge request approvals](../project/merge_requests/approvals/_index.md)
## Step 5: Merge the merge request
Before your changes can be merged, the merge request usually needs to be approved by other people,
and to have a passing CI/CD pipeline. The requirements are custom to your organization, but
usually they include ensuring:
- The code changes adhere to your organization's guidelines.
- The commit messages are clear, and link to related issues.
Merge conflicts can occur if someone else edits a file after you created your branch,
but before you merged it into the target branch. You must resolve any conflicts before you can merge.
For details, see:
- [Merge conflicts](../project/merge_requests/conflicts.md)
- [Merge methods](../project/merge_requests/methods/_index.md)
|
https://docs.gitlab.com/user/getting_started_gitlab_duo
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/getting_started_gitlab_duo.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
getting_started_gitlab_duo.md
|
AI-powered
|
AI Framework
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started with GitLab Duo
|
Use the AI-native assistant throughout your lifecycle.
|
GitLab Duo is your AI-native assistant. It can help you write, review, and edit code,
along with a variety of other tasks throughout your GitLab workflow.
It can help you troubleshoot your pipeline, write tests, address vulnerabilities, and more.
## Step 1: Ensure you have access to GitLab Duo
To get started with GitLab Duo, your organization must have a Premium or Ultimate subscription
and a GitLab Duo add-on.
Your add-on determines the GitLab Duo features you have access to.
- The GitLab Duo Core add-on comes with all Premium and Ultimate subscriptions.
- The GitLab Duo Pro and GitLab Duo Enterprise add-ons are available for purchase.
For GitLab Duo features, your organization can use the GitLab default language models
or host their own models by using GitLab Duo Self-Hosted.
If you have issues accessing GitLab Duo features, your administrators
can check the health of the installation.
For more information, see:
- [GitLab Duo features by add-on](../gitlab_duo/feature_summary.md).
- [How to purchase an add-on](../../subscriptions/subscription-add-ons.md).
- [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md).
- [Health check details](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo).
## Step 2: Try GitLab Duo Chat in the UI
If your organization has either the GitLab Duo Pro or Enterprise add-on,
you can try using Chat in the GitLab UI.
Go to a project and in the upper-right corner, a button named **GitLab Duo Chat** should be displayed.
If this button is available, it means everything is configured properly.
Try asking Chat a question or type `/` to see a list of slash commands.
For more information, see:
- [GitLab Duo Chat](../gitlab_duo_chat/_index.md).
## Step 3: Try other GitLab Duo features
GitLab Duo is available in all stages of your workflow. From troubleshooting
CI/CD pipelines to writing test cases and resolving security threats, GitLab Duo can help you
in a variety of ways.
The features you have access to differ depending on your subscription tier, add-on, and offering.
For example, if you have access to:
- Root Cause Analysis, you can go to one of your failed CI/CD jobs and at the bottom
of the page, select **Troubleshoot**.
- Discussion Summary, in the **Activity** section of an issue with a lot of comments,
select **View summary**. GitLab Duo summarizes the contents of the issue.
For more information, see:
- [The complete list of GitLab Duo features](../gitlab_duo/_index.md).
- [Turn on GitLab Duo features that are still in development](../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features).
## Step 4: Prepare to use GitLab Duo in your IDE
Now you can try GitLab Duo features, like GitLab Duo Chat and Code Suggestions, in your IDE.
To use GitLab Duo Chat in your IDE, you'll install an extension and authenticate with GitLab.
- In GitLab 17.11 and earlier, you'll need the GitLab Duo Pro or Enterprise add-on.
- In 18.0 and later, you'll need to turn on GitLab Duo,
and have the GitLab Duo Core, Pro, or Enterprise add-on.
GitLab Duo Core is included with all Premium and Ultimate subscriptions.
Alternatively, if you have GitLab Duo Pro or Enterprise, you can use the Web IDE,
which is included in the GitLab UI and already fully configured.
For more information, see:
- [Turn on GitLab Duo](../gitlab_duo/turn_on_off.md).
- [Set up the extension for VS Code](../../editor_extensions/visual_studio_code/setup.md).
- [Set up the extension for JetBrains](../../editor_extensions/jetbrains_ide/setup.md).
- [Set up the extension for Visual Studio](../../editor_extensions/visual_studio/setup.md).
- [Set up the extension for Neovim](../../editor_extensions/neovim/setup.md).
- [Use the Web IDE](../project/web_ide/_index.md).
## Step 5: Start using Code Suggestions and Chat in your IDE
Finally, test Code Suggestions and Chat in your IDE.
- Code Suggestions recommends code as you type.
- Chat is available to ask questions about your code or anything else you need.
You can choose the languages you want suggestions for.
For more information, see:
- [Supported extensions and languages](../project/repository/code_suggestions/supported_extensions.md).
- [Turn on Code Suggestions](../project/repository/code_suggestions/set_up.md#turn-on-code-suggestions).
- [Troubleshoot GitLab Workflow extension for VS Code](../../editor_extensions/visual_studio_code/troubleshooting.md).
- [Troubleshoot GitLab plugin for JetBrains IDEs](../../editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md).
- [Troubleshoot GitLab extension for Visual Studio](../../editor_extensions/visual_studio/visual_studio_troubleshooting.md).
- [Troubleshoot GitLab plugin for Neovim](../../editor_extensions/neovim/neovim_troubleshooting.md).
|
---
stage: AI-powered
group: AI Framework
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use the AI-native assistant throughout your lifecycle.
title: Get started with GitLab Duo
breadcrumbs:
- doc
- user
- get_started
---
GitLab Duo is your AI-native assistant. It can help you write, review, and edit code,
along with a variety of other tasks throughout your GitLab workflow.
It can help you troubleshoot your pipeline, write tests, address vulnerabilities, and more.
## Step 1: Ensure you have access to GitLab Duo
To get started with GitLab Duo, your organization must have a Premium or Ultimate subscription
and a GitLab Duo add-on.
Your add-on determines the GitLab Duo features you have access to.
- The GitLab Duo Core add-on comes with all Premium and Ultimate subscriptions.
- The GitLab Duo Pro and GitLab Duo Enterprise add-ons are available for purchase.
For GitLab Duo features, your organization can use the GitLab default language models
or host their own models by using GitLab Duo Self-Hosted.
If you have issues accessing GitLab Duo features, your administrators
can check the health of the installation.
For more information, see:
- [GitLab Duo features by add-on](../gitlab_duo/feature_summary.md).
- [How to purchase an add-on](../../subscriptions/subscription-add-ons.md).
- [GitLab Duo Self-Hosted](../../administration/gitlab_duo_self_hosted/_index.md).
- [Health check details](../../administration/gitlab_duo/setup.md#run-a-health-check-for-gitlab-duo).
## Step 2: Try GitLab Duo Chat in the UI
If your organization has either the GitLab Duo Pro or Enterprise add-on,
you can try using Chat in the GitLab UI.
Go to a project and in the upper-right corner, a button named **GitLab Duo Chat** should be displayed.
If this button is available, it means everything is configured properly.
Try asking Chat a question or type `/` to see a list of slash commands.
For more information, see:
- [GitLab Duo Chat](../gitlab_duo_chat/_index.md).
## Step 3: Try other GitLab Duo features
GitLab Duo is available in all stages of your workflow. From troubleshooting
CI/CD pipelines to writing test cases and resolving security threats, GitLab Duo can help you
in a variety of ways.
The features you have access to differ depending on your subscription tier, add-on, and offering.
For example, if you have access to:
- Root Cause Analysis, you can go to one of your failed CI/CD jobs and at the bottom
of the page, select **Troubleshoot**.
- Discussion Summary, in the **Activity** section of an issue with a lot of comments,
select **View summary**. GitLab Duo summarizes the contents of the issue.
For more information, see:
- [The complete list of GitLab Duo features](../gitlab_duo/_index.md).
- [Turn on GitLab Duo features that are still in development](../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features).
## Step 4: Prepare to use GitLab Duo in your IDE
Now you can try GitLab Duo features, like GitLab Duo Chat and Code Suggestions, in your IDE.
To use GitLab Duo Chat in your IDE, you'll install an extension and authenticate with GitLab.
- In GitLab 17.11 and earlier, you'll need the GitLab Duo Pro or Enterprise add-on.
- In 18.0 and later, you'll need to turn on GitLab Duo,
and have the GitLab Duo Core, Pro, or Enterprise add-on.
GitLab Duo Core is included with all Premium and Ultimate subscriptions.
Alternatively, if you have GitLab Duo Pro or Enterprise, you can use the Web IDE,
which is included in the GitLab UI and already fully configured.
For more information, see:
- [Turn on GitLab Duo](../gitlab_duo/turn_on_off.md).
- [Set up the extension for VS Code](../../editor_extensions/visual_studio_code/setup.md).
- [Set up the extension for JetBrains](../../editor_extensions/jetbrains_ide/setup.md).
- [Set up the extension for Visual Studio](../../editor_extensions/visual_studio/setup.md).
- [Set up the extension for Neovim](../../editor_extensions/neovim/setup.md).
- [Use the Web IDE](../project/web_ide/_index.md).
## Step 5: Start using Code Suggestions and Chat in your IDE
Finally, test Code Suggestions and Chat in your IDE.
- Code Suggestions recommends code as you type.
- Chat is available to ask questions about your code or anything else you need.
You can choose the languages you want suggestions for.
For more information, see:
- [Supported extensions and languages](../project/repository/code_suggestions/supported_extensions.md).
- [Turn on Code Suggestions](../project/repository/code_suggestions/set_up.md#turn-on-code-suggestions).
- [Troubleshoot GitLab Workflow extension for VS Code](../../editor_extensions/visual_studio_code/troubleshooting.md).
- [Troubleshoot GitLab plugin for JetBrains IDEs](../../editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md).
- [Troubleshoot GitLab extension for Visual Studio](../../editor_extensions/visual_studio/visual_studio_troubleshooting.md).
- [Troubleshoot GitLab plugin for Neovim](../../editor_extensions/neovim/neovim_troubleshooting.md).
|
https://docs.gitlab.com/user/get_started_projects
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/get_started_projects.md
|
2025-08-13
|
doc/user/get_started
|
[
"doc",
"user",
"get_started"
] |
get_started_projects.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Get started organizing work with projects
|
Configure projects to suit your organization.
|
Projects in GitLab organize all the data for a specific development project.
A project is where you work with your team, store your files, and manage your tasks.
Use projects to:
- Write and save code
- Track issues and tasks
- Collaborate on code changes
- Test and deploy your app
Project creation and maintenance is part of a larger workflow:

## Step 1: Create a project
Start by creating a new project in GitLab to contain your codebase,
documentation, and related resources.
A project contains a repository. A repository contains all the files,
directories, and data related to your work.
When you create the project, review and configure the following settings to align with your development workflow and collaboration requirements:
- Visibility level
- Merge request approvals
- Issue tracking
- CI/CD pipelines
- Description templates for entities like issues or merge requests
For more information, see:
- [Create a project](../project/_index.md)
- [Manage projects](../project/working_with_projects.md)
- [Project visibility](../public_access.md)
- [Project settings](../project/settings/_index.md)
- [Description templates](../project/description_templates.md)
## Step 2: Secure and control access to projects
Use the following tools to manage secure access to your projects:
- Project access tokens: Grant specific access rights to automated tools or external systems for secure integration.
- Deploy keys: Grant read-only access to your repositories to securely deploy your project to external systems.
- Deploy tokens: Grant temporary, limited access to your project's repository and registry for secure deployments and automation.
For more information, see:
- [Project access tokens](../project/settings/project_access_tokens.md)
- [Deploy keys](../project/deploy_keys/_index.md)
- [Deploy tokens](../project/deploy_tokens/_index.md)
## Step 3: Collaborate and share projects
You can invite multiple projects to a group, sometimes called
`sharing a project with a group`. Each project has its own repository,
issues, merge requests, and other features.
With multiple projects in a group, team members can collaborate on individual
projects while having a high-level view of all the work done in the group.
To further refine access to your projects, you can add subgroups to
your group.
For more information, see:
- [Share projects](../project/members/sharing_projects_groups.md)
- [Subgroups](../group/subgroups/_index.md)
## Step 4: Enhance project discoverability and recognition
Use the search box to quickly find specific projects,
issues, merge requests, or code snippets across your GitLab instance.
To make projects easier to find:
- Create a consistent and recognizable naming scheme for your projects with reserved project and group names.
- Add badges to your project's `README` file. Badges can display important information,
like build status, project health, test coverage, or version number.
- Assign project topics. Topics are labels that help you organize and find projects.
For more information, see:
- [Reserved project and group names](../reserved_names.md)
- [Search](../search/_index.md)
- [Badges](../project/badges.md)
- [Project topics](../project/project_topics.md)
## Step 5: Boost development efficiency and maintain code quality
Use code intelligence features to enhance your productivity and
maintain a high-quality codebase, such as:
- Code navigation
- Hover information
- Auto-completion
Code intelligence is a range of tools
that help you efficiently explore, analyze, and maintain your codebase.
To quickly locate and go to specific files in your project,
use the file finder.
For more information, see:
- [Code intelligence](../project/code_intelligence.md)
- [Files](../project/repository/files/_index.md)
## Step 6: Migrate projects into GitLab
Use file exports to migrate projects to GitLab from other systems or GitLab instances.
When you migrate a frequently accessed repository to GitLab, you can use a project alias to
continue to access it by its original name.
On GitLab.com, you can transfer a project from one namespace to another.
A transfer essentially moves a project to another group
so its members have access or ownership.
For more information, see:
- [Migrate projects by using file exports](../project/import/_index.md)
- [Project aliases](../project/working_with_projects.md#project-aliases)
- [Transfer a project to another namespace](../project/settings/migrate_projects.md)
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Configure projects to suit your organization.
title: Get started organizing work with projects
breadcrumbs:
- doc
- user
- get_started
---
Projects in GitLab organize all the data for a specific development project.
A project is where you work with your team, store your files, and manage your tasks.
Use projects to:
- Write and save code
- Track issues and tasks
- Collaborate on code changes
- Test and deploy your app
Project creation and maintenance is part of a larger workflow:

## Step 1: Create a project
Start by creating a new project in GitLab to contain your codebase,
documentation, and related resources.
A project contains a repository. A repository contains all the files,
directories, and data related to your work.
When you create the project, review and configure the following settings to align with your development workflow and collaboration requirements:
- Visibility level
- Merge request approvals
- Issue tracking
- CI/CD pipelines
- Description templates for entities like issues or merge requests
For more information, see:
- [Create a project](../project/_index.md)
- [Manage projects](../project/working_with_projects.md)
- [Project visibility](../public_access.md)
- [Project settings](../project/settings/_index.md)
- [Description templates](../project/description_templates.md)
## Step 2: Secure and control access to projects
Use the following tools to manage secure access to your projects:
- Project access tokens: Grant specific access rights to automated tools or external systems for secure integration.
- Deploy keys: Grant read-only access to your repositories to securely deploy your project to external systems.
- Deploy tokens: Grant temporary, limited access to your project's repository and registry for secure deployments and automation.
For more information, see:
- [Project access tokens](../project/settings/project_access_tokens.md)
- [Deploy keys](../project/deploy_keys/_index.md)
- [Deploy tokens](../project/deploy_tokens/_index.md)
## Step 3: Collaborate and share projects
You can invite multiple projects to a group, sometimes called
`sharing a project with a group`. Each project has its own repository,
issues, merge requests, and other features.
With multiple projects in a group, team members can collaborate on individual
projects while having a high-level view of all the work done in the group.
To further refine access to your projects, you can add subgroups to
your group.
For more information, see:
- [Share projects](../project/members/sharing_projects_groups.md)
- [Subgroups](../group/subgroups/_index.md)
## Step 4: Enhance project discoverability and recognition
Use the search box to quickly find specific projects,
issues, merge requests, or code snippets across your GitLab instance.
To make projects easier to find:
- Create a consistent and recognizable naming scheme for your projects with reserved project and group names.
- Add badges to your project's `README` file. Badges can display important information,
like build status, project health, test coverage, or version number.
- Assign project topics. Topics are labels that help you organize and find projects.
For more information, see:
- [Reserved project and group names](../reserved_names.md)
- [Search](../search/_index.md)
- [Badges](../project/badges.md)
- [Project topics](../project/project_topics.md)
## Step 5: Boost development efficiency and maintain code quality
Use code intelligence features to enhance your productivity and
maintain a high-quality codebase, such as:
- Code navigation
- Hover information
- Auto-completion
Code intelligence is a range of tools
that help you efficiently explore, analyze, and maintain your codebase.
To quickly locate and go to specific files in your project,
use the file finder.
For more information, see:
- [Code intelligence](../project/code_intelligence.md)
- [Files](../project/repository/files/_index.md)
## Step 6: Migrate projects into GitLab
Use file exports to migrate projects to GitLab from other systems or GitLab instances.
When you migrate a frequently accessed repository to GitLab, you can use a project alias to
continue to access it by its original name.
On GitLab.com, you can transfer a project from one namespace to another.
A transfer essentially moves a project to another group
so its members have access or ownership.
For more information, see:
- [Migrate projects by using file exports](../project/import/_index.md)
- [Project aliases](../project/working_with_projects.md#project-aliases)
- [Transfer a project to another namespace](../project/settings/migrate_projects.md)
|
https://docs.gitlab.com/user/use_project_as_go_package
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/use_project_as_go_package.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
use_project_as_go_package.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Use a project as a Go package
|
Go modules and import calls.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Changed in [GitLab 17.3](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161162) to return 404 errors for unauthorized `go get` requests.
{{< /history >}}
Prerequisites:
- Contact your administrator to enable the [GitLab Go Proxy](../packages/go_proxy/_index.md).
- To use a private project in a subgroup as a Go package, you must [authenticate Go requests](#authenticate-go-requests-to-private-projects). Go requests that are not authenticated cause
`go get` to fail. You don't need to authenticate Go requests for projects that are not in subgroups.
To use a project as a Go package, use the `go get` and `godoc.org` discovery requests. You can use the meta tags:
- [`go-import`](https://pkg.go.dev/cmd/go#hdr-Remote_import_paths)
- [`go-source`](https://github.com/golang/gddo/wiki/Source-Code-Links)
{{< alert type="note" >}}
If you make a `go get` request with invalid HTTP credentials, you receive a 404 error.
You can find the HTTP credentials in `~/.netrc` (MacOS and Linux) or `~/_netrc` (Windows).
{{< /alert >}}
## Authenticate Go requests to private projects
Prerequisites:
- Your GitLab instance must be accessible with HTTPS.
- You must have a [personal access token](../profile/personal_access_tokens.md) with `read_api` scope.
To authenticate Go requests, create a [`.netrc`](https://everything.curl.dev/usingcurl/netrc.html) file with the following information:
```plaintext
machine gitlab.example.com
login <gitlab_user_name>
password <personal_access_token>
```
On Windows, Go reads `~/_netrc` instead of `~/.netrc`.
The `go` command does not transmit credentials over insecure connections. It authenticates
HTTPS requests made by Go, but does not authenticate requests made
through Git.
## Authenticate Git requests
If Go cannot fetch a module from a proxy, it uses Git. Git uses a `.netrc` file to authenticate requests, but you can
configure other authentication methods.
Configure Git to either:
- Embed credentials in the request URL:
```shell
git config --global url."https://${user}:${personal_access_token}@gitlab.example.com".insteadOf "https://gitlab.example.com"
```
- Use SSH instead of HTTPS:
```shell
git config --global url."git@gitlab.example.com:".insteadOf "https://gitlab.example.com/"
```
## Disable Go module fetching for private projects
To fetch modules or packages, Go uses
the environment variables:
- `GOPRIVATE`
- `GONOPROXY`
- `GONOSUMDB`
To disable fetching:
1. Disable `GOPRIVATE`:
- To disable queries for one project, disable `GOPRIVATE=gitlab.example.com/my/private/project`.
- To disable queries for all projects on GitLab.com, disable `GOPRIVATE=gitlab.example.com`.
1. Disable proxy queries in `GONOPROXY`.
1. Disable checksum queries in `GONOSUMDB`.
- If the module name or its prefix is in `GOPRIVATE` or `GONOPROXY`, Go does not query module
proxies.
- If the module name or its prefix is in `GOPRIVATE` or `GONOSUMDB`, Go does not query
Checksum databases.
## Authenticate Git requests to private subgroups
If the Go module is located under a private subgroup like
`gitlab.com/namespace/subgroup/go-module`, then the Git authentication doesn't work.
It happens, because `go get` makes an unauthenticated request to discover
the repository path.
Without an HTTP authentication by using a `.netrc` file, GitLab responds with
`gitlab.com/namespace/subgroup.git` to prevent a security risk of exposing
the project's existence for unauthenticated users.
As a result, the Go module cannot be downloaded.
Unfortunately, Go doesn't provide any means of request authentication apart
from `.netrc`. In a future version, Go may add support for arbitrary
authentication headers.
Follow [`golang/go#26232`](https://github.com/golang/go/issues/26232) for details.
### Workaround: use `.git` in the module name
There is a way to skip `go get` request and force Go to use a Git authentication
directly, but it requires a modification of the module name. [From Go documentation](https://go.dev/ref/mod#vcs-find):
> If the module path has a VCS qualifier (one of `.bzr`, `.fossil`, `.git`, `.hg`, `.svn`)
> at the end of a path component, the go command will use everything up to that
> path qualifier as the repository URL. For example, for the module
> `example.com/foo.git/bar`, the go command downloads the repository
> at `example.com/foo.git` using Git, expecting to find the module
> in the bar subdirectory.
1. Go to `go.mod` of the Go module in a private subgroup.
1. Add `.git` to the module name.
For example, rename`module gitlab.com/namespace/subgroup/go-module` to `module gitlab.com/namespace/subgroup/go-module.git`.
1. Commit and push this change.
1. Visit Go projects that depend on this module and adjust their `import` calls.
For example, `import gitlab.com/namespace/subgroup/go-module.git`.
The Go module should be correctly fetched after this change.
For example, `GOPRIVATE=gitlab.com/namespace/* go mod tidy`.
## Fetch Go modules from Geo secondary sites
Use [Geo](../../administration/geo/_index.md) to access Git repositories that contain Go modules
on secondary Geo servers.
You can use SSH or HTTP to access the Geo secondary server.
### Use SSH to access the Geo secondary server
To access the Geo secondary server with SSH:
1. Reconfigure Git on the client to send traffic for the primary to the secondary:
```shell
git config --global url."git@gitlab-secondary.example.com".insteadOf "https://gitlab.example.com"
git config --global url."git@gitlab-secondary.example.com".insteadOf "http://gitlab.example.com"
```
- For `gitlab.example.com`, use the primary site domain name.
- For `gitlab-secondary.example.com`, use the secondary site domain name.
1. Ensure the client is set up for SSH access to GitLab repositories. You can test this on the primary,
and GitLab replicates the public key to the secondary.
The `go get` request generates HTTP traffic to the primary Geo server. When the module
download starts, the `insteadOf` configuration sends the traffic to the secondary Geo server.
### Use HTTP to access the Geo secondary
You must use persistent access tokens that replicate to the secondary server. You cannot use
CI/CD job tokens to fetch Go modules with HTTP.
To access the Geo secondary server with HTTP:
1. Add a Git `insteadOf` redirect on the client:
```shell
git config --global url."https://gitlab-secondary.example.com".insteadOf "https://gitlab.example.com"
```
- For `gitlab.example.com`, use the primary site domain name.
- For `gitlab-secondary.example.com`, use the secondary site domain name.
1. Generate a [personal access token](../profile/personal_access_tokens.md) and
add the credentials in the client's `~/.netrc` file:
```shell
machine gitlab.example.com login USERNAME password TOKEN
machine gitlab-secondary.example.com login USERNAME password TOKEN
```
The `go get` request generates HTTP traffic to the primary Geo server. When the module
download starts, the `insteadOf` configuration sends the traffic to the secondary Geo server.
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Use a project as a Go package
description: Go modules and import calls.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Changed in [GitLab 17.3](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161162) to return 404 errors for unauthorized `go get` requests.
{{< /history >}}
Prerequisites:
- Contact your administrator to enable the [GitLab Go Proxy](../packages/go_proxy/_index.md).
- To use a private project in a subgroup as a Go package, you must [authenticate Go requests](#authenticate-go-requests-to-private-projects). Go requests that are not authenticated cause
`go get` to fail. You don't need to authenticate Go requests for projects that are not in subgroups.
To use a project as a Go package, use the `go get` and `godoc.org` discovery requests. You can use the meta tags:
- [`go-import`](https://pkg.go.dev/cmd/go#hdr-Remote_import_paths)
- [`go-source`](https://github.com/golang/gddo/wiki/Source-Code-Links)
{{< alert type="note" >}}
If you make a `go get` request with invalid HTTP credentials, you receive a 404 error.
You can find the HTTP credentials in `~/.netrc` (MacOS and Linux) or `~/_netrc` (Windows).
{{< /alert >}}
## Authenticate Go requests to private projects
Prerequisites:
- Your GitLab instance must be accessible with HTTPS.
- You must have a [personal access token](../profile/personal_access_tokens.md) with `read_api` scope.
To authenticate Go requests, create a [`.netrc`](https://everything.curl.dev/usingcurl/netrc.html) file with the following information:
```plaintext
machine gitlab.example.com
login <gitlab_user_name>
password <personal_access_token>
```
On Windows, Go reads `~/_netrc` instead of `~/.netrc`.
The `go` command does not transmit credentials over insecure connections. It authenticates
HTTPS requests made by Go, but does not authenticate requests made
through Git.
## Authenticate Git requests
If Go cannot fetch a module from a proxy, it uses Git. Git uses a `.netrc` file to authenticate requests, but you can
configure other authentication methods.
Configure Git to either:
- Embed credentials in the request URL:
```shell
git config --global url."https://${user}:${personal_access_token}@gitlab.example.com".insteadOf "https://gitlab.example.com"
```
- Use SSH instead of HTTPS:
```shell
git config --global url."git@gitlab.example.com:".insteadOf "https://gitlab.example.com/"
```
## Disable Go module fetching for private projects
To fetch modules or packages, Go uses
the environment variables:
- `GOPRIVATE`
- `GONOPROXY`
- `GONOSUMDB`
To disable fetching:
1. Disable `GOPRIVATE`:
- To disable queries for one project, disable `GOPRIVATE=gitlab.example.com/my/private/project`.
- To disable queries for all projects on GitLab.com, disable `GOPRIVATE=gitlab.example.com`.
1. Disable proxy queries in `GONOPROXY`.
1. Disable checksum queries in `GONOSUMDB`.
- If the module name or its prefix is in `GOPRIVATE` or `GONOPROXY`, Go does not query module
proxies.
- If the module name or its prefix is in `GOPRIVATE` or `GONOSUMDB`, Go does not query
Checksum databases.
## Authenticate Git requests to private subgroups
If the Go module is located under a private subgroup like
`gitlab.com/namespace/subgroup/go-module`, then the Git authentication doesn't work.
It happens, because `go get` makes an unauthenticated request to discover
the repository path.
Without an HTTP authentication by using a `.netrc` file, GitLab responds with
`gitlab.com/namespace/subgroup.git` to prevent a security risk of exposing
the project's existence for unauthenticated users.
As a result, the Go module cannot be downloaded.
Unfortunately, Go doesn't provide any means of request authentication apart
from `.netrc`. In a future version, Go may add support for arbitrary
authentication headers.
Follow [`golang/go#26232`](https://github.com/golang/go/issues/26232) for details.
### Workaround: use `.git` in the module name
There is a way to skip `go get` request and force Go to use a Git authentication
directly, but it requires a modification of the module name. [From Go documentation](https://go.dev/ref/mod#vcs-find):
> If the module path has a VCS qualifier (one of `.bzr`, `.fossil`, `.git`, `.hg`, `.svn`)
> at the end of a path component, the go command will use everything up to that
> path qualifier as the repository URL. For example, for the module
> `example.com/foo.git/bar`, the go command downloads the repository
> at `example.com/foo.git` using Git, expecting to find the module
> in the bar subdirectory.
1. Go to `go.mod` of the Go module in a private subgroup.
1. Add `.git` to the module name.
For example, rename`module gitlab.com/namespace/subgroup/go-module` to `module gitlab.com/namespace/subgroup/go-module.git`.
1. Commit and push this change.
1. Visit Go projects that depend on this module and adjust their `import` calls.
For example, `import gitlab.com/namespace/subgroup/go-module.git`.
The Go module should be correctly fetched after this change.
For example, `GOPRIVATE=gitlab.com/namespace/* go mod tidy`.
## Fetch Go modules from Geo secondary sites
Use [Geo](../../administration/geo/_index.md) to access Git repositories that contain Go modules
on secondary Geo servers.
You can use SSH or HTTP to access the Geo secondary server.
### Use SSH to access the Geo secondary server
To access the Geo secondary server with SSH:
1. Reconfigure Git on the client to send traffic for the primary to the secondary:
```shell
git config --global url."git@gitlab-secondary.example.com".insteadOf "https://gitlab.example.com"
git config --global url."git@gitlab-secondary.example.com".insteadOf "http://gitlab.example.com"
```
- For `gitlab.example.com`, use the primary site domain name.
- For `gitlab-secondary.example.com`, use the secondary site domain name.
1. Ensure the client is set up for SSH access to GitLab repositories. You can test this on the primary,
and GitLab replicates the public key to the secondary.
The `go get` request generates HTTP traffic to the primary Geo server. When the module
download starts, the `insteadOf` configuration sends the traffic to the secondary Geo server.
### Use HTTP to access the Geo secondary
You must use persistent access tokens that replicate to the secondary server. You cannot use
CI/CD job tokens to fetch Go modules with HTTP.
To access the Geo secondary server with HTTP:
1. Add a Git `insteadOf` redirect on the client:
```shell
git config --global url."https://gitlab-secondary.example.com".insteadOf "https://gitlab.example.com"
```
- For `gitlab.example.com`, use the primary site domain name.
- For `gitlab-secondary.example.com`, use the secondary site domain name.
1. Generate a [personal access token](../profile/personal_access_tokens.md) and
add the credentials in the client's `~/.netrc` file:
```shell
machine gitlab.example.com login USERNAME password TOKEN
machine gitlab-secondary.example.com login USERNAME password TOKEN
```
The `go get` request generates HTTP traffic to the primary Geo server. When the module
download starts, the `insteadOf` configuration sends the traffic to the secondary Geo server.
|
https://docs.gitlab.com/user/quick_actions
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/quick_actions.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
quick_actions.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
GitLab quick actions
|
Commands, shortcuts, and inline actions.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Quick actions provide text-based shortcuts for common actions in GitLab.
Quick actions:
- Execute common actions without using the user interface.
- Support working with issues, merge requests, epics, and commits.
- Run automatically when you save descriptions or comments.
- Respond to specific contexts and conditions.
- Process multiple commands when entered on separate lines.
For example, you can use quick actions to:
- Assign users.
- Add labels.
- Set due dates.
- Change status.
- Set other attributes.
Each command starts with a forward slash (`/`) and must be entered on a separate line.
Many quick actions accept parameters, which you can enter with quotation marks (`"`) or specific formatting.
## Parameters
Many quick actions require a parameter. For example, the `/assign` quick action
requires a username. GitLab uses [autocomplete characters](autocomplete_characters.md)
with quick actions to help users enter parameters, by providing a list of
available values.
If you manually enter a parameter, it must be enclosed in double quotation marks
(`"`), unless it contains only these characters:
- ASCII letters
- Numbers (0-9)
- Underscore (`_`), hyphen (`-`), question mark (`?`), dot (`.`), ampersand (`&`) or at (`@`)
Parameters are case-sensitive. Autocomplete handles this, and the insertion
of quotation marks, automatically.
## Issues, merge requests, and epics
The following quick actions are applicable to descriptions, discussions, and
threads. Some quick actions might not be available to all subscription tiers.
<!--
Keep this table sorted alphabetically
To auto-format this table, use the VS Code Markdown Table formatter: `https://docs.gitlab.com/ee/development/documentation/styleguide/#editor-extensions-for-table-formatting`.
-->
| Command | Issue | Merge request | Epic | Action |
|:------------------------------------------------------------------------------------------------|:-----------------------|:-----------------------|:-----------------------|:-------|
| `/add_child <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Add `<item>` as a child item. The `<item>` value should be in the format of `#item`, `group/project#item`, or a URL to the item. For issues, you can add tasks and OKRs. [The new look for issues](issues/issue_work_items.md) must be enabled. For epics, you can add issues, tasks, and OKRs. Multiple work items can be added as child items at the same time. |
| `/add_contacts [contact:email1@example.com] [contact:email2@example.com]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add one or more active [CRM contacts](../crm/_index.md). |
| `/add_email email1 email2` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add up to six [email participants](service_desk/external_participants.md). This action is behind the feature flag `issue_email_participants`. Not supported in [issue templates](description_templates.md). |
| `/approve` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Approve the merge request. |
| `/assign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign one or more users. |
| `/assign me` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign yourself. |
| `/assign_reviewer @user1 @user2` or `/reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign one or more users as reviewers. |
| `/assign_reviewer me` or `/reviewer me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign yourself as a reviewer. |
| `/blocked_by <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark the item as blocked by other items. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214232) in GitLab 16.0). |
| `/blocks <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark the item as blocking other items. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214232) in GitLab 16.0). |
| `/board_move ~column` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Move issue to column on the board. The project must have only one issue board. |
| `/cc @user` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mention a user. This command performs no action. You can instead type `CC @user` or only `@user`. |
| `/clear_health_status` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Clear [health status](issues/managing_issues.md#health-status). |
| `/clear_weight` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Clear weight. |
| `/clone <path/to/group_or_project> [--with_notes]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Clone the work item to a given group or project, or the current one if no arguments are given. Copies as much data as possible as long as the target contains equivalent objects like labels, milestones, or epics. Does not copy comments or system notes unless `--with_notes` is provided as an argument. |
| `/close` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Close. |
| `/confidential` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark issue or epic as confidential. |
| `/convert_to_ticket <email address>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | [Convert an issue into a Service Desk ticket](service_desk/using_service_desk.md#convert-a-regular-issue-to-a-service-desk-ticket). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 |
| `/copy_metadata <!merge_request>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Copy labels and milestone from another merge request in the project. |
| `/copy_metadata <#item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Copy labels and milestone from another item in the project. |
| `/create_merge_request <branch name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Create a new merge request starting from the current issue. |
| `/done` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Mark to-do item as done. |
| `/draft` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set the [draft status](merge_requests/drafts.md). |
| `/due <date>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. See [Chronic](https://gitlab.com/gitlab-org/ruby/gems/gitlab-chronic#examples) for more examples. |
| `/duplicate <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Close this item and mark as related to, and a duplicate of, `<item>`. |
| `/epic <epic>` or `/set_parent <epic>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No |{{< icon name="check-circle" >}} Yes| Add to epic `<epic>` as a child item. The `<epic>` value should be in the format of `&epic`, `#epic`, `group&epic`, `group#epic`, or a URL to an epic. |
| `/estimate <time>` or `/estimate_time <time>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Set time estimate. For example, `/estimate 1mo 2w 3d 4h 5m`. For more information, see [Time tracking](time_tracking.md). |
| `/health_status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set [health status](issues/managing_issues.md#health-status). Valid options for `<value>` are `on_track`, `needs_attention`, and `at_risk`. |
| `/iteration *iteration:<iteration ID> or <iteration name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration. For example, to set the `Late in July` iteration: `/iteration *iteration:"Late in July"`. |
| `/iteration [cadence:<iteration cadence ID> or <iteration cadence name>] <--current or --next>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration to the current or next upcoming iteration of the referenced iteration cadence. For example, `/iteration [cadence:"Team cadence"] --current` sets the iteration to the current iteration of the iteration cadence named "Team cadence". [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9. |
| `/iteration <--current or --next>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration to the current or next upcoming iteration when a group has one iteration cadence. For example, `/iteration --current` sets the iteration to the current iteration of the iteration cadence. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9. |
| `/label ~label1 ~label2` or `/labels ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add one or more labels. Label names can also start without a tilde (`~`), but mixed syntax is not supported. |
| `/link` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a link and description to [linked resources](../../operations/incident_management/linked_resources.md) in an incident. |
| `/lock` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Lock the discussions. |
| `/merge` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Merge changes. Depending on the project setting, this may be [when the pipeline succeeds](merge_requests/auto_merge.md), or adding to a [Merge Train](../../ci/pipelines/merge_trains.md). |
| `/milestone %milestone` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set milestone. |
| `/move <path/to/group_or_project>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Move the work item to another group or project. Be careful when moving a work item to a location with different access rules. Before moving the work item, make sure it does not contain sensitive data. |
| `/page <policy name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Start escalations for the incident. |
| `/promote_to_incident` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Promote issue to incident. You can also use the quick action when creating a new issue. |
| `/promote` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Promote issue to epic. If [the new look for issues](issues/issue_work_items.md) is enabled, use `/promote_to epic` instead. |
| `/publish` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Publish issue to an associated [Status Page](../../operations/incident_management/status_page.md). |
| `/react :emoji:` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Toggle an emoji reaction. [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409884) from `/award` in GitLab 16.7. `/award` is still available as an aliased command. |
| `/ready` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set the [ready status](merge_requests/drafts.md#mark-merge-requests-as-ready). |
| `/reassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Replace current assignees with those specified. |
| `/reassign_reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Replace current reviewers with those specified. |
| `/rebase` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Rebase source branch on the latest commit of the target branch. For help, see [troubleshooting information](../../topics/git/troubleshooting_git.md). |
| `/relabel ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current labels with those specified. |
| `/relate <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark items as related. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. |
| `/remove_child <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove `<item>` as child item. The `<item>` value should be in the format of `#item`, `group/project#item`, or a URL to the item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/remove_contacts [contact:email1@example.com] [contact:email2@example.com]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove one or more [CRM contacts](../crm/_index.md) |
| `/remove_due_date` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove due date. |
| `/remove_email email1 email2` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove up to six [email participants](service_desk/external_participants.md). This action is behind the feature flag `issue_email_participants`. Not supported in issue templates, merge requests, or epics. |
| `/remove_estimate` or `/remove_time_estimate` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove time estimate. |
| `/remove_iteration` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove iteration. |
| `/remove_milestone` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove milestone. |
| `/remove_parent` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove the parent from item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/remove_time_spent` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |{{< icon name="check-circle" >}} Yes | Remove time spent. |
| `/remove_zoom` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove Zoom meeting from this issue. |
| `/reopen` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Reopen. |
| `/request_review @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assigns or requests a new review from one or more users. |
| `/request_review me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assigns or requests a new review from one or more users. |
| `/set_parent <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set parent item. The `<item>` value should be in the format of `#IID`, reference, or a URL to an item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/severity <severity>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set the severity. Issue type must be `Incident`. Options for `<severity>` are `S1` ... `S4`, `critical`, `high`, `medium`, `low`, `unknown`. |
| `/shrug` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `¯\_(ツ)_/¯`. |
| `/spend <time> [<date>]` or `/spend_time <time> [<date>]` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Add or subtract spent time. Optionally, specify the date that time was spent on. For example, `/spend 1mo 2w 3d 4h 5m 2018-08-26` or `/spend -1h 30m`. For more information, see [Time tracking](time_tracking.md). |
| `/status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set [status](../work_items/status.md). Valid options for `<value>` include status options set for the namespace. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 with flag named `work_item_status_feature_flag`. |
| `/submit_review` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Submit a pending review. |
| `/subscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Subscribe to notifications. |
| `/tableflip` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `(╯°□°)╯︵ ┻━┻`. |
| `/target_branch <local branch name>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set target branch. |
| `/timeline <timeline comment> \| <date(YYYY-MM-DD)> <time(HH:MM)>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a timeline event to this incident. For example, `/timeline DB load spiked \| 2022-09-07 09:30`. |
| `/title <new title>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Change title. |
| `/todo` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add a to-do item. |
| `/unapprove` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Unapprove the merge request. |
| `/unassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove specific assignees. |
| `/unassign_reviewer @user1 @user2` or `/remove_reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove specific reviewers. |
| `/unassign_reviewer me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove yourself as a reviewer. |
| `/unassign_reviewer` or `/remove_reviewer` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove all reviewers. |
| `/unassign` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove all assignees. |
| `/unlabel ~label1 ~label2` or `/remove_label ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specified labels. |
| `/unlabel` or `/remove_label` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all labels. |
| `/unlink <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No |{{< icon name="check-circle" >}} Yes| Remove link with to the provided issue. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/414400) in GitLab 16.1). |
| `/unlock` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |{{< icon name="check-circle" >}} Yes| Unlock the discussions.|
| `/unsubscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe from notifications. |
| `/weight <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set weight. Valid values are integers like `0`, `1`, or `2`. |
| `/zoom <Zoom URL>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a Zoom meeting to this issue or incident. Users on GitLab Premium can add a short description when [adding a Zoom link to an incident](../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident). |
## Work items
{{< history >}}
- Epics as work items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1.
{{< /history >}}
Work items in GitLab include:
- [Tasks](../tasks.md)
- [OKRs](../okrs.md)
- [Epics](../group/epics/_index.md) (see [Issues, merge requests, and epics](#issues-merge-requests-and-epics))
The following quick actions can be applied through the description field when editing or commenting on work items.
<!--
Keep this table sorted alphabetically
To auto-format this table, use the VS Code Markdown Table formatter: `https://docs.gitlab.com/ee/development/documentation/styleguide/#editor-extensions-for-table-formatting`.
-->
| Command | Task | Objective | Key Result | Action |
|:--------------------------------------------------------------|:-----------------------|:-----------------------|:-----------------------|:-------|
| `/assign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Assign one or more users. |
| `/assign me` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Assign yourself. |
| `/add_child <work_item>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Add child to `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. Multiple work items can be added as child items at the same time. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420797) in GitLab 16.5. |
| `/award :emoji:` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Toggle an emoji reaction. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412275) in GitLab 16.5 |
| `/checkin_reminder <cadence>` | {{< icon name="dotted-circle" >}} No| {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Schedule [check-in reminders](../okrs.md#schedule-okr-check-in-reminders). Options are `weekly`, `twice-monthly`, `monthly`, or `never` (default). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422761) in GitLab 16.4 with flags named `okrs_mvc` and `okr_checkin_reminders`. |
| `/clear_health_status` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Clear [health status](issues/managing_issues.md#health-status). |
| `/clear_weight` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Clear weight. |
| `/close` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Close. |
| `/confidential` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mark work item as confidential. [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412276) in GitLab 16.4. |
| `/copy_metadata <work_item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Copy labels and milestone from another work item in the same namespace. The `<work_item>` value should be in the format of `#item` or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/509076) in GitLab 17.9. |
| `/done` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mark to-do item as done. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412277) in GitLab 16.2. |
| `/due <date>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. |
| `/health_status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Set [health status](issues/managing_issues.md#health-status). Valid options for `<value>` are `on_track`, `needs_attention`, or `at_risk`. |
| `/label ~label1 ~label2` or `/labels ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add one or more labels. Label names can also start without a tilde (`~`), but mixed syntax is not supported. |
| `/promote_to <type>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Promotes work item to specified type. Available options for `<type>`: `issue` (promote a task) or `objective` (promote a key result). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1. |
| `/reassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current assignees with those specified. |
| `/relabel ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current labels with those specified. |
| `/remove_due_date` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove due date. |
| `/remove_child <work_item>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove the child `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/132761) in GitLab 16.10. |
| `/remove_parent` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Removes the parent work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/434344) in GitLab 16.9. |
| `/reopen` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Reopen. |
| `/set_parent <work_item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set parent work item to `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420798) in GitLab 16.5. Alias `/epic` for [issues with the new look](issues/issue_work_items.md) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/514942) in GitLab 17.10. |
| `/shrug` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `¯\_(ツ)_/¯`. |
| `/status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set [status](../work_items/status.md). Valid options for `<value>` include status options set for the namespace. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 with flag named `work_item_status_feature_flag`. |
| `/subscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Subscribe to notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420796) in GitLab 16.4 |
| `/tableflip` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `(╯°□°)╯︵ ┻━┻`. |
| `/title <new title>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Change title. |
| `/todo` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add a to-do item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412277) in GitLab 16.2. |
| `/type` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Converts work item to specified type. Available options for `<type>` include `issue`, `task`, `objective` and `key result`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385227) in GitLab 16.0. |
| `/unassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specific assignees. |
| `/unassign` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all assignees. |
| `/unlabel ~label1 ~label2` or `/remove_label ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specified labels. |
| `/unlabel` or `/remove_label` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all labels. |
| `/unlink` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove link to the provided work item. The `<work item>` value should be in the format of `#work_item`, `group/project#work_item`, or the full work item URL. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481851) in GitLab 17.8. |
| `/unsubscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe to notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420796) in GitLab 16.4 |
| `/weight <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set weight. Valid options for `<value>` include `0`, `1`, and `2`. |
## Commit comments
You can use quick actions when commenting on individual commits. These quick actions work only in
commit comment threads, not in commit messages or other GitLab contexts.
To use quick actions in commit comments:
1. Go to a commit page by selecting a commit from the commits list, merge request,
or other commit links.
1. In the comment form at the bottom of the commit page, enter your quick action.
1. Select **Comment**.
The following quick actions are applicable for commit comments:
| Command | Action |
|:----------------------- |:------------------------------------------|
| `/tag v1.2.3 <message>` | Creates a Git tag pointing to the commented commit, with an optional message. |
Here is an example Git tag:
```plaintext
Ready for release after security fix.
/tag v2.1.1 Security patch release
This comment creates a Git tag named `v2.1.1` pointing to the commit, with the
message "Security patch release".
## Troubleshooting
### Quick action isn't executed
If you run a quick action, but nothing happens, check if the quick action appears in the autocomplete
box as you type it.
If it doesn't, it's possible that:
- The feature related to the quick action isn't available to you based on your subscription tier or
user role for the group or project.
- A required condition for the quick action isn't met.
For example, you're running `/unlabel` on an issue without any labels.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: GitLab quick actions
description: Commands, shortcuts, and inline actions.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Quick actions provide text-based shortcuts for common actions in GitLab.
Quick actions:
- Execute common actions without using the user interface.
- Support working with issues, merge requests, epics, and commits.
- Run automatically when you save descriptions or comments.
- Respond to specific contexts and conditions.
- Process multiple commands when entered on separate lines.
For example, you can use quick actions to:
- Assign users.
- Add labels.
- Set due dates.
- Change status.
- Set other attributes.
Each command starts with a forward slash (`/`) and must be entered on a separate line.
Many quick actions accept parameters, which you can enter with quotation marks (`"`) or specific formatting.
## Parameters
Many quick actions require a parameter. For example, the `/assign` quick action
requires a username. GitLab uses [autocomplete characters](autocomplete_characters.md)
with quick actions to help users enter parameters, by providing a list of
available values.
If you manually enter a parameter, it must be enclosed in double quotation marks
(`"`), unless it contains only these characters:
- ASCII letters
- Numbers (0-9)
- Underscore (`_`), hyphen (`-`), question mark (`?`), dot (`.`), ampersand (`&`) or at (`@`)
Parameters are case-sensitive. Autocomplete handles this, and the insertion
of quotation marks, automatically.
## Issues, merge requests, and epics
The following quick actions are applicable to descriptions, discussions, and
threads. Some quick actions might not be available to all subscription tiers.
<!--
Keep this table sorted alphabetically
To auto-format this table, use the VS Code Markdown Table formatter: `https://docs.gitlab.com/ee/development/documentation/styleguide/#editor-extensions-for-table-formatting`.
-->
| Command | Issue | Merge request | Epic | Action |
|:------------------------------------------------------------------------------------------------|:-----------------------|:-----------------------|:-----------------------|:-------|
| `/add_child <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Add `<item>` as a child item. The `<item>` value should be in the format of `#item`, `group/project#item`, or a URL to the item. For issues, you can add tasks and OKRs. [The new look for issues](issues/issue_work_items.md) must be enabled. For epics, you can add issues, tasks, and OKRs. Multiple work items can be added as child items at the same time. |
| `/add_contacts [contact:email1@example.com] [contact:email2@example.com]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add one or more active [CRM contacts](../crm/_index.md). |
| `/add_email email1 email2` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add up to six [email participants](service_desk/external_participants.md). This action is behind the feature flag `issue_email_participants`. Not supported in [issue templates](description_templates.md). |
| `/approve` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Approve the merge request. |
| `/assign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign one or more users. |
| `/assign me` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign yourself. |
| `/assign_reviewer @user1 @user2` or `/reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign one or more users as reviewers. |
| `/assign_reviewer me` or `/reviewer me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assign yourself as a reviewer. |
| `/blocked_by <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark the item as blocked by other items. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214232) in GitLab 16.0). |
| `/blocks <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark the item as blocking other items. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214232) in GitLab 16.0). |
| `/board_move ~column` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Move issue to column on the board. The project must have only one issue board. |
| `/cc @user` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mention a user. This command performs no action. You can instead type `CC @user` or only `@user`. |
| `/clear_health_status` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Clear [health status](issues/managing_issues.md#health-status). |
| `/clear_weight` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Clear weight. |
| `/clone <path/to/group_or_project> [--with_notes]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Clone the work item to a given group or project, or the current one if no arguments are given. Copies as much data as possible as long as the target contains equivalent objects like labels, milestones, or epics. Does not copy comments or system notes unless `--with_notes` is provided as an argument. |
| `/close` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Close. |
| `/confidential` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark issue or epic as confidential. |
| `/convert_to_ticket <email address>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | [Convert an issue into a Service Desk ticket](service_desk/using_service_desk.md#convert-a-regular-issue-to-a-service-desk-ticket). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/433376) in GitLab 16.9 |
| `/copy_metadata <!merge_request>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Copy labels and milestone from another merge request in the project. |
| `/copy_metadata <#item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Copy labels and milestone from another item in the project. |
| `/create_merge_request <branch name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Create a new merge request starting from the current issue. |
| `/done` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Mark to-do item as done. |
| `/draft` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set the [draft status](merge_requests/drafts.md). |
| `/due <date>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. See [Chronic](https://gitlab.com/gitlab-org/ruby/gems/gitlab-chronic#examples) for more examples. |
| `/duplicate <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Close this item and mark as related to, and a duplicate of, `<item>`. |
| `/epic <epic>` or `/set_parent <epic>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No |{{< icon name="check-circle" >}} Yes| Add to epic `<epic>` as a child item. The `<epic>` value should be in the format of `&epic`, `#epic`, `group&epic`, `group#epic`, or a URL to an epic. |
| `/estimate <time>` or `/estimate_time <time>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Set time estimate. For example, `/estimate 1mo 2w 3d 4h 5m`. For more information, see [Time tracking](time_tracking.md). |
| `/health_status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set [health status](issues/managing_issues.md#health-status). Valid options for `<value>` are `on_track`, `needs_attention`, and `at_risk`. |
| `/iteration *iteration:<iteration ID> or <iteration name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration. For example, to set the `Late in July` iteration: `/iteration *iteration:"Late in July"`. |
| `/iteration [cadence:<iteration cadence ID> or <iteration cadence name>] <--current or --next>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration to the current or next upcoming iteration of the referenced iteration cadence. For example, `/iteration [cadence:"Team cadence"] --current` sets the iteration to the current iteration of the iteration cadence named "Team cadence". [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9. |
| `/iteration <--current or --next>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set iteration to the current or next upcoming iteration when a group has one iteration cadence. For example, `/iteration --current` sets the iteration to the current iteration of the iteration cadence. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384885) in GitLab 16.9. |
| `/label ~label1 ~label2` or `/labels ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add one or more labels. Label names can also start without a tilde (`~`), but mixed syntax is not supported. |
| `/link` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a link and description to [linked resources](../../operations/incident_management/linked_resources.md) in an incident. |
| `/lock` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Lock the discussions. |
| `/merge` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Merge changes. Depending on the project setting, this may be [when the pipeline succeeds](merge_requests/auto_merge.md), or adding to a [Merge Train](../../ci/pipelines/merge_trains.md). |
| `/milestone %milestone` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set milestone. |
| `/move <path/to/group_or_project>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Move the work item to another group or project. Be careful when moving a work item to a location with different access rules. Before moving the work item, make sure it does not contain sensitive data. |
| `/page <policy name>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Start escalations for the incident. |
| `/promote_to_incident` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Promote issue to incident. You can also use the quick action when creating a new issue. |
| `/promote` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Promote issue to epic. If [the new look for issues](issues/issue_work_items.md) is enabled, use `/promote_to epic` instead. |
| `/publish` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Publish issue to an associated [Status Page](../../operations/incident_management/status_page.md). |
| `/react :emoji:` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Toggle an emoji reaction. [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409884) from `/award` in GitLab 16.7. `/award` is still available as an aliased command. |
| `/ready` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set the [ready status](merge_requests/drafts.md#mark-merge-requests-as-ready). |
| `/reassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Replace current assignees with those specified. |
| `/reassign_reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Replace current reviewers with those specified. |
| `/rebase` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Rebase source branch on the latest commit of the target branch. For help, see [troubleshooting information](../../topics/git/troubleshooting_git.md). |
| `/relabel ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current labels with those specified. |
| `/relate <item1> <item2>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Mark items as related. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. |
| `/remove_child <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove `<item>` as child item. The `<item>` value should be in the format of `#item`, `group/project#item`, or a URL to the item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/remove_contacts [contact:email1@example.com] [contact:email2@example.com]` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove one or more [CRM contacts](../crm/_index.md) |
| `/remove_due_date` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove due date. |
| `/remove_email email1 email2` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove up to six [email participants](service_desk/external_participants.md). This action is behind the feature flag `issue_email_participants`. Not supported in issue templates, merge requests, or epics. |
| `/remove_estimate` or `/remove_time_estimate` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove time estimate. |
| `/remove_iteration` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove iteration. |
| `/remove_milestone` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove milestone. |
| `/remove_parent` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove the parent from item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/remove_time_spent` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |{{< icon name="check-circle" >}} Yes | Remove time spent. |
| `/remove_zoom` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Remove Zoom meeting from this issue. |
| `/reopen` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Reopen. |
| `/request_review @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assigns or requests a new review from one or more users. |
| `/request_review me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Assigns or requests a new review from one or more users. |
| `/set_parent <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set parent item. The `<item>` value should be in the format of `#IID`, reference, or a URL to an item. For issues, [the new look for issues](issues/issue_work_items.md) must be enabled. |
| `/severity <severity>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set the severity. Issue type must be `Incident`. Options for `<severity>` are `S1` ... `S4`, `critical`, `high`, `medium`, `low`, `unknown`. |
| `/shrug` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `¯\_(ツ)_/¯`. |
| `/spend <time> [<date>]` or `/spend_time <time> [<date>]` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes| Add or subtract spent time. Optionally, specify the date that time was spent on. For example, `/spend 1mo 2w 3d 4h 5m 2018-08-26` or `/spend -1h 30m`. For more information, see [Time tracking](time_tracking.md). |
| `/status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set [status](../work_items/status.md). Valid options for `<value>` include status options set for the namespace. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 with flag named `work_item_status_feature_flag`. |
| `/submit_review` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Submit a pending review. |
| `/subscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Subscribe to notifications. |
| `/tableflip` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `(╯°□°)╯︵ ┻━┻`. |
| `/target_branch <local branch name>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Set target branch. |
| `/timeline <timeline comment> \| <date(YYYY-MM-DD)> <time(HH:MM)>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a timeline event to this incident. For example, `/timeline DB load spiked \| 2022-09-07 09:30`. |
| `/title <new title>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Change title. |
| `/todo` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add a to-do item. |
| `/unapprove` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Unapprove the merge request. |
| `/unassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove specific assignees. |
| `/unassign_reviewer @user1 @user2` or `/remove_reviewer @user1 @user2` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove specific reviewers. |
| `/unassign_reviewer me` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove yourself as a reviewer. |
| `/unassign_reviewer` or `/remove_reviewer` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove all reviewers. |
| `/unassign` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove all assignees. |
| `/unlabel ~label1 ~label2` or `/remove_label ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specified labels. |
| `/unlabel` or `/remove_label` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all labels. |
| `/unlink <item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No |{{< icon name="check-circle" >}} Yes| Remove link with to the provided issue. The `<item>` value should be in the format of `#item`, `group/project#item`, or the full URL. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/414400) in GitLab 16.1). |
| `/unlock` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |{{< icon name="check-circle" >}} Yes| Unlock the discussions.|
| `/unsubscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe from notifications. |
| `/weight <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set weight. Valid values are integers like `0`, `1`, or `2`. |
| `/zoom <Zoom URL>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Add a Zoom meeting to this issue or incident. Users on GitLab Premium can add a short description when [adding a Zoom link to an incident](../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident). |
## Work items
{{< history >}}
- Epics as work items [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1.
{{< /history >}}
Work items in GitLab include:
- [Tasks](../tasks.md)
- [OKRs](../okrs.md)
- [Epics](../group/epics/_index.md) (see [Issues, merge requests, and epics](#issues-merge-requests-and-epics))
The following quick actions can be applied through the description field when editing or commenting on work items.
<!--
Keep this table sorted alphabetically
To auto-format this table, use the VS Code Markdown Table formatter: `https://docs.gitlab.com/ee/development/documentation/styleguide/#editor-extensions-for-table-formatting`.
-->
| Command | Task | Objective | Key Result | Action |
|:--------------------------------------------------------------|:-----------------------|:-----------------------|:-----------------------|:-------|
| `/assign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Assign one or more users. |
| `/assign me` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Assign yourself. |
| `/add_child <work_item>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Add child to `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. Multiple work items can be added as child items at the same time. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420797) in GitLab 16.5. |
| `/award :emoji:` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Toggle an emoji reaction. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412275) in GitLab 16.5 |
| `/checkin_reminder <cadence>` | {{< icon name="dotted-circle" >}} No| {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Schedule [check-in reminders](../okrs.md#schedule-okr-check-in-reminders). Options are `weekly`, `twice-monthly`, `monthly`, or `never` (default). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422761) in GitLab 16.4 with flags named `okrs_mvc` and `okr_checkin_reminders`. |
| `/clear_health_status` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Clear [health status](issues/managing_issues.md#health-status). |
| `/clear_weight` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Clear weight. |
| `/close` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Close. |
| `/confidential` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mark work item as confidential. [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412276) in GitLab 16.4. |
| `/copy_metadata <work_item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Copy labels and milestone from another work item in the same namespace. The `<work_item>` value should be in the format of `#item` or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/509076) in GitLab 17.9. |
| `/done` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Mark to-do item as done. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412277) in GitLab 16.2. |
| `/due <date>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. |
| `/health_status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Set [health status](issues/managing_issues.md#health-status). Valid options for `<value>` are `on_track`, `needs_attention`, or `at_risk`. |
| `/label ~label1 ~label2` or `/labels ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add one or more labels. Label names can also start without a tilde (`~`), but mixed syntax is not supported. |
| `/promote_to <type>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Promotes work item to specified type. Available options for `<type>`: `issue` (promote a task) or `objective` (promote a key result). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412534) in GitLab 16.1. |
| `/reassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current assignees with those specified. |
| `/relabel ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Replace current labels with those specified. |
| `/remove_due_date` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Remove due date. |
| `/remove_child <work_item>` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | Remove the child `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/132761) in GitLab 16.10. |
| `/remove_parent` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Removes the parent work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/434344) in GitLab 16.9. |
| `/reopen` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Reopen. |
| `/set_parent <work_item>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | Set parent work item to `<work_item>`. The `<work_item>` value should be in the format of `#item`, `group/project#item`, or a URL to a work item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420798) in GitLab 16.5. Alias `/epic` for [issues with the new look](issues/issue_work_items.md) [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/514942) in GitLab 17.10. |
| `/shrug` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `¯\_(ツ)_/¯`. |
| `/status <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set [status](../work_items/status.md). Valid options for `<value>` include status options set for the namespace. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 with flag named `work_item_status_feature_flag`. |
| `/subscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Subscribe to notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420796) in GitLab 16.4 |
| `/tableflip` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add `(╯°□°)╯︵ ┻━┻`. |
| `/title <new title>` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Change title. |
| `/todo` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Add a to-do item. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412277) in GitLab 16.2. |
| `/type` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Converts work item to specified type. Available options for `<type>` include `issue`, `task`, `objective` and `key result`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385227) in GitLab 16.0. |
| `/unassign @user1 @user2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specific assignees. |
| `/unassign` | {{< icon name="dotted-circle" >}} No | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all assignees. |
| `/unlabel ~label1 ~label2` or `/remove_label ~label1 ~label2` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove specified labels. |
| `/unlabel` or `/remove_label` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove all labels. |
| `/unlink` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Remove link to the provided work item. The `<work item>` value should be in the format of `#work_item`, `group/project#work_item`, or the full work item URL. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/481851) in GitLab 17.8. |
| `/unsubscribe` | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes | Unsubscribe to notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/420796) in GitLab 16.4 |
| `/weight <value>` | {{< icon name="check-circle" >}} Yes | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No | Set weight. Valid options for `<value>` include `0`, `1`, and `2`. |
## Commit comments
You can use quick actions when commenting on individual commits. These quick actions work only in
commit comment threads, not in commit messages or other GitLab contexts.
To use quick actions in commit comments:
1. Go to a commit page by selecting a commit from the commits list, merge request,
or other commit links.
1. In the comment form at the bottom of the commit page, enter your quick action.
1. Select **Comment**.
The following quick actions are applicable for commit comments:
| Command | Action |
|:----------------------- |:------------------------------------------|
| `/tag v1.2.3 <message>` | Creates a Git tag pointing to the commented commit, with an optional message. |
Here is an example Git tag:
```plaintext
Ready for release after security fix.
/tag v2.1.1 Security patch release
This comment creates a Git tag named `v2.1.1` pointing to the commit, with the
message "Security patch release".
## Troubleshooting
### Quick action isn't executed
If you run a quick action, but nothing happens, check if the quick action appears in the autocomplete
box as you type it.
If it doesn't, it's possible that:
- The feature related to the quick action isn't available to you based on your subscription tier or
user role for the group or project.
- A required condition for the quick action isn't met.
For example, you're running `/unlabel` on an issue without any labels.
|
https://docs.gitlab.com/user/project
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/_index.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
_index.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Create a project
|
New project and project templates.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You have different options to create a project. You can create a blank project, create a project
from built-in or custom templates, or [create a project with `git push`](../../topics/git/project.md).
## Create a blank project
To create a blank project:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create blank project**.
1. Enter the project details:
1. **Project name**: Enter the name of your project.
For more information, see [naming rules](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs).
1. **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
1. **Project deployment target (optional)**: If you want to deploy your project to specific environment,
select the relevant deployment target.
1. **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. **Initialize repository with a README**: Select this option to initialize the Git repository,
create a default branch, and enable cloning of this project's repository.
1. **Enable Static Application Security Testing (SAST)**: Select this option to analyze the
source code for known security vulnerabilities.
1. **Enable Secret Detection**: Select this option to analyze the
source code for secrets and credentials to prevent unauthorized access.
1. Select **Create project**.
## Create a project from a built-in template
Built-in templates populate a new project with files to help you get started.
These templates are sourced from the [`project-templates`](https://gitlab.com/gitlab-org/project-templates)
and [`pages`](https://gitlab.com/pages) groups.
Anyone can contribute to built-in project templates.
To create a project from a built-in template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Built-in** tab.
1. From the list of templates:
- To preview a template, select **Preview**.
- To use a template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project.
The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
{{< alert type="note" >}}
If a user creates a project from a template, or [imports a project](settings/import_export.md#import-a-project-and-its-data),
they are shown as the author of the imported items, which retain the original timestamp from the template or import.
This can make items appear as if they were created before the user's account existed.
{{< /alert >}}
Imported objects are labeled as `By <username> on <timestamp>`.
Before GitLab 17.1, the label was suffixed with `(imported from GitLab)`.
### Create a project from the HIPAA Audit Protocol template
The HIPAA Audit Protocol template contains issues for audit inquiries in the
HIPAA Audit Protocol published by the U.S Department of Health and Human Services.
To create a project from the HIPAA Audit Protocol template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Built-in** tab.
1. Locate the **HIPAA Audit Protocol** template:
- To preview the template, select **Preview**.
- To use the template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project.
The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
## Create a project from a custom template
Custom project templates are available for your [instance](../../administration/custom_project_templates.md)
and [group](../group/custom_project_templates.md).
To create a project from a custom template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Instance** or **Group** tab.
1. From the list of templates:
- To preview the template, select **Preview**.
- To use a template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project. The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
## Create a project that uses SHA-256 hashing
{{< details >}}
- Status: Experiment
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/431864) in GitLab 16.7 [with a flag](../../administration/feature_flags/_index.md) named `support_sha256_repositories`. Disabled by default. This feature is an [experiment](../../policy/development_stages_support.md#experiment).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can select SHA-256 hashing for a project only when you create the project.
Git does not support migrating to SHA-256 later, or migrating back to SHA-1.
To create a project that uses SHA-256 hashing:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project. The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. In the **Project Configuration** area, expand the **Experimental settings**.
1. Select **Use SHA-256 as the repository hashing algorithm**.
1. Select **Create project**.
### Why SHA-256?
By default, Git uses the SHA-1 hashing algorithm
to generate a 40-character
ID for objects such as commits, blobs, trees, and tags. The SHA-1 algorithm was proven to be insecure when
[Google was able to produce a hash collision](https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html).
The Git project is not yet impacted by these
kinds of attacks because of the way Git stores objects.
In SHA-256 repositories, the algorithm generates a 64-character ID instead of a 40-character ID.
The Git project determined that the SHA-256 feature is safe to use when they
[removed the experimental label](https://github.com/git/git/blob/master/Documentation/RelNotes/2.42.0.txt#L41-L45).
Federal regulations, such as NIST and CISA [guidelines](https://csrc.nist.gov/projects/hash-functions/nist-policy-on-hash-functions),
which [FedRamp](https://www.fedramp.gov/) enforces, have set a due date in 2030 to stop using SHA-1 and
encourage agencies to move away from SHA-1 earlier, if possible.
## Related topics
- [Create a project with `git push`](../../topics/git/project.md)
- [Reserved project and group names](../reserved_names.md)
- [Rules for project and group names](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs)
- [Manage projects](working_with_projects.md)
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Create a project
description: New project and project templates.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You have different options to create a project. You can create a blank project, create a project
from built-in or custom templates, or [create a project with `git push`](../../topics/git/project.md).
## Create a blank project
To create a blank project:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create blank project**.
1. Enter the project details:
1. **Project name**: Enter the name of your project.
For more information, see [naming rules](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs).
1. **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
1. **Project deployment target (optional)**: If you want to deploy your project to specific environment,
select the relevant deployment target.
1. **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. **Initialize repository with a README**: Select this option to initialize the Git repository,
create a default branch, and enable cloning of this project's repository.
1. **Enable Static Application Security Testing (SAST)**: Select this option to analyze the
source code for known security vulnerabilities.
1. **Enable Secret Detection**: Select this option to analyze the
source code for secrets and credentials to prevent unauthorized access.
1. Select **Create project**.
## Create a project from a built-in template
Built-in templates populate a new project with files to help you get started.
These templates are sourced from the [`project-templates`](https://gitlab.com/gitlab-org/project-templates)
and [`pages`](https://gitlab.com/pages) groups.
Anyone can contribute to built-in project templates.
To create a project from a built-in template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Built-in** tab.
1. From the list of templates:
- To preview a template, select **Preview**.
- To use a template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project.
The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
{{< alert type="note" >}}
If a user creates a project from a template, or [imports a project](settings/import_export.md#import-a-project-and-its-data),
they are shown as the author of the imported items, which retain the original timestamp from the template or import.
This can make items appear as if they were created before the user's account existed.
{{< /alert >}}
Imported objects are labeled as `By <username> on <timestamp>`.
Before GitLab 17.1, the label was suffixed with `(imported from GitLab)`.
### Create a project from the HIPAA Audit Protocol template
The HIPAA Audit Protocol template contains issues for audit inquiries in the
HIPAA Audit Protocol published by the U.S Department of Health and Human Services.
To create a project from the HIPAA Audit Protocol template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Built-in** tab.
1. Locate the **HIPAA Audit Protocol** template:
- To preview the template, select **Preview**.
- To use the template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project.
The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
## Create a project from a custom template
Custom project templates are available for your [instance](../../administration/custom_project_templates.md)
and [group](../group/custom_project_templates.md).
To create a project from a custom template:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Create from template**.
1. Select the **Instance** or **Group** tab.
1. From the list of templates:
- To preview the template, select **Preview**.
- To use a template, select **Use template**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project. The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. Select **Create project**.
## Create a project that uses SHA-256 hashing
{{< details >}}
- Status: Experiment
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/431864) in GitLab 16.7 [with a flag](../../administration/feature_flags/_index.md) named `support_sha256_repositories`. Disabled by default. This feature is an [experiment](../../policy/development_stages_support.md#experiment).
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can select SHA-256 hashing for a project only when you create the project.
Git does not support migrating to SHA-256 later, or migrating back to SHA-1.
To create a project that uses SHA-256 hashing:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Enter the project details:
- **Project name**: Enter the name of your project.
- **Project slug**: Enter the path to your project. GitLab uses the slug as the URL path.
- **Project description (optional)** Enter a description for your project. The character limit is 500.
- **Visibility Level**: Select the appropriate visibility level.
See the [viewing and access rights](../public_access.md) for users.
1. In the **Project Configuration** area, expand the **Experimental settings**.
1. Select **Use SHA-256 as the repository hashing algorithm**.
1. Select **Create project**.
### Why SHA-256?
By default, Git uses the SHA-1 hashing algorithm
to generate a 40-character
ID for objects such as commits, blobs, trees, and tags. The SHA-1 algorithm was proven to be insecure when
[Google was able to produce a hash collision](https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html).
The Git project is not yet impacted by these
kinds of attacks because of the way Git stores objects.
In SHA-256 repositories, the algorithm generates a 64-character ID instead of a 40-character ID.
The Git project determined that the SHA-256 feature is safe to use when they
[removed the experimental label](https://github.com/git/git/blob/master/Documentation/RelNotes/2.42.0.txt#L41-L45).
Federal regulations, such as NIST and CISA [guidelines](https://csrc.nist.gov/projects/hash-functions/nist-policy-on-hash-functions),
which [FedRamp](https://www.fedramp.gov/) enforces, have set a due date in 2030 to stop using SHA-1 and
encourage agencies to move away from SHA-1 earlier, if possible.
## Related topics
- [Create a project with `git push`](../../topics/git/project.md)
- [Reserved project and group names](../reserved_names.md)
- [Rules for project and group names](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs)
- [Manage projects](working_with_projects.md)
|
https://docs.gitlab.com/user/system_notes
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/system_notes.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
system_notes.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
System notes
|
Event history, activity log, and comment history.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
System notes are short descriptions that help you understand the history of events
that occur during the lifecycle of a GitLab object, such as:
- [Alerts](../../operations/incident_management/alerts.md).
- [Designs](issues/design_management.md).
- [Issues](issues/_index.md).
- [Merge requests](merge_requests/_index.md).
- [Objectives and key results](../okrs.md) (OKRs).
- [Tasks](../tasks.md).
GitLab logs information about events triggered by Git or the GitLab application
in system notes. System notes use the format `<Author> <action> <time ago>`.
## Show or filter system notes
By default, system notes do not display. When displayed, they are shown oldest first.
If you change the filter or sort options, your selection is remembered across sections.
For all item types except merge requests, the filtering options are:
- **Show all activity** displays both comments and history.
- **Show comments only** hides system notes.
- **Show history only** hides user comments.
Merge requests provide more granular filtering options.
### On an epic
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Epics**.
1. Identify your desired epic, and select its title.
1. Go to the **Activity** section.
1. For **Sort or filter**, select **Show all activity**.
### On an issue
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find your issue.
1. Go to **Activity**.
1. For **Sort or filter**, select **Show all activity**.
### On a merge request
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Go to **Activity**.
1. For **Sort or filter**, select **Show all activity** to see all system notes.
To narrow the types of system notes returned, select one or more of:
- **Approvals**
- **Assignees & Reviewers**
- **Comments**
- **Commits & branches**
- **Edits**
- **Labels**
- **Lock status**
- **Mentions**
- **Merge request status**
- **Tracking**
## Privacy considerations
You can see only the system notes linked to objects you can access.
For example, if someone mentions your issue 111 in an issue in their private project:
- The project members see the following note in issue 111: `Alex Garcia mentioned in agarcia/private-project#222`.
- Non-members of the project can't see the note at all.
## Related topics
- [Notes API](../../api/notes.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Event history, activity log, and comment history.
title: System notes
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
System notes are short descriptions that help you understand the history of events
that occur during the lifecycle of a GitLab object, such as:
- [Alerts](../../operations/incident_management/alerts.md).
- [Designs](issues/design_management.md).
- [Issues](issues/_index.md).
- [Merge requests](merge_requests/_index.md).
- [Objectives and key results](../okrs.md) (OKRs).
- [Tasks](../tasks.md).
GitLab logs information about events triggered by Git or the GitLab application
in system notes. System notes use the format `<Author> <action> <time ago>`.
## Show or filter system notes
By default, system notes do not display. When displayed, they are shown oldest first.
If you change the filter or sort options, your selection is remembered across sections.
For all item types except merge requests, the filtering options are:
- **Show all activity** displays both comments and history.
- **Show comments only** hides system notes.
- **Show history only** hides user comments.
Merge requests provide more granular filtering options.
### On an epic
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Epics**.
1. Identify your desired epic, and select its title.
1. Go to the **Activity** section.
1. For **Sort or filter**, select **Show all activity**.
### On an issue
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issues** and find your issue.
1. Go to **Activity**.
1. For **Sort or filter**, select **Show all activity**.
### On a merge request
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Merge requests** and find your merge request.
1. Go to **Activity**.
1. For **Sort or filter**, select **Show all activity** to see all system notes.
To narrow the types of system notes returned, select one or more of:
- **Approvals**
- **Assignees & Reviewers**
- **Comments**
- **Commits & branches**
- **Edits**
- **Labels**
- **Lock status**
- **Mentions**
- **Merge request status**
- **Tracking**
## Privacy considerations
You can see only the system notes linked to objects you can access.
For example, if someone mentions your issue 111 in an issue in their private project:
- The project members see the following note in issue 111: `Alex Garcia mentioned in agarcia/private-project#222`.
- Non-members of the project can't see the note at all.
## Related topics
- [Notes API](../../api/notes.md)
|
https://docs.gitlab.com/user/canary_deployments
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/canary_deployments.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
canary_deployments.md
|
none
|
unassigned
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Canary deployments
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Canary deployments are a popular [continuous deployment](https://en.wikipedia.org/wiki/Continuous_deployment)
strategy, where a small portion of the fleet is updated to the new version of
your application.
When embracing [continuous delivery](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/), an organization needs to decide what
type of deployment strategy to use. One of the most popular strategies is canary
deployments, where a small portion of the fleet is updated to the new version
first. This subset, the canaries, then serve as the proverbial
[canary in the coal mine](https://en.wiktionary.org/wiki/canary_in_a_coal_mine).
If there is a problem with the new version of the application, only a small
percentage of users are affected and the change can either be fixed or quickly
reverted.
## Use cases
Canary deployments can be used when you want to ship features to only a portion of
your pods fleet and watch their behavior as a percentage of your user base
visits the temporarily deployed feature. If all works well, you can deploy the
feature to production knowing that it shouldn't cause any problems.
Canary deployments are also especially required for backend refactors, performance
improvements, or other changes where the user interface doesn't change, but you
want to make sure the performance stays the same, or improves. Developers need
to be careful when using canaries with user-facing changes, because by default,
requests from the same user are randomly distributed between canary and
non-canary pods, which could result in confusion or even errors. If needed, you
may want to consider
[setting `service.spec.sessionAffinity` to `ClientIP` in your Kubernetes service definitions](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies),
but that is beyond the scope of this document.
## Advanced traffic control with Canary Ingress
Canary deployments can be more strategic with [Canary Ingress](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary),
which is an advanced traffic routing service that controls incoming HTTP
requests between stable and canary deployments based on factors such as weight, sessions, cookies,
and others. GitLab uses this service in its [Auto Deploy architecture](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#v2-chart-resource-architecture)
to let users quickly and safely roll out their new deployments.
### How to set up a Canary Ingress in a canary deployment
A Canary Ingress is installed by default if your Auto DevOps pipeline uses
[`v2.0.0+` of `auto-deploy-image`](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#verify-dependency-versions).
A Canary Ingress becomes available when you create a new canary deployment and is destroyed when the
canary deployment is promoted to production.
Here's an example setup flow from scratch:
1. Prepare an [Auto DevOps-enabled](../../topics/autodevops/_index.md) project.
1. Set up a [Kubernetes Cluster](../infrastructure/clusters/_index.md) in your project.
1. Install [NGINX Ingress](https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx) in your cluster.
1. Set up [the base domain](clusters/gitlab_managed_clusters.md#base-domain) based on the Ingress
Endpoint assigned above.
1. Check if [`v2.0.0+` of `auto-deploy-image` is used in your Auto DevOps pipelines](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#verify-dependency-versions).
If it isn't, follow the documentation to specify the image version.
1. [Run a new Auto DevOps pipeline](../../ci/pipelines/_index.md#run-a-pipeline-manually)
and make sure that the `production` job succeeds and creates a production environment.
1. Configure a [`canary` deployment job for Auto DevOps pipelines](../../topics/autodevops/cicd_variables.md#deploy-policy-for-canary-environments).
1. [Run a new Auto DevOps pipeline](../../ci/pipelines/_index.md#run-a-pipeline-manually)
and make sure that the `canary` job succeeds and creates a canary deployment with Canary Ingress.
### Show Canary Ingress deployments on deploy boards (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
To view canary deployments you must properly configure deploy boards:
1. Follow the steps to [enable deploy boards](deploy_boards.md#enabling-deploy-boards).
1. To track canary deployments you must label your Kubernetes deployments and
pods with `track: canary`. To get started quickly, you can use the [Auto Deploy](../../topics/autodevops/stages.md#auto-deploy)
template for canary deployments that GitLab provides.
Depending on the deploy, the label should be either `stable` or `canary`.
GitLab assumes the track label is `stable` if the label is blank or missing.
Any other track label is considered `canary` (temporary).
This allows GitLab to discover whether a deployment is stable or canary (temporary).
After you configure the deploy boards, and the pipeline runs at least once,
Go to the environments page under **Pipelines > Environments**.
As the pipeline executes, deploy boards clearly mark canary pods, enabling
quick and clear insight into the status of each environment and deployment.
Canary deployments are marked with a yellow dot in the deploy board so that you
can quickly notice them.

#### How to check the current traffic weight on a Canary Ingress (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
1. Visit the [deploy board](deploy_boards.md).
1. View the current weights on the right.

#### How to change the traffic weight on a Canary Ingress (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
You can change the traffic weight in your environment's deploy board by using [GraphiQL](../../api/graphql/getting_started.md#graphiql),
or by sending requests to the [GraphQL API](../../api/graphql/getting_started.md#command-line).
To use your [deploy board](deploy_boards.md):
1. Go to **Operate > Environments** for your project.
1. Set the new weight with the dropdown list on the right side.
1. Confirm your selection.
Here's an example using [GraphiQL](../../api/graphql/getting_started.md#graphiql):
1. Visit [GraphiQL Explorer](https://gitlab.com/-/graphql-explorer).
1. Execute the `environmentsCanaryIngressUpdate` GraphQL mutation:
```shell
mutation {
environmentsCanaryIngressUpdate(input:{
id: "gid://gitlab/Environment/29", # Your Environment ID. You can get the ID from the URL of the environment page.
weight: 45 # The new traffic weight. for example, If you set `45`, 45% of traffic goes to a canary deployment and 55% of traffic goes to a stable deployment.
}) {
errors
}
}
```
1. If the request succeeds, the `errors` response contains an empty array. GitLab sends a `PATCH`
request to your Kubernetes cluster for updating the weight parameter on a Canary Ingress.
|
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Canary deployments
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Canary deployments are a popular [continuous deployment](https://en.wikipedia.org/wiki/Continuous_deployment)
strategy, where a small portion of the fleet is updated to the new version of
your application.
When embracing [continuous delivery](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/), an organization needs to decide what
type of deployment strategy to use. One of the most popular strategies is canary
deployments, where a small portion of the fleet is updated to the new version
first. This subset, the canaries, then serve as the proverbial
[canary in the coal mine](https://en.wiktionary.org/wiki/canary_in_a_coal_mine).
If there is a problem with the new version of the application, only a small
percentage of users are affected and the change can either be fixed or quickly
reverted.
## Use cases
Canary deployments can be used when you want to ship features to only a portion of
your pods fleet and watch their behavior as a percentage of your user base
visits the temporarily deployed feature. If all works well, you can deploy the
feature to production knowing that it shouldn't cause any problems.
Canary deployments are also especially required for backend refactors, performance
improvements, or other changes where the user interface doesn't change, but you
want to make sure the performance stays the same, or improves. Developers need
to be careful when using canaries with user-facing changes, because by default,
requests from the same user are randomly distributed between canary and
non-canary pods, which could result in confusion or even errors. If needed, you
may want to consider
[setting `service.spec.sessionAffinity` to `ClientIP` in your Kubernetes service definitions](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies),
but that is beyond the scope of this document.
## Advanced traffic control with Canary Ingress
Canary deployments can be more strategic with [Canary Ingress](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary),
which is an advanced traffic routing service that controls incoming HTTP
requests between stable and canary deployments based on factors such as weight, sessions, cookies,
and others. GitLab uses this service in its [Auto Deploy architecture](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#v2-chart-resource-architecture)
to let users quickly and safely roll out their new deployments.
### How to set up a Canary Ingress in a canary deployment
A Canary Ingress is installed by default if your Auto DevOps pipeline uses
[`v2.0.0+` of `auto-deploy-image`](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#verify-dependency-versions).
A Canary Ingress becomes available when you create a new canary deployment and is destroyed when the
canary deployment is promoted to production.
Here's an example setup flow from scratch:
1. Prepare an [Auto DevOps-enabled](../../topics/autodevops/_index.md) project.
1. Set up a [Kubernetes Cluster](../infrastructure/clusters/_index.md) in your project.
1. Install [NGINX Ingress](https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx) in your cluster.
1. Set up [the base domain](clusters/gitlab_managed_clusters.md#base-domain) based on the Ingress
Endpoint assigned above.
1. Check if [`v2.0.0+` of `auto-deploy-image` is used in your Auto DevOps pipelines](../../topics/autodevops/upgrading_auto_deploy_dependencies.md#verify-dependency-versions).
If it isn't, follow the documentation to specify the image version.
1. [Run a new Auto DevOps pipeline](../../ci/pipelines/_index.md#run-a-pipeline-manually)
and make sure that the `production` job succeeds and creates a production environment.
1. Configure a [`canary` deployment job for Auto DevOps pipelines](../../topics/autodevops/cicd_variables.md#deploy-policy-for-canary-environments).
1. [Run a new Auto DevOps pipeline](../../ci/pipelines/_index.md#run-a-pipeline-manually)
and make sure that the `canary` job succeeds and creates a canary deployment with Canary Ingress.
### Show Canary Ingress deployments on deploy boards (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
To view canary deployments you must properly configure deploy boards:
1. Follow the steps to [enable deploy boards](deploy_boards.md#enabling-deploy-boards).
1. To track canary deployments you must label your Kubernetes deployments and
pods with `track: canary`. To get started quickly, you can use the [Auto Deploy](../../topics/autodevops/stages.md#auto-deploy)
template for canary deployments that GitLab provides.
Depending on the deploy, the label should be either `stable` or `canary`.
GitLab assumes the track label is `stable` if the label is blank or missing.
Any other track label is considered `canary` (temporary).
This allows GitLab to discover whether a deployment is stable or canary (temporary).
After you configure the deploy boards, and the pipeline runs at least once,
Go to the environments page under **Pipelines > Environments**.
As the pipeline executes, deploy boards clearly mark canary pods, enabling
quick and clear insight into the status of each environment and deployment.
Canary deployments are marked with a yellow dot in the deploy board so that you
can quickly notice them.

#### How to check the current traffic weight on a Canary Ingress (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
1. Visit the [deploy board](deploy_boards.md).
1. View the current weights on the right.

#### How to change the traffic weight on a Canary Ingress (deprecated)
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
{{< /alert >}}
You can change the traffic weight in your environment's deploy board by using [GraphiQL](../../api/graphql/getting_started.md#graphiql),
or by sending requests to the [GraphQL API](../../api/graphql/getting_started.md#command-line).
To use your [deploy board](deploy_boards.md):
1. Go to **Operate > Environments** for your project.
1. Set the new weight with the dropdown list on the right side.
1. Confirm your selection.
Here's an example using [GraphiQL](../../api/graphql/getting_started.md#graphiql):
1. Visit [GraphiQL Explorer](https://gitlab.com/-/graphql-explorer).
1. Execute the `environmentsCanaryIngressUpdate` GraphQL mutation:
```shell
mutation {
environmentsCanaryIngressUpdate(input:{
id: "gid://gitlab/Environment/29", # Your Environment ID. You can get the ID from the URL of the environment page.
weight: 45 # The new traffic weight. for example, If you set `45`, 45% of traffic goes to a canary deployment and 55% of traffic goes to a stable deployment.
}) {
errors
}
}
```
1. If the request succeeds, the `errors` response contains an empty array. GitLab sends a `PATCH`
request to your Kubernetes cluster for updating the weight parameter on a Canary Ingress.
|
https://docs.gitlab.com/user/description_templates
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/description_templates.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
description_templates.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Description templates
|
Issue templates, merge request templates, instance, and group templates.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Work item support](https://gitlab.com/gitlab-org/gitlab/-/issues/512208) introduced in GitLab 17.10.
- Support for epics [introduced](https://gitlab.com/groups/gitlab-org/-/epics/16088) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `work_item_epics`. Enabled by default. Introduced in [beta](../../policy/development_stages_support.md#beta).
- Support for epics [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
Description templates standardize and automate how issues and merge requests are created in GitLab.
Description templates:
- Create consistent layouts for issues and merge requests across projects.
- Provide specialized templates for different workflow stages and purposes.
- Support custom templates for projects, groups, and the entire instance.
- Auto-populate fields with variables and quick actions.
- Ensure proper tracking of bugs, features, and other work items.
- Format [Service Desk email responses](service_desk/configure.md#use-a-custom-template-for-service-desk-tickets).
You can define templates to use as descriptions
for your:
- [Issues](issues/_index.md)
- [Epics](../group/epics/_index.md) ([group-level description templates](#set-group-level-description-templates) must be set up)
- [Tasks](../tasks.md)
- [Objectives and key results](../okrs.md)
- [Incidents](../../operations/incident_management/manage_incidents.md)
- [Service Desk tickets](service_desk/_index.md)
- [Merge requests](merge_requests/_index.md)
Projects inherit templates from their group and instance.
Templates must be:
- Saved with the `.md` extension.
- Stored in your project's repository in the `.gitlab/issue_templates` or `.gitlab/merge_request_templates` directory.
- Present on the default branch.
## Create a description template
Create a new description template as a Markdown (`.md`) file inside the `.gitlab/issue_templates/` directory in your repository.
To create a work item description template:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Next to the default branch, select {{< icon name="plus" >}}.
1. Select **New file**.
1. Next to the default branch, in the **File name** text box, enter `.gitlab/issue_templates/mytemplate.md`,
where `mytemplate` is the name of your template.
1. Commit to your default branch.
To check if this has worked correctly:
1. [Create a new issue](issues/create_issues.md) or
[create a new epic](../group/epics/manage_epics.md#create-an-epic).
1. See if you can find your description template in the **Choose a template** dropdown list.
## Create a merge request template
Similarly to issue templates, create a new Markdown (`.md`) file inside the
`.gitlab/merge_request_templates/` directory in your repository. Unlike issue
templates, merge requests have [additional inheritance rules](merge_requests/creating_merge_requests.md)
that depend on the contents of commit messages and branch names.
To create a merge request description template for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Next to the default branch, select {{< icon name="plus" >}}.
1. Select **New file**.
1. Next to the default branch, in the **File name** text box, enter `.gitlab/merge_request_templates/mytemplate.md`,
where `mytemplate` is the name of your merge request template.
1. Commit to your default branch.
To check if this has worked correctly, [create a new merge request](merge_requests/creating_merge_requests.md)
and see if you can find your description template in the **Choose a template** dropdown list.
## Use the templates
When you create or edit an issue or a merge request, it shows in the **Choose a template** dropdown list.
To apply a template:
1. Create or edit an issue, work item, or a merge request.
1. Select the **Choose a template** dropdown list.
1. If the **Description** text box hasn't been empty, to confirm, select **Apply template**.
1. Select **Save changes**.
When you select a description template, its content is copied to the description text box.
To discard any changes to the description you've made after selecting the template: expand the **Choose a template** dropdown list and select **Reset template**.

{{< alert type="note" >}}
You can create shortcut links to create an issue using a designated template.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`. Read more about [creating issues using a URL with prefilled values](issues/create_issues.md#using-a-url-with-prefilled-values).
{{< /alert >}}
### Supported variables in merge request templates
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89810) in GitLab 15.7.
{{< /history >}}
{{< alert type="note" >}}
This feature is available only for
[the default template](#set-a-default-template-for-merge-requests-and-issues).
{{< /alert >}}
When you save a merge request for the first time, GitLab replaces these variables in
your merge request template with their values:
| Variable | Description | Output example |
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.` |
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` |
| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md` <br><br> `Improved project description in readme file.` |
| `%{first_multiline_commit_description}` | Description (without the first line/title) of the first commit that's not a merge commit and has more than one line in message body. | `Improved project description in readme file.` |
| `%{source_branch}` | The name of the branch being merged. | `my-feature-branch` |
| `%{target_branch}` | The name of the branch that the changes are applied to. | `main` |
### Set instance-level description templates
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can set a description template at the **instance level** for issues
and merge requests by using an [instance template repository](../../administration/settings/instance_template_repository.md).
You can also use the instance template repository for file templates.
You might also be interested in [project templates](../../administration/custom_project_templates.md)
that you can use when creating a new project in the instance.
### Set group-level description templates
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With **group-level** description templates, you can select a project within the group to store
your templates. Then, you can access these templates in other projects in the group.
As a result, you can use the same templates in issues and merge requests in all the group's projects.
Prerequisites:
- You must have the Owner role for the group.
- The project must be a direct child of the group.
To re-use templates [you've created](description_templates.md#create-a-description-template):
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Templates**.
1. From the dropdown list, select your template project as the template repository at group level.
1. Select **Save changes**.

You might also be interested in templates for various
[file types in groups](../group/manage.md#group-file-templates).
### Set a default template for merge requests and issues
In a project, you can choose a default description template for new issues and merge requests.
As a result, every time a new merge request or issue is created, it's pre-filled with the text you
entered in the template.
Prerequisites:
- On your project's left sidebar, select **Settings > General** and expand **Visibility, project features, permissions**.
Ensure issues or merge requests are set to either **Everyone with access** or **Only Project Members**.
To set a default description template for merge requests, either:
- [Create a merge request template](#create-a-merge-request-template) named `Default.md` (case-insensitive)
and save it in `.gitlab/merge_request_templates/`.
This [doesn't overwrite](#priority-of-default-description-templates) the default template if one has been set in the project settings.
- Users on GitLab Premium and Ultimate: set the default template in project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Default description template for merge requests** section, fill in the text area.
1. Select **Save changes**.
To set a default description template for issues, either:
- [Create an issue template](#create-a-description-template) named `Default.md` (case-insensitive)
and save it in `.gitlab/issue_templates/`.
This [doesn't overwrite](#priority-of-default-description-templates) the default template if one has been set in the project settings.
- Users on GitLab Premium and Ultimate: set the default template in project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Default description template for issues**.
1. Fill in the text area.
1. Select **Save changes**.
Because GitLab merge request and issues support [Markdown](../markdown.md), you can use it to format
headings, lists, and so on.
You can also provide `issues_template` and `merge_requests_template` attributes in the
[Projects REST API](../../api/projects.md) to keep your default issue and merge request templates up to date.
#### Priority of default description templates
When you set [issue description templates](#set-a-default-template-for-merge-requests-and-issues)
in various places, they have the following priorities in a project.
The ones higher up override the ones below:
1. Template set in project settings.
1. `Default.md` (case-insensitive) from the parent group.
1. `Default.md` (case-insensitive) from the project repository.
Merge requests have [additional inheritance rules](merge_requests/creating_merge_requests.md)
that depend on the contents of commit messages and branch names.
## Example description template
We use description templates for issues and merge requests in the
[`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/-/tree/master/.gitlab) of the
GitLab project, which you can refer to for some examples.
{{< alert type="note" >}}
It's possible to use [quick actions](quick_actions.md) in description templates to quickly add
labels, assignees, and milestones. The quick actions are only executed if the user submitting
the issue or merge request has the permissions to perform the relevant actions.
{{< /alert >}}
Here is an example of a bug report template:
```markdown
## Summary
<!-- HTML comments are not displayed -->
(Summarize the bug encountered concisely)
## Steps to reproduce
(How one can reproduce the issue - this is very important)
## Example Project
(If possible, create an example project here on GitLab.com that exhibits the problematic
behavior, and link to it here in the bug report.
If you are using an older version of GitLab, this will also determine whether the bug has been fixed
in a more recent version)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.)
## Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
/label ~bug ~reproduced ~needs-investigation
/cc @project-manager
/assign @qa-tester
```
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Description templates
description: Issue templates, merge request templates, instance, and group templates.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Work item support](https://gitlab.com/gitlab-org/gitlab/-/issues/512208) introduced in GitLab 17.10.
- Support for epics [introduced](https://gitlab.com/groups/gitlab-org/-/epics/16088) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `work_item_epics`. Enabled by default. Introduced in [beta](../../policy/development_stages_support.md#beta).
- Support for epics [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1. Feature flag `work_item_epics` removed.
{{< /history >}}
Description templates standardize and automate how issues and merge requests are created in GitLab.
Description templates:
- Create consistent layouts for issues and merge requests across projects.
- Provide specialized templates for different workflow stages and purposes.
- Support custom templates for projects, groups, and the entire instance.
- Auto-populate fields with variables and quick actions.
- Ensure proper tracking of bugs, features, and other work items.
- Format [Service Desk email responses](service_desk/configure.md#use-a-custom-template-for-service-desk-tickets).
You can define templates to use as descriptions
for your:
- [Issues](issues/_index.md)
- [Epics](../group/epics/_index.md) ([group-level description templates](#set-group-level-description-templates) must be set up)
- [Tasks](../tasks.md)
- [Objectives and key results](../okrs.md)
- [Incidents](../../operations/incident_management/manage_incidents.md)
- [Service Desk tickets](service_desk/_index.md)
- [Merge requests](merge_requests/_index.md)
Projects inherit templates from their group and instance.
Templates must be:
- Saved with the `.md` extension.
- Stored in your project's repository in the `.gitlab/issue_templates` or `.gitlab/merge_request_templates` directory.
- Present on the default branch.
## Create a description template
Create a new description template as a Markdown (`.md`) file inside the `.gitlab/issue_templates/` directory in your repository.
To create a work item description template:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Next to the default branch, select {{< icon name="plus" >}}.
1. Select **New file**.
1. Next to the default branch, in the **File name** text box, enter `.gitlab/issue_templates/mytemplate.md`,
where `mytemplate` is the name of your template.
1. Commit to your default branch.
To check if this has worked correctly:
1. [Create a new issue](issues/create_issues.md) or
[create a new epic](../group/epics/manage_epics.md#create-an-epic).
1. See if you can find your description template in the **Choose a template** dropdown list.
## Create a merge request template
Similarly to issue templates, create a new Markdown (`.md`) file inside the
`.gitlab/merge_request_templates/` directory in your repository. Unlike issue
templates, merge requests have [additional inheritance rules](merge_requests/creating_merge_requests.md)
that depend on the contents of commit messages and branch names.
To create a merge request description template for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Next to the default branch, select {{< icon name="plus" >}}.
1. Select **New file**.
1. Next to the default branch, in the **File name** text box, enter `.gitlab/merge_request_templates/mytemplate.md`,
where `mytemplate` is the name of your merge request template.
1. Commit to your default branch.
To check if this has worked correctly, [create a new merge request](merge_requests/creating_merge_requests.md)
and see if you can find your description template in the **Choose a template** dropdown list.
## Use the templates
When you create or edit an issue or a merge request, it shows in the **Choose a template** dropdown list.
To apply a template:
1. Create or edit an issue, work item, or a merge request.
1. Select the **Choose a template** dropdown list.
1. If the **Description** text box hasn't been empty, to confirm, select **Apply template**.
1. Select **Save changes**.
When you select a description template, its content is copied to the description text box.
To discard any changes to the description you've made after selecting the template: expand the **Choose a template** dropdown list and select **Reset template**.

{{< alert type="note" >}}
You can create shortcut links to create an issue using a designated template.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`. Read more about [creating issues using a URL with prefilled values](issues/create_issues.md#using-a-url-with-prefilled-values).
{{< /alert >}}
### Supported variables in merge request templates
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89810) in GitLab 15.7.
{{< /history >}}
{{< alert type="note" >}}
This feature is available only for
[the default template](#set-a-default-template-for-merge-requests-and-issues).
{{< /alert >}}
When you save a merge request for the first time, GitLab replaces these variables in
your merge request template with their values:
| Variable | Description | Output example |
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.` |
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` |
| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md` <br><br> `Improved project description in readme file.` |
| `%{first_multiline_commit_description}` | Description (without the first line/title) of the first commit that's not a merge commit and has more than one line in message body. | `Improved project description in readme file.` |
| `%{source_branch}` | The name of the branch being merged. | `my-feature-branch` |
| `%{target_branch}` | The name of the branch that the changes are applied to. | `main` |
### Set instance-level description templates
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can set a description template at the **instance level** for issues
and merge requests by using an [instance template repository](../../administration/settings/instance_template_repository.md).
You can also use the instance template repository for file templates.
You might also be interested in [project templates](../../administration/custom_project_templates.md)
that you can use when creating a new project in the instance.
### Set group-level description templates
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With **group-level** description templates, you can select a project within the group to store
your templates. Then, you can access these templates in other projects in the group.
As a result, you can use the same templates in issues and merge requests in all the group's projects.
Prerequisites:
- You must have the Owner role for the group.
- The project must be a direct child of the group.
To re-use templates [you've created](description_templates.md#create-a-description-template):
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Templates**.
1. From the dropdown list, select your template project as the template repository at group level.
1. Select **Save changes**.

You might also be interested in templates for various
[file types in groups](../group/manage.md#group-file-templates).
### Set a default template for merge requests and issues
In a project, you can choose a default description template for new issues and merge requests.
As a result, every time a new merge request or issue is created, it's pre-filled with the text you
entered in the template.
Prerequisites:
- On your project's left sidebar, select **Settings > General** and expand **Visibility, project features, permissions**.
Ensure issues or merge requests are set to either **Everyone with access** or **Only Project Members**.
To set a default description template for merge requests, either:
- [Create a merge request template](#create-a-merge-request-template) named `Default.md` (case-insensitive)
and save it in `.gitlab/merge_request_templates/`.
This [doesn't overwrite](#priority-of-default-description-templates) the default template if one has been set in the project settings.
- Users on GitLab Premium and Ultimate: set the default template in project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. In the **Default description template for merge requests** section, fill in the text area.
1. Select **Save changes**.
To set a default description template for issues, either:
- [Create an issue template](#create-a-description-template) named `Default.md` (case-insensitive)
and save it in `.gitlab/issue_templates/`.
This [doesn't overwrite](#priority-of-default-description-templates) the default template if one has been set in the project settings.
- Users on GitLab Premium and Ultimate: set the default template in project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Default description template for issues**.
1. Fill in the text area.
1. Select **Save changes**.
Because GitLab merge request and issues support [Markdown](../markdown.md), you can use it to format
headings, lists, and so on.
You can also provide `issues_template` and `merge_requests_template` attributes in the
[Projects REST API](../../api/projects.md) to keep your default issue and merge request templates up to date.
#### Priority of default description templates
When you set [issue description templates](#set-a-default-template-for-merge-requests-and-issues)
in various places, they have the following priorities in a project.
The ones higher up override the ones below:
1. Template set in project settings.
1. `Default.md` (case-insensitive) from the parent group.
1. `Default.md` (case-insensitive) from the project repository.
Merge requests have [additional inheritance rules](merge_requests/creating_merge_requests.md)
that depend on the contents of commit messages and branch names.
## Example description template
We use description templates for issues and merge requests in the
[`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/-/tree/master/.gitlab) of the
GitLab project, which you can refer to for some examples.
{{< alert type="note" >}}
It's possible to use [quick actions](quick_actions.md) in description templates to quickly add
labels, assignees, and milestones. The quick actions are only executed if the user submitting
the issue or merge request has the permissions to perform the relevant actions.
{{< /alert >}}
Here is an example of a bug report template:
```markdown
## Summary
<!-- HTML comments are not displayed -->
(Summarize the bug encountered concisely)
## Steps to reproduce
(How one can reproduce the issue - this is very important)
## Example Project
(If possible, create an example project here on GitLab.com that exhibits the problematic
behavior, and link to it here in the bug report.
If you are using an older version of GitLab, this will also determine whether the bug has been fixed
in a more recent version)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.)
## Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
/label ~bug ~reproduced ~needs-investigation
/cc @project-manager
/assign @qa-tester
```
|
https://docs.gitlab.com/user/working_with_projects
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/working_with_projects.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
working_with_projects.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Manage projects
|
Settings, configuration, project activity, and project deletion.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Most work in GitLab is done in a [project](_index.md). Files and
code are saved in projects, and most features are in the scope of projects.
## Project overview
{{< history >}}
- Project creation date [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19452) in GitLab 16.10.
{{< /history >}}
When you select a project, the **Project overview** page shows the project contents:
- Files in the repository
- Project information (description)
- Topics
- Badges
- Number of stars, forks, commits, branches, tags, releases, and environments in the project
- Project storage size
- Optional files and configurations
- `README` or index file
- Wiki page
- License
- Changelog
- Contributing guidelines
- Kubernetes cluster
- CI/CD configuration
- Integrations
- GitLab Pages
- Creation date
For public projects, and members of internal and private projects
with [permissions to view the project's code](../permissions.md#project-members-permissions),
the project overview page shows:
- A [`README` or index file](repository/files/_index.md#readme-and-index-files).
- A list of directories in the project's repository.
For users without permission to view the project's code, the overview page shows:
- The wiki homepage.
- The list of issues in the project.
You can access a project by using its ID instead of its name at `https://gitlab.example.com/projects/<id>`.
For example, if in your personal namespace `alex` you have a project `my-project` with the ID `123456`,
you can access the project either at `https://gitlab.example.com/alex/my-project` or `https://gitlab.example.com/projects/123456`.
{{< alert type="note" >}}
In GitLab 17.5 and later, you can also use `https://gitlab.example.com/-/p/<id>` for this endpoint.
{{< /alert >}}
## Find the Project ID
You might need the project ID if you want to interact with the project using the [GitLab API](../../api/_index.md).
To find the project ID:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the project overview page, in the upper-right corner, select **Actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Copy project ID**.
## View projects
Use the **Projects** list to view:
- All the projects on an instance
- The projects you work with or own
- Inactive projects, including archived projects and projects pending deletion
### View all projects on an instance
To view the projects on your GitLab instance:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. Optional. Select a tab to filter which projects are displayed.
If you are not authenticated, the list shows public projects only.
### View projects you work with
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/13066) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/13066) tab label from **Yours** to **Member** in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/465889) in GitLab 17.10. Feature flag `your_work_projects_vue` removed.
{{< /history >}}
To view the projects you have interacted with:
1. On the left sidebar, select **Search or go to**.
1. Select **View all my projects**.
1. Optional. Select a tab to filter which projects are displayed:
- **Contributed**: Projects where you have:
- Created issues, merge requests, or epics
- Commented on issues, merge requests, or epics
- Closed issues, merge requests, or epics
- Pushed commits
- Approved merge requests
- Merged merge requests
- **Starred**: Projects you have [starred](#star-a-project)
- **Personal**: Projects created under your personal namespace
- **Member**: Projects you are a member of
- **Inactive**: Archived projects and projects pending deletion
You can also view your starred and personal projects from your personal profile:
1. On the left sidebar, select your avatar and then your username.
1. On the left sidebar, select **Starred projects** or **Personal projects**.
### View inactive projects
{{< history >}}
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/13066) tab label from "Pending deletion" to "Inactive" in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Changed tab label generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/465889) in GitLab 17.10. Feature flag `your_work_projects_vue` removed.
- [Moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
- [Enabled for projects in personal namespaces](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in GitLab 18.0.
{{< /history >}}
A project is inactive when:
- It is pending deletion.
- It has been archived.
To view all inactive projects:
1. Select either:
- **View all my projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Select the **Inactive** tab.
Each project in the list shows:
- A badge indicating that the project is archived or marked for deletion.
If the project is marked for deletion, the list also shows:
- The time the project was marked for deletion.
- The time the project is scheduled for final deletion.
- A **Restore** action to stop the project being eventually deleted.
### View only projects you own
To view only the projects you are the owner of:
1. On the left sidebar, select **Search or go to**.
1. Select either:
- **View all your projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Above the list of projects, select **Search or filter results**.
1. From the **Role** dropdown list, select **Owner**.
## View project activity
To view the activity of a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Activity**.
1. Optional. To filter activity by contribution type, select a tab:
- **All**: All contributions by project members.
- **Push events**: Push events in the project.
- **Merge events**: Accepted merge requests in the project.
- **Issue events**: Issues opened and closed in the project.
- **Comments**: Comments posted by project members.
- **Designs**: Designs added, updated, and removed in the project.
- **Team**: Members who joined and left the project.
GitLab removes project activity events older than three years from the events table for performance reasons.
## Filter projects by language
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385465) in GitLab 15.9 [with a flag](../../administration/feature_flags/_index.md) named `project_language_search`. Enabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110956) in GitLab 15.9. Feature flag `project_language_search` removed.
{{< /history >}}
You can filter projects by the programming language they use. To do this:
1. On the left sidebar, select **Search or go to**.
1. Select either:
- **View all your projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Above the list of projects, select **Search or filter results**.
1. From the **Language** dropdown list, select the language you want to filter projects by.
A list of projects that use the selected language is displayed.
## Star a project
You can star projects you use frequently to make them easier to find.
To star a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the upper-right corner of the page, select **Star**.
## Leave a project
{{< history >}}
- The button to leave a project [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/431539) to the Actions menu in GitLab 16.7.
{{< /history >}}
When you leave a project:
- You are no longer a project member and cannot contribute.
- All the issues and merge requests that were assigned
to you are unassigned.
Prerequisites:
- You can leave a project this way only when a project is part of a group under a [group namespace](../namespace/_index.md).
- You must be a [direct member](members/_index.md#membership-types) of the project.
To leave a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the project overview page, in the upper-right corner, select **Actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Leave project**, then **Leave project** again.
## Edit a project
Use the project general settings to edit your project details.
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. In the **Project name** text box, enter your project name. See the [limitations on project names](../reserved_names.md).
1. Optional. In the **Project description** text box, enter your project description. The description is limited to 2,000 characters.
Components published in the CI/CD catalog require a project description.
1. Select **Save changes**.
### Rename a repository
A project's repository name defines its URL.
Prerequisites:
- You must be an administrator or have the Maintainer or Owner role for the project.
{{< alert type="note" >}}
When you change the repository path, users may experience issues if they push to, or pull from, the old URL.
For more information on redirect duration and its side-effects, see
[redirects when renaming repositories](repository/_index.md#repository-path-changes).
{{< /alert >}}
To rename a repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Change path** text box, edit the path.
1. Select **Change path**.
### Add a project avatar
Add a project avatar to help visually identify your project. If you do not add an avatar, GitLab displays the first letter of your project name as the default project avatar.
To add a project avatar, use one of the following methods:
- Add a logo to your repository.
- Upload an avatar in your project settings.
#### Add a logo to your repository
If you haven't uploaded an avatar to your project settings, GitLab looks for a file named `logo` in your repository to use as the default project avatar.
Prerequisites:
- You must have at least the Maintainer role for the project.
- Your file must be 200 KB or smaller. The ideal image size is 192 x 192 pixels.
- The file must be named `logo` with the extension `.png`, `.jpg`, or `.gif`. For example, `logo.gif`.
To add a logo file to use as your project avatar:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the root of your project repository, upload the logo file.
#### Upload an avatar in project settings
Prerequisites:
- You must have at least the Maintainer role for the project.
- Your file must be 200 KB or smaller. The ideal image size is 192 x 192 pixels.
- The image must be one of the following file types:
- `.bmp`
- `.gif`
- `.ico`
- `.jpeg`
- `.png`
- `.tiff`
To upload an avatar in your project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. In the **Project avatar** section, select **Choose file**.
1. Select your avatar file.
1. Select **Save changes**.
## Delete a project
{{< history >}}
- Default behavior [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/389557) to delayed project deletion for Premium and Ultimate tiers on [GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/393622) and [GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119606) in 16.0.
- Option to delete projects immediately as a group setting removed [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/393622) and [on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119606) in GitLab 16.0.
- Default behavior changed to delayed project deletion for [GitLab Free](https://gitlab.com/groups/gitlab-org/-/epics/17208) and [personal projects](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in 18.0.
- Option to delete projects immediately [moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
{{< /history >}}
You can schedule a project for deletion.
By default, when you delete a project for the first time, it enters a pending deletion state.
Delete a project again to remove it immediately.
On GitLab.com, after a project is deleted, its data is retained for 30 days.
Prerequisites:
- You must have the Owner role for a project.
- Owners must be [allowed to delete projects](../../administration/settings/visibility_and_access_controls.md#restrict-project-deletion-to-administrators).
To delete a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Delete project** section, select **Delete project**.
1. On the confirmation dialog, enter the project name and select **Yes, delete project**.
1. Optional. To delete the project immediately, repeat these steps.
You can also [delete projects using the Rails console](troubleshooting.md#delete-a-project-using-console).
If the user who scheduled the project deletion loses access to the project before the deletion occurs
(for example, by leaving the project, having their role downgraded, or being banned from the project),
the deletion job restores the project. However, if the user regains access before the deletion job runs,
the job removes the project permanently.
### Restore a project
{{< history >}}
- [Moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
- [Enabled for projects in personal namespaces](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in GitLab 18.0.
{{< /history >}}
Prerequisites:
- You must have the Owner role for the project.
To restore a project pending deletion:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Restore project** section, select **Restore project**.
## Archive a project
{{< history >}}
- Pages removal [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343109) in GitLab 17.5.
{{< /history >}}
{{< alert type="note" >}}
When a project is archived, its fork relationship is removed and any open merge requests from forks
targeting this project are automatically closed.
{{< /alert >}}
When you archive a project, some features become read-only.
These features are still accessible, but not writable.
- Repository
- Packages
- Issues
- Merge requests
- Feature flags
- Pull mirroring
- All other project features
Active pipeline schedules of archived projects don't become read-only.
If the project has deployed Pages, they are removed along with any custom domains,
and the Pages link is no longer accessible.
Archived projects are:
- Labeled with an `archived` badge on the project page.
- Listed in the **Inactive** tab on the group page, **Your work** page, and **Explore** page.
- Read-only.
Prerequisites:
- [Deactivate](../../ci/pipelines/schedules.md#edit-a-pipeline-schedule) or delete any active pipeline schedules for the project.
<!-- LP: Remove this prerequisite after the issue is resolved (when a project is archived, active pipeline schedules continue to run). -->
To archive a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Archive project** section, select **Archive project**.
1. To confirm, select **OK**.
### Unarchive a project
When you unarchive a project, the read-only restriction is removed,
and the project becomes available in project lists.
Prerequisites:
- You must be an administrator or have the Owner role for the project.
1. Find the archived project.
1. On the left sidebar, select **Search or go to**.
1. Select **View all my projects**.
1. Select **Explore projects**.
1. In the **Sort projects** dropdown list, select **Show archived projects**.
1. In the **Filter by name** field, enter the project name.
1. Select the project link.
1. On the left sidebar, select **Settings > General**.
1. Under **Advanced**, select **Expand**.
1. In the **Unarchive project** section, select **Unarchive project**.
1. To confirm, select **OK**.
The deployed Pages are not restored and you must rerun the pipeline.
When a project is unarchived, its pull mirroring process will automatically resume.
## Transfer a project
{{< history >}}
- Support for transferring projects with container images within the same top-level namespace [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/499163) on GitLab.com in GitLab 17.7 [with a flag](../../administration/feature_flags/_index.md) named `transfer_project_with_tags`. Disabled by default.
- Support for transferring projects with container images within the same top-level namespace [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/499163) in GitLab 17.7. Feature flag removed.
{{< /history >}}
Transfer a project to move it to a different group.
A project transfer includes:
- Project components:
- Issues
- Merge requests
- Pipelines
- Dashboards
- Project members:
- Direct members
- Membership invitations
{{< alert type="note" >}}
Members with [inherited membership](members/_index.md#membership-types)
in the project lose access unless they are also members of the target group.
The project inherits new member permissions from the group you transfer it to.
{{< /alert >}}
The project's [path also changes](repository/_index.md#repository-path-changes), so make sure to update the URLs to the project components where necessary.
New project-level labels are created for issues and merge requests if matching group labels don't already exist in the target namespace.
If a project contains issues assigned to an epic, and that epic is not available in the target
group, GitLab creates a copy of the epic in the target group. When you transfer multiple projects
with issues assigned to the same epic, GitLab creates a separate copy of that epic in the target
group for each project.
{{< alert type="warning" >}}
Errors during the transfer process may lead to data loss of the project's components or dependencies of end users.
{{< /alert >}}
Prerequisites:
- You must have at least the Maintainer role for the [group](../group/_index.md#create-a-group) you are transferring to.
- You must be the Owner of the project you transfer.
- The group must allow creation of new projects.
- For projects where the container registry is enabled:
- On GitLab.com: You can only transfer projects within the same top-level namespace.
- On GitLab Self-Managed: The project must not contain [container images](../packages/container_registry/_index.md#move-or-rename-container-registry-repositories).
- The project must not have a security policy.
If a security policy is assigned to the project, it is automatically unassigned during the transfer.
- If the root namespace changes, you must remove npm packages that follow the [naming convention](../packages/npm_registry/_index.md#naming-convention) from the project.
After you transfer the project you can either:
- Update the package scope with the new root namespace path, and publish it again to the project.
- Republish the package to the project without updating the root namespace path, which causes the package to no longer follow the naming convention.
If you republish the package without updating the root namespace path, it will not be available for the [instance endpoint](../packages/npm_registry/_index.md#install-from-an-instance).
To transfer a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. Under **Transfer project**, choose the namespace to transfer the project to.
1. Select **Transfer project**.
1. Enter the project's name and select **Confirm**.
You are redirected to the project's new page and GitLab applies a redirect. For more information about repository redirects, see [repository path changes](repository/_index.md#repository-path-changes).
{{< alert type="note" >}}
Administrators can also transfer projects from the [Admin area](../../administration/admin_area.md#administering-projects).
{{< /alert >}}
### Transfer a GitLab.com project to a different subscription tier
When you transfer a project from a namespace licensed for GitLab.com Premium or Ultimate to GitLab Free:
- [Project access tokens](settings/project_access_tokens.md) are revoked.
- [Pipeline subscriptions](../../ci/pipelines/_index.md#trigger-a-pipeline-when-an-upstream-project-is-rebuilt-deprecated)
and [test cases](../../ci/test_cases/_index.md) are deleted.
## Add a compliance framework to a project
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can add compliance frameworks to projects in a group that has a [compliance framework](../compliance/compliance_frameworks/_index.md).
## Manage project access through LDAP groups
You can [use LDAP to manage group membership](../group/access_and_permissions.md#manage-group-memberships-with-ldap).
You cannot use LDAP groups to manage project access, but you can use the following workaround.
Prerequisites:
- You must [integrate LDAP with GitLab](../../administration/auth/ldap/_index.md).
- You must be an administrator.
1. [Create a group](../group/_index.md#create-a-group) to track membership of your project.
1. [Set up LDAP synchronization](../../administration/auth/ldap/ldap_synchronization.md) for that group.
1. To use LDAP groups to manage access to a project,
[add the LDAP-synchronized group as a member](../group/manage.md) to the project.
## Project aliases
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab repositories are usually accessed with a namespace and a project name. When migrating
frequently accessed repositories to GitLab, however, you can use project aliases to access those
repositories with the original name. Accessing repositories through a project alias reduces the risk
associated with migrating such repositories.
This feature is only available on Git over SSH. Also, only GitLab administrators can create project
aliases, and they can only do so through the API. For more information, see the
[Project Aliases API documentation](../../api/project_aliases.md).
After an administrator creates an alias for a project, you can use the alias to clone the
repository. For example, if an administrator creates the alias `gitlab` for the project
`https://gitlab.com/gitlab-org/gitlab`, you can clone the project with
`git clone git@gitlab.com:gitlab.git` instead of `git clone git@gitlab.com:gitlab-org/gitlab.git`.
## Related topics
- [Import a project](import/_index.md).
- [Connect an external repository to GitLab CI/CD](../../ci/ci_cd_for_external_repos/_index.md).
- [Fork a project](repository/forking_workflow.md#create-a-fork).
- Adjust [project visibility](../public_access.md#change-project-visibility) and [permissions](settings/_index.md#configure-project-features-and-permissions).
- [Rules for project and group names](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs)
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Manage projects
description: Settings, configuration, project activity, and project deletion.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Most work in GitLab is done in a [project](_index.md). Files and
code are saved in projects, and most features are in the scope of projects.
## Project overview
{{< history >}}
- Project creation date [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19452) in GitLab 16.10.
{{< /history >}}
When you select a project, the **Project overview** page shows the project contents:
- Files in the repository
- Project information (description)
- Topics
- Badges
- Number of stars, forks, commits, branches, tags, releases, and environments in the project
- Project storage size
- Optional files and configurations
- `README` or index file
- Wiki page
- License
- Changelog
- Contributing guidelines
- Kubernetes cluster
- CI/CD configuration
- Integrations
- GitLab Pages
- Creation date
For public projects, and members of internal and private projects
with [permissions to view the project's code](../permissions.md#project-members-permissions),
the project overview page shows:
- A [`README` or index file](repository/files/_index.md#readme-and-index-files).
- A list of directories in the project's repository.
For users without permission to view the project's code, the overview page shows:
- The wiki homepage.
- The list of issues in the project.
You can access a project by using its ID instead of its name at `https://gitlab.example.com/projects/<id>`.
For example, if in your personal namespace `alex` you have a project `my-project` with the ID `123456`,
you can access the project either at `https://gitlab.example.com/alex/my-project` or `https://gitlab.example.com/projects/123456`.
{{< alert type="note" >}}
In GitLab 17.5 and later, you can also use `https://gitlab.example.com/-/p/<id>` for this endpoint.
{{< /alert >}}
## Find the Project ID
You might need the project ID if you want to interact with the project using the [GitLab API](../../api/_index.md).
To find the project ID:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the project overview page, in the upper-right corner, select **Actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Copy project ID**.
## View projects
Use the **Projects** list to view:
- All the projects on an instance
- The projects you work with or own
- Inactive projects, including archived projects and projects pending deletion
### View all projects on an instance
To view the projects on your GitLab instance:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. Optional. Select a tab to filter which projects are displayed.
If you are not authenticated, the list shows public projects only.
### View projects you work with
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/13066) in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/13066) tab label from **Yours** to **Member** in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/465889) in GitLab 17.10. Feature flag `your_work_projects_vue` removed.
{{< /history >}}
To view the projects you have interacted with:
1. On the left sidebar, select **Search or go to**.
1. Select **View all my projects**.
1. Optional. Select a tab to filter which projects are displayed:
- **Contributed**: Projects where you have:
- Created issues, merge requests, or epics
- Commented on issues, merge requests, or epics
- Closed issues, merge requests, or epics
- Pushed commits
- Approved merge requests
- Merged merge requests
- **Starred**: Projects you have [starred](#star-a-project)
- **Personal**: Projects created under your personal namespace
- **Member**: Projects you are a member of
- **Inactive**: Archived projects and projects pending deletion
You can also view your starred and personal projects from your personal profile:
1. On the left sidebar, select your avatar and then your username.
1. On the left sidebar, select **Starred projects** or **Personal projects**.
### View inactive projects
{{< history >}}
- [Changed](https://gitlab.com/groups/gitlab-org/-/epics/13066) tab label from "Pending deletion" to "Inactive" in GitLab 17.9 [with a flag](../../administration/feature_flags/_index.md) named `your_work_projects_vue`. Disabled by default.
- [Changed tab label generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/465889) in GitLab 17.10. Feature flag `your_work_projects_vue` removed.
- [Moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
- [Enabled for projects in personal namespaces](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in GitLab 18.0.
{{< /history >}}
A project is inactive when:
- It is pending deletion.
- It has been archived.
To view all inactive projects:
1. Select either:
- **View all my projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Select the **Inactive** tab.
Each project in the list shows:
- A badge indicating that the project is archived or marked for deletion.
If the project is marked for deletion, the list also shows:
- The time the project was marked for deletion.
- The time the project is scheduled for final deletion.
- A **Restore** action to stop the project being eventually deleted.
### View only projects you own
To view only the projects you are the owner of:
1. On the left sidebar, select **Search or go to**.
1. Select either:
- **View all your projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Above the list of projects, select **Search or filter results**.
1. From the **Role** dropdown list, select **Owner**.
## View project activity
To view the activity of a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Activity**.
1. Optional. To filter activity by contribution type, select a tab:
- **All**: All contributions by project members.
- **Push events**: Push events in the project.
- **Merge events**: Accepted merge requests in the project.
- **Issue events**: Issues opened and closed in the project.
- **Comments**: Comments posted by project members.
- **Designs**: Designs added, updated, and removed in the project.
- **Team**: Members who joined and left the project.
GitLab removes project activity events older than three years from the events table for performance reasons.
## Filter projects by language
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385465) in GitLab 15.9 [with a flag](../../administration/feature_flags/_index.md) named `project_language_search`. Enabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110956) in GitLab 15.9. Feature flag `project_language_search` removed.
{{< /history >}}
You can filter projects by the programming language they use. To do this:
1. On the left sidebar, select **Search or go to**.
1. Select either:
- **View all your projects**, to filter your projects.
- **Explore**, to filter all projects you can access.
1. Above the list of projects, select **Search or filter results**.
1. From the **Language** dropdown list, select the language you want to filter projects by.
A list of projects that use the selected language is displayed.
## Star a project
You can star projects you use frequently to make them easier to find.
To star a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the upper-right corner of the page, select **Star**.
## Leave a project
{{< history >}}
- The button to leave a project [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/431539) to the Actions menu in GitLab 16.7.
{{< /history >}}
When you leave a project:
- You are no longer a project member and cannot contribute.
- All the issues and merge requests that were assigned
to you are unassigned.
Prerequisites:
- You can leave a project this way only when a project is part of a group under a [group namespace](../namespace/_index.md).
- You must be a [direct member](members/_index.md#membership-types) of the project.
To leave a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. On the project overview page, in the upper-right corner, select **Actions** ({{< icon name="ellipsis_v" >}}).
1. Select **Leave project**, then **Leave project** again.
## Edit a project
Use the project general settings to edit your project details.
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. In the **Project name** text box, enter your project name. See the [limitations on project names](../reserved_names.md).
1. Optional. In the **Project description** text box, enter your project description. The description is limited to 2,000 characters.
Components published in the CI/CD catalog require a project description.
1. Select **Save changes**.
### Rename a repository
A project's repository name defines its URL.
Prerequisites:
- You must be an administrator or have the Maintainer or Owner role for the project.
{{< alert type="note" >}}
When you change the repository path, users may experience issues if they push to, or pull from, the old URL.
For more information on redirect duration and its side-effects, see
[redirects when renaming repositories](repository/_index.md#repository-path-changes).
{{< /alert >}}
To rename a repository:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Change path** text box, edit the path.
1. Select **Change path**.
### Add a project avatar
Add a project avatar to help visually identify your project. If you do not add an avatar, GitLab displays the first letter of your project name as the default project avatar.
To add a project avatar, use one of the following methods:
- Add a logo to your repository.
- Upload an avatar in your project settings.
#### Add a logo to your repository
If you haven't uploaded an avatar to your project settings, GitLab looks for a file named `logo` in your repository to use as the default project avatar.
Prerequisites:
- You must have at least the Maintainer role for the project.
- Your file must be 200 KB or smaller. The ideal image size is 192 x 192 pixels.
- The file must be named `logo` with the extension `.png`, `.jpg`, or `.gif`. For example, `logo.gif`.
To add a logo file to use as your project avatar:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the root of your project repository, upload the logo file.
#### Upload an avatar in project settings
Prerequisites:
- You must have at least the Maintainer role for the project.
- Your file must be 200 KB or smaller. The ideal image size is 192 x 192 pixels.
- The image must be one of the following file types:
- `.bmp`
- `.gif`
- `.ico`
- `.jpeg`
- `.png`
- `.tiff`
To upload an avatar in your project settings:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. In the **Project avatar** section, select **Choose file**.
1. Select your avatar file.
1. Select **Save changes**.
## Delete a project
{{< history >}}
- Default behavior [changed](https://gitlab.com/gitlab-org/gitlab/-/issues/389557) to delayed project deletion for Premium and Ultimate tiers on [GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/393622) and [GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119606) in 16.0.
- Option to delete projects immediately as a group setting removed [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/393622) and [on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119606) in GitLab 16.0.
- Default behavior changed to delayed project deletion for [GitLab Free](https://gitlab.com/groups/gitlab-org/-/epics/17208) and [personal projects](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in 18.0.
- Option to delete projects immediately [moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
{{< /history >}}
You can schedule a project for deletion.
By default, when you delete a project for the first time, it enters a pending deletion state.
Delete a project again to remove it immediately.
On GitLab.com, after a project is deleted, its data is retained for 30 days.
Prerequisites:
- You must have the Owner role for a project.
- Owners must be [allowed to delete projects](../../administration/settings/visibility_and_access_controls.md#restrict-project-deletion-to-administrators).
To delete a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Delete project** section, select **Delete project**.
1. On the confirmation dialog, enter the project name and select **Yes, delete project**.
1. Optional. To delete the project immediately, repeat these steps.
You can also [delete projects using the Rails console](troubleshooting.md#delete-a-project-using-console).
If the user who scheduled the project deletion loses access to the project before the deletion occurs
(for example, by leaving the project, having their role downgraded, or being banned from the project),
the deletion job restores the project. However, if the user regains access before the deletion job runs,
the job removes the project permanently.
### Restore a project
{{< history >}}
- [Moved](https://gitlab.com/groups/gitlab-org/-/epics/17208) from GitLab Premium to GitLab Free in 18.0.
- [Enabled for projects in personal namespaces](https://gitlab.com/gitlab-org/gitlab/-/issues/536244) in GitLab 18.0.
{{< /history >}}
Prerequisites:
- You must have the Owner role for the project.
To restore a project pending deletion:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Restore project** section, select **Restore project**.
## Archive a project
{{< history >}}
- Pages removal [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343109) in GitLab 17.5.
{{< /history >}}
{{< alert type="note" >}}
When a project is archived, its fork relationship is removed and any open merge requests from forks
targeting this project are automatically closed.
{{< /alert >}}
When you archive a project, some features become read-only.
These features are still accessible, but not writable.
- Repository
- Packages
- Issues
- Merge requests
- Feature flags
- Pull mirroring
- All other project features
Active pipeline schedules of archived projects don't become read-only.
If the project has deployed Pages, they are removed along with any custom domains,
and the Pages link is no longer accessible.
Archived projects are:
- Labeled with an `archived` badge on the project page.
- Listed in the **Inactive** tab on the group page, **Your work** page, and **Explore** page.
- Read-only.
Prerequisites:
- [Deactivate](../../ci/pipelines/schedules.md#edit-a-pipeline-schedule) or delete any active pipeline schedules for the project.
<!-- LP: Remove this prerequisite after the issue is resolved (when a project is archived, active pipeline schedules continue to run). -->
To archive a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. In the **Archive project** section, select **Archive project**.
1. To confirm, select **OK**.
### Unarchive a project
When you unarchive a project, the read-only restriction is removed,
and the project becomes available in project lists.
Prerequisites:
- You must be an administrator or have the Owner role for the project.
1. Find the archived project.
1. On the left sidebar, select **Search or go to**.
1. Select **View all my projects**.
1. Select **Explore projects**.
1. In the **Sort projects** dropdown list, select **Show archived projects**.
1. In the **Filter by name** field, enter the project name.
1. Select the project link.
1. On the left sidebar, select **Settings > General**.
1. Under **Advanced**, select **Expand**.
1. In the **Unarchive project** section, select **Unarchive project**.
1. To confirm, select **OK**.
The deployed Pages are not restored and you must rerun the pipeline.
When a project is unarchived, its pull mirroring process will automatically resume.
## Transfer a project
{{< history >}}
- Support for transferring projects with container images within the same top-level namespace [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/499163) on GitLab.com in GitLab 17.7 [with a flag](../../administration/feature_flags/_index.md) named `transfer_project_with_tags`. Disabled by default.
- Support for transferring projects with container images within the same top-level namespace [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/499163) in GitLab 17.7. Feature flag removed.
{{< /history >}}
Transfer a project to move it to a different group.
A project transfer includes:
- Project components:
- Issues
- Merge requests
- Pipelines
- Dashboards
- Project members:
- Direct members
- Membership invitations
{{< alert type="note" >}}
Members with [inherited membership](members/_index.md#membership-types)
in the project lose access unless they are also members of the target group.
The project inherits new member permissions from the group you transfer it to.
{{< /alert >}}
The project's [path also changes](repository/_index.md#repository-path-changes), so make sure to update the URLs to the project components where necessary.
New project-level labels are created for issues and merge requests if matching group labels don't already exist in the target namespace.
If a project contains issues assigned to an epic, and that epic is not available in the target
group, GitLab creates a copy of the epic in the target group. When you transfer multiple projects
with issues assigned to the same epic, GitLab creates a separate copy of that epic in the target
group for each project.
{{< alert type="warning" >}}
Errors during the transfer process may lead to data loss of the project's components or dependencies of end users.
{{< /alert >}}
Prerequisites:
- You must have at least the Maintainer role for the [group](../group/_index.md#create-a-group) you are transferring to.
- You must be the Owner of the project you transfer.
- The group must allow creation of new projects.
- For projects where the container registry is enabled:
- On GitLab.com: You can only transfer projects within the same top-level namespace.
- On GitLab Self-Managed: The project must not contain [container images](../packages/container_registry/_index.md#move-or-rename-container-registry-repositories).
- The project must not have a security policy.
If a security policy is assigned to the project, it is automatically unassigned during the transfer.
- If the root namespace changes, you must remove npm packages that follow the [naming convention](../packages/npm_registry/_index.md#naming-convention) from the project.
After you transfer the project you can either:
- Update the package scope with the new root namespace path, and publish it again to the project.
- Republish the package to the project without updating the root namespace path, which causes the package to no longer follow the naming convention.
If you republish the package without updating the root namespace path, it will not be available for the [instance endpoint](../packages/npm_registry/_index.md#install-from-an-instance).
To transfer a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. Under **Transfer project**, choose the namespace to transfer the project to.
1. Select **Transfer project**.
1. Enter the project's name and select **Confirm**.
You are redirected to the project's new page and GitLab applies a redirect. For more information about repository redirects, see [repository path changes](repository/_index.md#repository-path-changes).
{{< alert type="note" >}}
Administrators can also transfer projects from the [Admin area](../../administration/admin_area.md#administering-projects).
{{< /alert >}}
### Transfer a GitLab.com project to a different subscription tier
When you transfer a project from a namespace licensed for GitLab.com Premium or Ultimate to GitLab Free:
- [Project access tokens](settings/project_access_tokens.md) are revoked.
- [Pipeline subscriptions](../../ci/pipelines/_index.md#trigger-a-pipeline-when-an-upstream-project-is-rebuilt-deprecated)
and [test cases](../../ci/test_cases/_index.md) are deleted.
## Add a compliance framework to a project
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can add compliance frameworks to projects in a group that has a [compliance framework](../compliance/compliance_frameworks/_index.md).
## Manage project access through LDAP groups
You can [use LDAP to manage group membership](../group/access_and_permissions.md#manage-group-memberships-with-ldap).
You cannot use LDAP groups to manage project access, but you can use the following workaround.
Prerequisites:
- You must [integrate LDAP with GitLab](../../administration/auth/ldap/_index.md).
- You must be an administrator.
1. [Create a group](../group/_index.md#create-a-group) to track membership of your project.
1. [Set up LDAP synchronization](../../administration/auth/ldap/ldap_synchronization.md) for that group.
1. To use LDAP groups to manage access to a project,
[add the LDAP-synchronized group as a member](../group/manage.md) to the project.
## Project aliases
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
GitLab repositories are usually accessed with a namespace and a project name. When migrating
frequently accessed repositories to GitLab, however, you can use project aliases to access those
repositories with the original name. Accessing repositories through a project alias reduces the risk
associated with migrating such repositories.
This feature is only available on Git over SSH. Also, only GitLab administrators can create project
aliases, and they can only do so through the API. For more information, see the
[Project Aliases API documentation](../../api/project_aliases.md).
After an administrator creates an alias for a project, you can use the alias to clone the
repository. For example, if an administrator creates the alias `gitlab` for the project
`https://gitlab.com/gitlab-org/gitlab`, you can clone the project with
`git clone git@gitlab.com:gitlab.git` instead of `git clone git@gitlab.com:gitlab-org/gitlab.git`.
## Related topics
- [Import a project](import/_index.md).
- [Connect an external repository to GitLab CI/CD](../../ci/ci_cd_for_external_repos/_index.md).
- [Fork a project](repository/forking_workflow.md#create-a-fork).
- Adjust [project visibility](../public_access.md#change-project-visibility) and [permissions](settings/_index.md#configure-project-features-and-permissions).
- [Rules for project and group names](../reserved_names.md#rules-for-usernames-project-and-group-names-and-slugs)
|
https://docs.gitlab.com/user/protected_tags
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/protected_tags.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
protected_tags.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Protected tags
|
Use protected tags in Git to control who can create tags, and prevent accidental tag updates or deletion.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Protected [tags](repository/tags/_index.md):
- Allow control over who has permission to create tags.
- Prevent accidental update or deletion once created.
Each rule allows you to match either:
- An individual tag name.
- Wildcards to control multiple tags at once.
This feature evolved out of [protected branches](repository/branches/protected.md).
{{< alert type="note" >}}
To create or delete a protected tag, you must be in the **Allowed to create or delete** list for that protected tag.
{{< /alert >}}
## Configuring protected tags
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. Select **Add new**.
1. To protect a single tag, select **Tag**, then choose your tag from the dropdown list.
1. To protect all tags with names matching a string:
1. Select **Tag**.
1. Enter the string to use for tag matching. Wildcards (`*`) are supported.
1. Select **Create wildcard**.
1. In **Allowed to create** , select roles that may create protected tags.
{{< alert type="note" >}}
In GitLab Premium and Ultimate, you can also add groups or individual users
to **Allowed to create**.
{{< /alert >}}
1. Select **Protect**.
The protected tag (or wildcard) displays in the **Protected tags** list.
### Add a group to protected tags
To set the members of a group or subgroup as Allowed to create protected tags:
1. On the left sidebar, select **Search or go** to and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. Add groups to the following field:
```plaintext
# Allow group members to create protected tags
Allowed to create: @group-x
```
#### Group inheritance and eligibility
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TD
accTitle: Diagram of group inheritance for protected tags
accDescr: If a project is shared with a group, the group members inherit permissions for protected tags.
A[Parent group X] -->|owns| B[Project A]
A -->|contains| C[Subgroup Y]
B -->|shared with| C
C -->|members inherit permissions| B
```
In this example:
- Parent group X (`group-x`) owns Project A.
- Parent group X also contains a subgroup, Subgroup Y. (`group-x/subgroup-y`)
- Project A is shared with Subgroup Y.
The eligible groups for protected tag permissions are:
- Project A: Both Group X and Subgroup Y, because Project A is shared with Subgroup Y.
#### Share projects with groups for protected tag permissions
You can share the project with a group or subgroup so that their members are
eligible for protected tag permissions.
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Diagram of project sharing for protected tag permissions
accDescr: Sharing a project with a group affects whether their members can have protected tag permissions.
A[Parent group X] -->|owns| B[Project A]
A -->|also contains| C[Subgroup Y]
C -.->D{Share Project A<br/>with Subgroup Y?} -.->|yes| E[Members of Subgroup Y<br/>can have protected<br/>tag permissions]
D{Share Project A<br/>with Subgroup Y?} -.->|no| F[Members of Subgroup Y<br />cannot have protected<br/>tag permissions]
E -.->|Add Subgroup Y<br/> to protected tag settings| I[Subgroup Y members<br/>can create tags] -.-> B
F -.-> |Add Subgroup Y<br/> to protected tag settings| J[Settings will not<br/>take effect] -.-> B
```
To grant access to Subgroup Y members for Project A, you must share the project with the subgroup.
Adding the subgroup directly to the protected tag settings is not effective and isn't applicable to subgroup members.
{{< alert type="note" >}}
For a group to have protected tag permissions, the project must be directly shared with the group.
Inherited project membership from parent groups is not sufficient for protected tag permissions.
{{< /alert >}}
## Wildcard protected tags
You can specify a wildcard protected tag, which protects all tags
matching the wildcard. For example:
| Wildcard Protected Tag | Matching Tags |
|------------------------|-------------------------------|
| `v*` | `v1.0.0`, `version-9.1` |
| `*-deploy` | `march-deploy`, `1.0-deploy` |
| `*gitlab*` | `gitlab`, `gitlab/v1` |
| `*` | `v1.0.1rc2`, `accidental-tag` |
Two different wildcards can potentially match the same tag. For example,
`*-stable` and `production-*` would both match a `production-stable` tag.
In that case, if _any_ of these protected tags have a setting like
**Allowed to create**, then `production-stable` also inherit this setting.
If you select a protected tag's name, GitLab displays a list of
all matching tags.
## Prevent tag creation with the same name as branches
A tag and a branch with identical names can contain different commits. If your
tags and branches use the same names, users running `git checkout`
commands might check out the _tag_ `qa` when they instead meant to check out
the _branch_ `qa`. As an added security measure, avoid creating tags with the
same name as branches. Confusing the two could lead to potential
security or operational issues.
To prevent this problem:
1. Identify the branch names you do not want used as tags.
1. As described in [Configuring protected tags](#configuring-protected-tags),
create a protected tag:
- For the **Name**, provide a name, such as `stable`. You can also create a wildcard
like `stable-*` to match multiple names, like `stable-v1` and `stable-v2`.
- For **Allowed to Create**, select **No one**.
- Select **Protect**.
Users can still create branches, but not tags, with the protected names.
## Allow deploy keys to create protected tags
You can permit a [deploy key](deploy_keys/_index.md) to create protected tags.
Prerequisites:
- The deploy key must be enabled for your project. A project deploy key is enabled by default when
it is created. However, a public deploy key must be
[granted](deploy_keys/_index.md#grant-project-access-to-a-public-deploy-key) access to the
project.
- The deploy key must have [write access](deploy_keys/_index.md#permissions) to your project
repository.
- The owner of the deploy key must have at least read access to the project.
- The owner of the deploy key must also be a member of the project.
To allow a deploy key to create a protected tag:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. From the **Tag** dropdown list, select the tag you want to protect.
1. From the **Allowed to create** list, select the deploy key.
1. Select **Protect**.
## Run pipelines on protected tags
The permissions to create protected tags define if a user can:
- Initiate and run CI/CD pipelines.
- Execute actions on jobs associated with these tags.
These permissions ensure that only authorized users can trigger and manage
CI/CD processes for protected tags.
## Delete a protected tag
You can manually delete protected tags with the GitLab API, or the
GitLab user interface.
Prerequisites:
- You must be in the **Allowed to create or delete** list.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
1. Next to the tag you want to delete, select **Delete** ({{< icon name="remove" >}}).
1. On the confirmation dialog, enter the tag name and select **Yes, delete protected tag**.
Protected tags can only be deleted by using GitLab either from the UI or API.
These protections prevent you from accidentally deleting a tag through local
Git commands or third-party Git clients.
## Related topics
- [Protected Tags API](../../api/protected_tags.md)
- [Tags API](../../api/tags.md)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use protected tags in Git to control who can create tags, and prevent
accidental tag updates or deletion.
title: Protected tags
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Protected [tags](repository/tags/_index.md):
- Allow control over who has permission to create tags.
- Prevent accidental update or deletion once created.
Each rule allows you to match either:
- An individual tag name.
- Wildcards to control multiple tags at once.
This feature evolved out of [protected branches](repository/branches/protected.md).
{{< alert type="note" >}}
To create or delete a protected tag, you must be in the **Allowed to create or delete** list for that protected tag.
{{< /alert >}}
## Configuring protected tags
Prerequisites:
- You must have at least the Maintainer role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. Select **Add new**.
1. To protect a single tag, select **Tag**, then choose your tag from the dropdown list.
1. To protect all tags with names matching a string:
1. Select **Tag**.
1. Enter the string to use for tag matching. Wildcards (`*`) are supported.
1. Select **Create wildcard**.
1. In **Allowed to create** , select roles that may create protected tags.
{{< alert type="note" >}}
In GitLab Premium and Ultimate, you can also add groups or individual users
to **Allowed to create**.
{{< /alert >}}
1. Select **Protect**.
The protected tag (or wildcard) displays in the **Protected tags** list.
### Add a group to protected tags
To set the members of a group or subgroup as Allowed to create protected tags:
1. On the left sidebar, select **Search or go** to and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. Add groups to the following field:
```plaintext
# Allow group members to create protected tags
Allowed to create: @group-x
```
#### Group inheritance and eligibility
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph TD
accTitle: Diagram of group inheritance for protected tags
accDescr: If a project is shared with a group, the group members inherit permissions for protected tags.
A[Parent group X] -->|owns| B[Project A]
A -->|contains| C[Subgroup Y]
B -->|shared with| C
C -->|members inherit permissions| B
```
In this example:
- Parent group X (`group-x`) owns Project A.
- Parent group X also contains a subgroup, Subgroup Y. (`group-x/subgroup-y`)
- Project A is shared with Subgroup Y.
The eligible groups for protected tag permissions are:
- Project A: Both Group X and Subgroup Y, because Project A is shared with Subgroup Y.
#### Share projects with groups for protected tag permissions
You can share the project with a group or subgroup so that their members are
eligible for protected tag permissions.
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Diagram of project sharing for protected tag permissions
accDescr: Sharing a project with a group affects whether their members can have protected tag permissions.
A[Parent group X] -->|owns| B[Project A]
A -->|also contains| C[Subgroup Y]
C -.->D{Share Project A<br/>with Subgroup Y?} -.->|yes| E[Members of Subgroup Y<br/>can have protected<br/>tag permissions]
D{Share Project A<br/>with Subgroup Y?} -.->|no| F[Members of Subgroup Y<br />cannot have protected<br/>tag permissions]
E -.->|Add Subgroup Y<br/> to protected tag settings| I[Subgroup Y members<br/>can create tags] -.-> B
F -.-> |Add Subgroup Y<br/> to protected tag settings| J[Settings will not<br/>take effect] -.-> B
```
To grant access to Subgroup Y members for Project A, you must share the project with the subgroup.
Adding the subgroup directly to the protected tag settings is not effective and isn't applicable to subgroup members.
{{< alert type="note" >}}
For a group to have protected tag permissions, the project must be directly shared with the group.
Inherited project membership from parent groups is not sufficient for protected tag permissions.
{{< /alert >}}
## Wildcard protected tags
You can specify a wildcard protected tag, which protects all tags
matching the wildcard. For example:
| Wildcard Protected Tag | Matching Tags |
|------------------------|-------------------------------|
| `v*` | `v1.0.0`, `version-9.1` |
| `*-deploy` | `march-deploy`, `1.0-deploy` |
| `*gitlab*` | `gitlab`, `gitlab/v1` |
| `*` | `v1.0.1rc2`, `accidental-tag` |
Two different wildcards can potentially match the same tag. For example,
`*-stable` and `production-*` would both match a `production-stable` tag.
In that case, if _any_ of these protected tags have a setting like
**Allowed to create**, then `production-stable` also inherit this setting.
If you select a protected tag's name, GitLab displays a list of
all matching tags.
## Prevent tag creation with the same name as branches
A tag and a branch with identical names can contain different commits. If your
tags and branches use the same names, users running `git checkout`
commands might check out the _tag_ `qa` when they instead meant to check out
the _branch_ `qa`. As an added security measure, avoid creating tags with the
same name as branches. Confusing the two could lead to potential
security or operational issues.
To prevent this problem:
1. Identify the branch names you do not want used as tags.
1. As described in [Configuring protected tags](#configuring-protected-tags),
create a protected tag:
- For the **Name**, provide a name, such as `stable`. You can also create a wildcard
like `stable-*` to match multiple names, like `stable-v1` and `stable-v2`.
- For **Allowed to Create**, select **No one**.
- Select **Protect**.
Users can still create branches, but not tags, with the protected names.
## Allow deploy keys to create protected tags
You can permit a [deploy key](deploy_keys/_index.md) to create protected tags.
Prerequisites:
- The deploy key must be enabled for your project. A project deploy key is enabled by default when
it is created. However, a public deploy key must be
[granted](deploy_keys/_index.md#grant-project-access-to-a-public-deploy-key) access to the
project.
- The deploy key must have [write access](deploy_keys/_index.md#permissions) to your project
repository.
- The owner of the deploy key must have at least read access to the project.
- The owner of the deploy key must also be a member of the project.
To allow a deploy key to create a protected tag:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Repository**.
1. Expand **Protected tags**.
1. From the **Tag** dropdown list, select the tag you want to protect.
1. From the **Allowed to create** list, select the deploy key.
1. Select **Protect**.
## Run pipelines on protected tags
The permissions to create protected tags define if a user can:
- Initiate and run CI/CD pipelines.
- Execute actions on jobs associated with these tags.
These permissions ensure that only authorized users can trigger and manage
CI/CD processes for protected tags.
## Delete a protected tag
You can manually delete protected tags with the GitLab API, or the
GitLab user interface.
Prerequisites:
- You must be in the **Allowed to create or delete** list.
To do this:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Tags**.
1. Next to the tag you want to delete, select **Delete** ({{< icon name="remove" >}}).
1. On the confirmation dialog, enter the tag name and select **Yes, delete protected tag**.
Protected tags can only be deleted by using GitLab either from the UI or API.
These protections prevent you from accidentally deleting a tag through local
Git commands or third-party Git clients.
## Related topics
- [Protected Tags API](../../api/protected_tags.md)
- [Tags API](../../api/tags.md)
|
https://docs.gitlab.com/user/time_tracking
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/time_tracking.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
time_tracking.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Time tracking
|
Estimates, time spent, and reporting.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Time tracking for tasks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/438577) in GitLab 17.0.
- Time tracking for epics [introduced](https://gitlab.com/groups/gitlab-org/-/epics/12396) in GitLab 17.5. [The new look for epics](../group/epics/_index.md#epics-as-work-items) must be enabled.
- Minimum role to add, edit, and remove estimate [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
- Time tracking for epics [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1.
{{< /history >}}
Time tracking helps record and manage time invested in GitLab work items.
Time tracking:
- Records actual time spent on issues, merge requests, epics, and tasks.
- Estimates total time needed for completion.
- Provides detailed reports of time entries.
- Calculates totals using standardized time units.
- Tracks history through quick actions and the UI.
You can see time tracking information in the right sidebar of your work items:

Enter and remove time tracking data using [quick actions](quick_actions.md) or the user interface.
Type quick actions on their own lines.
If you use any quick action more than once in a single comment, only its last occurrence is applied.
## Permissions
Different time tracking features are available based on your role:
- To add, edit, and remove estimates, you need at least the Planner role for issues and tasks, or the Developer role for merge requests.
- To add and edit time spent, you need at least the Planner role for the project.
- To delete a time entry, you must be the author or have at least the Maintainer role.
## Estimates
The estimate is designed to show the total time needed to complete an item.
You can see the estimated time remaining when you hover over the time tracking information in the right sidebar.

### Add an estimate
Prerequisites:
- In issues, you must have at least the Planner role for the project.
- In tasks, you must have at least the Planner role for the project.
- In merge requests, you must have at least the Developer role for the project.
To enter an estimate, use the `/estimate` [quick action](quick_actions.md), followed by the time.
For example, if you need to enter an estimate of 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes,
type `/estimate 1mo 2w 3d 4h 5m`.
Check the [time units you can use](#available-time-units).
An item can have only one estimate.
Every time you enter a new time estimate, it overwrites the previous value.
### Remove an estimate
Prerequisites:
- In issues, you must have at least the Planner role for the project.
- In tasks, you must have at least the Planner role for the project.
- In merge requests, you must have at least the Developer role for the project.
To remove an estimate entirely, use the `/remove_estimate` [quick action](quick_actions.md).
## Time spent
As you work, you can log the time you've spent.
Every new time spent entry is added to the current total time spent for the
issue, task, or the merge request.
The total amount of time spent on an issue, task, or merge request cannot exceed a year.
### Add time spent
Prerequisites:
- You must have at least the Planner role for the project.
#### Using the user interface
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101563) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150564) in GitLab 17.0. When you don't specify when time was spent, current time is used.
{{< /history >}}
To add a time entry using the user interface:
1. In the **Time tracking** section of the sidebar, select **Add time entry** ({{< icon name="plus" >}}). A dialog opens.
1. Enter:
- The amount of time spent.
- Optional. When it was spent. If empty, uses current time.
- Optional. A summary.
1. Select **Save**.
The **Spent** total in the sidebar is updated and you can view all entries in a [time tracking report](#view-an-items-time-tracking-report).
#### Using a quick action
To enter time spent, use the `/spend` [quick action](quick_actions.md), followed by the time.
For example, if you need
to log 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes, type `/spend 1mo 2w 3d 4h 5m`.
Check the [time units you can use](#available-time-units).
To add a [time tracking report](#view-an-items-time-tracking-report) entry with a note, create a comment
with a description and the quick action.
It then shows in the time tracking report **Summary/Notes** column. For example:
```plaintext
Draft MR and respond to initial comments
/spend 30m
```
To log when time was spent, enter a date after the time, using the `YYYY-MM-DD` format.
For example, to log 1 hour of time spent on 31 January 2021,
enter `/spend 1h 2021-01-31`.
If you type a future date, no time is logged.
#### Using commit messages
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16543) in GitLab 18.3 with a flag named `commit_time_tracking`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
You can record time spent on issues directly in commit messages. This approach is useful when you want to track time as you work, without updating the issue separately.
To add time spent in a commit message, include an issue reference and a time tracking marker in the format `@<time>` with no spaces between time units.
For example:
```plaintext
Fix a bug in the login form #123 @1mo2d3h15m
```
This commit message adds 1 month, 2 days, 3 hours, and 15 minutes of time spent to issue #123.
The time tracking marker must:
- Start with the `@` symbol.
- Be followed immediately by time units with no spaces between them.
- Support the following time units: months (`mo`), days (`d`), hours (`h`), minutes (`m`), and seconds (`s`).
- Use the same [time units](#available-time-units) as regular time tracking.
When you push a commit with time tracking information:
1. GitLab extracts the time spent from the commit message.
1. The time is added to any issues referenced in the same commit message.
1. A system note is added to the issue indicating time was added from a commit.
1. The time tracking entry includes the commit SHA and title as the description.
##### Commit author permissions
Time is added to an issue from a commit message only if the commit author has permission to update the issue:
- The commit author must have at least the Planner role for the project where the issue exists.
- If the author doesn't have sufficient permissions, the time tracking information in their commit is ignored.
- Permission checks use the same rules as regular time tracking.
##### Known issues
**Multiple time amounts in one commit**
When a commit message references multiple issues with different time amounts, only the first time amount is applied to all referenced issues.
For example, this commit message:
```plaintext
Fixes #41 @1h30m and fixes #40 @2h
```
Adds 1h30m to both issue #41 and issue #40. The second time amount (`@2h`) is ignored.
**Duplicate time entries from commit SHA changes**
When a commit's SHA changes (for example, after rebasing or amending), GitLab treats it as a new commit for time tracking. This can create duplicate time entries if both the original and new commits are referenced in the issue.
To avoid duplicate time entries when commit SHAs might change:
- Add time directly to the issue using the UI or quick actions instead of commit messages.
- If you must use commit messages for time tracking, add the time only after your branch's history is finalized.
- Before merging, check the issue's time tracking report to identify and remove any potential duplicates.
### Prevent duplicate time tracking in merge requests
When you merge a merge request containing commits with time tracking information, GitLab prevents duplicate time tracking:
- Time is tracked only once per commit, even if the same commit message appears multiple times in the repository history.
- GitLab prevents duplicate time tracking by checking if a time entry with the same commit title and ID already exists for an issue.
- When commits are merged, no additional time is tracked. This prevents double-counting time when feature branches are merged to the default branch.
### Subtract time spent
Prerequisites:
- You must have at least the Planner role for the project.
To subtract time, enter a negative value. For example, `/spend -3d` removes three
days from the total time spent. You can't go below 0 minutes of time spent,
so if you remove more time than already entered, GitLab ignores the subtraction.
### Delete time spent
{{< history >}}
- Delete button [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/356796) in GitLab 15.1.
{{< /history >}}
A timelog is a single entry of time spent, either positive or negative.
Prerequisites:
- You must be the author of the timelog or have at least the Maintainer role for the project.
To delete a timelog, either:
- In the time tracking report, on the right of a timelog entry, select **Delete time spent** ({{< icon name="remove" >}}).
- Use the [GraphQL API](../../api/graphql/reference/_index.md#mutationtimelogdelete).
### Delete all the time spent
Prerequisites:
- You must have at least the Planner role for the project.
To delete all the time spent at once, use the `/remove_time_spent` [quick action](quick_actions.md).
## View an item's time tracking report
To view a time tracking report of time spent on an item:
- On the right sidebar, next to **Spent**, select the time.

The breakdown of spent time displayed is limited to a maximum of 100 entries.
## Global time tracking report
{{< details >}}
- Status: Experiment
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344002) in GitLab 15.11 [with a flag](../../administration/feature_flags/_index.md) named `global_time_tracking_report`. Disabled by default.
- Enabled on GitLab.com in GitLab 16.5.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `global_time_tracking_report`.
On GitLab.com, this feature is available. On GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
View a report of time spent in issues, tasks, and merge requests across all of GitLab.
This feature is an [experiment](../../policy/development_stages_support.md).
If you find a bug, let us know in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/435222).
To view the global time tracking report:
1. In your browser, enter the global report's URL:
- For GitLab Self-Managed, add `/-/timelogs` to your base URL. For example, `https://gitlab.example.com/-/timelogs`.
- For GitLab.com, go to <https://gitlab.com/-/timelogs>.
1. Optional. To filter by a specific user, enter their username without the `@` symbol.
1. Select start and end dates.
1. Select **Run report**.

## Available time units
The following time units are available:
| Time unit | What to type | Conversion rate |
| --------- | --------------------------- | --------------- |
| Month | `mo`, `month`, or `months` | 4 w (160 h) |
| Week | `w`, `week`, or `weeks` | 5 d (40 h) |
| Day | `d`, `day`, or `days` | 8 h |
| Hour | `h`, `hour`, or `hours` | 60 m |
| Minute | `m`, `minute`, or `minutes` | |
### Limit displayed units to hours
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
On GitLab Self-Managed, you can limit the display of time units to hours.
To do so:
1. On the left sidebar, select **Search or go to**.
1. Select **Settings > Preferences**.
1. Expand **Localization**.
1. Under **Time tracking**, select the **Limit display of time tracking units to hours** checkbox.
1. Select **Save changes**.
With this option enabled, `75h` is displayed instead of `1w 4d 3h`.
## Related topics
- Time tracking GraphQL references:
- [Connection](../../api/graphql/reference/_index.md#timelogconnection)
- [Edge](../../api/graphql/reference/_index.md#timelogedge)
- [Fields](../../api/graphql/reference/_index.md#timelog)
- [Timelogs](../../api/graphql/reference/_index.md#querytimelogs)
- [Group timelogs](../../api/graphql/reference/_index.md#grouptimelogs)
- [Project Timelogs](../../api/graphql/reference/_index.md#projecttimelogs)
- [User Timelogs](../../api/graphql/reference/_index.md#usertimelogs)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Time tracking
description: Estimates, time spent, and reporting.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Time tracking for tasks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/438577) in GitLab 17.0.
- Time tracking for epics [introduced](https://gitlab.com/groups/gitlab-org/-/epics/12396) in GitLab 17.5. [The new look for epics](../group/epics/_index.md#epics-as-work-items) must be enabled.
- Minimum role to add, edit, and remove estimate [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
- Time tracking for epics [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/468310) in GitLab 18.1.
{{< /history >}}
Time tracking helps record and manage time invested in GitLab work items.
Time tracking:
- Records actual time spent on issues, merge requests, epics, and tasks.
- Estimates total time needed for completion.
- Provides detailed reports of time entries.
- Calculates totals using standardized time units.
- Tracks history through quick actions and the UI.
You can see time tracking information in the right sidebar of your work items:

Enter and remove time tracking data using [quick actions](quick_actions.md) or the user interface.
Type quick actions on their own lines.
If you use any quick action more than once in a single comment, only its last occurrence is applied.
## Permissions
Different time tracking features are available based on your role:
- To add, edit, and remove estimates, you need at least the Planner role for issues and tasks, or the Developer role for merge requests.
- To add and edit time spent, you need at least the Planner role for the project.
- To delete a time entry, you must be the author or have at least the Maintainer role.
## Estimates
The estimate is designed to show the total time needed to complete an item.
You can see the estimated time remaining when you hover over the time tracking information in the right sidebar.

### Add an estimate
Prerequisites:
- In issues, you must have at least the Planner role for the project.
- In tasks, you must have at least the Planner role for the project.
- In merge requests, you must have at least the Developer role for the project.
To enter an estimate, use the `/estimate` [quick action](quick_actions.md), followed by the time.
For example, if you need to enter an estimate of 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes,
type `/estimate 1mo 2w 3d 4h 5m`.
Check the [time units you can use](#available-time-units).
An item can have only one estimate.
Every time you enter a new time estimate, it overwrites the previous value.
### Remove an estimate
Prerequisites:
- In issues, you must have at least the Planner role for the project.
- In tasks, you must have at least the Planner role for the project.
- In merge requests, you must have at least the Developer role for the project.
To remove an estimate entirely, use the `/remove_estimate` [quick action](quick_actions.md).
## Time spent
As you work, you can log the time you've spent.
Every new time spent entry is added to the current total time spent for the
issue, task, or the merge request.
The total amount of time spent on an issue, task, or merge request cannot exceed a year.
### Add time spent
Prerequisites:
- You must have at least the Planner role for the project.
#### Using the user interface
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101563) in GitLab 15.7.
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150564) in GitLab 17.0. When you don't specify when time was spent, current time is used.
{{< /history >}}
To add a time entry using the user interface:
1. In the **Time tracking** section of the sidebar, select **Add time entry** ({{< icon name="plus" >}}). A dialog opens.
1. Enter:
- The amount of time spent.
- Optional. When it was spent. If empty, uses current time.
- Optional. A summary.
1. Select **Save**.
The **Spent** total in the sidebar is updated and you can view all entries in a [time tracking report](#view-an-items-time-tracking-report).
#### Using a quick action
To enter time spent, use the `/spend` [quick action](quick_actions.md), followed by the time.
For example, if you need
to log 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes, type `/spend 1mo 2w 3d 4h 5m`.
Check the [time units you can use](#available-time-units).
To add a [time tracking report](#view-an-items-time-tracking-report) entry with a note, create a comment
with a description and the quick action.
It then shows in the time tracking report **Summary/Notes** column. For example:
```plaintext
Draft MR and respond to initial comments
/spend 30m
```
To log when time was spent, enter a date after the time, using the `YYYY-MM-DD` format.
For example, to log 1 hour of time spent on 31 January 2021,
enter `/spend 1h 2021-01-31`.
If you type a future date, no time is logged.
#### Using commit messages
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16543) in GitLab 18.3 with a flag named `commit_time_tracking`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
You can record time spent on issues directly in commit messages. This approach is useful when you want to track time as you work, without updating the issue separately.
To add time spent in a commit message, include an issue reference and a time tracking marker in the format `@<time>` with no spaces between time units.
For example:
```plaintext
Fix a bug in the login form #123 @1mo2d3h15m
```
This commit message adds 1 month, 2 days, 3 hours, and 15 minutes of time spent to issue #123.
The time tracking marker must:
- Start with the `@` symbol.
- Be followed immediately by time units with no spaces between them.
- Support the following time units: months (`mo`), days (`d`), hours (`h`), minutes (`m`), and seconds (`s`).
- Use the same [time units](#available-time-units) as regular time tracking.
When you push a commit with time tracking information:
1. GitLab extracts the time spent from the commit message.
1. The time is added to any issues referenced in the same commit message.
1. A system note is added to the issue indicating time was added from a commit.
1. The time tracking entry includes the commit SHA and title as the description.
##### Commit author permissions
Time is added to an issue from a commit message only if the commit author has permission to update the issue:
- The commit author must have at least the Planner role for the project where the issue exists.
- If the author doesn't have sufficient permissions, the time tracking information in their commit is ignored.
- Permission checks use the same rules as regular time tracking.
##### Known issues
**Multiple time amounts in one commit**
When a commit message references multiple issues with different time amounts, only the first time amount is applied to all referenced issues.
For example, this commit message:
```plaintext
Fixes #41 @1h30m and fixes #40 @2h
```
Adds 1h30m to both issue #41 and issue #40. The second time amount (`@2h`) is ignored.
**Duplicate time entries from commit SHA changes**
When a commit's SHA changes (for example, after rebasing or amending), GitLab treats it as a new commit for time tracking. This can create duplicate time entries if both the original and new commits are referenced in the issue.
To avoid duplicate time entries when commit SHAs might change:
- Add time directly to the issue using the UI or quick actions instead of commit messages.
- If you must use commit messages for time tracking, add the time only after your branch's history is finalized.
- Before merging, check the issue's time tracking report to identify and remove any potential duplicates.
### Prevent duplicate time tracking in merge requests
When you merge a merge request containing commits with time tracking information, GitLab prevents duplicate time tracking:
- Time is tracked only once per commit, even if the same commit message appears multiple times in the repository history.
- GitLab prevents duplicate time tracking by checking if a time entry with the same commit title and ID already exists for an issue.
- When commits are merged, no additional time is tracked. This prevents double-counting time when feature branches are merged to the default branch.
### Subtract time spent
Prerequisites:
- You must have at least the Planner role for the project.
To subtract time, enter a negative value. For example, `/spend -3d` removes three
days from the total time spent. You can't go below 0 minutes of time spent,
so if you remove more time than already entered, GitLab ignores the subtraction.
### Delete time spent
{{< history >}}
- Delete button [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/356796) in GitLab 15.1.
{{< /history >}}
A timelog is a single entry of time spent, either positive or negative.
Prerequisites:
- You must be the author of the timelog or have at least the Maintainer role for the project.
To delete a timelog, either:
- In the time tracking report, on the right of a timelog entry, select **Delete time spent** ({{< icon name="remove" >}}).
- Use the [GraphQL API](../../api/graphql/reference/_index.md#mutationtimelogdelete).
### Delete all the time spent
Prerequisites:
- You must have at least the Planner role for the project.
To delete all the time spent at once, use the `/remove_time_spent` [quick action](quick_actions.md).
## View an item's time tracking report
To view a time tracking report of time spent on an item:
- On the right sidebar, next to **Spent**, select the time.

The breakdown of spent time displayed is limited to a maximum of 100 entries.
## Global time tracking report
{{< details >}}
- Status: Experiment
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/344002) in GitLab 15.11 [with a flag](../../administration/feature_flags/_index.md) named `global_time_tracking_report`. Disabled by default.
- Enabled on GitLab.com in GitLab 16.5.
{{< /history >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `global_time_tracking_report`.
On GitLab.com, this feature is available. On GitLab Dedicated, this feature is not available.
This feature is not ready for production use.
{{< /alert >}}
View a report of time spent in issues, tasks, and merge requests across all of GitLab.
This feature is an [experiment](../../policy/development_stages_support.md).
If you find a bug, let us know in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/435222).
To view the global time tracking report:
1. In your browser, enter the global report's URL:
- For GitLab Self-Managed, add `/-/timelogs` to your base URL. For example, `https://gitlab.example.com/-/timelogs`.
- For GitLab.com, go to <https://gitlab.com/-/timelogs>.
1. Optional. To filter by a specific user, enter their username without the `@` symbol.
1. Select start and end dates.
1. Select **Run report**.

## Available time units
The following time units are available:
| Time unit | What to type | Conversion rate |
| --------- | --------------------------- | --------------- |
| Month | `mo`, `month`, or `months` | 4 w (160 h) |
| Week | `w`, `week`, or `weeks` | 5 d (40 h) |
| Day | `d`, `day`, or `days` | 8 h |
| Hour | `h`, `hour`, or `hours` | 60 m |
| Minute | `m`, `minute`, or `minutes` | |
### Limit displayed units to hours
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
On GitLab Self-Managed, you can limit the display of time units to hours.
To do so:
1. On the left sidebar, select **Search or go to**.
1. Select **Settings > Preferences**.
1. Expand **Localization**.
1. Under **Time tracking**, select the **Limit display of time tracking units to hours** checkbox.
1. Select **Save changes**.
With this option enabled, `75h` is displayed instead of `1w 4d 3h`.
## Related topics
- Time tracking GraphQL references:
- [Connection](../../api/graphql/reference/_index.md#timelogconnection)
- [Edge](../../api/graphql/reference/_index.md#timelogedge)
- [Fields](../../api/graphql/reference/_index.md#timelog)
- [Timelogs](../../api/graphql/reference/_index.md#querytimelogs)
- [Group timelogs](../../api/graphql/reference/_index.md#grouptimelogs)
- [Project Timelogs](../../api/graphql/reference/_index.md#projecttimelogs)
- [User Timelogs](../../api/graphql/reference/_index.md#usertimelogs)
|
https://docs.gitlab.com/user/troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/troubleshooting.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
troubleshooting.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting projects
|
Problem solving, common issues, debugging, and error resolution.
|
When working with projects, you might encounter the following issues, or require alternate methods to complete specific tasks.
## `An error occurred while fetching commit data`
When you visit a project, the message `An error occurred while fetching commit data` might be displayed
if you use an ad blocker in your browser. The solution is to disable your ad blocker
for the GitLab instance you are trying to access.
## Find projects using an SQL query
While in [a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session), you can find and store an array of projects based on a SQL query:
```ruby
# Finds projects that end with '%ject'
projects = Project.find_by_sql("SELECT * FROM projects WHERE name LIKE '%ject'")
=> [#<Project id:12 root/my-first-project>>, #<Project id:13 root/my-second-project>>]
```
## Clear a project's or repository's cache
If a project or repository has been updated but the state is not reflected in the UI, you may need to clear the project's or repository's cache.
You can do so through [a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session) and one of the following:
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
## Clear project cache
ProjectCacheWorker.perform_async(project.id)
## Clear repository .exists? cache
project.repository.expire_exists_cache
```
## Find projects that are pending deletion
If you need to find all projects marked for deletion but that have not yet been deleted,
[start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session) and run the following:
```ruby
projects = Project.where(pending_delete: true)
projects.each do |p|
puts "Project ID: #{p.id}"
puts "Project name: #{p.name}"
puts "Repository path: #{p.repository.full_path}"
end
```
### Transfer a project using console
If transferring a project through the UI or API is not working, you can attempt the transfer in a [Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session).
```ruby
p = Project.find_by_full_path('<project_path>')
# To set the owner of the project
current_user = p.creator
# Namespace where you want this to be moved
namespace = Namespace.find_by_full_path("<new_namespace>")
Projects::TransferService.new(p, current_user).execute(namespace)
```
## Delete a project using console
If a project cannot be deleted, you can attempt to delete it through [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session).
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
project = Project.find_by_full_path('<project_path>')
user = User.find_by_username('<username>')
Projects::DestroyService.new(project, user, {}).execute
```
If this fails, display why it doesn't work with:
```ruby
project = Project.find_by_full_path('<project_path>')
project.delete_error
```
## Toggle a feature for all projects within a group
While toggling a feature in a project can be done through the [projects API](../../api/projects.md),
you may need to do this for a large number of projects.
To toggle a specific feature, you can [start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session)
and run the following function:
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
projects = Group.find_by_name('_group_name').projects
projects.each do |p|
## replace <feature-name> with the appropriate feature name in all instances
state = p.<feature-name>
if state != 0
puts "#{p.name} has <feature-name> already enabled. Skipping..."
else
puts "#{p.name} didn't have <feature-name> enabled. Enabling..."
p.project_feature.update!(<feature-name>: ProjectFeature::PRIVATE)
end
end
```
To find features that can be toggled, run `pp p.project_feature`.
Available permission levels are listed in
[concerns/featurable.rb](https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/concerns/featurable.rb).
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting projects
description: Problem solving, common issues, debugging, and error resolution.
breadcrumbs:
- doc
- user
- project
---
When working with projects, you might encounter the following issues, or require alternate methods to complete specific tasks.
## `An error occurred while fetching commit data`
When you visit a project, the message `An error occurred while fetching commit data` might be displayed
if you use an ad blocker in your browser. The solution is to disable your ad blocker
for the GitLab instance you are trying to access.
## Find projects using an SQL query
While in [a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session), you can find and store an array of projects based on a SQL query:
```ruby
# Finds projects that end with '%ject'
projects = Project.find_by_sql("SELECT * FROM projects WHERE name LIKE '%ject'")
=> [#<Project id:12 root/my-first-project>>, #<Project id:13 root/my-second-project>>]
```
## Clear a project's or repository's cache
If a project or repository has been updated but the state is not reflected in the UI, you may need to clear the project's or repository's cache.
You can do so through [a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session) and one of the following:
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
## Clear project cache
ProjectCacheWorker.perform_async(project.id)
## Clear repository .exists? cache
project.repository.expire_exists_cache
```
## Find projects that are pending deletion
If you need to find all projects marked for deletion but that have not yet been deleted,
[start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session) and run the following:
```ruby
projects = Project.where(pending_delete: true)
projects.each do |p|
puts "Project ID: #{p.id}"
puts "Project name: #{p.name}"
puts "Repository path: #{p.repository.full_path}"
end
```
### Transfer a project using console
If transferring a project through the UI or API is not working, you can attempt the transfer in a [Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session).
```ruby
p = Project.find_by_full_path('<project_path>')
# To set the owner of the project
current_user = p.creator
# Namespace where you want this to be moved
namespace = Namespace.find_by_full_path("<new_namespace>")
Projects::TransferService.new(p, current_user).execute(namespace)
```
## Delete a project using console
If a project cannot be deleted, you can attempt to delete it through [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session).
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
project = Project.find_by_full_path('<project_path>')
user = User.find_by_username('<username>')
Projects::DestroyService.new(project, user, {}).execute
```
If this fails, display why it doesn't work with:
```ruby
project = Project.find_by_full_path('<project_path>')
project.delete_error
```
## Toggle a feature for all projects within a group
While toggling a feature in a project can be done through the [projects API](../../api/projects.md),
you may need to do this for a large number of projects.
To toggle a specific feature, you can [start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session)
and run the following function:
{{< alert type="warning" >}}
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
{{< /alert >}}
```ruby
projects = Group.find_by_name('_group_name').projects
projects.each do |p|
## replace <feature-name> with the appropriate feature name in all instances
state = p.<feature-name>
if state != 0
puts "#{p.name} has <feature-name> already enabled. Skipping..."
else
puts "#{p.name} didn't have <feature-name> enabled. Enabling..."
p.project_feature.update!(<feature-name>: ProjectFeature::PRIVATE)
end
end
```
To find features that can be toggled, run `pp p.project_feature`.
Available permission levels are listed in
[concerns/featurable.rb](https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/concerns/featurable.rb).
|
https://docs.gitlab.com/user/code_intelligence
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/code_intelligence.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
code_intelligence.md
|
Create
|
Code Review
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Code intelligence
|
Type signatures, symbol documentation, and go-to definition.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Code intelligence adds code navigation features common to interactive
development environments (IDE), including:
- Type signatures and symbol documentation.
- Go-to definition.
Code intelligence is built into GitLab and powered by [LSIF](https://lsif.dev/)
(Language Server Index Format), a file format for precomputed code
intelligence data. GitLab processes one LSIF file per project, and
Code intelligence does not support different LSIF files per branch.
[SCIP](https://github.com/sourcegraph/scip/) is the next evolution of tooling
for indexing source code. You can use it to power code navigation features,
such as:
- Go to definition
- Find references
GitLab does not natively support SCIP for code intelligence. However, you can use the
[SCIP CLI](https://github.com/sourcegraph/scip/blob/main/docs/CLI.md) to convert
indexes generated with SCIP tooling into a LSIF-compatible file. For discussions on native
SCIP support, see [issue 412981](https://gitlab.com/gitlab-org/gitlab/-/issues/412981).
For progress on upcoming code intelligence enhancements, see
[epic 4212](https://gitlab.com/groups/gitlab-org/-/epics/4212).
## Configure code intelligence
Prerequisites:
- You've checked to ensure there is a compatible indexer for your project's languages:
- [LSIF indexers](https://lsif.dev/#implementations-server)
- [SCIP indexers](https://github.com/sourcegraph/scip/#tools-using-scip)
To see how your language is best supported, review the
[indexers recommended by Sourcegraph](https://sourcegraph.com/docs/code-search/code-navigation/writing_an_indexer#sourcegraph-recommended-indexers).
### With the CI/CD component
{{< history >}}
- Python support [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/301111) in GitLab 17.9.
- .Net/C# support [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/372243) in GitLab 18.0.
{{< /history >}}
GitLab provides a [CI/CD component](../../ci/components/_index.md) to configure code intelligence
in your `.gitlab-ci.yml` file. The component supports these languages:
- Go version 1.21 or later.
- TypeScript or JavaScript.
- Java 8, 11, 17, and 21.
- Python
- .Net/C#
To contribute more languages to the component, open a merge request in the
[Code intelligence component project](https://gitlab.com/components/code-intelligence).
1. Add a GitLab CI/CD component to your project's `.gitlab-ci.yml`. For example, this job generates
the LSIF artifact for `golang`:
```yaml
include:
- component: ${CI_SERVER_FQDN}/components/code-intelligence/golang-code-intel@v0.0.3
inputs:
golang_version: ${GO_VERSION}
```
1. For configuration instructions for the [code intelligence component](https://gitlab.com/components/code-intelligence),
check the `README` for each supported language.
1. For more configuration details, see [Use a component](../../ci/components/_index.md#use-a-component).
### Add CI/CD jobs for code intelligence
To enable code intelligence for a project, add GitLab CI/CD jobs to your project's `.gitlab-ci.yml`.
{{< tabs >}}
{{< tab title="With a SCIP indexer" >}}
1. Add a job to your `.gitlab-ci.yml` configuration. This job generates the
SCIP index and converts it to LSIF for use in GitLab:
```yaml
"code_navigation":
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # the job only needs to run against the default branch
image: node:latest
stage: test
allow_failure: true # recommended
script:
- npm install -g @sourcegraph/scip-typescript
- npm install
- scip-typescript index
- |
env \
TAG="v0.4.0" \
OS="$(uname -s | tr '[:upper:]' '[:lower:]')" \
ARCH="$(uname -m | sed -e 's/x86_64/amd64/')" \
bash -c 'curl --location "https://github.com/sourcegraph/scip/releases/download/$TAG/scip-$OS-$ARCH.tar.gz"' \
| tar xzf - scip
- chmod +x scip
- ./scip convert --from index.scip --to dump.lsif
artifacts:
reports:
lsif: dump.lsif
```
1. Depending on your CI/CD configuration, you might need to run the job manually,
or wait for it to run as part of an existing pipeline.
{{< /tab >}}
{{< tab title="With a LSIF indexer" >}}
1. Add a job (`code_navigation`) to your `.gitlab-ci.yml` configuration to generate the index:
```yaml
code_navigation:
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # the job only needs to run against the default branch
image: sourcegraph/lsif-go:v1
allow_failure: true # recommended
script:
- lsif-go
artifacts:
reports:
lsif: dump.lsif
```
1. Depending on your CI/CD configuration, you might need to run the job manually,
or wait for it to run as part of an existing pipeline.
{{< /tab >}}
{{< /tabs >}}
{{< alert type="note" >}}
GitLab limits the artifact produced by the code generation jobs to 200 MB by the
[(`ci_max_artifact_size_lsif`)](../../administration/instance_limits.md#maximum-file-size-per-type-of-artifact)
artifact application limit. On GitLab Self-Managed instances, an instance administrator
can change this value.
{{< /alert >}}
## View code intelligence results
After the job succeeds, browse your repository to see code intelligence information:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file in your repository. If you know the filename, either:
- Enter the `/~` keyboard shortcut to open the file finder, and enter the file's name.
- In the upper right, select **Find file**.
1. Point to lines of code. Items on that line with information from code intelligence display a dotted line underneath them:

1. Select the item to learn more information about it.
## Find references
Use code intelligence to see all uses of an object:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file in your repository. If you know the filename, either:
- Enter the `/~` keyboard shortcut to open the file finder, and enter the file's name.
- In the upper right, select **Find file**.
1. Point to the object, then select it.
1. In the dialog, select:
- **Definition** to see a definition of this object.
- **References** to view a list of the files that use this object.

|
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Type signatures, symbol documentation, and go-to definition.
title: Code intelligence
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Code intelligence adds code navigation features common to interactive
development environments (IDE), including:
- Type signatures and symbol documentation.
- Go-to definition.
Code intelligence is built into GitLab and powered by [LSIF](https://lsif.dev/)
(Language Server Index Format), a file format for precomputed code
intelligence data. GitLab processes one LSIF file per project, and
Code intelligence does not support different LSIF files per branch.
[SCIP](https://github.com/sourcegraph/scip/) is the next evolution of tooling
for indexing source code. You can use it to power code navigation features,
such as:
- Go to definition
- Find references
GitLab does not natively support SCIP for code intelligence. However, you can use the
[SCIP CLI](https://github.com/sourcegraph/scip/blob/main/docs/CLI.md) to convert
indexes generated with SCIP tooling into a LSIF-compatible file. For discussions on native
SCIP support, see [issue 412981](https://gitlab.com/gitlab-org/gitlab/-/issues/412981).
For progress on upcoming code intelligence enhancements, see
[epic 4212](https://gitlab.com/groups/gitlab-org/-/epics/4212).
## Configure code intelligence
Prerequisites:
- You've checked to ensure there is a compatible indexer for your project's languages:
- [LSIF indexers](https://lsif.dev/#implementations-server)
- [SCIP indexers](https://github.com/sourcegraph/scip/#tools-using-scip)
To see how your language is best supported, review the
[indexers recommended by Sourcegraph](https://sourcegraph.com/docs/code-search/code-navigation/writing_an_indexer#sourcegraph-recommended-indexers).
### With the CI/CD component
{{< history >}}
- Python support [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/301111) in GitLab 17.9.
- .Net/C# support [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/372243) in GitLab 18.0.
{{< /history >}}
GitLab provides a [CI/CD component](../../ci/components/_index.md) to configure code intelligence
in your `.gitlab-ci.yml` file. The component supports these languages:
- Go version 1.21 or later.
- TypeScript or JavaScript.
- Java 8, 11, 17, and 21.
- Python
- .Net/C#
To contribute more languages to the component, open a merge request in the
[Code intelligence component project](https://gitlab.com/components/code-intelligence).
1. Add a GitLab CI/CD component to your project's `.gitlab-ci.yml`. For example, this job generates
the LSIF artifact for `golang`:
```yaml
include:
- component: ${CI_SERVER_FQDN}/components/code-intelligence/golang-code-intel@v0.0.3
inputs:
golang_version: ${GO_VERSION}
```
1. For configuration instructions for the [code intelligence component](https://gitlab.com/components/code-intelligence),
check the `README` for each supported language.
1. For more configuration details, see [Use a component](../../ci/components/_index.md#use-a-component).
### Add CI/CD jobs for code intelligence
To enable code intelligence for a project, add GitLab CI/CD jobs to your project's `.gitlab-ci.yml`.
{{< tabs >}}
{{< tab title="With a SCIP indexer" >}}
1. Add a job to your `.gitlab-ci.yml` configuration. This job generates the
SCIP index and converts it to LSIF for use in GitLab:
```yaml
"code_navigation":
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # the job only needs to run against the default branch
image: node:latest
stage: test
allow_failure: true # recommended
script:
- npm install -g @sourcegraph/scip-typescript
- npm install
- scip-typescript index
- |
env \
TAG="v0.4.0" \
OS="$(uname -s | tr '[:upper:]' '[:lower:]')" \
ARCH="$(uname -m | sed -e 's/x86_64/amd64/')" \
bash -c 'curl --location "https://github.com/sourcegraph/scip/releases/download/$TAG/scip-$OS-$ARCH.tar.gz"' \
| tar xzf - scip
- chmod +x scip
- ./scip convert --from index.scip --to dump.lsif
artifacts:
reports:
lsif: dump.lsif
```
1. Depending on your CI/CD configuration, you might need to run the job manually,
or wait for it to run as part of an existing pipeline.
{{< /tab >}}
{{< tab title="With a LSIF indexer" >}}
1. Add a job (`code_navigation`) to your `.gitlab-ci.yml` configuration to generate the index:
```yaml
code_navigation:
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # the job only needs to run against the default branch
image: sourcegraph/lsif-go:v1
allow_failure: true # recommended
script:
- lsif-go
artifacts:
reports:
lsif: dump.lsif
```
1. Depending on your CI/CD configuration, you might need to run the job manually,
or wait for it to run as part of an existing pipeline.
{{< /tab >}}
{{< /tabs >}}
{{< alert type="note" >}}
GitLab limits the artifact produced by the code generation jobs to 200 MB by the
[(`ci_max_artifact_size_lsif`)](../../administration/instance_limits.md#maximum-file-size-per-type-of-artifact)
artifact application limit. On GitLab Self-Managed instances, an instance administrator
can change this value.
{{< /alert >}}
## View code intelligence results
After the job succeeds, browse your repository to see code intelligence information:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file in your repository. If you know the filename, either:
- Enter the `/~` keyboard shortcut to open the file finder, and enter the file's name.
- In the upper right, select **Find file**.
1. Point to lines of code. Items on that line with information from code intelligence display a dotted line underneath them:

1. Select the item to learn more information about it.
## Find references
Use code intelligence to see all uses of an object:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Repository**.
1. Go to the file in your repository. If you know the filename, either:
- Enter the `/~` keyboard shortcut to open the file finder, and enter the file's name.
- In the upper right, select **Find file**.
1. Point to the object, then select it.
1. In the dialog, select:
- **Definition** to see a definition of this object.
- **References** to view a list of the files that use this object.

|
https://docs.gitlab.com/user/badges
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/badges.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
badges.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Badges
|
Pipeline status, group, project, and custom badges.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Badges are a unified way to present condensed pieces of information about your projects.
A badge consists of a small image and a URL that the image points to.
In GitLab, badges are displayed on the project overview page, below the project description.
You can use badges at the [project](#project-badges) and [group](#group-badges) level.
## Available badges
GitLab provides the following pipeline badges:
- [Pipeline status badge](#pipeline-status-badges)
- [Test coverage report badge](#test-coverage-report-badges)
- [Latest release badge](#latest-release-badges)
GitLab also supports [custom badges](#customize-badges).
## Pipeline status badges
The pipeline status badge indicates the status of the latest pipeline in a project.
Depending on the status of your pipeline, the badge can have one of the following values:
- `pending`
- `running`
- `passed`
- `failed`
- `skipped`
- `manual`
- `canceled`
- `unknown`
You can access a pipeline status badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg
```
### Display only non-skipped status
To make the pipeline status badge display only the last non-skipped status, use the `?ignore_skipped=true` query parameter:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg?ignore_skipped=true
```
## Test coverage report badges
The test coverage report badge indicates the percentage of code that is tested in a project.
The value is calculated based on the latest successful pipeline.
You can access a test coverage report badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg
```
You can define the regular expression for the [code coverage](../../ci/testing/code_coverage/_index.md#configure-coverage-reporting)
that each job log is matched against.
This means that each job in the pipeline can have the test coverage percentage value defined.
To get the coverage report from a specific job, add the `job=coverage_job_name` parameter to the URL.
For example, you can use code similar to the following to add the test coverage report badge of the
`coverage` job to a Markdown file:
```markdown

```
### Test coverage limits and badge colors
The following table shows the default test coverage limits and badge colors:
| Test coverage | Percentage limits | Badge color |
|---------------|-----------------------------|-------------|
| Good | 95 up to and including 100% | <span style="color: #4c1">■</span> `#4c1` |
| Acceptable | 90 up to 95% | <span style="color:#a3c51c"> ■</span> `#a3c51c` |
| Medium | 75 up to 90% | <span style="color: #dfb317">■</span> `#dfb317` |
| Low | 0 up to 75% | <span style="color: #e05d44">■</span> `#e05d44` |
| Unknown | No coverage | <span style="color: #9f9f9f">■</span> `#9f9f9f` |
{{< alert type="note" >}}
*Up to* means up to, but not including, the upper bound.
{{< /alert >}}
### Change the default limits
You can override the default limits by passing the following query parameters in the coverage report badge URL:
| Query parameter | Acceptable values | Default |
|------------------|----------------------------------------------|---------|
| `min_good` | Any value between `3` and `100` | `95` |
| `min_acceptable` | Any value between `2` and `min_good`−1 | `90` |
| `min_medium` | Any value between `1` and `min_acceptable`−1 | `75` |
For example:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?min_good=98&min_acceptable=75
```
If you set an invalid boundary, GitLab automatically adjusts it to be valid. For example,
if you set `min_good` to `80` and `min_acceptable` to `85`, GitLab sets `min_acceptable`
to `79` (`min_good - 1`) because the minimum acceptable value cannot be higher than
the minimum good value.
## Latest release badges
The latest release badge indicates the latest release tag name for your project.
If there is no release, it shows `none`.
You can access a latest release badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/-/badges/release.svg
```
By default, the badge fetches the release sorted using the [`released_at`](../../api/releases/_index.md#create-a-release)
time with the `?order_by` query parameter.
```plaintext
https://gitlab.example.com/<namespace>/<project>/-/badges/release.svg?order_by=release_at
```
You can change the width of the release name field by using the `value_width` parameter ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113615) in GitLab 15.10).
The value must be between 1 and 200, and the default value is 54.
If you set an out of range value, GitLab automatically adjusts it to the default value.
## Project badges
Badges can be added to a project by Maintainers or Owners, and are visible on the project's **Overview** page.
If you find that you have to add the same badges to several projects, you may want to add them at the [group level](#group-badges).
### Example project badge: Pipeline Status
A common project badge presents the GitLab CI pipeline status.
To add this badge to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Under **Name**, enter _Pipeline Status_.
1. Under **Link**, enter the following URL:
`https://gitlab.com/%{project_path}/-/commits/%{default_branch}`
1. Under **Badge image URL**, enter the following URL:
`https://gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg`
1. Select **Add badge**.
## Group badges
Badges can be added to a group by Owners, and are visible on the **Overview**
page of any project that belongs to the group.
By adding a badge to a group, you add and enforce a project-level badge
for all projects in the group.
{{< alert type="note" >}}
While these badges appear as project-level badges in the codebase, they
cannot be edited or deleted at the project level.
{{< /alert >}}
If you need individual badges for each project, either:
- Add the badge at the [project level](#project-badges).
- Use [placeholders](#placeholders).
## View badges
To view badges available in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
## Add a badge
To add a new badge to a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Select **Add badge**.
1. In the **Name** text box, enter the name of your badge.
1. In the **Link** text box, enter the URL that the badges should point to.
1. In the **Badge image URL** text box, enter the URL of the image you want to display for the badge.
1. Select **Add badge**.
## View the URL of pipeline badges
You can view the exact link for your badges.
Then you can use the link to embed the badge in your HTML or Markdown pages.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > CI/CD**.
1. Expand **General pipelines**.
1. In the **Pipeline status**, **Coverage report**, or **Latest release** sections, view the URLs for the images.
{{< alert type="note" >}}
The pipeline status badge is based on specific Git revisions (branches). Ensure you select the appropriate branch to view the correct pipeline status.
{{< /alert >}}
## Customize badges
You can customize the following aspects of a badge:
- Style
- Text
- Width
- Image
### Customize badge style
Pipeline badges can be rendered in different styles by adding the `style=style_name` parameter to the URL. Two styles are available:
- Flat (default):
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat
```

- Flat square:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat-square
```

### Customize badge text
The text for a badge can be customized to differentiate between multiple coverage jobs that run in the same pipeline.
Customize the badge text and width by adding the `key_text=custom_text` and `key_width=custom_key_width` parameters to the URL:
```plaintext
https://gitlab.com/gitlab-org/gitlab/badges/main/coverage.svg?job=karma&key_text=Frontend+Coverage&key_width=130
```

### Customize badge image
Use custom badge images in a project or a group if you want to use badges other than the default
ones.
Prerequisites:
- A valid URL that points directly to the desired image for the badge.
If the image is located in a GitLab repository, use the raw link to the image.
Using placeholders, here is an example badge image URL referring to a raw image at the root of a repository:
```plaintext
https://gitlab.example.com/<project_path>/-/raw/<default_branch>/my-image.svg
```
To add a new badge with a custom image to a group or project:
1. On the left sidebar, select **Search or go to** and find your project or
group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Under **Name**, enter the name for the badge.
1. Under **Link**, enter the URL that the badge should point to.
1. Under **Badge image URL**, enter the URL that points directly to the custom image that should be
displayed.
1. Select **Add badge**.
To learn how to use custom images generated through a pipeline, see the documentation on
[accessing the latest job artifacts by URL](../../ci/jobs/job_artifacts.md#from-a-url).
## Edit a badge
To edit a badge in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Next to the badge you want to edit, select **Edit** ({{< icon name="pencil" >}}).
1. Edit the **Name**, **Link**, or **Badge image URL**.
1. Select **Save changes**.
## Delete a badge
To delete a badge in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Next to the badge you want to delete, select **Delete** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete badge**.
{{< alert type="note" >}}
Badges associated with a group can be edited or deleted only at the [group level](#group-badges).
{{< /alert >}}
## Placeholders
Both the URL a badge points to and the image URL can contain placeholders,
which are evaluated when displaying the badge.
The following placeholders are available:
- `%{project_path}`: Path of a project including the parent groups
- `%{project_title}`: Title of a project
- `%{project_name}`: Name of a project
- `%{project_id}`: Database ID associated with a project
- `%{project_namespace}`: Project namespace of a project
- `%{group_name}`: Group of a project
- `%{gitlab_server}`: Server of a project
- `%{gitlab_pages_domain}`: Domain hosting GitLab Pages
- `%{default_branch}`: Default branch name configured for a project's repository
- `%{commit_sha}`: ID of the most recent commit to the default branch of a
project's repository
- `%{latest_tag}`: Latest tag added to the project's repository
{{< alert type="note" >}}
Placeholders allow badges to expose otherwise-private information, such as the
default branch or commit SHA when the project is configured to have a private
repository. This behavior is intentional, as badges are intended to be used publicly. Avoid
using these placeholders if the information is sensitive.
{{< /alert >}}
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Badges
description: Pipeline status, group, project, and custom badges.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Badges are a unified way to present condensed pieces of information about your projects.
A badge consists of a small image and a URL that the image points to.
In GitLab, badges are displayed on the project overview page, below the project description.
You can use badges at the [project](#project-badges) and [group](#group-badges) level.
## Available badges
GitLab provides the following pipeline badges:
- [Pipeline status badge](#pipeline-status-badges)
- [Test coverage report badge](#test-coverage-report-badges)
- [Latest release badge](#latest-release-badges)
GitLab also supports [custom badges](#customize-badges).
## Pipeline status badges
The pipeline status badge indicates the status of the latest pipeline in a project.
Depending on the status of your pipeline, the badge can have one of the following values:
- `pending`
- `running`
- `passed`
- `failed`
- `skipped`
- `manual`
- `canceled`
- `unknown`
You can access a pipeline status badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg
```
### Display only non-skipped status
To make the pipeline status badge display only the last non-skipped status, use the `?ignore_skipped=true` query parameter:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg?ignore_skipped=true
```
## Test coverage report badges
The test coverage report badge indicates the percentage of code that is tested in a project.
The value is calculated based on the latest successful pipeline.
You can access a test coverage report badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg
```
You can define the regular expression for the [code coverage](../../ci/testing/code_coverage/_index.md#configure-coverage-reporting)
that each job log is matched against.
This means that each job in the pipeline can have the test coverage percentage value defined.
To get the coverage report from a specific job, add the `job=coverage_job_name` parameter to the URL.
For example, you can use code similar to the following to add the test coverage report badge of the
`coverage` job to a Markdown file:
```markdown

```
### Test coverage limits and badge colors
The following table shows the default test coverage limits and badge colors:
| Test coverage | Percentage limits | Badge color |
|---------------|-----------------------------|-------------|
| Good | 95 up to and including 100% | <span style="color: #4c1">■</span> `#4c1` |
| Acceptable | 90 up to 95% | <span style="color:#a3c51c"> ■</span> `#a3c51c` |
| Medium | 75 up to 90% | <span style="color: #dfb317">■</span> `#dfb317` |
| Low | 0 up to 75% | <span style="color: #e05d44">■</span> `#e05d44` |
| Unknown | No coverage | <span style="color: #9f9f9f">■</span> `#9f9f9f` |
{{< alert type="note" >}}
*Up to* means up to, but not including, the upper bound.
{{< /alert >}}
### Change the default limits
You can override the default limits by passing the following query parameters in the coverage report badge URL:
| Query parameter | Acceptable values | Default |
|------------------|----------------------------------------------|---------|
| `min_good` | Any value between `3` and `100` | `95` |
| `min_acceptable` | Any value between `2` and `min_good`−1 | `90` |
| `min_medium` | Any value between `1` and `min_acceptable`−1 | `75` |
For example:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?min_good=98&min_acceptable=75
```
If you set an invalid boundary, GitLab automatically adjusts it to be valid. For example,
if you set `min_good` to `80` and `min_acceptable` to `85`, GitLab sets `min_acceptable`
to `79` (`min_good - 1`) because the minimum acceptable value cannot be higher than
the minimum good value.
## Latest release badges
The latest release badge indicates the latest release tag name for your project.
If there is no release, it shows `none`.
You can access a latest release badge image by using the following link:
```plaintext
https://gitlab.example.com/<namespace>/<project>/-/badges/release.svg
```
By default, the badge fetches the release sorted using the [`released_at`](../../api/releases/_index.md#create-a-release)
time with the `?order_by` query parameter.
```plaintext
https://gitlab.example.com/<namespace>/<project>/-/badges/release.svg?order_by=release_at
```
You can change the width of the release name field by using the `value_width` parameter ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113615) in GitLab 15.10).
The value must be between 1 and 200, and the default value is 54.
If you set an out of range value, GitLab automatically adjusts it to the default value.
## Project badges
Badges can be added to a project by Maintainers or Owners, and are visible on the project's **Overview** page.
If you find that you have to add the same badges to several projects, you may want to add them at the [group level](#group-badges).
### Example project badge: Pipeline Status
A common project badge presents the GitLab CI pipeline status.
To add this badge to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Under **Name**, enter _Pipeline Status_.
1. Under **Link**, enter the following URL:
`https://gitlab.com/%{project_path}/-/commits/%{default_branch}`
1. Under **Badge image URL**, enter the following URL:
`https://gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg`
1. Select **Add badge**.
## Group badges
Badges can be added to a group by Owners, and are visible on the **Overview**
page of any project that belongs to the group.
By adding a badge to a group, you add and enforce a project-level badge
for all projects in the group.
{{< alert type="note" >}}
While these badges appear as project-level badges in the codebase, they
cannot be edited or deleted at the project level.
{{< /alert >}}
If you need individual badges for each project, either:
- Add the badge at the [project level](#project-badges).
- Use [placeholders](#placeholders).
## View badges
To view badges available in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
## Add a badge
To add a new badge to a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Select **Add badge**.
1. In the **Name** text box, enter the name of your badge.
1. In the **Link** text box, enter the URL that the badges should point to.
1. In the **Badge image URL** text box, enter the URL of the image you want to display for the badge.
1. Select **Add badge**.
## View the URL of pipeline badges
You can view the exact link for your badges.
Then you can use the link to embed the badge in your HTML or Markdown pages.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > CI/CD**.
1. Expand **General pipelines**.
1. In the **Pipeline status**, **Coverage report**, or **Latest release** sections, view the URLs for the images.
{{< alert type="note" >}}
The pipeline status badge is based on specific Git revisions (branches). Ensure you select the appropriate branch to view the correct pipeline status.
{{< /alert >}}
## Customize badges
You can customize the following aspects of a badge:
- Style
- Text
- Width
- Image
### Customize badge style
Pipeline badges can be rendered in different styles by adding the `style=style_name` parameter to the URL. Two styles are available:
- Flat (default):
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat
```

- Flat square:
```plaintext
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat-square
```

### Customize badge text
The text for a badge can be customized to differentiate between multiple coverage jobs that run in the same pipeline.
Customize the badge text and width by adding the `key_text=custom_text` and `key_width=custom_key_width` parameters to the URL:
```plaintext
https://gitlab.com/gitlab-org/gitlab/badges/main/coverage.svg?job=karma&key_text=Frontend+Coverage&key_width=130
```

### Customize badge image
Use custom badge images in a project or a group if you want to use badges other than the default
ones.
Prerequisites:
- A valid URL that points directly to the desired image for the badge.
If the image is located in a GitLab repository, use the raw link to the image.
Using placeholders, here is an example badge image URL referring to a raw image at the root of a repository:
```plaintext
https://gitlab.example.com/<project_path>/-/raw/<default_branch>/my-image.svg
```
To add a new badge with a custom image to a group or project:
1. On the left sidebar, select **Search or go to** and find your project or
group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Under **Name**, enter the name for the badge.
1. Under **Link**, enter the URL that the badge should point to.
1. Under **Badge image URL**, enter the URL that points directly to the custom image that should be
displayed.
1. Select **Add badge**.
To learn how to use custom images generated through a pipeline, see the documentation on
[accessing the latest job artifacts by URL](../../ci/jobs/job_artifacts.md#from-a-url).
## Edit a badge
To edit a badge in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Next to the badge you want to edit, select **Edit** ({{< icon name="pencil" >}}).
1. Edit the **Name**, **Link**, or **Badge image URL**.
1. Select **Save changes**.
## Delete a badge
To delete a badge in a project or group:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Settings > General**.
1. Expand **Badges**.
1. Next to the badge you want to delete, select **Delete** ({{< icon name="remove" >}}).
1. On the confirmation dialog, select **Delete badge**.
{{< alert type="note" >}}
Badges associated with a group can be edited or deleted only at the [group level](#group-badges).
{{< /alert >}}
## Placeholders
Both the URL a badge points to and the image URL can contain placeholders,
which are evaluated when displaying the badge.
The following placeholders are available:
- `%{project_path}`: Path of a project including the parent groups
- `%{project_title}`: Title of a project
- `%{project_name}`: Name of a project
- `%{project_id}`: Database ID associated with a project
- `%{project_namespace}`: Project namespace of a project
- `%{group_name}`: Group of a project
- `%{gitlab_server}`: Server of a project
- `%{gitlab_pages_domain}`: Domain hosting GitLab Pages
- `%{default_branch}`: Default branch name configured for a project's repository
- `%{commit_sha}`: ID of the most recent commit to the default branch of a
project's repository
- `%{latest_tag}`: Latest tag added to the project's repository
{{< alert type="note" >}}
Placeholders allow badges to expose otherwise-private information, such as the
default branch or commit SHA when the project is configured to have a private
repository. This behavior is intentional, as badges are intended to be used publicly. Avoid
using these placeholders if the information is sensitive.
{{< /alert >}}
|
https://docs.gitlab.com/user/deploy_boards
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/deploy_boards.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
deploy_boards.md
|
Deploy
|
Environments
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Deploy boards (deprecated)
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Disabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/353410) in GitLab 15.0.
{{< /history >}}
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
[An epic exists](https://gitlab.com/groups/gitlab-org/-/epics/2493)
to add this functionality to the [agent](../clusters/agent/_index.md).
{{< /alert >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `certificate_based_clusters`.
{{< /alert >}}
GitLab deploy boards offer a consolidated view of the current health and
status of each CI [environment](../../ci/environments/_index.md) running on [Kubernetes](https://kubernetes.io), displaying the status
of the pods in the deployment. Developers and other teammates can view the
progress and status of a rollout, pod by pod, in the workflow they already use
without any need to access Kubernetes.
{{< alert type="note" >}}
If you have a Kubernetes cluster, you can Auto Deploy applications to production
environments by using [Auto DevOps](../../topics/autodevops/_index.md).
{{< /alert >}}
With deploy boards you can gain more insight into deploys with benefits such as:
- Following a deploy from the start, not just when it's done
- Watching the rollout of a build across multiple servers
- Finer state detail (Succeeded, Running, Failed, Pending, Unknown)
- See [Canary Deployments](canary_deployments.md)
Here's an example of a deploy board of the production environment.

The squares represent pods in your Kubernetes cluster that are associated with
the given environment. Hovering above each square you can see the state of a
deploy rolling out. The percentage is the percent of the pods that are updated
to the latest release.
Deploy boards are tightly coupled with Kubernetes, so you should be familiar with:
- [Kubernetes pods](https://kubernetes.io/docs/concepts/workloads/pods/)
- [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
- [Kubernetes namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
- [Kubernetes canary deployments](https://kubernetes.io/docs/concepts/workloads/management/#canary-deployments)
## Use cases
The deploy board is a visual representation of the Kubernetes pods for a
specific environment, so there are a lot of use cases. To name a few:
- You want to promote what's running in staging to production. So you go to the
environments list, verify that what's running in staging is what you think it is, then select the [manual job](../../ci/jobs/job_control.md#create-a-job-that-must-be-run-manually) to deploy to production.
- You triggered a deploy, and you have many containers to upgrade, so you know
this takes a while (you've also throttled your deploy to only take down X
containers at a time). But you need to tell someone when it's deployed, so you
go to the environments list and look at the production environment to see what
the progress is in real-time as each pod is rolled.
- You get a report that something is weird in production, so you look at the
production environment to see what is running, and if a deploy is ongoing,
stuck, or failed.
- You've got an MR that looks good, but you want to run it on staging because
staging is set up in some way closer to production. So you go to the environment
list, find the [Review App](../../ci/review_apps/_index.md) you're interested in, and select the
manual action to deploy it to staging.
## Enabling deploy boards
To display the deploy boards for a specific [environment](../../ci/environments/_index.md) you should:
1. Have [defined an environment](../../ci/environments/_index.md) with a deploy stage.
1. Have a Kubernetes cluster up and running.
{{< alert type="note" >}}
If you're using OpenShift, ensure that you're using the `Deployment` resource
instead of `DeploymentConfiguration`. Otherwise, the deploy boards don't render
correctly. For more information, read the
[OpenShift docs](https://docs.openshift.com/container-platform/3.7/dev_guide/deployments/kubernetes_deployments.html#kubernetes-deployments-vs-deployment-configurations)
and [GitLab issue #4584](https://gitlab.com/gitlab-org/gitlab/-/issues/4584).
{{< /alert >}}
1. [Configure GitLab Runner](../../ci/runners/_index.md) with the [`docker`](https://docs.gitlab.com/runner/executors/docker.html) or
[`kubernetes`](https://docs.gitlab.com/runner/executors/kubernetes/) executor.
1. Configure the [Kubernetes integration](../infrastructure/clusters/_index.md) in your project for the
cluster. The Kubernetes namespace is of particular note as you need it
for your deployment scripts (exposed by the `KUBE_NAMESPACE` deployment variable).
1. Ensure Kubernetes annotations of `app.gitlab.com/env: $CI_ENVIRONMENT_SLUG`
and `app.gitlab.com/app: $CI_PROJECT_PATH_SLUG` are applied to the
deployments, replica sets, and pods, where `$CI_ENVIRONMENT_SLUG` and
`$CI_PROJECT_PATH_SLUG` are the values of the CI/CD variables. This is so we can
lookup the proper environment in a cluster/namespace which may have more
than one. These resources should be contained in the namespace defined in
the Kubernetes service setting. You can use an [Auto deploy](../../topics/autodevops/stages.md#auto-deploy) `.gitlab-ci.yml`
template which has predefined stages and commands to use, and automatically
applies the annotations. Each project must have a unique namespace in
Kubernetes as well. The image below demonstrates how this is shown inside
Kubernetes.
If you use GCP to manage clusters, you can see the deployment details in GCP itself by navigating to **Workloads > deployment name > Details**:

Once all of these previous instructions are set up and the pipeline has run at least once,
go to the environments page under **Operate > Environments**.
Deploy boards are visible by default. You can explicitly select
the triangle next to their respective environment name to hide them.
### Example manifest file
The following example is an extract of a Kubernetes manifest deployment file, using the two annotations `app.gitlab.com/env` and `app.gitlab.com/app` to enable the **deploy boards**:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
spec:
replicas: 1
selector:
matchLabels:
app: "APPLICATION_NAME"
template:
metadata:
labels:
app: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
```
The annotations are applied to the deployments, replica sets, and pods. By changing the number of replicas, like `kubectl scale --replicas=3 deploy APPLICATION_NAME -n ${KUBE_NAMESPACE}`, you can follow the instances' pods from the board.
{{< alert type="note" >}}
The YAML file is static. If you apply it using `kubectl apply`, you must
manually provide the project and environment slugs, or create a script to
replace the variables in the YAML before applying.
{{< /alert >}}
## Canary Deployments
A popular CI strategy, where a small portion of the fleet is updated to the new
version of your application.
[Read more about Canary Deployments.](canary_deployments.md)
## Further reading
- [GitLab Auto deploy](../../topics/autodevops/stages.md#auto-deploy)
- [GitLab CI/CD variables](../../ci/variables/_index.md)
- [Environments and deployments](../../ci/environments/_index.md)
- [Kubernetes deploy example](https://gitlab.com/gitlab-examples/kubernetes-deploy)
|
---
stage: Deploy
group: Environments
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Deploy boards (deprecated)
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Disabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/353410) in GitLab 15.0.
{{< /history >}}
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
[An epic exists](https://gitlab.com/groups/gitlab-org/-/epics/2493)
to add this functionality to the [agent](../clusters/agent/_index.md).
{{< /alert >}}
{{< alert type="flag" >}}
On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `certificate_based_clusters`.
{{< /alert >}}
GitLab deploy boards offer a consolidated view of the current health and
status of each CI [environment](../../ci/environments/_index.md) running on [Kubernetes](https://kubernetes.io), displaying the status
of the pods in the deployment. Developers and other teammates can view the
progress and status of a rollout, pod by pod, in the workflow they already use
without any need to access Kubernetes.
{{< alert type="note" >}}
If you have a Kubernetes cluster, you can Auto Deploy applications to production
environments by using [Auto DevOps](../../topics/autodevops/_index.md).
{{< /alert >}}
With deploy boards you can gain more insight into deploys with benefits such as:
- Following a deploy from the start, not just when it's done
- Watching the rollout of a build across multiple servers
- Finer state detail (Succeeded, Running, Failed, Pending, Unknown)
- See [Canary Deployments](canary_deployments.md)
Here's an example of a deploy board of the production environment.

The squares represent pods in your Kubernetes cluster that are associated with
the given environment. Hovering above each square you can see the state of a
deploy rolling out. The percentage is the percent of the pods that are updated
to the latest release.
Deploy boards are tightly coupled with Kubernetes, so you should be familiar with:
- [Kubernetes pods](https://kubernetes.io/docs/concepts/workloads/pods/)
- [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
- [Kubernetes namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
- [Kubernetes canary deployments](https://kubernetes.io/docs/concepts/workloads/management/#canary-deployments)
## Use cases
The deploy board is a visual representation of the Kubernetes pods for a
specific environment, so there are a lot of use cases. To name a few:
- You want to promote what's running in staging to production. So you go to the
environments list, verify that what's running in staging is what you think it is, then select the [manual job](../../ci/jobs/job_control.md#create-a-job-that-must-be-run-manually) to deploy to production.
- You triggered a deploy, and you have many containers to upgrade, so you know
this takes a while (you've also throttled your deploy to only take down X
containers at a time). But you need to tell someone when it's deployed, so you
go to the environments list and look at the production environment to see what
the progress is in real-time as each pod is rolled.
- You get a report that something is weird in production, so you look at the
production environment to see what is running, and if a deploy is ongoing,
stuck, or failed.
- You've got an MR that looks good, but you want to run it on staging because
staging is set up in some way closer to production. So you go to the environment
list, find the [Review App](../../ci/review_apps/_index.md) you're interested in, and select the
manual action to deploy it to staging.
## Enabling deploy boards
To display the deploy boards for a specific [environment](../../ci/environments/_index.md) you should:
1. Have [defined an environment](../../ci/environments/_index.md) with a deploy stage.
1. Have a Kubernetes cluster up and running.
{{< alert type="note" >}}
If you're using OpenShift, ensure that you're using the `Deployment` resource
instead of `DeploymentConfiguration`. Otherwise, the deploy boards don't render
correctly. For more information, read the
[OpenShift docs](https://docs.openshift.com/container-platform/3.7/dev_guide/deployments/kubernetes_deployments.html#kubernetes-deployments-vs-deployment-configurations)
and [GitLab issue #4584](https://gitlab.com/gitlab-org/gitlab/-/issues/4584).
{{< /alert >}}
1. [Configure GitLab Runner](../../ci/runners/_index.md) with the [`docker`](https://docs.gitlab.com/runner/executors/docker.html) or
[`kubernetes`](https://docs.gitlab.com/runner/executors/kubernetes/) executor.
1. Configure the [Kubernetes integration](../infrastructure/clusters/_index.md) in your project for the
cluster. The Kubernetes namespace is of particular note as you need it
for your deployment scripts (exposed by the `KUBE_NAMESPACE` deployment variable).
1. Ensure Kubernetes annotations of `app.gitlab.com/env: $CI_ENVIRONMENT_SLUG`
and `app.gitlab.com/app: $CI_PROJECT_PATH_SLUG` are applied to the
deployments, replica sets, and pods, where `$CI_ENVIRONMENT_SLUG` and
`$CI_PROJECT_PATH_SLUG` are the values of the CI/CD variables. This is so we can
lookup the proper environment in a cluster/namespace which may have more
than one. These resources should be contained in the namespace defined in
the Kubernetes service setting. You can use an [Auto deploy](../../topics/autodevops/stages.md#auto-deploy) `.gitlab-ci.yml`
template which has predefined stages and commands to use, and automatically
applies the annotations. Each project must have a unique namespace in
Kubernetes as well. The image below demonstrates how this is shown inside
Kubernetes.
If you use GCP to manage clusters, you can see the deployment details in GCP itself by navigating to **Workloads > deployment name > Details**:

Once all of these previous instructions are set up and the pipeline has run at least once,
go to the environments page under **Operate > Environments**.
Deploy boards are visible by default. You can explicitly select
the triangle next to their respective environment name to hide them.
### Example manifest file
The following example is an extract of a Kubernetes manifest deployment file, using the two annotations `app.gitlab.com/env` and `app.gitlab.com/app` to enable the **deploy boards**:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
spec:
replicas: 1
selector:
matchLabels:
app: "APPLICATION_NAME"
template:
metadata:
labels:
app: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
```
The annotations are applied to the deployments, replica sets, and pods. By changing the number of replicas, like `kubectl scale --replicas=3 deploy APPLICATION_NAME -n ${KUBE_NAMESPACE}`, you can follow the instances' pods from the board.
{{< alert type="note" >}}
The YAML file is static. If you apply it using `kubectl apply`, you must
manually provide the project and environment slugs, or create a script to
replace the variables in the YAML before applying.
{{< /alert >}}
## Canary Deployments
A popular CI strategy, where a small portion of the fleet is updated to the new
version of your application.
[Read more about Canary Deployments.](canary_deployments.md)
## Further reading
- [GitLab Auto deploy](../../topics/autodevops/stages.md#auto-deploy)
- [GitLab CI/CD variables](../../ci/variables/_index.md)
- [Environments and deployments](../../ci/environments/_index.md)
- [Kubernetes deploy example](https://gitlab.com/gitlab-examples/kubernetes-deploy)
|
https://docs.gitlab.com/user/file_lock
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/file_lock.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
file_lock.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
File locking
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
File locking prevents multiple people from editing the same file simultaneously, which helps avoid
merge conflicts. File locking is especially valuable for binary files that cannot be merged like
design files, videos, and other non-text content.
GitLab supports two different types of file locking:
- [Exclusive file locks](../../topics/git/file_management.md#file-locks): Applied through the
command line with Git LFS and [`.gitattributes`](repository/files/git_attributes.md).
These locks prevent modifications to locked files on any branch.
- [Default branch file and directory locks](#default-branch-file-and-directory-locks): Applied
through the GitLab UI. These locks prevent modifications to files and directories on the
default branch only.
## Permissions
You must have at least the Developer role for the project to create, view, or manage file locks.
For more information, see [Roles and permissions](../permissions.md).
## Default branch file and directory locks
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Default branch locks apply only to the [default branch](repository/branches/default.md) set in your
project's settings. These locks help maintain stability in your default branch without blocking
collaborator workflows in other branches.
When a file or directory is locked by a user:
- Only the user who created the lock can modify the file or directory on the default branch.
- For other users, the locked file or directory is read-only on the default branch.
- Direct changes to locked files or directories on the default branch are blocked.
- Merge requests that modify locked files or directories cannot be merged to the default branch.
{{< alert type="note" >}}
On non-default branches, all users can still modify locked files and directories.
A **Lock** status is visible on these files and directories. This helps team members
to be aware of in-flight work without restricting their workflow on other branches.
{{< /alert >}}
## Lock a file or directory
Prerequisites:
- You must have at least the Developer role for the project.
To lock a file or directory:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file or directory you want to lock.
1. In the upper-right corner, select **Lock**.
1. On the confirmation dialog, select **OK**.
If **Lock** is not enabled, you don't have the required permissions to lock the file.
To view the user who locked a directory (if it was not you), hover over the button. Reinstatement of
similar functionality for locked files is discussed in
[issue 376222](https://gitlab.com/gitlab-org/gitlab/-/issues/376222).
### File operations from the Actions menu
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/519325) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `blob_overflow_menu`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/522993) in GitLab 18.1. Feature flag `blob_overflow_menu` removed.
{{< /history >}}
To lock a file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to lock.
1. In the upper-right corner, next to a filename, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Lock**.
1. On the confirmation dialog, select **OK**.
If you do not have permission to lock the file, the menu item is disabled.
## View locked files
Prerequisites:
- You must have at least the Developer role for the project.
To view locked files:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Locked files**.
The **Locked files** page displays all files locked with either Git LFS exclusive locks or the GitLab UI.
## Remove file locks
Prerequisites:
- You must either:
- Be the user who created the lock.
- Have at least the Maintainer role for the project.
To remove a lock:
{{< tabs >}}
{{< tab title="From a file" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to unlock.
1. Select **Unlock**.
1. On the confirmation dialog, select **Unlock**.
{{< /tab >}}
{{< tab title="From the Locked file page" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Locked files**.
1. To the right of the file you want to unlock, select **Unlock**.
1. On the confirmation dialog, select **OK**.
{{< /tab >}}
{{< /tabs >}}
## Related topics
- [File management with Git](../../topics/git/file_management.md)
- [File locks](../../topics/git/file_management.md#file-locks)
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: File locking
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
File locking prevents multiple people from editing the same file simultaneously, which helps avoid
merge conflicts. File locking is especially valuable for binary files that cannot be merged like
design files, videos, and other non-text content.
GitLab supports two different types of file locking:
- [Exclusive file locks](../../topics/git/file_management.md#file-locks): Applied through the
command line with Git LFS and [`.gitattributes`](repository/files/git_attributes.md).
These locks prevent modifications to locked files on any branch.
- [Default branch file and directory locks](#default-branch-file-and-directory-locks): Applied
through the GitLab UI. These locks prevent modifications to files and directories on the
default branch only.
## Permissions
You must have at least the Developer role for the project to create, view, or manage file locks.
For more information, see [Roles and permissions](../permissions.md).
## Default branch file and directory locks
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Default branch locks apply only to the [default branch](repository/branches/default.md) set in your
project's settings. These locks help maintain stability in your default branch without blocking
collaborator workflows in other branches.
When a file or directory is locked by a user:
- Only the user who created the lock can modify the file or directory on the default branch.
- For other users, the locked file or directory is read-only on the default branch.
- Direct changes to locked files or directories on the default branch are blocked.
- Merge requests that modify locked files or directories cannot be merged to the default branch.
{{< alert type="note" >}}
On non-default branches, all users can still modify locked files and directories.
A **Lock** status is visible on these files and directories. This helps team members
to be aware of in-flight work without restricting their workflow on other branches.
{{< /alert >}}
## Lock a file or directory
Prerequisites:
- You must have at least the Developer role for the project.
To lock a file or directory:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file or directory you want to lock.
1. In the upper-right corner, select **Lock**.
1. On the confirmation dialog, select **OK**.
If **Lock** is not enabled, you don't have the required permissions to lock the file.
To view the user who locked a directory (if it was not you), hover over the button. Reinstatement of
similar functionality for locked files is discussed in
[issue 376222](https://gitlab.com/gitlab-org/gitlab/-/issues/376222).
### File operations from the Actions menu
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/519325) in GitLab 17.10 [with a flag](../../administration/feature_flags/_index.md) named `blob_overflow_menu`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/522993) in GitLab 18.1. Feature flag `blob_overflow_menu` removed.
{{< /history >}}
To lock a file:
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to lock.
1. In the upper-right corner, next to a filename, select **Actions** ({{< icon name="ellipsis_v" >}}) **> Lock**.
1. On the confirmation dialog, select **OK**.
If you do not have permission to lock the file, the menu item is disabled.
## View locked files
Prerequisites:
- You must have at least the Developer role for the project.
To view locked files:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Locked files**.
The **Locked files** page displays all files locked with either Git LFS exclusive locks or the GitLab UI.
## Remove file locks
Prerequisites:
- You must either:
- Be the user who created the lock.
- Have at least the Maintainer role for the project.
To remove a lock:
{{< tabs >}}
{{< tab title="From a file" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Go to the file you want to unlock.
1. Select **Unlock**.
1. On the confirmation dialog, select **Unlock**.
{{< /tab >}}
{{< tab title="From the Locked file page" >}}
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Code > Locked files**.
1. To the right of the file you want to unlock, select **Unlock**.
1. On the confirmation dialog, select **OK**.
{{< /tab >}}
{{< /tabs >}}
## Related topics
- [File management with Git](../../topics/git/file_management.md)
- [File locks](../../topics/git/file_management.md#file-locks)
|
https://docs.gitlab.com/user/issue_board
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/issue_board.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
issue_board.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Issue boards
|
Visualization, workflow, Kanban, and prioritization.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Milestones and iterations shown on issue cards [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25758) in GitLab 16.11.
- Ability to delete the last board in a group or project [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/499579) in GitLab 17.6.
- Minimum role to manage issue boards [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Issue boards provide a visual way to manage and track work in GitLab.
Issue boards:
- Display issues as cards in customizable lists based on labels, milestones, or assignees.
- Track issues through different stages of your workflow.
- Support agile methodologies like Kanban and Scrum.
- Organize multiple boards for different teams and projects.
- Visualize workload and progress across your entire process.
Your issues appear as cards in vertical lists, organized by their assigned
[labels](labels.md), [milestones](#milestone-lists), [iterations](#iteration-lists), [assignees](#assignee-lists) or [status](#status-lists).
Add metadata to your issues, then create the corresponding list for your existing issues.
When you're ready, you can drag your issue cards from one list to another.
Issue boards can power common frameworks like [Kanban](https://en.wikipedia.org/wiki/Kanban_(development)) and
[Scrum](https://en.wikipedia.org/wiki/Scrum_(software_development)).
To let your team members organize their own workflows, use
[multiple issue boards](#multiple-issue-boards). This allows creating multiple issue
boards in the same project.

Different issue board features are available in different [GitLab tiers](https://about.gitlab.com/pricing/):
| Tier | Number of project issue boards | Number of [group issue boards](#group-issue-boards) | [Configurable issue boards](#configurable-issue-boards) | [Assignee lists](#assignee-lists) |
| -------- | ------------------------------ | --------------------------------------------------- | ------------------------------------------------------- | --------------------------------- |
| Free | Multiple | 1 | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No |
| Premium | Multiple | Multiple | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |
| Ultimate | Multiple | Multiple | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |
Read more about [GitLab Enterprise features for issue boards](#gitlab-enterprise-features-for-issue-boards).

<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch a [video presentation](https://youtu.be/vjccjHI7aGI) of the issue board feature.
<!-- Video published on 2020-04-02 -->
## Multiple issue boards
Multiple issue boards allow for more than one issue board for:
- A project in all tiers
- A group in the Premium and Ultimate tier
Multiple issue boards are great for large projects with more than one team, in which a repository hosts
the code of multiple products and when you want to create boards to power different workflows across
the software development lifecycle.
Using the search box at the top of the menu, you can filter the listed boards.
When you have ten or more boards available, a **Recent** section is also shown in the menu, with
shortcuts to your last four visited boards.

When you're revisiting an issue board in a project or group with multiple boards,
GitLab automatically loads the last board you visited.
### Create an issue board
Prerequisites:
- You must have at least the Planner role for the project.
To create a new issue board:
1. In the upper-left corner of the issue board page, select the dropdown list with the current board name.
1. Select **Create new board**.
1. Enter the new board's name and select its scope: milestone, iteration, labels, assignee, or weight.
1. Select **Create board**
### Delete an issue board
Prerequisites:
- You must have at least the Planner role for the project or group where the board is saved.
To delete the open issue board:
1. In the upper-right corner of the issue board page, select **Configure board** ({{< icon name="settings" >}}).
1. Select **Delete board**.
1. Select **Delete** to confirm.
If the board you've deleted was the last one, a new `Development` board is created.
## Issue boards use cases
You can tailor GitLab issue boards to your own preferred workflow.
For workflow-based documentation, see [Tutorials: Plan and track your work](../../tutorials/plan_and_track.md).
### Use cases for a single issue board
With the [GitLab Flow](https://about.gitlab.com/topics/version-control/what-is-gitlab-flow/) you can
discuss proposals in issues, label them, and organize and prioritize them with issue boards.
For example, let's consider this simplified development workflow:
1. You have a repository that hosts your application's codebase, and your team actively contributes code.
1. Your **backend** team starts working on a new implementation, gathers feedback and approval, and
passes it over to the **frontend** team.
1. When frontend is complete, the new feature is deployed to a **staging** environment to be tested.
1. When successful, it's deployed to **production**.
If you have the labels **Backend**, **Frontend**, **Staging**, and
**Production**, and an issue board with a list for each, you can:
- Visualize the entire flow of implementations since the beginning of the development lifecycle
until deployed to production.
- Prioritize the issues in a list by moving them vertically.
- Move issues between lists to organize them according to the labels you've set.
- Add multiple issues to lists in the board by selecting one or more existing issues.

### Scrum team
In a Scrum team, use [multiple issue boards](#multiple-issue-boards) so that each scrum team has their own board.
On the Scrum board, you can easily move issues through each
part of the process. For example: **To Do**, **Doing**, and **Done**.
### Quick assignments
To quickly assign issues to your team members:
1. Create [assignee lists](#assignee-lists) for each team member.
1. Drag an issue onto the team member's list.
## Issue board terminology
An **issue board** represents a unique view of your issues. It can have multiple lists with each
list consisting of issues represented by cards.
A **list** is a column on the issue board that displays issues matching certain attributes.
In addition to the default "Open" and "Closed" lists, each additional list shows issues matching
your chosen label, assignee, or milestone. On the top of each list you can see the number of issues
that belong to it. Types of lists include:
- **Open** (default): all open issues that do not belong to one of the other lists.
Always appears as the leftmost list.
- **Closed** (default): all closed issues. Always appears as the rightmost list.
- **Label list**: all open issues for a label.
- [**Assignee list**](#assignee-lists): all open issues assigned to a user.
- [**Milestone list**](#milestone-lists): all open issues for a milestone.
- [**Iteration list**](#iteration-lists): all open issues for an iteration.
- [**Status list**](#status-lists): all issues having a status.
A **Card** is a box on a list, and it represents an issue. You can drag cards from one list to
another to change their label, assignee, or milestone. The information you can see on a
card includes:
- Issue title
- Associated labels
- Issue number
- Assignee
- Weight
- Milestone
- Iteration (in the Premium and Ultimate tier)
- Due date
- Time tracking estimate
- Health status
A **swimlane** is a horizontal grouping of issues on the issue board, for example by parent epic.
## Ordering issues in a list
Prerequisites:
- You must have at least the Planner role for the project.
When an issue is created, the system assigns a relative order value that is greater than the maximum value
of that issue's project or top-level group. This means the issue is at the bottom of any issue list that
it appears in.
When you visit a board, issues appear ordered in any list. You're able to change
that order by dragging the issues. The changed order is saved, so that anybody who visits the same
board later sees the reordering, with some exceptions.
Any time you drag and reorder the issue, its relative order value changes accordingly.
Then, any time that issue appears in any board, the ordering is done according to
the updated relative order value. If a user in your GitLab instance
drags issue `A` above issue `B`, the ordering is maintained when these two issues are subsequently
loaded in any board in the same instance.
This could be a different project board or a different group
board, for example.
This ordering also affects [issue lists](issues/sorting_issue_lists.md).
Changing the order in an issue board changes the ordering in an issue list,
and vice versa.
## Focus mode
In focus mode, the navigation UI is hidden, allowing you to focus on issues in the board.
To enable or disable focus mode, in the upper-right corner, select **Toggle focus mode** ({{< icon name="maximize" >}}).
## Group issue boards
Accessible at the group navigation level, a group issue board offers the same features as a project-level board.
It can display issues from all projects that fall under the group and its descendant subgroups.
Users on GitLab Free can use a single group issue board.
## GitLab Enterprise features for issue boards
GitLab issue boards are available on the GitLab Free tier, but some
advanced functionality is present in [higher tiers only](https://about.gitlab.com/pricing/).
### Configurable issue boards
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
An issue board can be associated with a [milestone](milestones/_index.md),
[labels](labels.md), assignee, weight, and current [iteration](../group/iterations/_index.md),
which automatically filter the board issues accordingly.
This allows you to create unique boards according to your team's need.

You can define the scope of your board when creating it or by selecting the **Configure board** ({{< icon name="settings" >}}) button.
After a milestone, iteration, assignee, or weight is assigned to an issue board, you can no longer
filter through these in the search bar. To do that, you need to remove the desired scope
(for example, milestone, assignee, or weight) from the issue board.
If you don't have editing permission in a board, you're still able to see the configuration by
selecting **Board configuration** ({{< icon name="settings" >}}).
### Assignee lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
As in a regular list showing all issues with a chosen label, you can add
an assignee list that shows all issues assigned to a user.
You can have a board with both label lists and assignee lists.
Prerequisites:
- You must have at least the Planner role for the project.
To add an assignee list:
1. Select **New list**.
1. Select **Assignee**.
1. In the dropdown list, select a user.
1. Select **Add to board**.
Now that the assignee list is added, you can assign or unassign issues to that user
by [moving issues](#move-issues-and-lists) to and from an assignee list.
To remove an assignee list, just as with a label list, select the trash icon.

### Milestone lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can create milestone lists that filter issues by the assigned
milestone, giving you more freedom and visibility on the issue board.
Prerequisites:
- You must have at least the Planner role for the project.
To add a milestone list:
1. Select **New list**.
1. Select **Milestone**.
1. In the dropdown list, select a milestone.
1. Select **Add to board**.
To change the milestone of issues, [drag issue cards](#move-issues-and-lists) to and from a milestone list.

### Iteration lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can create lists of issues in an iteration.
Prerequisites:
- You must have at least the Planner role for the project.
To add an iteration list:
1. Select **New list**.
1. Select **Iteration**.
1. In the dropdown list, select an iteration.
1. Select **Add to board**.
To change the iteration of issues, [drag issue cards](#move-issues-and-lists) to and from an iteration list.

### Status lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Create lists of issues that have a specific status.
Status lists help you organize issues by their workflow stage, such as **In progress** or **Done**.
For more information about status, see [Status](../work_items/status.md).
Status lists behave differently from other list types:
- **Status lists**: Can include both open and closed issues, depending on whether the status maps to an open or closed state.
- **Other lists** (like assignee or milestone): Always show only open issues.
Prerequisites:
- You must have at least the Planner role for the project.
To add a status list:
1. Select **New list**.
1. Select **Status**.
1. From the dropdown list, select the status.
1. Select **Add to board**.
The status list is added to the board and displays issues with that status.
To change the status of issues, [drag issue cards](#move-issues-and-lists) to and from a status list.

### Group issues in swimlanes
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With swimlanes you can visualize issues grouped by epic.
Your issue board keeps all the other features, but with a different visual organization of issues.
This feature is available both at the project and group level.
Prerequisites:
- You must have at least the Planner role for the project.
To group issues by epic in an issue board:
1. Select **View options** ({{< icon name="preferences" >}}).
1. Select **Epic swimlanes**.

You can then [edit](#edit-an-issue) issues without leaving this view and [drag](#move-issues-and-lists)
them to change their position and epic assignment:
- To reorder an issue, drag it to the new position in a list.
- To assign an issue to another epic, drag it to the epic's horizontal lane.
- To remove an issue from an epic, drag it to the **Issues with no epic assigned** lane.
- To move an issue to another epic and another list, at the same time, drag the issue diagonally.

### Sum of issue weights
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The top of each list indicates the sum of issue weights for the issues that
belong to that list. This is useful when using boards for capacity allocation,
especially in combination with [assignee lists](#assignee-lists).

### Work in progress limits
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Setting limits by weight [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/119208/) in GitLab 17.11.
{{< /history >}}
You can set a work in progress (WIP) limit for each issue list on an issue board.
When a limit is set, the current state and configured limit are shown in the board list header.
A line in the list separates items within the limit from those in excess of the limit.
You cannot set a WIP limit on the default lists (**Open** and **Closed**).
#### Types of limits
GitLab supports two types of WIP limits:
- **Items**: Limits the number of issues in a list regardless of their weight.
The board header shows the number of issues in the list and the item limit.
For example, if there are 4 issues and an item limit of 3, the header shows **4/3**.

- **Weight**: Limits the total weight of issues in a list.
The board header shows the total weight of issues in the list and the weight limit.
For example, if there are issues with weights adding up to 8 and a weight limit of 5, the header shows **8/5**.

Examples:
- When you have a list with four issues and an item limit of five, the header shows **4/5**.
If you exceed the limit, the current number of issues is shown in red.
- You have a list with five issues with an item limit of five. When you move another issue to that list,
the list's header displays **6/5**, with the six shown in red. The work in progress limit line is shown before the sixth issue.
- When using weight limits, if you have three issues with weights of 1, 2, and 5 (total weight of 8) and a weight limit of 5, the header shows **8/5** with the 8 in red. The work in progress limit line appears after the issues whose combined weight is within the limit, separating them from issues that exceed the limit.
#### Set work in progress limit
Prerequisites:
- You must have at least the Planner role for the project.
To set a WIP limit for a list, in an issue board:
1. On the top of the list you want to edit, select **Edit list settings** ({{< icon name="settings" >}}).
The list settings sidebar opens on the right.
1. Next to **Work in progress limit**, select **Edit**.
1. Choose the limit type from the dropdown list:
- **Items**: To limit by the number of issues.
- **Weight**: To limit by the total weight of issues.
1. Enter the maximum number of items or maximum weight.
1. Press <kbd>Enter</kbd> to save.
To remove a WIP limit, select **Remove limit**.
### Blocked issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If an issue is [blocked by another issue](issues/related_issues.md#blocking-issues), an icon appears next to its title to indicate its blocked
status.
When you hover over the blocked icon ({{< icon name="entity-blocked" >}}), a detailed information popover is displayed.

## Actions you can take on an issue board
- [Edit an issue](#edit-an-issue).
- [Create a new list](#create-a-new-list).
- [Remove an existing list](#remove-a-list).
- [Remove an issue from a list](#remove-an-issue-from-a-list).
- [Filter issues](#filter-issues) that appear across your issue board.
- [Move issues and lists](#move-issues-and-lists).
- Drag and reorder the lists.
- Change issue labels (by dragging an issue between lists).
- Close an issue (by dragging it to the **Closed** list).
### Edit an issue
You can edit an issue without leaving the board view.
To open the right sidebar, select an issue card (not its title).
Prerequisites:
- You must have at least the Planner role for the project.
You can edit the following issue attributes in the right sidebar:
- Assignees
- Confidentiality
- Due date
- [Epic](../group/epics/_index.md)
- [Health status](issues/managing_issues.md#health-status)
- [Iteration](../group/iterations/_index.md)
- Labels
- Milestone
- Notifications setting
- Title
- [Weight](issues/issue_weight.md)
- Time tracking
<!-- When issues_list_drawer feature flag is removed, use the following info
and the ones outlined in issues/managing_issues.md#open-issues-in-a-drawer to update the main previous topic. -->
If your administrator enabled the [issue drawer](issues/managing_issues.md#open-issues-in-a-drawer),
when you select an issue card from the issue board, the issue opens in a drawer.
There, you can edit all the fields, including the description, comments, or related items.
### Create a new list
{{< history >}}
- Creating a list between existing lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462515) in GitLab 17.5.
{{< /history >}}
You can create a new list between two existing lists or at the right of an issue board.
To create a new list between two lists:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issue boards**.
1. Hover or move keyboard focus between two lists.
1. Select **New list**.
The new list panel opens.

1. Choose the label, user, milestone, iteration, or status to base the new list on.
1. Select **Add to board**.
The new list is inserted in the same position on the board as the new list panel.
To move and reorder lists, drag them around.
Alternatively, you can select the **New list** at the right end of the board.
The new list is inserted at the right end of the lists, before **Closed**.
### Remove a list
Removing a list doesn't have any effect on issues and labels, as it's just the
list view that's removed. You can always create it again later if you need.
Prerequisites:
- You must have at least the Planner role for the project.
To remove a list from an issue board:
1. On the top of the list you want to remove, select **Edit list settings** ({{< icon name="settings" >}}).
The list settings sidebar opens on the right.
1. Select **Remove list**.
1. On the confirmation dialog, select **Remove list** again.
### Add issues to a list
Prerequisites:
- You must have at least the Planner role for the project.
If your board is scoped to one or more attributes, go to the issues you want to add and apply the
same attributes as your board scope.
For example, to add an issue to a list scoped to the `Doing` label, in a group issue board:
1. Go to an issue in the group or one of the subgroups or projects.
1. Add the `Doing` label.
The issue should now show in the `Doing` list on your issue board.
### Remove an issue from a list
When an issue should no longer belong to a list, you can remove it.
Prerequisites:
- You must have at least the Planner role for the project.
The steps depend on the scope of the list:
1. To open the right sidebar, select the issue card.
1. Remove what's keeping the issue in the list.
If it's a label list, remove the label. If it's an [assignee list](#assignee-lists), unassign the user.
### Filter issues
You can use the filters on top of your issue board to show only
the results you want. It's similar to the filtering used in the [issue tracker](issues/_index.md).
Prerequisites:
- You must have at least the Planner role for the project.
You can filter by the following:
- Assignee
- Author
- [Epic](../group/epics/_index.md)
- [Iteration](../group/iterations/_index.md)
- Label
- Milestone
- My reaction
- Release
- Type (issue/incident)
- [Weight](issues/issue_weight.md)
- [Status](../work_items/status.md)
#### Filtering issues in a group board
When [filtering issues](#filter-issues) in a **group** board, keep this behavior in mind:
- Milestones: you can filter by the milestones belonging to the group and its descendant groups.
- Labels: you can only filter by the labels belonging to the group but not its descendant groups.
When you edit issues individually using the right sidebar, you can additionally select the
milestones and labels from the **project** that the issue is from.
### Move issues and lists
You can move issues and lists by dragging them.
Prerequisites:
- You must have at least the Planner role for a project in GitLab.
To move an issue, select the issue card and drag it to another position in its current list or
into a different list. Learn about possible effects in [Dragging issues between lists](#dragging-issues-between-lists).
To move a list, select its top bar, and drag it horizontally.
You can't move the **Open** and **Closed** lists, but you can hide them when editing an issue board.
#### Move an issue to the start of the list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367473) in GitLab 15.4.
{{< /history >}}
You can move issues to the top of the list with a menu shortcut.
Your issue is moved to the top of the list even if other issues are hidden by a filter.
Prerequisites:
- You must at least have the Planner role for the project.
To move an issue to the start of the list:
1. In an issue board, hover over the card of the issue you want to move.
1. Select **Card options** ({{< icon name="ellipsis_v" >}}), then **Move to start of list**.
#### Move an issue to the end of the list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367473) in GitLab 15.4.
{{< /history >}}
You can move issues to the bottom of the list with a menu shortcut.
Your issue is moved to the bottom of the list even if other issues are hidden by a filter.
Prerequisites:
- You must at least have the Planner role for the project.
To move an issue to the end of the list:
1. In an issue board, hover over the card of the issue you want to move.
1. Select **Card options** ({{< icon name="ellipsis_v" >}}), then **Move to end of list**.
#### Dragging issues between lists
To move an issue to another list, select the issue card and drag it onto that list.
When you drag issues between lists, the result is different depending on the source list
and the target list.
| | To Open | To Closed | To label B list | To assignee Bob list |
| ---------------------------- | -------------- | ----------- | ------------------------------ | ----------------------------- |
| **From Open** | - | Close issue | Add label B | Assign Bob |
| **From Closed** | Reopen issue | - | Reopen issue and add label B | Reopen issue and assign Bob |
| **From label A list** | Remove label A | Close issue | Remove label A and add label B | Assign Bob |
| **From assignee Alice list** | Unassign Alice | Close issue | Add label B | Unassign Alice and assign Bob |
## Tips
A few things to remember:
- Moving an issue between lists removes the label from the list it came from
and adds the label from the list it goes to.
- An issue can exist in multiple lists if it has more than one label.
- Lists are populated with issues automatically if the issues are labeled.
- Selecting the issue title inside a card takes you to that issue.
- Selecting a label inside a card quickly filters the entire issue board
and show only the issues from all lists that have that label.
- When an issue is moved from a status list to an open list, the default open status is applied.
Similarly, when it's moved to a closed list, the default closed status is applied.
- For performance and visibility reasons, each list shows the first 20 issues
by default. If you have more than 20 issues, start scrolling down and the next
20 appear.
## Troubleshooting issue boards
### `There was a problem fetching users` on group issue board when filtering by Author or Assignee
If you get a banner with `There was a problem fetching users` error when filtering by author or assignee on
group issue board, make sure that you are added as a member to the current group.
Non-members do not have permission to list group members when filtering by author or assignee on issue boards.
To fix this error, you should add all of your users to the top-level group with at least the Guest role.
### Use Rails console to fix issue boards not loading and timing out
If you see issue board not loading and timing out in UI, use Rails console to call the Issue Rebalancing service to fix it:
1. [Start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session).
1. Run these commands:
```ruby
p = Project.find_by_full_path('<username-or-group>/<project-name>')
Issues::RelativePositionRebalancingService.new(p.root_namespace.all_projects).execute
```
1. To exit the Rails console, type `quit`.
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Issue boards
description: Visualization, workflow, Kanban, and prioritization.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Milestones and iterations shown on issue cards [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25758) in GitLab 16.11.
- Ability to delete the last board in a group or project [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/499579) in GitLab 17.6.
- Minimum role to manage issue boards [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Issue boards provide a visual way to manage and track work in GitLab.
Issue boards:
- Display issues as cards in customizable lists based on labels, milestones, or assignees.
- Track issues through different stages of your workflow.
- Support agile methodologies like Kanban and Scrum.
- Organize multiple boards for different teams and projects.
- Visualize workload and progress across your entire process.
Your issues appear as cards in vertical lists, organized by their assigned
[labels](labels.md), [milestones](#milestone-lists), [iterations](#iteration-lists), [assignees](#assignee-lists) or [status](#status-lists).
Add metadata to your issues, then create the corresponding list for your existing issues.
When you're ready, you can drag your issue cards from one list to another.
Issue boards can power common frameworks like [Kanban](https://en.wikipedia.org/wiki/Kanban_(development)) and
[Scrum](https://en.wikipedia.org/wiki/Scrum_(software_development)).
To let your team members organize their own workflows, use
[multiple issue boards](#multiple-issue-boards). This allows creating multiple issue
boards in the same project.

Different issue board features are available in different [GitLab tiers](https://about.gitlab.com/pricing/):
| Tier | Number of project issue boards | Number of [group issue boards](#group-issue-boards) | [Configurable issue boards](#configurable-issue-boards) | [Assignee lists](#assignee-lists) |
| -------- | ------------------------------ | --------------------------------------------------- | ------------------------------------------------------- | --------------------------------- |
| Free | Multiple | 1 | {{< icon name="dotted-circle" >}} No | {{< icon name="dotted-circle" >}} No |
| Premium | Multiple | Multiple | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |
| Ultimate | Multiple | Multiple | {{< icon name="check-circle" >}} Yes | {{< icon name="check-circle" >}} Yes |
Read more about [GitLab Enterprise features for issue boards](#gitlab-enterprise-features-for-issue-boards).

<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch a [video presentation](https://youtu.be/vjccjHI7aGI) of the issue board feature.
<!-- Video published on 2020-04-02 -->
## Multiple issue boards
Multiple issue boards allow for more than one issue board for:
- A project in all tiers
- A group in the Premium and Ultimate tier
Multiple issue boards are great for large projects with more than one team, in which a repository hosts
the code of multiple products and when you want to create boards to power different workflows across
the software development lifecycle.
Using the search box at the top of the menu, you can filter the listed boards.
When you have ten or more boards available, a **Recent** section is also shown in the menu, with
shortcuts to your last four visited boards.

When you're revisiting an issue board in a project or group with multiple boards,
GitLab automatically loads the last board you visited.
### Create an issue board
Prerequisites:
- You must have at least the Planner role for the project.
To create a new issue board:
1. In the upper-left corner of the issue board page, select the dropdown list with the current board name.
1. Select **Create new board**.
1. Enter the new board's name and select its scope: milestone, iteration, labels, assignee, or weight.
1. Select **Create board**
### Delete an issue board
Prerequisites:
- You must have at least the Planner role for the project or group where the board is saved.
To delete the open issue board:
1. In the upper-right corner of the issue board page, select **Configure board** ({{< icon name="settings" >}}).
1. Select **Delete board**.
1. Select **Delete** to confirm.
If the board you've deleted was the last one, a new `Development` board is created.
## Issue boards use cases
You can tailor GitLab issue boards to your own preferred workflow.
For workflow-based documentation, see [Tutorials: Plan and track your work](../../tutorials/plan_and_track.md).
### Use cases for a single issue board
With the [GitLab Flow](https://about.gitlab.com/topics/version-control/what-is-gitlab-flow/) you can
discuss proposals in issues, label them, and organize and prioritize them with issue boards.
For example, let's consider this simplified development workflow:
1. You have a repository that hosts your application's codebase, and your team actively contributes code.
1. Your **backend** team starts working on a new implementation, gathers feedback and approval, and
passes it over to the **frontend** team.
1. When frontend is complete, the new feature is deployed to a **staging** environment to be tested.
1. When successful, it's deployed to **production**.
If you have the labels **Backend**, **Frontend**, **Staging**, and
**Production**, and an issue board with a list for each, you can:
- Visualize the entire flow of implementations since the beginning of the development lifecycle
until deployed to production.
- Prioritize the issues in a list by moving them vertically.
- Move issues between lists to organize them according to the labels you've set.
- Add multiple issues to lists in the board by selecting one or more existing issues.

### Scrum team
In a Scrum team, use [multiple issue boards](#multiple-issue-boards) so that each scrum team has their own board.
On the Scrum board, you can easily move issues through each
part of the process. For example: **To Do**, **Doing**, and **Done**.
### Quick assignments
To quickly assign issues to your team members:
1. Create [assignee lists](#assignee-lists) for each team member.
1. Drag an issue onto the team member's list.
## Issue board terminology
An **issue board** represents a unique view of your issues. It can have multiple lists with each
list consisting of issues represented by cards.
A **list** is a column on the issue board that displays issues matching certain attributes.
In addition to the default "Open" and "Closed" lists, each additional list shows issues matching
your chosen label, assignee, or milestone. On the top of each list you can see the number of issues
that belong to it. Types of lists include:
- **Open** (default): all open issues that do not belong to one of the other lists.
Always appears as the leftmost list.
- **Closed** (default): all closed issues. Always appears as the rightmost list.
- **Label list**: all open issues for a label.
- [**Assignee list**](#assignee-lists): all open issues assigned to a user.
- [**Milestone list**](#milestone-lists): all open issues for a milestone.
- [**Iteration list**](#iteration-lists): all open issues for an iteration.
- [**Status list**](#status-lists): all issues having a status.
A **Card** is a box on a list, and it represents an issue. You can drag cards from one list to
another to change their label, assignee, or milestone. The information you can see on a
card includes:
- Issue title
- Associated labels
- Issue number
- Assignee
- Weight
- Milestone
- Iteration (in the Premium and Ultimate tier)
- Due date
- Time tracking estimate
- Health status
A **swimlane** is a horizontal grouping of issues on the issue board, for example by parent epic.
## Ordering issues in a list
Prerequisites:
- You must have at least the Planner role for the project.
When an issue is created, the system assigns a relative order value that is greater than the maximum value
of that issue's project or top-level group. This means the issue is at the bottom of any issue list that
it appears in.
When you visit a board, issues appear ordered in any list. You're able to change
that order by dragging the issues. The changed order is saved, so that anybody who visits the same
board later sees the reordering, with some exceptions.
Any time you drag and reorder the issue, its relative order value changes accordingly.
Then, any time that issue appears in any board, the ordering is done according to
the updated relative order value. If a user in your GitLab instance
drags issue `A` above issue `B`, the ordering is maintained when these two issues are subsequently
loaded in any board in the same instance.
This could be a different project board or a different group
board, for example.
This ordering also affects [issue lists](issues/sorting_issue_lists.md).
Changing the order in an issue board changes the ordering in an issue list,
and vice versa.
## Focus mode
In focus mode, the navigation UI is hidden, allowing you to focus on issues in the board.
To enable or disable focus mode, in the upper-right corner, select **Toggle focus mode** ({{< icon name="maximize" >}}).
## Group issue boards
Accessible at the group navigation level, a group issue board offers the same features as a project-level board.
It can display issues from all projects that fall under the group and its descendant subgroups.
Users on GitLab Free can use a single group issue board.
## GitLab Enterprise features for issue boards
GitLab issue boards are available on the GitLab Free tier, but some
advanced functionality is present in [higher tiers only](https://about.gitlab.com/pricing/).
### Configurable issue boards
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
An issue board can be associated with a [milestone](milestones/_index.md),
[labels](labels.md), assignee, weight, and current [iteration](../group/iterations/_index.md),
which automatically filter the board issues accordingly.
This allows you to create unique boards according to your team's need.

You can define the scope of your board when creating it or by selecting the **Configure board** ({{< icon name="settings" >}}) button.
After a milestone, iteration, assignee, or weight is assigned to an issue board, you can no longer
filter through these in the search bar. To do that, you need to remove the desired scope
(for example, milestone, assignee, or weight) from the issue board.
If you don't have editing permission in a board, you're still able to see the configuration by
selecting **Board configuration** ({{< icon name="settings" >}}).
### Assignee lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
As in a regular list showing all issues with a chosen label, you can add
an assignee list that shows all issues assigned to a user.
You can have a board with both label lists and assignee lists.
Prerequisites:
- You must have at least the Planner role for the project.
To add an assignee list:
1. Select **New list**.
1. Select **Assignee**.
1. In the dropdown list, select a user.
1. Select **Add to board**.
Now that the assignee list is added, you can assign or unassign issues to that user
by [moving issues](#move-issues-and-lists) to and from an assignee list.
To remove an assignee list, just as with a label list, select the trash icon.

### Milestone lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can create milestone lists that filter issues by the assigned
milestone, giving you more freedom and visibility on the issue board.
Prerequisites:
- You must have at least the Planner role for the project.
To add a milestone list:
1. Select **New list**.
1. Select **Milestone**.
1. In the dropdown list, select a milestone.
1. Select **Add to board**.
To change the milestone of issues, [drag issue cards](#move-issues-and-lists) to and from a milestone list.

### Iteration lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can create lists of issues in an iteration.
Prerequisites:
- You must have at least the Planner role for the project.
To add an iteration list:
1. Select **New list**.
1. Select **Iteration**.
1. In the dropdown list, select an iteration.
1. Select **Add to board**.
To change the iteration of issues, [drag issue cards](#move-issues-and-lists) to and from an iteration list.

### Status lists
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/543862) in GitLab 18.2 [with a flag](../../administration/feature_flags/_index.md) named `work_item_status_feature_flag`. Enabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
Create lists of issues that have a specific status.
Status lists help you organize issues by their workflow stage, such as **In progress** or **Done**.
For more information about status, see [Status](../work_items/status.md).
Status lists behave differently from other list types:
- **Status lists**: Can include both open and closed issues, depending on whether the status maps to an open or closed state.
- **Other lists** (like assignee or milestone): Always show only open issues.
Prerequisites:
- You must have at least the Planner role for the project.
To add a status list:
1. Select **New list**.
1. Select **Status**.
1. From the dropdown list, select the status.
1. Select **Add to board**.
The status list is added to the board and displays issues with that status.
To change the status of issues, [drag issue cards](#move-issues-and-lists) to and from a status list.

### Group issues in swimlanes
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
With swimlanes you can visualize issues grouped by epic.
Your issue board keeps all the other features, but with a different visual organization of issues.
This feature is available both at the project and group level.
Prerequisites:
- You must have at least the Planner role for the project.
To group issues by epic in an issue board:
1. Select **View options** ({{< icon name="preferences" >}}).
1. Select **Epic swimlanes**.

You can then [edit](#edit-an-issue) issues without leaving this view and [drag](#move-issues-and-lists)
them to change their position and epic assignment:
- To reorder an issue, drag it to the new position in a list.
- To assign an issue to another epic, drag it to the epic's horizontal lane.
- To remove an issue from an epic, drag it to the **Issues with no epic assigned** lane.
- To move an issue to another epic and another list, at the same time, drag the issue diagonally.

### Sum of issue weights
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The top of each list indicates the sum of issue weights for the issues that
belong to that list. This is useful when using boards for capacity allocation,
especially in combination with [assignee lists](#assignee-lists).

### Work in progress limits
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Setting limits by weight [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/119208/) in GitLab 17.11.
{{< /history >}}
You can set a work in progress (WIP) limit for each issue list on an issue board.
When a limit is set, the current state and configured limit are shown in the board list header.
A line in the list separates items within the limit from those in excess of the limit.
You cannot set a WIP limit on the default lists (**Open** and **Closed**).
#### Types of limits
GitLab supports two types of WIP limits:
- **Items**: Limits the number of issues in a list regardless of their weight.
The board header shows the number of issues in the list and the item limit.
For example, if there are 4 issues and an item limit of 3, the header shows **4/3**.

- **Weight**: Limits the total weight of issues in a list.
The board header shows the total weight of issues in the list and the weight limit.
For example, if there are issues with weights adding up to 8 and a weight limit of 5, the header shows **8/5**.

Examples:
- When you have a list with four issues and an item limit of five, the header shows **4/5**.
If you exceed the limit, the current number of issues is shown in red.
- You have a list with five issues with an item limit of five. When you move another issue to that list,
the list's header displays **6/5**, with the six shown in red. The work in progress limit line is shown before the sixth issue.
- When using weight limits, if you have three issues with weights of 1, 2, and 5 (total weight of 8) and a weight limit of 5, the header shows **8/5** with the 8 in red. The work in progress limit line appears after the issues whose combined weight is within the limit, separating them from issues that exceed the limit.
#### Set work in progress limit
Prerequisites:
- You must have at least the Planner role for the project.
To set a WIP limit for a list, in an issue board:
1. On the top of the list you want to edit, select **Edit list settings** ({{< icon name="settings" >}}).
The list settings sidebar opens on the right.
1. Next to **Work in progress limit**, select **Edit**.
1. Choose the limit type from the dropdown list:
- **Items**: To limit by the number of issues.
- **Weight**: To limit by the total weight of issues.
1. Enter the maximum number of items or maximum weight.
1. Press <kbd>Enter</kbd> to save.
To remove a WIP limit, select **Remove limit**.
### Blocked issues
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If an issue is [blocked by another issue](issues/related_issues.md#blocking-issues), an icon appears next to its title to indicate its blocked
status.
When you hover over the blocked icon ({{< icon name="entity-blocked" >}}), a detailed information popover is displayed.

## Actions you can take on an issue board
- [Edit an issue](#edit-an-issue).
- [Create a new list](#create-a-new-list).
- [Remove an existing list](#remove-a-list).
- [Remove an issue from a list](#remove-an-issue-from-a-list).
- [Filter issues](#filter-issues) that appear across your issue board.
- [Move issues and lists](#move-issues-and-lists).
- Drag and reorder the lists.
- Change issue labels (by dragging an issue between lists).
- Close an issue (by dragging it to the **Closed** list).
### Edit an issue
You can edit an issue without leaving the board view.
To open the right sidebar, select an issue card (not its title).
Prerequisites:
- You must have at least the Planner role for the project.
You can edit the following issue attributes in the right sidebar:
- Assignees
- Confidentiality
- Due date
- [Epic](../group/epics/_index.md)
- [Health status](issues/managing_issues.md#health-status)
- [Iteration](../group/iterations/_index.md)
- Labels
- Milestone
- Notifications setting
- Title
- [Weight](issues/issue_weight.md)
- Time tracking
<!-- When issues_list_drawer feature flag is removed, use the following info
and the ones outlined in issues/managing_issues.md#open-issues-in-a-drawer to update the main previous topic. -->
If your administrator enabled the [issue drawer](issues/managing_issues.md#open-issues-in-a-drawer),
when you select an issue card from the issue board, the issue opens in a drawer.
There, you can edit all the fields, including the description, comments, or related items.
### Create a new list
{{< history >}}
- Creating a list between existing lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462515) in GitLab 17.5.
{{< /history >}}
You can create a new list between two existing lists or at the right of an issue board.
To create a new list between two lists:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Plan > Issue boards**.
1. Hover or move keyboard focus between two lists.
1. Select **New list**.
The new list panel opens.

1. Choose the label, user, milestone, iteration, or status to base the new list on.
1. Select **Add to board**.
The new list is inserted in the same position on the board as the new list panel.
To move and reorder lists, drag them around.
Alternatively, you can select the **New list** at the right end of the board.
The new list is inserted at the right end of the lists, before **Closed**.
### Remove a list
Removing a list doesn't have any effect on issues and labels, as it's just the
list view that's removed. You can always create it again later if you need.
Prerequisites:
- You must have at least the Planner role for the project.
To remove a list from an issue board:
1. On the top of the list you want to remove, select **Edit list settings** ({{< icon name="settings" >}}).
The list settings sidebar opens on the right.
1. Select **Remove list**.
1. On the confirmation dialog, select **Remove list** again.
### Add issues to a list
Prerequisites:
- You must have at least the Planner role for the project.
If your board is scoped to one or more attributes, go to the issues you want to add and apply the
same attributes as your board scope.
For example, to add an issue to a list scoped to the `Doing` label, in a group issue board:
1. Go to an issue in the group or one of the subgroups or projects.
1. Add the `Doing` label.
The issue should now show in the `Doing` list on your issue board.
### Remove an issue from a list
When an issue should no longer belong to a list, you can remove it.
Prerequisites:
- You must have at least the Planner role for the project.
The steps depend on the scope of the list:
1. To open the right sidebar, select the issue card.
1. Remove what's keeping the issue in the list.
If it's a label list, remove the label. If it's an [assignee list](#assignee-lists), unassign the user.
### Filter issues
You can use the filters on top of your issue board to show only
the results you want. It's similar to the filtering used in the [issue tracker](issues/_index.md).
Prerequisites:
- You must have at least the Planner role for the project.
You can filter by the following:
- Assignee
- Author
- [Epic](../group/epics/_index.md)
- [Iteration](../group/iterations/_index.md)
- Label
- Milestone
- My reaction
- Release
- Type (issue/incident)
- [Weight](issues/issue_weight.md)
- [Status](../work_items/status.md)
#### Filtering issues in a group board
When [filtering issues](#filter-issues) in a **group** board, keep this behavior in mind:
- Milestones: you can filter by the milestones belonging to the group and its descendant groups.
- Labels: you can only filter by the labels belonging to the group but not its descendant groups.
When you edit issues individually using the right sidebar, you can additionally select the
milestones and labels from the **project** that the issue is from.
### Move issues and lists
You can move issues and lists by dragging them.
Prerequisites:
- You must have at least the Planner role for a project in GitLab.
To move an issue, select the issue card and drag it to another position in its current list or
into a different list. Learn about possible effects in [Dragging issues between lists](#dragging-issues-between-lists).
To move a list, select its top bar, and drag it horizontally.
You can't move the **Open** and **Closed** lists, but you can hide them when editing an issue board.
#### Move an issue to the start of the list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367473) in GitLab 15.4.
{{< /history >}}
You can move issues to the top of the list with a menu shortcut.
Your issue is moved to the top of the list even if other issues are hidden by a filter.
Prerequisites:
- You must at least have the Planner role for the project.
To move an issue to the start of the list:
1. In an issue board, hover over the card of the issue you want to move.
1. Select **Card options** ({{< icon name="ellipsis_v" >}}), then **Move to start of list**.
#### Move an issue to the end of the list
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367473) in GitLab 15.4.
{{< /history >}}
You can move issues to the bottom of the list with a menu shortcut.
Your issue is moved to the bottom of the list even if other issues are hidden by a filter.
Prerequisites:
- You must at least have the Planner role for the project.
To move an issue to the end of the list:
1. In an issue board, hover over the card of the issue you want to move.
1. Select **Card options** ({{< icon name="ellipsis_v" >}}), then **Move to end of list**.
#### Dragging issues between lists
To move an issue to another list, select the issue card and drag it onto that list.
When you drag issues between lists, the result is different depending on the source list
and the target list.
| | To Open | To Closed | To label B list | To assignee Bob list |
| ---------------------------- | -------------- | ----------- | ------------------------------ | ----------------------------- |
| **From Open** | - | Close issue | Add label B | Assign Bob |
| **From Closed** | Reopen issue | - | Reopen issue and add label B | Reopen issue and assign Bob |
| **From label A list** | Remove label A | Close issue | Remove label A and add label B | Assign Bob |
| **From assignee Alice list** | Unassign Alice | Close issue | Add label B | Unassign Alice and assign Bob |
## Tips
A few things to remember:
- Moving an issue between lists removes the label from the list it came from
and adds the label from the list it goes to.
- An issue can exist in multiple lists if it has more than one label.
- Lists are populated with issues automatically if the issues are labeled.
- Selecting the issue title inside a card takes you to that issue.
- Selecting a label inside a card quickly filters the entire issue board
and show only the issues from all lists that have that label.
- When an issue is moved from a status list to an open list, the default open status is applied.
Similarly, when it's moved to a closed list, the default closed status is applied.
- For performance and visibility reasons, each list shows the first 20 issues
by default. If you have more than 20 issues, start scrolling down and the next
20 appear.
## Troubleshooting issue boards
### `There was a problem fetching users` on group issue board when filtering by Author or Assignee
If you get a banner with `There was a problem fetching users` error when filtering by author or assignee on
group issue board, make sure that you are added as a member to the current group.
Non-members do not have permission to list group members when filtering by author or assignee on issue boards.
To fix this error, you should add all of your users to the top-level group with at least the Guest role.
### Use Rails console to fix issue boards not loading and timing out
If you see issue board not loading and timing out in UI, use Rails console to call the Issue Rebalancing service to fix it:
1. [Start a Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session).
1. Run these commands:
```ruby
p = Project.find_by_full_path('<username-or-group>/<project-name>')
Issues::RelativePositionRebalancingService.new(p.root_namespace.all_projects).execute
```
1. To exit the Rails console, type `quit`.
|
https://docs.gitlab.com/user/project_topics
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project_topics.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
project_topics.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Project topics
|
Project organization, subscribe, and view.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Topics are labels that you can assign to projects to help you organize and find them.
A topic is typically a short name that describes the content or purpose of a project.
You can assign a topic to several projects.
For example, you can create and assign the topics `python` and `hackathon` to all projects that use Python and are intended for Hackathon contributions.
Topics assigned to a project are displayed in the **Project overview** and [**Projects**](working_with_projects.md#view-projects) lists, below the project information description.
{{< alert type="note" >}}
Only users with access to the project can see the topics assigned to that project,
but everyone (including unauthenticated users) can see the topics available on the GitLab instance.
Do not include sensitive information in the name of a topic.
{{< /alert >}}
## Explore topics
To explore project topics:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. On the left sidebar, select **Topics**. The **Explore topics** page displays a list of all project topics.
1. Optional. To filter topics by name, in the search box, enter your search criteria.
1. To view the projects associated with a topic, select a topic.
You can also access a topic page with the URL `https://gitlab.com/explore/projects/topics/<topic-name>`.
## Filter and sort topics
On the project topic page, you can filter the list of projects that have that topic by:
- Name
- Language
- Visibility
- Owner
- Archived projects
You can also sort the projects by:
- Date
- Name
- Number of stars
- To filter projects by name, in the search box, enter your search criteria.
- To sort projects by other criteria, from the dropdown lists, select an option.
## Subscribe to a topic
If you want to know when new projects are added to a topic, you can use its RSS feed.
You can do this either from the **Explore topics** page or a project with topics.
To subscribe to a topic:
- From the **Explore topics** page:
1. On the left sidebar, expand the top-most chevron ({{< icon name="chevron-down" >}}).
1. Select **Explore**.
1. Select **Topics**.
1. Select the topic you want to subscribe to.
1. In the upper-right corner, select **Subscribe to the new projects feed** ({{< icon name="rss" >}}).
- From a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the **Project overview** page, from the **Topics** list select the topic you want to subscribe to.
1. In the upper-right corner, select **Subscribe to the new projects feed** ({{< icon name="rss" >}}).
The results are displayed as an RSS feed in Atom format.
The URL of the result contains a feed token and the list of projects that have the topic. You can add this URL to your feed reader.
## Assign topics to a project
To assign topics to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **General**.
1. In the **Topics** text box, enter the project topics. Popular topics are suggested as you type.
1. Select **Save changes**.
## Administer topics
Instance administrators can administer all project topics from the
[**Admin** area's Topics page](../../administration/admin_area.md#administering-topics).
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Project topics
description: Project organization, subscribe, and view.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Topics are labels that you can assign to projects to help you organize and find them.
A topic is typically a short name that describes the content or purpose of a project.
You can assign a topic to several projects.
For example, you can create and assign the topics `python` and `hackathon` to all projects that use Python and are intended for Hackathon contributions.
Topics assigned to a project are displayed in the **Project overview** and [**Projects**](working_with_projects.md#view-projects) lists, below the project information description.
{{< alert type="note" >}}
Only users with access to the project can see the topics assigned to that project,
but everyone (including unauthenticated users) can see the topics available on the GitLab instance.
Do not include sensitive information in the name of a topic.
{{< /alert >}}
## Explore topics
To explore project topics:
1. On the left sidebar, select **Search or go to**.
1. Select **Explore**.
1. On the left sidebar, select **Topics**. The **Explore topics** page displays a list of all project topics.
1. Optional. To filter topics by name, in the search box, enter your search criteria.
1. To view the projects associated with a topic, select a topic.
You can also access a topic page with the URL `https://gitlab.com/explore/projects/topics/<topic-name>`.
## Filter and sort topics
On the project topic page, you can filter the list of projects that have that topic by:
- Name
- Language
- Visibility
- Owner
- Archived projects
You can also sort the projects by:
- Date
- Name
- Number of stars
- To filter projects by name, in the search box, enter your search criteria.
- To sort projects by other criteria, from the dropdown lists, select an option.
## Subscribe to a topic
If you want to know when new projects are added to a topic, you can use its RSS feed.
You can do this either from the **Explore topics** page or a project with topics.
To subscribe to a topic:
- From the **Explore topics** page:
1. On the left sidebar, expand the top-most chevron ({{< icon name="chevron-down" >}}).
1. Select **Explore**.
1. Select **Topics**.
1. Select the topic you want to subscribe to.
1. In the upper-right corner, select **Subscribe to the new projects feed** ({{< icon name="rss" >}}).
- From a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. In the **Project overview** page, from the **Topics** list select the topic you want to subscribe to.
1. In the upper-right corner, select **Subscribe to the new projects feed** ({{< icon name="rss" >}}).
The results are displayed as an RSS feed in Atom format.
The URL of the result contains a feed token and the list of projects that have the topic. You can add this URL to your feed reader.
## Assign topics to a project
To assign topics to a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings** > **General**.
1. In the **Topics** text box, enter the project topics. Popular topics are suggested as you type.
1. Select **Save changes**.
## Administer topics
Instance administrators can administer all project topics from the
[**Admin** area's Topics page](../../administration/admin_area.md#administering-topics).
|
https://docs.gitlab.com/user/autocomplete_characters
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/autocomplete_characters.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
autocomplete_characters.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Autocomplete characters
|
Autocomplete characters in Markdown fields.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The autocomplete characters provide a quick way of entering field values into
Markdown fields. When you start typing a word in a Markdown field with one of
the following characters, GitLab progressively autocompletes against a set of
matching values. The string matching is not case-sensitive.
| Character | Autocompletes | Relevant matches shown |
| :-------- | :------------ | :---- |
| `~` | Labels | 20 |
| `%` | Milestones | 5 |
| `@` | Users and groups | 10 |
| `#` | Issues | 5 |
| `!` | Merge requests | 5 |
| `&` | Epics | 5 |
| `$` | Snippets | 5 |
| `:` | Emoji | 5 |
| `/` | Quick Actions | 100 |
When you select an item from the list, the value is entered in the field.
The more characters you enter, the more precise the matches are.
You can use autocomplete characters in combination with [Quick Actions](quick_actions.md).
## User autocomplete
Assume your GitLab instance includes the following users:
<!-- vale gitlab_base.Spelling = NO -->
| Username | Name |
| :-------------- | :--- |
| alessandra | Rosy Grant |
| lawrence.white | Kelsey Kerluke |
| leanna | Rosemarie Rogahn |
| logan_gutkowski | Lee Wuckert |
| shelba | Josefine Haley |
<!-- vale gitlab_base.Spelling = YES -->
User autocompletion sorts by the users whose username or name start with your query first.
For example, typing `@lea` shows `leanna` first and typing `@ros` shows `Rosemarie Rogahn` and `Rosy Grant` first.
Any usernames or names that include your query are shown afterwards in the autocomplete menu.
You can also search across the full name to find a user.
To find `Rosy Grant`, even if their username is for example `alessandra`, you can type their full name without spaces like `@rosygrant`.
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Autocomplete characters in Markdown fields.
title: Autocomplete characters
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
The autocomplete characters provide a quick way of entering field values into
Markdown fields. When you start typing a word in a Markdown field with one of
the following characters, GitLab progressively autocompletes against a set of
matching values. The string matching is not case-sensitive.
| Character | Autocompletes | Relevant matches shown |
| :-------- | :------------ | :---- |
| `~` | Labels | 20 |
| `%` | Milestones | 5 |
| `@` | Users and groups | 10 |
| `#` | Issues | 5 |
| `!` | Merge requests | 5 |
| `&` | Epics | 5 |
| `$` | Snippets | 5 |
| `:` | Emoji | 5 |
| `/` | Quick Actions | 100 |
When you select an item from the list, the value is entered in the field.
The more characters you enter, the more precise the matches are.
You can use autocomplete characters in combination with [Quick Actions](quick_actions.md).
## User autocomplete
Assume your GitLab instance includes the following users:
<!-- vale gitlab_base.Spelling = NO -->
| Username | Name |
| :-------------- | :--- |
| alessandra | Rosy Grant |
| lawrence.white | Kelsey Kerluke |
| leanna | Rosemarie Rogahn |
| logan_gutkowski | Lee Wuckert |
| shelba | Josefine Haley |
<!-- vale gitlab_base.Spelling = YES -->
User autocompletion sorts by the users whose username or name start with your query first.
For example, typing `@lea` shows `leanna` first and typing `@ros` shows `Rosemarie Rogahn` and `Rosy Grant` first.
Any usernames or names that include your query are shown afterwards in the autocomplete menu.
You can also search across the full name to find a user.
To find `Rosy Grant`, even if their username is for example `alessandra`, you can type their full name without spaces like `@rosygrant`.
|
https://docs.gitlab.com/user/organize_work_with_projects
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/organize_work_with_projects.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
organize_work_with_projects.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Organize work with projects
|
Project visibility, search, badges, layout.
|
In GitLab, a project is a broad container for all aspects of your development work. Projects
contain a code repository, collaborative tools, project management features, and CI/CD capabilities.
Use your project to organize all the data for your development project:
- Track issues
- Plan work
- Collaborate on code
- Use CI/CD tools to continuously build, test, and deploy your application
Projects can be available [publicly, internally, or privately](../public_access.md).
GitLab does not limit the number of private projects you can create.
{{< cards >}}
- [Getting started](../get_started/get_started_projects.md)
- [Create a project](_index.md)
- [Manage projects](working_with_projects.md)
- [Project visibility](../public_access.md)
- [Project settings](working_with_projects.md)
- [Description templates](description_templates.md)
- [Project access tokens](settings/project_access_tokens.md)
- [Deploy keys](deploy_keys/_index.md)
- [Deploy tokens](deploy_tokens/_index.md)
- [Reserved project and group names](../reserved_names.md)
- [Search](../search/_index.md)
- [Badges](badges.md)
- [Project topics](project_topics.md)
- [Code intelligence](code_intelligence.md)
- [Import and migrate](import/_index.md)
- [System notes](system_notes.md)
- [Manage projects](working_with_projects.md)
- [Use a project as a Go package](use_project_as_go_package.md)
- [Tutorial: Build a protected workflow for your project](../../tutorials/protected_workflow/_index.md)
- [Troubleshooting](troubleshooting.md)
{{< /cards >}}
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Project visibility, search, badges, layout.
title: Organize work with projects
breadcrumbs:
- doc
- user
- project
---
In GitLab, a project is a broad container for all aspects of your development work. Projects
contain a code repository, collaborative tools, project management features, and CI/CD capabilities.
Use your project to organize all the data for your development project:
- Track issues
- Plan work
- Collaborate on code
- Use CI/CD tools to continuously build, test, and deploy your application
Projects can be available [publicly, internally, or privately](../public_access.md).
GitLab does not limit the number of private projects you can create.
{{< cards >}}
- [Getting started](../get_started/get_started_projects.md)
- [Create a project](_index.md)
- [Manage projects](working_with_projects.md)
- [Project visibility](../public_access.md)
- [Project settings](working_with_projects.md)
- [Description templates](description_templates.md)
- [Project access tokens](settings/project_access_tokens.md)
- [Deploy keys](deploy_keys/_index.md)
- [Deploy tokens](deploy_tokens/_index.md)
- [Reserved project and group names](../reserved_names.md)
- [Search](../search/_index.md)
- [Badges](badges.md)
- [Project topics](project_topics.md)
- [Code intelligence](code_intelligence.md)
- [Import and migrate](import/_index.md)
- [System notes](system_notes.md)
- [Manage projects](working_with_projects.md)
- [Use a project as a Go package](use_project_as_go_package.md)
- [Tutorial: Build a protected workflow for your project](../../tutorials/protected_workflow/_index.md)
- [Troubleshooting](troubleshooting.md)
{{< /cards >}}
|
https://docs.gitlab.com/user/labels
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/labels.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
labels.md
|
Plan
|
Project Management
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Labels
|
Project labels, group labels, nested scopes, and filtering.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Labels organize and track work across GitLab features.
As projects grow from small teams to large organizations, labels help you track and manage increasing volumes of work.
Labels:
- Categorize issues, merge requests, and epics with custom attributes.
- Filter content in lists and boards.
- Prioritize work items with colors and descriptive titles.
- Track priority and severity with scoped labels.
- Structure workflows through organized groupings.
## Types of labels
Use three types of labels in GitLab:
- **Project labels** can be assigned to issues and merge requests in that project only.
- **Group labels** can be assigned to issues, merge requests, and [epics](../group/epics/_index.md)
in any project in the selected group or its subgroups.
- **Instance labels** [are created](../../administration/labels.md) by instance
administrators and are copied to all new projects.
## Assign and unassign labels
{{< history >}}
- Real-time updates in the sidebar [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/241538) in GitLab 14.10 with a [feature flag](../../administration/feature_flags/_index.md) named `realtime_labels`, disabled by default.
- Real-time updates in the sidebar [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/357370#note_991987201) in GitLab 15.1.
- Real-time updates in the sidebar [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/357370) in GitLab 15.5.
- Real-time updates in the sidebar [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103199) in GitLab 15.6. Feature flag `realtime_labels` removed.
{{< /history >}}
You can assign labels to any issue, merge request, or epic.
Changed labels are immediately visible to other users, without refreshing the page, on the following:
- Epics
- Incidents
- Issues
- Merge requests
To assign or unassign a label:
1. In the **Labels** section of the sidebar, select **Edit**.
1. In the **Assign labels** list, search for labels by typing their names.
You can search repeatedly to add more labels.
The selected labels are marked with a checkmark.
1. Select the labels you want to assign or unassign.
1. To apply your changes to labels, select **X** next to **Assign labels** or select any area
outside the label section.
Alternatively, to unassign a label, select the **X** on the label you want to unassign.
You can also assign and unassign labels with [quick actions](quick_actions.md):
- Assign labels with `/label`.
- Remove labels with `/unlabel`.
- Remove all labels and assign new ones with `/relabel`.
## View available labels
### View project labels
To view the **project's labels**:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
Or:
1. View an issue or merge request.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Manage project labels**.
The list of labels includes both the labels created in the project and
all labels created in the project's ancestor groups. For each label, you can see the
project or group path where it was created.
### View group labels
To view the **group's labels**:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
Or:
1. View an epic.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Manage group labels**.
The list includes all labels created only in the group. It does not list any labels created in
the group's projects.
## Create a label
{{< history >}}
- Minimum role to create a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project or group.
### Create a project label
To create a project label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select **New label**.
1. In the **Title** field, enter a short, descriptive name for the label. You
can also use this field to create [scoped, mutually exclusive labels](#scoped-labels).
1. Optional. In the **Description** field, enter additional
information about how and when to use this label.
1. Optional. Select a color by selecting from the available colors, or enter a hex color value for
a specific color in the **Background color** field.
1. Select **Create label**.
### Create a project label from an issue or merge request
{{< history >}}
- Minimum role to create a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can also create a new project label from an issue or merge request.
Labels you create this way belong to the same project as the issue or merge request.
Prerequisites:
- You must have at least the Planner role for the project.
To do so:
1. View an issue or merge request.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Create project label**.
1. Fill in the name field. You can't specify a description if creating a label this way.
You can add a description later by [editing the label](#edit-a-label).
1. Select a color by selecting from the available colors, or enter a hex color value for a specific color.
1. Select **Create**. Your label is created and selected.
### Create a group label
To create a group label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Select **New label**.
1. In the **Title** field, enter a short, descriptive name for the label. You
can also use this field to create [scoped, mutually exclusive labels](#scoped-labels).
1. Optional. In the **Description** field, enter additional
information about how and when to use this label.
1. Optional. Select a color by selecting from the available colors, or enter a hex color value for
a specific color in the **Background color** field.
1. Select **Create label**.
### Create a group label from an epic
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to create a group label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can also create a new group label from an epic.
Labels you create this way belong to the same group as the epic.
Prerequisites:
- You must have at least the Planner role for the group.
To do so:
1. View an epic.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Create group label**.
1. Fill in the name field. You can't specify a description if creating a label this way.
You can add a description later by [editing the label](#edit-a-label).
1. Select a color by selecting from the available colors,enter input a hex color value for a specific color.
1. Select **Create**.
## Edit a label
{{< history >}}
- Minimum role to edit a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project or group.
### Edit a project label
To edit a **project** label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select **Save changes**.
### Edit a group label
To edit a **group** label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select **Save changes**.
## Delete a label
{{< history >}}
- Minimum role to delete a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="warning" >}}
If you delete a label, it is permanently deleted. All references to the label are removed from the
system and you cannot undo the deletion.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
### Delete a project label
To delete a **project** label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the **Subscribe** button, select ({{< icon name="ellipsis_v" >}}), and then select **Delete**.
### Delete a group label
To delete a **group** label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Either:
- Next to the **Subscribe** button, select ({{< icon name="ellipsis_v" >}}).
- Next to the label you want to edit, select **Edit** ({{< icon name="pencil" >}}).
1. Select **Delete**.
## Archived labels
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/4233) in GitLab 18.3 [with a flag](../../administration/feature_flags/_index.md) named `labels_archive`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can archive labels that are no longer actively used but need to be preserved
for historical perspective and search purposes.
For example, you might archive
release labels like `Q4-25` after a release is complete, keeping them available
for searches while removing them from the label selection dropdown list.
When you archive a label:
- The label is hidden from the label selection dropdown list in issues, merge requests, and epics.
- The label remains visible on existing issues, merge requests, and epics where it was previously assigned.
- You can still search for the label and view historical data.
- The label appears in a separate **Archived** tab on the **Labels** page.
### Archive a label
Prerequisites:
- You must have at least the Planner role for the project or group.
To archive a label:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Labels**.
1. Next to the label you want to archive, select **Edit** ({{< icon name="pencil" >}}).
1. Select the **Archived** checkbox.
1. Select **Save changes**.
The label is archived and [deprioritized](#set-label-priority).
### View archived labels
To view archived labels:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Labels**.
1. Go to the labels page for your project or group.
1. Select the **Archived** tab.
### Unarchive a label
Prerequisites:
- You must have at least the Planner role for the project or group.
To unarchive a label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select the **Archived** tab.
1. Next to the label you want to unarchive, select **Edit** ({{< icon name="pencil" >}}).
1. Clear the **Archived** checkbox.
1. Select Save changes.
## Promote a project label to a group label
{{< history >}}
- Minimum role to promote a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You might want to make a project label available for other
projects in the same group. Then, you can promote the label to a group label.
If other projects in the same group have a label with the same title, they are all
merged with the new group label. If a group label with the same title exists, it is
also merged.
{{< alert type="warning" >}}
Promoting a label is a permanent action and cannot be reversed.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
- You must have at least the Planner role for the project's parent group.
To promote a project label to a group label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the **Subscribe** button, select the three dots ({{< icon name="ellipsis_v" >}}) and
select **Promote to group label**.
All issues, merge requests, issue board lists, issue board filters, and label subscriptions
with the old labels are assigned to the new group label.
The new group label has the same ID as the previous project label.
## Promote a subgroup label to the parent group
{{< history >}}
- Minimum role to promote a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
It's not possible to directly promote a group label to the parent group.
To achieve this, use the following workaround.
Prerequisites:
- There must be a group that contains subgroups ("parent group").
- There must be a subgroup in the parent group, that has a label you want to promote.
- You must have at least the Planner role for both groups.
To "promote" the label to the parent group:
1. In the parent group, [create a label](#create-a-group-label) with the same name as the original
one. We recommend making it a different color so you don't mistake the two while you're doing this.
1. In the subgroup, [view its labels](#view-group-labels). You should see the two labels and where
they come from:

1. Next to the subgroup label (the old one), select **Issues**, **Merge requests**, or **Epics**.
1. Add the new label to issues, merge requests, and epics that have the old label.
To do it faster, use [bulk editing](issues/managing_issues.md#bulk-edit-issues-from-a-group).
1. In the subgroup or the parent group, [delete the label](#delete-a-group-label) that belongs to
the lower-level group.
You should now have a label in the parent group that is named the same as the old one, and added
to the same issues, MRs, and epics.
## Generate default project labels
{{< history >}}
- Minimum role to generate default labels [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
If a project or its parent group has no labels, you can generate a default set of project
labels from the label list page.
Prerequisites:
- You must have at least the Planner role for the project.
- The project must have no labels present.
To add the default labels to the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select **Generate a default set of labels**.
The following labels are created:
- `bug`
- `confirmed`
- `critical`
- `discussion`
- `documentation`
- `enhancement`
- `suggestion`
- `support`
## Scoped labels
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Teams can use scoped labels to annotate issues, merge requests, and epics with mutually exclusive
labels. By preventing certain labels from being used together, you can create more complex workflows.

A scoped label uses a double-colon (`::`) syntax in its title, for example: `workflow::in-review`.
An issue, merge request, or epic cannot have two scoped labels, of the form `key::value`,
with the same `key`. If you add a new label with the same `key` but a different `value`,
the previous `key` label is replaced with the new label.
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=7l7tnEva6I8">Scoped Labels - Setting up your Organization with GitLab</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/7l7tnEva6I8" frameborder="0" allowfullscreen> </iframe>
</figure>
### Filter by scoped labels
To filter issue, merge request, or epic lists by a given scope, enter
`<scope>::*` in the searched label name.
For example, filtering by the `platform::*` label returns issues that have `platform::iOS`,
`platform::Android`, or `platform::Linux` labels.
{{< alert type="note" >}}
Filtering by scoped labels not available on the issues or merge requests dashboard pages.
{{< /alert >}}
### Scoped labels examples
**Example 1**. Updating issue priority:
1. You decide that an issue is of low priority, and assign it the `priority::low` label.
1. After more review, you realize the issue's priority is higher increased, and you assign it the
`priority::high` label.
1. Because an issue shouldn't have two priority labels at the same time, GitLab removes the
`priority::low` label.
**Example 2**. You want a custom field in issues to track the operating system platform
that your features target, where each issue should only target one platform.
You create three labels:
- `platform::iOS`
- `platform::Android`
- `platform::Linux`
If you assign any of these labels to an issue automatically removes any other existing label that
starts with `platform::`.
**Example 3**. You can use scoped labels to represent the workflow states of your teams.
Suppose you have the following labels:
- `workflow::development`
- `workflow::review`
- `workflow::deployed`
If an issue already has the label `workflow::development` and a developer wants to show that the
issue is now under review, they assign the `workflow::review`, and the `workflow::development` label
is removed.
The same happens when you move issues across label lists in an
[issue board](issue_board.md). With scoped labels, team members not working in an
issue board can also advance workflow states consistently in issues themselves.
For a video explanation, see:
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=4BCBby6du3c">Use scoped labels for custom fields and custom workflows</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/4BCBby6du3c" frameborder="0" allowfullscreen> </iframe>
</figure>
### Nested scopes
You can create a label with a nested scope by using multiple double colons `::` when creating
it. In this case, everything before the last `::` is the scope.
For example, if your project has these labels:
- `workflow::backend::review`
- `workflow::backend::development`
- `workflow::frontend::review`
An issue **can't** have both `workflow::backend::review` and `workflow::backend::development`
labels at the same time, because they both share the same scope: `workflow::backend`.
On the other hand, an issue **can** have both `workflow::backend::review` and `workflow::frontend::review`
labels at the same time, because they both have different scopes: `workflow::frontend` and `workflow::backend`.
## Receive notifications when a label is used
You can subscribe to a label to [receive notifications](../profile/notifications.md) whenever the
label is assigned to an issue, merge request, or epic.
To subscribe to a label:
1. [View the label list page.](#view-available-labels)
1. To the right of any label, select **Subscribe**.
1. Optional. If you are subscribing to a group label from a project, select either:
- **Subscribe at project level** to be notified about events in this project.
- **Subscribe at group level** to be notified about events in the whole group.
## Set label priority
{{< history >}}
- Minimum role to set label priority [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Labels can have relative priorities, which are used when you sort issue and merge request lists
by [label priority](issues/sorting_issue_lists.md#sorting-by-label-priority) and [priority](issues/sorting_issue_lists.md#sorting-by-priority).
When prioritizing labels, you must do it from a project.
It's not possible to do it from the group label list.
{{< alert type="note" >}}
Priority sorting is based on the highest priority label only.
[This discussion](https://gitlab.com/gitlab-org/gitlab/-/issues/14523) considers changing this.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
To prioritize a label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to a label you want to prioritize, select the star ({{< icon name="star-o" >}}).

This label now appears at the top of the label list, under **Prioritized Labels**.
To change the relative priority of these labels, drag them up and down the list.
The labels higher in the list get higher priority.
To learn what happens when you sort by priority or label priority, see
[Sorting and ordering issue lists](issues/sorting_issue_lists.md).
## Lock labels when a merge request is merged
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/408676) in GitLab 16.3 [with a flag](../../administration/feature_flags/_index.md) named `enforce_locked_labels_on_merge`. This feature is [beta](../../policy/development_stages_support.md). Disabled by default.
- Minimum role to lock labels [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
To comply with certain auditing requirements, you can set a label to be locked.
When a merge request with locked labels gets merged, nobody can remove them from the MR.
When you add locked labels to issues or epics, they behave like regular labels.
Prerequisites:
- You must have at least the Planner role for the project or group.
{{< alert type="warning" >}}
After you set a label as locked, nobody can undo it or delete the label.
{{< /alert >}}
To set a label to get locked on merge:
1. On the left sidebar, select **Search or go to** and find your group or project.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select the **Lock label after a merge request is merged** checkbox.
1. Select **Save changes**.
## Related topics
- Tutorials:
- [Set up a single project for issue triage](../../tutorials/issue_triage/_index.md)
- [Set up issue boards for team hand-off](../../tutorials/boards_for_teams/_index.md)
- [Labels administration](../../administration/labels.md)
|
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Labels
description: Project labels, group labels, nested scopes, and filtering.
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Labels organize and track work across GitLab features.
As projects grow from small teams to large organizations, labels help you track and manage increasing volumes of work.
Labels:
- Categorize issues, merge requests, and epics with custom attributes.
- Filter content in lists and boards.
- Prioritize work items with colors and descriptive titles.
- Track priority and severity with scoped labels.
- Structure workflows through organized groupings.
## Types of labels
Use three types of labels in GitLab:
- **Project labels** can be assigned to issues and merge requests in that project only.
- **Group labels** can be assigned to issues, merge requests, and [epics](../group/epics/_index.md)
in any project in the selected group or its subgroups.
- **Instance labels** [are created](../../administration/labels.md) by instance
administrators and are copied to all new projects.
## Assign and unassign labels
{{< history >}}
- Real-time updates in the sidebar [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/241538) in GitLab 14.10 with a [feature flag](../../administration/feature_flags/_index.md) named `realtime_labels`, disabled by default.
- Real-time updates in the sidebar [enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/357370#note_991987201) in GitLab 15.1.
- Real-time updates in the sidebar [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/357370) in GitLab 15.5.
- Real-time updates in the sidebar [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103199) in GitLab 15.6. Feature flag `realtime_labels` removed.
{{< /history >}}
You can assign labels to any issue, merge request, or epic.
Changed labels are immediately visible to other users, without refreshing the page, on the following:
- Epics
- Incidents
- Issues
- Merge requests
To assign or unassign a label:
1. In the **Labels** section of the sidebar, select **Edit**.
1. In the **Assign labels** list, search for labels by typing their names.
You can search repeatedly to add more labels.
The selected labels are marked with a checkmark.
1. Select the labels you want to assign or unassign.
1. To apply your changes to labels, select **X** next to **Assign labels** or select any area
outside the label section.
Alternatively, to unassign a label, select the **X** on the label you want to unassign.
You can also assign and unassign labels with [quick actions](quick_actions.md):
- Assign labels with `/label`.
- Remove labels with `/unlabel`.
- Remove all labels and assign new ones with `/relabel`.
## View available labels
### View project labels
To view the **project's labels**:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
Or:
1. View an issue or merge request.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Manage project labels**.
The list of labels includes both the labels created in the project and
all labels created in the project's ancestor groups. For each label, you can see the
project or group path where it was created.
### View group labels
To view the **group's labels**:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
Or:
1. View an epic.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Manage group labels**.
The list includes all labels created only in the group. It does not list any labels created in
the group's projects.
## Create a label
{{< history >}}
- Minimum role to create a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project or group.
### Create a project label
To create a project label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select **New label**.
1. In the **Title** field, enter a short, descriptive name for the label. You
can also use this field to create [scoped, mutually exclusive labels](#scoped-labels).
1. Optional. In the **Description** field, enter additional
information about how and when to use this label.
1. Optional. Select a color by selecting from the available colors, or enter a hex color value for
a specific color in the **Background color** field.
1. Select **Create label**.
### Create a project label from an issue or merge request
{{< history >}}
- Minimum role to create a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can also create a new project label from an issue or merge request.
Labels you create this way belong to the same project as the issue or merge request.
Prerequisites:
- You must have at least the Planner role for the project.
To do so:
1. View an issue or merge request.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Create project label**.
1. Fill in the name field. You can't specify a description if creating a label this way.
You can add a description later by [editing the label](#edit-a-label).
1. Select a color by selecting from the available colors, or enter a hex color value for a specific color.
1. Select **Create**. Your label is created and selected.
### Create a group label
To create a group label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Select **New label**.
1. In the **Title** field, enter a short, descriptive name for the label. You
can also use this field to create [scoped, mutually exclusive labels](#scoped-labels).
1. Optional. In the **Description** field, enter additional
information about how and when to use this label.
1. Optional. Select a color by selecting from the available colors, or enter a hex color value for
a specific color in the **Background color** field.
1. Select **Create label**.
### Create a group label from an epic
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- Minimum role to create a group label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You can also create a new group label from an epic.
Labels you create this way belong to the same group as the epic.
Prerequisites:
- You must have at least the Planner role for the group.
To do so:
1. View an epic.
1. On the right sidebar, in the **Labels** section, select **Edit**.
1. Select **Create group label**.
1. Fill in the name field. You can't specify a description if creating a label this way.
You can add a description later by [editing the label](#edit-a-label).
1. Select a color by selecting from the available colors,enter input a hex color value for a specific color.
1. Select **Create**.
## Edit a label
{{< history >}}
- Minimum role to edit a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Prerequisites:
- You must have at least the Planner role for the project or group.
### Edit a project label
To edit a **project** label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select **Save changes**.
### Edit a group label
To edit a **group** label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select **Save changes**.
## Delete a label
{{< history >}}
- Minimum role to delete a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="warning" >}}
If you delete a label, it is permanently deleted. All references to the label are removed from the
system and you cannot undo the deletion.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
### Delete a project label
To delete a **project** label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the **Subscribe** button, select ({{< icon name="ellipsis_v" >}}), and then select **Delete**.
### Delete a group label
To delete a **group** label:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Manage > Labels**.
1. Either:
- Next to the **Subscribe** button, select ({{< icon name="ellipsis_v" >}}).
- Next to the label you want to edit, select **Edit** ({{< icon name="pencil" >}}).
1. Select **Delete**.
## Archived labels
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/4233) in GitLab 18.3 [with a flag](../../administration/feature_flags/_index.md) named `labels_archive`. Disabled by default.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
You can archive labels that are no longer actively used but need to be preserved
for historical perspective and search purposes.
For example, you might archive
release labels like `Q4-25` after a release is complete, keeping them available
for searches while removing them from the label selection dropdown list.
When you archive a label:
- The label is hidden from the label selection dropdown list in issues, merge requests, and epics.
- The label remains visible on existing issues, merge requests, and epics where it was previously assigned.
- You can still search for the label and view historical data.
- The label appears in a separate **Archived** tab on the **Labels** page.
### Archive a label
Prerequisites:
- You must have at least the Planner role for the project or group.
To archive a label:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Labels**.
1. Next to the label you want to archive, select **Edit** ({{< icon name="pencil" >}}).
1. Select the **Archived** checkbox.
1. Select **Save changes**.
The label is archived and [deprioritized](#set-label-priority).
### View archived labels
To view archived labels:
1. On the left sidebar, select **Search or go to** and find your project or group.
1. Select **Manage > Labels**.
1. Go to the labels page for your project or group.
1. Select the **Archived** tab.
### Unarchive a label
Prerequisites:
- You must have at least the Planner role for the project or group.
To unarchive a label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select the **Archived** tab.
1. Next to the label you want to unarchive, select **Edit** ({{< icon name="pencil" >}}).
1. Clear the **Archived** checkbox.
1. Select Save changes.
## Promote a project label to a group label
{{< history >}}
- Minimum role to promote a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
You might want to make a project label available for other
projects in the same group. Then, you can promote the label to a group label.
If other projects in the same group have a label with the same title, they are all
merged with the new group label. If a group label with the same title exists, it is
also merged.
{{< alert type="warning" >}}
Promoting a label is a permanent action and cannot be reversed.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
- You must have at least the Planner role for the project's parent group.
To promote a project label to a group label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to the **Subscribe** button, select the three dots ({{< icon name="ellipsis_v" >}}) and
select **Promote to group label**.
All issues, merge requests, issue board lists, issue board filters, and label subscriptions
with the old labels are assigned to the new group label.
The new group label has the same ID as the previous project label.
## Promote a subgroup label to the parent group
{{< history >}}
- Minimum role to promote a label [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
It's not possible to directly promote a group label to the parent group.
To achieve this, use the following workaround.
Prerequisites:
- There must be a group that contains subgroups ("parent group").
- There must be a subgroup in the parent group, that has a label you want to promote.
- You must have at least the Planner role for both groups.
To "promote" the label to the parent group:
1. In the parent group, [create a label](#create-a-group-label) with the same name as the original
one. We recommend making it a different color so you don't mistake the two while you're doing this.
1. In the subgroup, [view its labels](#view-group-labels). You should see the two labels and where
they come from:

1. Next to the subgroup label (the old one), select **Issues**, **Merge requests**, or **Epics**.
1. Add the new label to issues, merge requests, and epics that have the old label.
To do it faster, use [bulk editing](issues/managing_issues.md#bulk-edit-issues-from-a-group).
1. In the subgroup or the parent group, [delete the label](#delete-a-group-label) that belongs to
the lower-level group.
You should now have a label in the parent group that is named the same as the old one, and added
to the same issues, MRs, and epics.
## Generate default project labels
{{< history >}}
- Minimum role to generate default labels [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
If a project or its parent group has no labels, you can generate a default set of project
labels from the label list page.
Prerequisites:
- You must have at least the Planner role for the project.
- The project must have no labels present.
To add the default labels to the project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Select **Generate a default set of labels**.
The following labels are created:
- `bug`
- `confirmed`
- `critical`
- `discussion`
- `documentation`
- `enhancement`
- `suggestion`
- `support`
## Scoped labels
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Teams can use scoped labels to annotate issues, merge requests, and epics with mutually exclusive
labels. By preventing certain labels from being used together, you can create more complex workflows.

A scoped label uses a double-colon (`::`) syntax in its title, for example: `workflow::in-review`.
An issue, merge request, or epic cannot have two scoped labels, of the form `key::value`,
with the same `key`. If you add a new label with the same `key` but a different `value`,
the previous `key` label is replaced with the new label.
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=7l7tnEva6I8">Scoped Labels - Setting up your Organization with GitLab</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/7l7tnEva6I8" frameborder="0" allowfullscreen> </iframe>
</figure>
### Filter by scoped labels
To filter issue, merge request, or epic lists by a given scope, enter
`<scope>::*` in the searched label name.
For example, filtering by the `platform::*` label returns issues that have `platform::iOS`,
`platform::Android`, or `platform::Linux` labels.
{{< alert type="note" >}}
Filtering by scoped labels not available on the issues or merge requests dashboard pages.
{{< /alert >}}
### Scoped labels examples
**Example 1**. Updating issue priority:
1. You decide that an issue is of low priority, and assign it the `priority::low` label.
1. After more review, you realize the issue's priority is higher increased, and you assign it the
`priority::high` label.
1. Because an issue shouldn't have two priority labels at the same time, GitLab removes the
`priority::low` label.
**Example 2**. You want a custom field in issues to track the operating system platform
that your features target, where each issue should only target one platform.
You create three labels:
- `platform::iOS`
- `platform::Android`
- `platform::Linux`
If you assign any of these labels to an issue automatically removes any other existing label that
starts with `platform::`.
**Example 3**. You can use scoped labels to represent the workflow states of your teams.
Suppose you have the following labels:
- `workflow::development`
- `workflow::review`
- `workflow::deployed`
If an issue already has the label `workflow::development` and a developer wants to show that the
issue is now under review, they assign the `workflow::review`, and the `workflow::development` label
is removed.
The same happens when you move issues across label lists in an
[issue board](issue_board.md). With scoped labels, team members not working in an
issue board can also advance workflow states consistently in issues themselves.
For a video explanation, see:
<div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=4BCBby6du3c">Use scoped labels for custom fields and custom workflows</a>.
</div>
<figure class="video-container">
<iframe src="https://www.youtube-nocookie.com/embed/4BCBby6du3c" frameborder="0" allowfullscreen> </iframe>
</figure>
### Nested scopes
You can create a label with a nested scope by using multiple double colons `::` when creating
it. In this case, everything before the last `::` is the scope.
For example, if your project has these labels:
- `workflow::backend::review`
- `workflow::backend::development`
- `workflow::frontend::review`
An issue **can't** have both `workflow::backend::review` and `workflow::backend::development`
labels at the same time, because they both share the same scope: `workflow::backend`.
On the other hand, an issue **can** have both `workflow::backend::review` and `workflow::frontend::review`
labels at the same time, because they both have different scopes: `workflow::frontend` and `workflow::backend`.
## Receive notifications when a label is used
You can subscribe to a label to [receive notifications](../profile/notifications.md) whenever the
label is assigned to an issue, merge request, or epic.
To subscribe to a label:
1. [View the label list page.](#view-available-labels)
1. To the right of any label, select **Subscribe**.
1. Optional. If you are subscribing to a group label from a project, select either:
- **Subscribe at project level** to be notified about events in this project.
- **Subscribe at group level** to be notified about events in the whole group.
## Set label priority
{{< history >}}
- Minimum role to set label priority [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
Labels can have relative priorities, which are used when you sort issue and merge request lists
by [label priority](issues/sorting_issue_lists.md#sorting-by-label-priority) and [priority](issues/sorting_issue_lists.md#sorting-by-priority).
When prioritizing labels, you must do it from a project.
It's not possible to do it from the group label list.
{{< alert type="note" >}}
Priority sorting is based on the highest priority label only.
[This discussion](https://gitlab.com/gitlab-org/gitlab/-/issues/14523) considers changing this.
{{< /alert >}}
Prerequisites:
- You must have at least the Planner role for the project.
To prioritize a label:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Labels**.
1. Next to a label you want to prioritize, select the star ({{< icon name="star-o" >}}).

This label now appears at the top of the label list, under **Prioritized Labels**.
To change the relative priority of these labels, drag them up and down the list.
The labels higher in the list get higher priority.
To learn what happens when you sort by priority or label priority, see
[Sorting and ordering issue lists](issues/sorting_issue_lists.md).
## Lock labels when a merge request is merged
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
- Status: Beta
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/408676) in GitLab 16.3 [with a flag](../../administration/feature_flags/_index.md) named `enforce_locked_labels_on_merge`. This feature is [beta](../../policy/development_stages_support.md). Disabled by default.
- Minimum role to lock labels [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169256) from Reporter to Planner in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
{{< /alert >}}
To comply with certain auditing requirements, you can set a label to be locked.
When a merge request with locked labels gets merged, nobody can remove them from the MR.
When you add locked labels to issues or epics, they behave like regular labels.
Prerequisites:
- You must have at least the Planner role for the project or group.
{{< alert type="warning" >}}
After you set a label as locked, nobody can undo it or delete the label.
{{< /alert >}}
To set a label to get locked on merge:
1. On the left sidebar, select **Search or go to** and find your group or project.
1. Select **Manage > Labels**.
1. Next to the label you want to edit, select the vertical ellipsis ({{< icon name="ellipsis_v" >}}), and then select **Edit**.
1. Select the **Lock label after a merge request is merged** checkbox.
1. Select **Save changes**.
## Related topics
- Tutorials:
- [Set up a single project for issue triage](../../tutorials/issue_triage/_index.md)
- [Set up issue boards for team hand-off](../../tutorials/boards_for_teams/_index.md)
- [Labels administration](../../administration/labels.md)
|
https://docs.gitlab.com/user/changelogs
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/changelogs.md
|
2025-08-13
|
doc/user/project
|
[
"doc",
"user",
"project"
] |
changelogs.md
|
Create
|
Source Code
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Changelogs
|
Build, automate, and customize changelogs in your GitLab project.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Changelogs are generated based on commit titles and Git trailers. To be included
in a changelog, a commit must contain a specific Git trailer. Changelogs are generated
from commit titles, and categorized by Git trailer type. You can enrich changelog entries
with additional data, such as a link to the merge request or details about the
commit author. Changelog formats [can be customized](#customize-the-changelog-output) with a template.
Each section in the default changelog has a title containing the version
number and release date, like this:
```markdown
## 1.0.0 (2021-01-05)
### Features (4 changes)
- [Feature 1](gitlab-org/gitlab@123abc) by @alice ([merge request](gitlab-org/gitlab!123))
- [Feature 2](gitlab-org/gitlab@456abc) ([merge request](gitlab-org/gitlab!456))
- [Feature 3](gitlab-org/gitlab@234abc) by @steve
- [Feature 4](gitlab-org/gitlab@456)
```
The date format for sections can be customized, but the rest of the title cannot.
When adding new sections, GitLab parses these titles to determine where to place
the new information in the file. GitLab sorts sections according to their versions,
not their dates.
Each section contains changes sorted by category (like "Features"), and the format
of these sections can be changed. The section names derive from the values of the
Git trailer used to include or exclude commits.
Commits for changelogs can be retrieved when operating on a mirror. GitLab itself
uses this feature, because patch releases can include changes from both public
projects and private security mirrors.
## Add a trailer to a Git commit
You can add trailers manually when you write a commit message. To include a commit
using the default trailer of `Changelog` and categorize it as a feature, add the
string `Changelog: feature` to your commit message, like this:
```plaintext
<Commit message subject>
<Commit message description>
Changelog: feature
```
If your merge request has multiple commits, add the `Changelog` entry to the first commit.
This ensures the correct entry is generated when you squash commits.
The `Changelog` trailer accepts these values:
- `added`: New feature
- `fixed`: Bug fix
- `changed`: Feature change
- `deprecated`: New deprecation
- `removed`: Feature removal
- `security`: Security fix
- `performance`: Performance improvement
- `other`: Other
## Create a changelog
Changelogs are generated from the command line, using either the API or the
GitLab CLI. The changelog output is formatted in Markdown, and
[you can customize it](#customize-the-changelog-output).
### From the API
To use the API to generate changelogs with a `curl` command, see
[Add changelog data to a changelog file](../../api/repositories.md#add-changelog-data-to-a-changelog-file)
in the API documentation.
### From the GitLab CLI
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/cli/-/merge_requests/1222) in `glab` version 1.30.0.
{{< /history >}}
Prerequisites:
- You have installed and configured the [GitLab CLI](../../editor_extensions/gitlab_cli/_index.md),
version 1.30.0 or later.
- Your repository's tag naming schema matches
[the expected tag naming format](#customize-the-tag-format-when-extracting-versions).
- Commits include [changelog trailers](#add-a-trailer-to-a-git-commit).
To generate the changelog:
1. Update your local copy of your repository with `git fetch`.
1. To generate a changelog for the current version (as determined by `git describe --tags`)
with the default options:
- Run the command `glab changelog generate`.
- To save the output to a file, run the command `glab changelog generate > <filename>.md`.
1. To generate a changelog with customized options, run the command `glab changelog generate`
and append your desired options. Some options include:
- `--config-file [string]`: The path to the changelog configuration file in your project's
Git repository. This file must exist in your project's Git repository. Defaults to `.gitlab/changelog_config.yml`.
- Commit range:
- `--from [string]`: The start of the range of commits (as a SHA) to use for
generating the changelog. This commit itself isn't included in the changelog.
- `--to [string]`: The end of the range of commits (as a SHA) to use for
generating the changelog. This commit is included in the list. Defaults to the `HEAD`
of the default project branch.
- `--date [string]`: The date and time of the release, in ISO 8601 (`2016-03-11T03:45:40Z`)
format. Defaults to the current time.
- `--trailer [string]`: The Git trailer to use for including commits. Defaults to `Changelog`.
- `--version [string]`: The version to generate the changelog for.
To learn more about the parameters available in GitLab CLI, run `glab changelog generate --help`. See the
[API documentation](../../api/repositories.md#add-changelog-data-to-a-changelog-file)
for definitions and usage.
## Customize the changelog output
To customize the changelog output, edit the changelog configuration file, and commit these changes to your project's Git repository. The default location for this configuration is `.gitlab/changelog_config.yml`.
For performance and security reasons, parsing the changelog configuration is limited to `2` seconds.
If parsing the configuration results in timeout errors, consider reducing the size of the configuration.
The file supports these variables:
- `date_format`: The date format, in `strftime` format, used in the title of the newly added changelog data.
- `template`: A custom template to use when generating the changelog data.
- `include_groups`: A list of group full paths containing users whose contributions
should be credited regardless of project membership. The user generating the changelog
must have access to each group for credit to be given.
- `categories`: A hash that maps raw category names to the names to use in the changelog.
To alter the names displayed in the changelog, add these lines to your configuration file
and edit them to meet your needs. This example renders the category titles as
`### Features`, `### Bug fixes`, and `### Performance improvements`:
```yaml
---
categories:
feature: Features
bug: Bug fixes
performance: Performance improvements
```
### Custom templates
{{< history >}}
- Default template [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155806) from using `commit.reference` and `merge_request.reference` to `commit.web_url` and `merge_request.web_url` in GitLab 17.1.
{{< /history >}}
Category sections are generated using a template. The default template:
```plaintext
{% if categories %}
{% each categories %}
### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %})
{% each entries %}
- [{{ title }}]({{ commit.web_url }})\
{% if author.credit %} by {{ author.reference }}{% end %}\
{% if merge_request %} ([merge request]({{ merge_request.web_url }})){% end %}
{% end %}
{% end %}
{% else %}
No changes.
{% end %}
```
The `{% ... %}` tags are for statements, and `{{ ... }}` is used for printing
data. Statements must be terminated using a `{% end %}` tag. Both the `if` and
`each` statements require a single argument.
For example, for a variable called `valid`, you can display "yes"
when this value is true, and display "nope" otherwise by doing the following:
```plaintext
{% if valid %}
yes
{% else %}
nope
{% end %}
```
The use of `else` is optional. A value is considered true when it's a non-empty
value or boolean `true`. Empty arrays and hashes are considered false.
Looping is done using `each`, and variables inside a loop are scoped to it.
Referring to the current value in a loop is done using the variable tag
`{{ it }}`. Other variables read their value from the current loop value. Take
this template for example:
```plaintext
{% each users %}
{{name}}
{% end %}
```
Assuming `users` is an array of objects, each with a `name` field, this would
then print the name of every user.
Using variable tags, you can access nested objects. For example,
`{{ users.0.name }}` prints the name of the first user in the `users` variable.
If a line ends in a backslash, the next newline is ignored. This allows you to
wrap code across multiple lines, without introducing unnecessary newlines in the
Markdown output.
Tags that use `{%` and `%}` (known as expression tags) consume the newline that
directly follows them, if any. This means that this:
```plaintext
---
{% if foo %}
bar
{% end %}
---
```
Compiles into this:
```plaintext
---
bar
---
```
Instead of this:
```plaintext
---
bar
---
```
You can specify a custom template in your configuration, like this:
```yaml
---
template: |
{% if categories %}
{% each categories %}
### {{ title }}
{% each entries %}
- [{{ title }}]({{ commit.web_url }})\
{% if author.credit %} by {{ author.reference }}{% end %}
{% end %}
{% end %}
{% else %}
No changes.
{% end %}
```
When specifying the template you should use `template: |` and not
`template: >`, as the latter doesn't preserve newlines in the template.
### Template data
{{< history >}}
- `commit.web_url` and `merge_request.web_url` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155806) in GitLab 17.1.
{{< /history >}}
At the top level, the following variable is available:
- `categories`: an array of objects, one for every changelog category.
In a category, the following variables are available:
- `count`: the number of entries in this category.
- `entries`: the entries that belong to this category.
- `single_change`: a boolean that indicates if there is only one change (`true`),
or multiple changes (`false`).
- `title`: the title of the category (after it has been remapped).
In an entry, the following variables are available (here `foo.bar` means that
`bar` is a sub-field of `foo`):
- `author.contributor`: a boolean set to `true` when the author is not a project
member, otherwise `false`.
- `author.credit`: a boolean set to `true` when `author.contributor` is `true` or
when `include_groups` is configured, and the author is a member of one of the
groups.
- `author.reference`: a reference to the commit author (for example, `@alice`).
- `commit.reference`: a reference to the commit, for example,
`gitlab-org/gitlab@0a4cdd86ab31748ba6dac0f69a8653f206e5cfc7`.
- `commit.web_url`: a URL to the commit, for example,
`https://gitlab.com/gitlab-org/gitlab/-/commit/0a4cdd86ab31748ba6dac0f69a8653f206e5cfc7`.
- `commit.trailers`: an object containing all the Git trailers that were present
in the commit body.
These trailers can be referenced using `commit.trailers.<name>`. For example, assuming the following commit:
```plaintext
Add some impressive new feature
Changelog: added
Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/1234
Status: important
```
The `Changelog`, `Issue` and `Status` trailers can be accessed in the template as follows:
```yaml
{% each entries %}
{% if commit.trailers.Issue %} ([link to issue]({{ commit.trailers.Issue }})){% end %}
{% if commit.trailers.Status %}Status: {{ commit.trailers.Status }}{% end %}
{% end %}
```
- `merge_request.reference`: a reference to the merge request that first
introduced the change (for example, `gitlab-org/gitlab!50063`).
- `merge_request.web_url`: a URL to the merge request that first introduced
the change (for example, `https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50063`).
- `title`: the title of the changelog entry (this is the commit title).
The `author` and `merge_request` objects might not be present if the data
couldn't be determined. For example, when a commit is created without a
corresponding merge request, no merge request is displayed.
### Customize the tag format when extracting versions
GitLab uses a regular expression (using the
[re2](https://github.com/google/re2/) engine and syntax) to extract a semantic
version from tag names. The default regular expression is:
```plaintext
^v?(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<pre>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<meta>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
```
This regular expression is based on the official
[semantic versioning](https://semver.org/) regular expression, and also includes
support for tag names that start with the letter `v`.
If your project uses a different format for tags, you can specify a different
regular expression. The regular expression used must produce the following
capture groups. If any of these capture groups are missing, the tag is ignored:
- `major`
- `minor`
- `patch`
The following capture groups are optional:
- `pre`: If set, the tag is ignored. Ignoring `pre` tags ensures release candidate
tags and other pre-release tags are not considered when determining the range of
commits to generate a changelog for.
- `meta`: Optional. Specifies build metadata.
Using this information, GitLab builds a map of Git tags and their release
versions. It then determines what the latest tag is, based on the version
extracted from each tag.
To specify a custom regular expression, use the `tag_regex` setting in your
changelog configuration YAML file. For example, this pattern matches tag names
such as `version-1.2.3` but not `version-1.2`.
```yaml
---
tag_regex: '^version-(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)$'
```
To test if your regular expression is working, you can use websites such as
[regex101](https://regex101.com/). If the regular expression syntax is invalid,
an error is produced when generating a changelog.
## Reverted commit handling
To be treated as a revert commit, the commit message must contain the string
`This reverts commit <SHA>`, where `SHA` is the SHA of the commit to be reverted.
When generating a changelog for a range, GitLab ignores commits both added and
reverted in that range. In this example, commit C reverts commit B. Because
commit C has no other trailer, only commit A is added to the changelog:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Flowchart of 3 commits
accDescr: Shows the flow of 3 commits, where commit C reverts commit B, but it contains no trailer
A[Commit A<br>Changelog: changed] --> B[Commit B<br>Changelog: changed]
B --> C[Commit C<br>Reverts commit B]
```
However, if the revert commit (commit C) also contains a changelog trailer,
both commits A and C are included in the changelog:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Flowchart of 3 commits
accDescr: Shows the flow of 3 commits, where commit C reverts commit B, but both commits A and C contain trailers
A[Commit A<br><br>Changelog: changed] --> B[Commit B<br><br>Changelog: changed]
B --> C[Commit C<br>Reverts commit B<br>Changelog: changed]
```
Commit B is skipped.
## Related topics
- [Changelog-related endpoints](../../api/repositories.md) in the Repositories API.
- [`glab changelog`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/changelog) in the GitLab CLI documentation.
|
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Build, automate, and customize changelogs in your GitLab project.
title: Changelogs
breadcrumbs:
- doc
- user
- project
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Changelogs are generated based on commit titles and Git trailers. To be included
in a changelog, a commit must contain a specific Git trailer. Changelogs are generated
from commit titles, and categorized by Git trailer type. You can enrich changelog entries
with additional data, such as a link to the merge request or details about the
commit author. Changelog formats [can be customized](#customize-the-changelog-output) with a template.
Each section in the default changelog has a title containing the version
number and release date, like this:
```markdown
## 1.0.0 (2021-01-05)
### Features (4 changes)
- [Feature 1](gitlab-org/gitlab@123abc) by @alice ([merge request](gitlab-org/gitlab!123))
- [Feature 2](gitlab-org/gitlab@456abc) ([merge request](gitlab-org/gitlab!456))
- [Feature 3](gitlab-org/gitlab@234abc) by @steve
- [Feature 4](gitlab-org/gitlab@456)
```
The date format for sections can be customized, but the rest of the title cannot.
When adding new sections, GitLab parses these titles to determine where to place
the new information in the file. GitLab sorts sections according to their versions,
not their dates.
Each section contains changes sorted by category (like "Features"), and the format
of these sections can be changed. The section names derive from the values of the
Git trailer used to include or exclude commits.
Commits for changelogs can be retrieved when operating on a mirror. GitLab itself
uses this feature, because patch releases can include changes from both public
projects and private security mirrors.
## Add a trailer to a Git commit
You can add trailers manually when you write a commit message. To include a commit
using the default trailer of `Changelog` and categorize it as a feature, add the
string `Changelog: feature` to your commit message, like this:
```plaintext
<Commit message subject>
<Commit message description>
Changelog: feature
```
If your merge request has multiple commits, add the `Changelog` entry to the first commit.
This ensures the correct entry is generated when you squash commits.
The `Changelog` trailer accepts these values:
- `added`: New feature
- `fixed`: Bug fix
- `changed`: Feature change
- `deprecated`: New deprecation
- `removed`: Feature removal
- `security`: Security fix
- `performance`: Performance improvement
- `other`: Other
## Create a changelog
Changelogs are generated from the command line, using either the API or the
GitLab CLI. The changelog output is formatted in Markdown, and
[you can customize it](#customize-the-changelog-output).
### From the API
To use the API to generate changelogs with a `curl` command, see
[Add changelog data to a changelog file](../../api/repositories.md#add-changelog-data-to-a-changelog-file)
in the API documentation.
### From the GitLab CLI
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/cli/-/merge_requests/1222) in `glab` version 1.30.0.
{{< /history >}}
Prerequisites:
- You have installed and configured the [GitLab CLI](../../editor_extensions/gitlab_cli/_index.md),
version 1.30.0 or later.
- Your repository's tag naming schema matches
[the expected tag naming format](#customize-the-tag-format-when-extracting-versions).
- Commits include [changelog trailers](#add-a-trailer-to-a-git-commit).
To generate the changelog:
1. Update your local copy of your repository with `git fetch`.
1. To generate a changelog for the current version (as determined by `git describe --tags`)
with the default options:
- Run the command `glab changelog generate`.
- To save the output to a file, run the command `glab changelog generate > <filename>.md`.
1. To generate a changelog with customized options, run the command `glab changelog generate`
and append your desired options. Some options include:
- `--config-file [string]`: The path to the changelog configuration file in your project's
Git repository. This file must exist in your project's Git repository. Defaults to `.gitlab/changelog_config.yml`.
- Commit range:
- `--from [string]`: The start of the range of commits (as a SHA) to use for
generating the changelog. This commit itself isn't included in the changelog.
- `--to [string]`: The end of the range of commits (as a SHA) to use for
generating the changelog. This commit is included in the list. Defaults to the `HEAD`
of the default project branch.
- `--date [string]`: The date and time of the release, in ISO 8601 (`2016-03-11T03:45:40Z`)
format. Defaults to the current time.
- `--trailer [string]`: The Git trailer to use for including commits. Defaults to `Changelog`.
- `--version [string]`: The version to generate the changelog for.
To learn more about the parameters available in GitLab CLI, run `glab changelog generate --help`. See the
[API documentation](../../api/repositories.md#add-changelog-data-to-a-changelog-file)
for definitions and usage.
## Customize the changelog output
To customize the changelog output, edit the changelog configuration file, and commit these changes to your project's Git repository. The default location for this configuration is `.gitlab/changelog_config.yml`.
For performance and security reasons, parsing the changelog configuration is limited to `2` seconds.
If parsing the configuration results in timeout errors, consider reducing the size of the configuration.
The file supports these variables:
- `date_format`: The date format, in `strftime` format, used in the title of the newly added changelog data.
- `template`: A custom template to use when generating the changelog data.
- `include_groups`: A list of group full paths containing users whose contributions
should be credited regardless of project membership. The user generating the changelog
must have access to each group for credit to be given.
- `categories`: A hash that maps raw category names to the names to use in the changelog.
To alter the names displayed in the changelog, add these lines to your configuration file
and edit them to meet your needs. This example renders the category titles as
`### Features`, `### Bug fixes`, and `### Performance improvements`:
```yaml
---
categories:
feature: Features
bug: Bug fixes
performance: Performance improvements
```
### Custom templates
{{< history >}}
- Default template [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155806) from using `commit.reference` and `merge_request.reference` to `commit.web_url` and `merge_request.web_url` in GitLab 17.1.
{{< /history >}}
Category sections are generated using a template. The default template:
```plaintext
{% if categories %}
{% each categories %}
### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %})
{% each entries %}
- [{{ title }}]({{ commit.web_url }})\
{% if author.credit %} by {{ author.reference }}{% end %}\
{% if merge_request %} ([merge request]({{ merge_request.web_url }})){% end %}
{% end %}
{% end %}
{% else %}
No changes.
{% end %}
```
The `{% ... %}` tags are for statements, and `{{ ... }}` is used for printing
data. Statements must be terminated using a `{% end %}` tag. Both the `if` and
`each` statements require a single argument.
For example, for a variable called `valid`, you can display "yes"
when this value is true, and display "nope" otherwise by doing the following:
```plaintext
{% if valid %}
yes
{% else %}
nope
{% end %}
```
The use of `else` is optional. A value is considered true when it's a non-empty
value or boolean `true`. Empty arrays and hashes are considered false.
Looping is done using `each`, and variables inside a loop are scoped to it.
Referring to the current value in a loop is done using the variable tag
`{{ it }}`. Other variables read their value from the current loop value. Take
this template for example:
```plaintext
{% each users %}
{{name}}
{% end %}
```
Assuming `users` is an array of objects, each with a `name` field, this would
then print the name of every user.
Using variable tags, you can access nested objects. For example,
`{{ users.0.name }}` prints the name of the first user in the `users` variable.
If a line ends in a backslash, the next newline is ignored. This allows you to
wrap code across multiple lines, without introducing unnecessary newlines in the
Markdown output.
Tags that use `{%` and `%}` (known as expression tags) consume the newline that
directly follows them, if any. This means that this:
```plaintext
---
{% if foo %}
bar
{% end %}
---
```
Compiles into this:
```plaintext
---
bar
---
```
Instead of this:
```plaintext
---
bar
---
```
You can specify a custom template in your configuration, like this:
```yaml
---
template: |
{% if categories %}
{% each categories %}
### {{ title }}
{% each entries %}
- [{{ title }}]({{ commit.web_url }})\
{% if author.credit %} by {{ author.reference }}{% end %}
{% end %}
{% end %}
{% else %}
No changes.
{% end %}
```
When specifying the template you should use `template: |` and not
`template: >`, as the latter doesn't preserve newlines in the template.
### Template data
{{< history >}}
- `commit.web_url` and `merge_request.web_url` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155806) in GitLab 17.1.
{{< /history >}}
At the top level, the following variable is available:
- `categories`: an array of objects, one for every changelog category.
In a category, the following variables are available:
- `count`: the number of entries in this category.
- `entries`: the entries that belong to this category.
- `single_change`: a boolean that indicates if there is only one change (`true`),
or multiple changes (`false`).
- `title`: the title of the category (after it has been remapped).
In an entry, the following variables are available (here `foo.bar` means that
`bar` is a sub-field of `foo`):
- `author.contributor`: a boolean set to `true` when the author is not a project
member, otherwise `false`.
- `author.credit`: a boolean set to `true` when `author.contributor` is `true` or
when `include_groups` is configured, and the author is a member of one of the
groups.
- `author.reference`: a reference to the commit author (for example, `@alice`).
- `commit.reference`: a reference to the commit, for example,
`gitlab-org/gitlab@0a4cdd86ab31748ba6dac0f69a8653f206e5cfc7`.
- `commit.web_url`: a URL to the commit, for example,
`https://gitlab.com/gitlab-org/gitlab/-/commit/0a4cdd86ab31748ba6dac0f69a8653f206e5cfc7`.
- `commit.trailers`: an object containing all the Git trailers that were present
in the commit body.
These trailers can be referenced using `commit.trailers.<name>`. For example, assuming the following commit:
```plaintext
Add some impressive new feature
Changelog: added
Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/1234
Status: important
```
The `Changelog`, `Issue` and `Status` trailers can be accessed in the template as follows:
```yaml
{% each entries %}
{% if commit.trailers.Issue %} ([link to issue]({{ commit.trailers.Issue }})){% end %}
{% if commit.trailers.Status %}Status: {{ commit.trailers.Status }}{% end %}
{% end %}
```
- `merge_request.reference`: a reference to the merge request that first
introduced the change (for example, `gitlab-org/gitlab!50063`).
- `merge_request.web_url`: a URL to the merge request that first introduced
the change (for example, `https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50063`).
- `title`: the title of the changelog entry (this is the commit title).
The `author` and `merge_request` objects might not be present if the data
couldn't be determined. For example, when a commit is created without a
corresponding merge request, no merge request is displayed.
### Customize the tag format when extracting versions
GitLab uses a regular expression (using the
[re2](https://github.com/google/re2/) engine and syntax) to extract a semantic
version from tag names. The default regular expression is:
```plaintext
^v?(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<pre>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<meta>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
```
This regular expression is based on the official
[semantic versioning](https://semver.org/) regular expression, and also includes
support for tag names that start with the letter `v`.
If your project uses a different format for tags, you can specify a different
regular expression. The regular expression used must produce the following
capture groups. If any of these capture groups are missing, the tag is ignored:
- `major`
- `minor`
- `patch`
The following capture groups are optional:
- `pre`: If set, the tag is ignored. Ignoring `pre` tags ensures release candidate
tags and other pre-release tags are not considered when determining the range of
commits to generate a changelog for.
- `meta`: Optional. Specifies build metadata.
Using this information, GitLab builds a map of Git tags and their release
versions. It then determines what the latest tag is, based on the version
extracted from each tag.
To specify a custom regular expression, use the `tag_regex` setting in your
changelog configuration YAML file. For example, this pattern matches tag names
such as `version-1.2.3` but not `version-1.2`.
```yaml
---
tag_regex: '^version-(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)$'
```
To test if your regular expression is working, you can use websites such as
[regex101](https://regex101.com/). If the regular expression syntax is invalid,
an error is produced when generating a changelog.
## Reverted commit handling
To be treated as a revert commit, the commit message must contain the string
`This reverts commit <SHA>`, where `SHA` is the SHA of the commit to be reverted.
When generating a changelog for a range, GitLab ignores commits both added and
reverted in that range. In this example, commit C reverts commit B. Because
commit C has no other trailer, only commit A is added to the changelog:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Flowchart of 3 commits
accDescr: Shows the flow of 3 commits, where commit C reverts commit B, but it contains no trailer
A[Commit A<br>Changelog: changed] --> B[Commit B<br>Changelog: changed]
B --> C[Commit C<br>Reverts commit B]
```
However, if the revert commit (commit C) also contains a changelog trailer,
both commits A and C are included in the changelog:
```mermaid
%%{init: { "fontFamily": "GitLab Sans" }}%%
graph LR
accTitle: Flowchart of 3 commits
accDescr: Shows the flow of 3 commits, where commit C reverts commit B, but both commits A and C contain trailers
A[Commit A<br><br>Changelog: changed] --> B[Commit B<br><br>Changelog: changed]
B --> C[Commit C<br>Reverts commit B<br>Changelog: changed]
```
Commit B is skipped.
## Related topics
- [Changelog-related endpoints](../../api/repositories.md) in the Repositories API.
- [`glab changelog`](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/changelog) in the GitLab CLI documentation.
|
https://docs.gitlab.com/user/project/remote_development
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/remote_development
|
[
"doc",
"user",
"project",
"remote_development"
] |
_index.md
|
Create
|
Remote Development
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Remote development
|
Use your web browser to write code in a secure environment.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Remote development is a set of features you can use to make code changes
without having to install any dependencies or clone any repositories locally.
These features include:
- [Web IDE](#web-ide)
- [Workspaces](#workspaces)
## Web IDE
You can use the [Web IDE](../web_ide/_index.md) to make, commit, and push changes to a project directly from your web browser.
This way, you can update any project without having to install any dependencies or clone any repositories locally.
The Web IDE, however, lacks a native runtime environment where you could compile code, run tests, or generate real-time feedback.
## Workspaces
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
You can use [workspaces](../../workspace/_index.md) to create a fully featured development environment directly from GitLab.
This environment runs on a remote server and provides you with a complete IDE experience
without having to install any dependencies or clone repositories locally.
With workspaces, you can:
- Create a new development environment.
- Access a fully featured IDE, including a code editor, terminal, and build tools.
- Integrate your workspace with the rest of GitLab, including merge requests and CI/CD pipelines.
|
---
stage: Create
group: Remote Development
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: Use your web browser to write code in a secure environment.
title: Remote development
breadcrumbs:
- doc
- user
- project
- remote_development
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Remote development is a set of features you can use to make code changes
without having to install any dependencies or clone any repositories locally.
These features include:
- [Web IDE](#web-ide)
- [Workspaces](#workspaces)
## Web IDE
You can use the [Web IDE](../web_ide/_index.md) to make, commit, and push changes to a project directly from your web browser.
This way, you can update any project without having to install any dependencies or clone any repositories locally.
The Web IDE, however, lacks a native runtime environment where you could compile code, run tests, or generate real-time feedback.
## Workspaces
{{< details >}}
- Tier: Premium, Ultimate
{{< /details >}}
You can use [workspaces](../../workspace/_index.md) to create a fully featured development environment directly from GitLab.
This environment runs on a remote server and provides you with a complete IDE experience
without having to install any dependencies or clone repositories locally.
With workspaces, you can:
- Create a new development environment.
- Access a fully featured IDE, including a code editor, terminal, and build tools.
- Integrate your workspace with the rest of GitLab, including merge requests and CI/CD pipelines.
|
https://docs.gitlab.com/user/project/settings
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/_index.md
|
2025-08-13
|
doc/user/project/settings
|
[
"doc",
"user",
"project",
"settings"
] |
_index.md
|
Tenant Scale
|
Organizations
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Project settings
| null |
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
## Configure project features and permissions
To configure features and permissions for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To allow users to request access to the project, select the **Users can request access** checkbox.
1. To turn features on or off in the project, use the feature toggles.
1. Select **Save changes**.
### Feature dependencies
When you turn off a feature, the following additional features are also unavailable:
- If you turn off the **Issues** feature, project users cannot use:
- **Issue Boards**
- **Service Desk**
- Project users can still access **Milestones** from merge requests.
- If you turn off **Issues** and **Merge Requests**, project users cannot use:
- **Labels**
- **Milestones**
- If you turn off **Repository**, project users cannot access:
- **Merge requests**
- **CI/CD**
- **Git Large File Storage**
- **Packages**
- The metrics dashboard requires read access to project environments and deployments.
Users with access to the metrics dashboard can also access environments and deployments.
## Toggle project features
Available project features are visible and accessible to project members.
You can turn off specific project features, so that they are not visible
and accessible to project members, regardless of their role.
To toggle the availability of individual features in a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To change the availability of a feature, turn the toggle on or off.
1. Select **Save changes**.
## Turn off project analytics
{{< alert type="note" >}}
Turning off project analytics only removes the **Analyze** navigation item, but data is still being computed and available through the respective API endpoints.
{{< /alert >}}
By default, project analytics are displayed under the **Analyze** item in the left sidebar.
To turn this feature off and remove the **Analyze** item from the left sidebar:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Turn off the **Analytics** toggle.
1. Select **Save changes**.
## Turn off CVE identifier request in issues
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41203) in GitLab 13.4, only for public projects on GitLab.com.
{{< /history >}}
In some environments, users can submit a [CVE identifier request](../../application_security/cve_id_request.md) in an issue.
To turn off the CVE identifier request option in issues in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **Issues**, turn off the **CVE ID requests in the issue sidebar** toggle.
1. Select **Save changes**.
## Turn off project email notifications
Prerequisites:
- You must have the Owner role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Clear the **Enable email notifications** checkbox.
### Turn off diff previews in project email notifications
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24733) in GitLab 15.6 [with a flag](../../../administration/feature_flags/_index.md) named `diff_preview_in_email`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/382055) in GitLab 17.1. Feature flag `diff_preview_in_email` removed.
{{< /history >}}
When you review code in a merge request and comment on a line of code, GitLab
includes a few lines of the diff in the email notification to participants.
Some organizational policies treat email as a less secure system, or might not
control their own infrastructure for email. This can present risks to IP or
access control of source code.
Prerequisites:
- You must have the Owner role for the project.
To turn off diff previews for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Clear **Include diff previews**.
1. Select **Save changes**.
## Configure merge request settings for a project
Configure your project's merge request settings:
- Set up the [merge request method](../merge_requests/methods/_index.md) (merge commit, fast-forward merge).
- Add merge request [description templates](../description_templates.md).
- Turn on:
- [Merge request approvals](../merge_requests/approvals/_index.md).
- [Status checks](../merge_requests/status_checks.md).
- [Merge only if pipeline succeeds](../merge_requests/auto_merge.md).
- [Merge only when all threads are resolved](../merge_requests/_index.md#prevent-merge-unless-all-threads-are-resolved).
- [Required associated issue from Jira](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged).
- [**Delete source branch when merge request is accepted** option by default](#delete-the-source-branch-on-merge-by-default).
- Configure:
- [Suggested changes commit messages](../merge_requests/reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions).
- [Merge and squash commit message templates](../merge_requests/commit_templates.md).
- [Default target project](../merge_requests/creating_merge_requests.md#set-the-default-target-project) for merge requests coming from forks.
### Delete the source branch on merge by default
In merge requests, you can change the default behavior so that the
**Delete the source branch** checkbox is always selected.
To set this default:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select **Enable "Delete source branch" option by default**.
1. Select **Save changes**.
## Add additional webhook triggers for project access token expiration
{{< history >}}
- [Added](https://gitlab.com/gitlab-org/gitlab/-/issues/463016) 60 day and 30 days triggers to project and group access tokens webhooks in GitLab 17.9 [with a flag](../../../administration/feature_flags/_index.md) named `extended_expiry_webhook_execution_setting`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/513684) in GitLab 17.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/513684) in GitLab 17.10. Feature flag `extended_expiry_webhook_execution_setting` removed.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
GitLab sends multiple [expiry emails](project_access_tokens.md#project-access-token-expiry-emails) and triggers a related [webhook](../integrations/webhook_events.md#project-and-group-access-token-events) before a project token expires. By default, GitLab only triggers these webhooks 7 days before the token expires. When this feature is enabled, GitLab also triggers these webhooks 60 days and 30 days before the token expires.
To enable additional triggers for these webhooks:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Select the **Extended Group Access Tokens Expiry Webhook execution** checkbox.
1. Select **Save changes**.
|
---
stage: Tenant Scale
group: Organizations
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Project settings
breadcrumbs:
- doc
- user
- project
- settings
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
## Configure project features and permissions
To configure features and permissions for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To allow users to request access to the project, select the **Users can request access** checkbox.
1. To turn features on or off in the project, use the feature toggles.
1. Select **Save changes**.
### Feature dependencies
When you turn off a feature, the following additional features are also unavailable:
- If you turn off the **Issues** feature, project users cannot use:
- **Issue Boards**
- **Service Desk**
- Project users can still access **Milestones** from merge requests.
- If you turn off **Issues** and **Merge Requests**, project users cannot use:
- **Labels**
- **Milestones**
- If you turn off **Repository**, project users cannot access:
- **Merge requests**
- **CI/CD**
- **Git Large File Storage**
- **Packages**
- The metrics dashboard requires read access to project environments and deployments.
Users with access to the metrics dashboard can also access environments and deployments.
## Toggle project features
Available project features are visible and accessible to project members.
You can turn off specific project features, so that they are not visible
and accessible to project members, regardless of their role.
To toggle the availability of individual features in a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. To change the availability of a feature, turn the toggle on or off.
1. Select **Save changes**.
## Turn off project analytics
{{< alert type="note" >}}
Turning off project analytics only removes the **Analyze** navigation item, but data is still being computed and available through the respective API endpoints.
{{< /alert >}}
By default, project analytics are displayed under the **Analyze** item in the left sidebar.
To turn this feature off and remove the **Analyze** item from the left sidebar:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Turn off the **Analytics** toggle.
1. Select **Save changes**.
## Turn off CVE identifier request in issues
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41203) in GitLab 13.4, only for public projects on GitLab.com.
{{< /history >}}
In some environments, users can submit a [CVE identifier request](../../application_security/cve_id_request.md) in an issue.
To turn off the CVE identifier request option in issues in your project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Visibility, project features, permissions**.
1. Under **Issues**, turn off the **CVE ID requests in the issue sidebar** toggle.
1. Select **Save changes**.
## Turn off project email notifications
Prerequisites:
- You must have the Owner role for the project.
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Clear the **Enable email notifications** checkbox.
### Turn off diff previews in project email notifications
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24733) in GitLab 15.6 [with a flag](../../../administration/feature_flags/_index.md) named `diff_preview_in_email`. Disabled by default.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/382055) in GitLab 17.1. Feature flag `diff_preview_in_email` removed.
{{< /history >}}
When you review code in a merge request and comment on a line of code, GitLab
includes a few lines of the diff in the email notification to participants.
Some organizational policies treat email as a less secure system, or might not
control their own infrastructure for email. This can present risks to IP or
access control of source code.
Prerequisites:
- You must have the Owner role for the project.
To turn off diff previews for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Clear **Include diff previews**.
1. Select **Save changes**.
## Configure merge request settings for a project
Configure your project's merge request settings:
- Set up the [merge request method](../merge_requests/methods/_index.md) (merge commit, fast-forward merge).
- Add merge request [description templates](../description_templates.md).
- Turn on:
- [Merge request approvals](../merge_requests/approvals/_index.md).
- [Status checks](../merge_requests/status_checks.md).
- [Merge only if pipeline succeeds](../merge_requests/auto_merge.md).
- [Merge only when all threads are resolved](../merge_requests/_index.md#prevent-merge-unless-all-threads-are-resolved).
- [Required associated issue from Jira](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged).
- [**Delete source branch when merge request is accepted** option by default](#delete-the-source-branch-on-merge-by-default).
- Configure:
- [Suggested changes commit messages](../merge_requests/reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions).
- [Merge and squash commit message templates](../merge_requests/commit_templates.md).
- [Default target project](../merge_requests/creating_merge_requests.md#set-the-default-target-project) for merge requests coming from forks.
### Delete the source branch on merge by default
In merge requests, you can change the default behavior so that the
**Delete the source branch** checkbox is always selected.
To set this default:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Merge requests**.
1. Select **Enable "Delete source branch" option by default**.
1. Select **Save changes**.
## Add additional webhook triggers for project access token expiration
{{< history >}}
- [Added](https://gitlab.com/gitlab-org/gitlab/-/issues/463016) 60 day and 30 days triggers to project and group access tokens webhooks in GitLab 17.9 [with a flag](../../../administration/feature_flags/_index.md) named `extended_expiry_webhook_execution_setting`. Disabled by default.
- [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/513684) in GitLab 17.10.
- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/513684) in GitLab 17.10. Feature flag `extended_expiry_webhook_execution_setting` removed.
{{< /history >}}
{{< alert type="flag" >}}
The availability of this feature is controlled by a feature flag. For more information, see the history.
{{< /alert >}}
GitLab sends multiple [expiry emails](project_access_tokens.md#project-access-token-expiry-emails) and triggers a related [webhook](../integrations/webhook_events.md#project-and-group-access-token-events) before a project token expires. By default, GitLab only triggers these webhooks 7 days before the token expires. When this feature is enabled, GitLab also triggers these webhooks 60 days and 30 days before the token expires.
To enable additional triggers for these webhooks:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand the **Visibility, project features, permissions** section.
1. Select the **Extended Group Access Tokens Expiry Webhook execution** checkbox.
1. Select **Save changes**.
|
https://docs.gitlab.com/user/project/import_export
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/import_export.md
|
2025-08-13
|
doc/user/project/settings
|
[
"doc",
"user",
"project",
"settings"
] |
import_export.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Migrate projects and groups by using file exports
|
Use file exports to migrate projects and groups between GitLab instances.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
File exports give you a portable package of your GitLab data that works in offline environments.
This migration method preserves most project data, including
repositories, issues, merge requests, and comments.
Use file exports to:
- Migrate between offline environments.
- Move specific projects without their entire group structure.
[Direct transfer](../../group/import/_index.md) remains the recommended migration method for most situations.
{{< alert type="note" >}}
You should not use project export files to back up your data.
Using project export files for backups does not always work, and not all items are exported.
{{< /alert >}}
## Known issues
- Due to a known issue, you might encounter a
`PG::QueryCanceled: ERROR: canceling statement due to statement timeout` error.
For more information, see the
[troubleshooting documentation](import_export_troubleshooting.md#error-pgquerycanceled-error-canceling-statement-due-to-statement-timeout).
- In GitLab 17.0, 17.1, and 17.2, imported epics and work items are mapped
to the importing user rather than the original author.
- For merge requests, only the latest diff is preserved during import or export.
After importing or exporting a project, only the latest diff version and the latest pipeline in merge requests are visible.
## Migrate projects by uploading an export file
Existing projects can be exported to a file and
then imported into another GitLab instance.
### Preserving user contributions
The requirements for preserving user contribution depends on whether you're migrating to GitLab.com
or to a GitLab Self-Managed instance.
#### When migrating from GitLab Self-Managed to GitLab.com
When migrating projects by using file exports, an administrator's access token is required for user contributions to map correctly.
Therefore, user contributions never map correctly when importing file exports from a GitLab Self-Managed instance to GitLab.com.
Instead, all GitLab user associations (such as comment author) are changed to the user importing the project. To preserve
contribution history, do one of the following:
- [Migrate by using direct transfer](../../group/import/_index.md).
- Consider engaging Professional Services. For more information, see the
[Professional Services Full Catalog](https://about.gitlab.com/services/catalog/).
#### When migrating to GitLab Self-Managed
To ensure GitLab maps users and their contributions correctly:
- The owner of the project's top-level group should export the project so that the information of all members (direct
and inherited) with access to the project can be included in the exported file. Project maintainers and owners can
initiate the project export. However, only direct members of a project are then exported.
- An administrator must perform the import.
- Required users must exist on the destination GitLab instance. An administrator can create confirmed users either in
bulk in a Rails console or one by one in the UI.
- Users must [set a public email in their profiles](../../profile/_index.md#set-your-public-email) on the source GitLab
instance that matches their primary email address on the destination GitLab instance. You can also manually add users'
public emails by [editing project export files](#edit-project-export-files).
When the email of an existing user matches the email of an imported user, that user is added as a
[direct member](../members/_index.md) to the imported project.
If any of the previous conditions are not met, user contributions are not mapped correctly. Instead, all GitLab user
associations are changed to the user who performed the import. That user becomes an author of merge requests created by
other users. Supplementary comments mentioning original authors are:
- Added for comments, merge request approvals, linked tasks, and items.
- Not added for the merge request or issue creator, added or removed labels, and merged-by information.
### Edit project export files
You can add or remove data from export files. For example, you can:
- Manually add users public emails to the `project_members.ndjson` file.
- Trim CI pipelines by removing lines from the `ci_pipelines.ndjson` file.
To edit a project export file:
1. Extract the exported `.tar.gz` file.
1. Edit the appropriate file. For example, `tree/project/project_members.ndjson`.
1. Compress the files back to a `.tar.gz` file.
You can also make sure that all members were exported by checking the `project_members.ndjson` file.
### Compatibility
{{< history >}}
- Support for JSON-formatted project file exports [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/389888) in GitLab 15.11.
{{< /history >}}
Project file exports are in NDJSON format.
You can import project file exports that were exported from a version of GitLab up to two
[minor](../../../policy/maintenance.md#versioning) versions behind.
For example:
| Destination version | Compatible source versions |
|:--------------------|:---------------------------|
| 13.0 | 13.0, 12.10, 12.9 |
| 13.1 | 13.1, 13.0, 12.10 |
### Configure file exports as an import source
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Before you can migrate projects on GitLab Self-Managed using file exports, GitLab administrators must:
1. [Enable file exports](../../../administration/settings/import_and_export_settings.md#enable-project-export) on the source
instance.
1. Enable file exports as an import source for the destination instance. On GitLab.com, file exports are already enabled
as an import source.
To enable file exports as an import source for the destination instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **Import and export settings**.
1. Scroll to **Import sources**.
1. Select the **GitLab export** checkbox.
### Between CE and EE
You can export projects from the [Community Edition to the Enterprise Edition](https://about.gitlab.com/install/ce-or-ee/)
and vice versa, assuming [compatibility](#compatibility) is met.
If you're exporting a project from the Enterprise Edition to the Community Edition, you may lose
data that is retained only in the Enterprise Edition. For more information, see
[downgrading from EE to CE](../../../downgrade_ee_to_ce/_index.md).
### Export a project and its data
Before you can import a project, you must export it.
Prerequisites:
- Review the list of [items that are exported](#project-items-that-are-exported). Not all items are exported.
- You must have at least the Maintainer role for the project.
- For significantly improved performance for repositories with a large number of Git references, use GitLab 18.0 or later. For more information, see our
[blog post about decreasing GitLab repository backup times](https://about.gitlab.com/blog/2025/06/05/how-we-decreased-gitlab-repo-backup-times-from-48-hours-to-41-minutes/).
To export a project and its data, follow these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. Select **Export project**.
1. After the export is generated, you can:
- Follow a link contained in an email that you should receive.
- Refresh the project settings page and in the **Export project** area, select **Download export**.
The export is generated in your configured `shared_path`, a temporary shared directory, and then
moved to your configured `uploads_directory`. Every 24 hours, a worker deletes these export files.
#### Project items that are exported
Exported project items depend on the version of GitLab you use. To determine if a
specific project item is exported:
1. Check the [`exporters` array](https://gitlab.com/gitlab-org/gitlab/-/blob/b819a6aa6d53573980dd9ee4a1bfe597d69e88e5/app/services/projects/import_export/export_service.rb#L24).
1. Check the [`project/import_export.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/project/import_export.yml)
file for projects for your GitLab version. For example, <https://gitlab.com/gitlab-org/gitlab/-/blob/16-8-stable-ee/lib/gitlab/import_export/project/import_export.yml> for GitLab 16.8.
For a quick overview, items that are exported include:
- Project and wiki repositories
- Project uploads
- Project configuration, excluding integrations
- Issues
- Issue comments
- Issue iterations ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96184) in GitLab 15.4)
- Issue resource state events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Issue resource milestone events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Issue resource iteration events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Merge requests
- Merge request diffs
- Merge request comments
- Merge request resource state events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Merge request multiple assignees ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Merge request reviewers ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Merge request approvers ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Commit comments ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/391601) in GitLab 15.10)
- Labels
- Milestones
- Snippets
- Releases
- Time tracking and other project entities
- Design management files and data
- LFS objects
- Issue boards
- CI/CD pipelines
- Pipeline schedules (inactive and assigned to the user who initiated the import)
- Protected branches and tags
- Push rules
- Emoji reactions
- Direct project members
(if you have at least the Maintainer role for the exported project's group)
- Inherited project members as direct project members
(if you have the Owner role for the exported project's group or administrator access to the instance)
- Some merge request approval rules:
- [Approvals for protected branches](../merge_requests/approvals/rules.md#approvals-for-protected-branches)
- [Eligible approvers](../merge_requests/approvals/rules.md#eligible-approvers)
- Vulnerability report ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/501466) in GitLab 17.7)
#### Project items that are not exported
Items that are **not** exported include:
- [Child pipeline history](https://gitlab.com/gitlab-org/gitlab/-/issues/221088)
- Pipeline triggers
- Build traces and artifacts
- Package and container registry images
- CI/CD variables
- CI/CD job token allowlist
- Webhooks
- Any encrypted tokens
- [Number of required approvals](https://gitlab.com/gitlab-org/gitlab/-/issues/221087)
- Repository size limits
- Deploy keys allowed to push to protected branches
- Secure files
- [Activity logs for Git-related events](https://gitlab.com/gitlab-org/gitlab/-/issues/214700) (for example, pushing and creating tags)
- Security policies associated with your project
- Links between issues and linked items
- Links to related merge requests
- Pipeline schedule variables
### Import a project and its data
You can import a project and its data. The amount of data you can import depends on the maximum import file size:
- On GitLab Self-Managed, administrators can
[set maximum import file size](#set-maximum-import-file-size).
- On GitLab.com, the value is [set to 5 GB](../../gitlab_com/_index.md#account-and-limit-settings).
{{< alert type="warning" >}}
Only import projects from sources you trust. If you import a project from an untrusted source, it
may be possible for an attacker to steal your sensitive data.
{{< /alert >}}
#### Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- You must have [exported the project and its data](#export-a-project-and-its-data).
- Compare GitLab versions and ensure you are importing to a GitLab version that is the same or later
than the GitLab version you exported from.
- Review [compatibility](#compatibility) for any issues.
- At least the Maintainer role on the destination group to migrate to.
#### Import a project
To import a project:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. In **Import project from**, select **GitLab export**.
1. Enter your project name and URL. Then select the file you exported previously.
1. Select **Import project**.
You can query the status of an import by using the [API](../../../api/project_import_export.md#import-status).
The query might return an import error or exceptions.
#### Changes to imported items
Exported items are imported with the following changes:
- Project members with the Owner role are imported with the Maintainer role.
- If an imported project contains merge requests originating from forks, new branches associated with these merge
requests are created in the project. Therefore, the number of branches in the new project can be more than in the
source project.
- If the `Internal` visibility level [is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects),
all imported projects are given `Private` visibility.
Deploy keys aren't imported. To use deploy keys, you must enable them in your imported project and update protected branches.
#### Import large projects
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have a larger project, consider [using a Rake task](../../../administration/raketasks/project_import_export.md#import-large-projects).
### Set maximum import file size
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators can set the maximum import file size one of two ways:
- With the `max_import_size` option in the [Application settings API](../../../api/settings.md#update-application-settings).
- In the [**Admin** area UI](../../../administration/settings/import_and_export_settings.md#max-import-size).
The default is `0` (unlimited).
### Rate limits
To help avoid abuse, by default, users are rate limited to:
| Request type | Limit |
|:----------------|:--------------------------------|
| Export | 6 projects per minute |
| Download export | 1 download per project per minute |
| Import | 6 projects per minute |
## Migrate groups by uploading an export file (deprecated)
{{< history >}}
- [Deprecated](https://gitlab.com/groups/gitlab-org/-/epics/4619) in GitLab 14.6.
{{< /history >}}
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/-/epics/4619) in GitLab 14.6 and replaced by
[migrating groups by direct transfer](../../group/import/_index.md). However, this feature is still recommended for migrating groups between
offline systems. To follow progress on an alternative solution for [offline environments](../../application_security/offline_deployments/_index.md), see
[the relevant epic](https://gitlab.com/groups/gitlab-org/-/epics/8985).
{{< /alert >}}
Prerequisites:
- Owner role on the group to migrate.
Using file exports, you can:
- Export any group to a file and upload that file to another GitLab instance or to another location on the same instance.
- Use either the GitLab UI or the [API](../../../api/group_import_export.md).
- Migrate groups one by one, then export and import each project for the groups one by one.
GitLab maps user contributions correctly when an admin access token is used to perform the import. GitLab does not map
user contributions correctly when you are importing from a GitLab Self-Managed instance to GitLab.com. Correct mapping of user
contributions when importing from a GitLab Self-Managed instance to GitLab.com can be preserved with paid involvement of
Professional Services team.
### Additional information
- Exports are stored in a temporary directory and are deleted every 24 hours by a specific worker.
- To preserve group-level relationships from imported projects, export and import groups first so that projects can
be imported into the desired group structure.
- Imported groups are given a `private` visibility level, unless imported into a parent group.
- If imported into a parent group, a subgroup inherits the same level of visibility unless otherwise restricted.
- You can export groups from the [Community Edition to the Enterprise Edition](https://about.gitlab.com/install/ce-or-ee/)
and vice versa. The Enterprise Edition retains some group data that isn't part of the Community Edition. If you're
exporting a group from the Enterprise Edition to the Community Edition, you may lose this data. For more information,
see [downgrading from EE to CE](../../../downgrade_ee_to_ce/_index.md).
The maximum import file size depends on whether you import to GitLab Self-Managed or GitLab.com:
- If importing to a GitLab Self-Managed instance, you can import a import file of any size. Administrators can change
this behavior using either:
- The `max_import_size` option in the [Application settings API](../../../api/settings.md#update-application-settings).
- The [**Admin** area](../../../administration/settings/account_and_limit_settings.md).
- On GitLab.com, you can import groups using import files of no more than
[5 GB](../../gitlab_com/_index.md#account-and-limit-settings) in size.
### Compatibility
{{< history >}}
- Support for JSON-formatted project file exports [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/383682) in GitLab 15.8.
{{< /history >}}
Group file exports are in NDJSON format.
You can import group file exports that were exported from a version of GitLab up to two
[minor](../../../policy/maintenance.md#versioning) versions behind.
For example:
| Destination version | Compatible source versions |
|:--------------------|:---------------------------|
| 13.0 | 13.0, 12.10, 12.9 |
| 13.1 | 13.1, 13.0, 12.10 |
### Group items that are exported
The [`import_export.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/group/import_export.yml)
file for groups lists items exported and imported when migrating groups using file exports. View this file in the branch
for your version of GitLab to check which items can be imported to the destination GitLab instance. For example,
[`import_export.yml` on the `16-8-stable-ee` branch](https://gitlab.com/gitlab-org/gitlab/-/blob/16-8-stable-ee/lib/gitlab/import_export/group/import_export.yml).
Group items that are exported include:
- Milestones
- Group Labels (without associated label priorities)
- Boards and Board Lists
- Badges
- Subgroups (including all the aforementioned data)
- Epics
- Epic resource state events. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4.
- Events
- [Wikis](../wiki/group.md)
- Iterations cadences. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95372) in GitLab 15.4.
### Group items that are not exported
Items that are **not** exported include:
- Projects
- Runner tokens
- SAML discovery tokens
- Uploads
### Preparation
- To preserve the member list and their respective permissions on imported groups, review the users in these groups. Make
sure these users exist before importing the desired groups.
- Users must set a public email in the source GitLab instance that matches their confirmed primary email in the
destination GitLab instance. Most users receive an email asking them to confirm their email address.
### Export a group
Prerequisites:
- You must have the Owner role for the group.
To export the contents of a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. In the **Advanced** section, select **Export group**.
1. After the export is generated, you can:
- Follow a link contained in an email that you should receive.
- Refresh the group settings page and in the **Export project** area, select **Download export**.
### Import the group
To import the group:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New group**.
1. Select **Import group**.
1. In the **Import group from file** section, enter a group name and accept or modify the associated group URL.
1. Select **Choose file**.
1. Select the GitLab export file you want to import.
1. To begin importing, select **Import**.
### Rate limits
To help avoid abuse, by default, users are rate limited to:
| Request Type | Limit |
|-----------------|-------|
| Export | 6 groups per minute |
| Download export | 1 download per group per minute |
| Import | 6 groups per minute |
## Related topics
- [Project import and export API](../../../api/project_import_export.md)
- [Project import and export administration Rake tasks](../../../administration/raketasks/project_import_export.md)
- [Migrating GitLab groups](../../group/import/_index.md)
- [Group import and export API](../../../api/group_import_export.md)
- [Migrate groups by direct transfer](../../group/import/_index.md).
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Migrate projects and groups by using file exports
description: Use file exports to migrate projects and groups between GitLab instances.
breadcrumbs:
- doc
- user
- project
- settings
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
File exports give you a portable package of your GitLab data that works in offline environments.
This migration method preserves most project data, including
repositories, issues, merge requests, and comments.
Use file exports to:
- Migrate between offline environments.
- Move specific projects without their entire group structure.
[Direct transfer](../../group/import/_index.md) remains the recommended migration method for most situations.
{{< alert type="note" >}}
You should not use project export files to back up your data.
Using project export files for backups does not always work, and not all items are exported.
{{< /alert >}}
## Known issues
- Due to a known issue, you might encounter a
`PG::QueryCanceled: ERROR: canceling statement due to statement timeout` error.
For more information, see the
[troubleshooting documentation](import_export_troubleshooting.md#error-pgquerycanceled-error-canceling-statement-due-to-statement-timeout).
- In GitLab 17.0, 17.1, and 17.2, imported epics and work items are mapped
to the importing user rather than the original author.
- For merge requests, only the latest diff is preserved during import or export.
After importing or exporting a project, only the latest diff version and the latest pipeline in merge requests are visible.
## Migrate projects by uploading an export file
Existing projects can be exported to a file and
then imported into another GitLab instance.
### Preserving user contributions
The requirements for preserving user contribution depends on whether you're migrating to GitLab.com
or to a GitLab Self-Managed instance.
#### When migrating from GitLab Self-Managed to GitLab.com
When migrating projects by using file exports, an administrator's access token is required for user contributions to map correctly.
Therefore, user contributions never map correctly when importing file exports from a GitLab Self-Managed instance to GitLab.com.
Instead, all GitLab user associations (such as comment author) are changed to the user importing the project. To preserve
contribution history, do one of the following:
- [Migrate by using direct transfer](../../group/import/_index.md).
- Consider engaging Professional Services. For more information, see the
[Professional Services Full Catalog](https://about.gitlab.com/services/catalog/).
#### When migrating to GitLab Self-Managed
To ensure GitLab maps users and their contributions correctly:
- The owner of the project's top-level group should export the project so that the information of all members (direct
and inherited) with access to the project can be included in the exported file. Project maintainers and owners can
initiate the project export. However, only direct members of a project are then exported.
- An administrator must perform the import.
- Required users must exist on the destination GitLab instance. An administrator can create confirmed users either in
bulk in a Rails console or one by one in the UI.
- Users must [set a public email in their profiles](../../profile/_index.md#set-your-public-email) on the source GitLab
instance that matches their primary email address on the destination GitLab instance. You can also manually add users'
public emails by [editing project export files](#edit-project-export-files).
When the email of an existing user matches the email of an imported user, that user is added as a
[direct member](../members/_index.md) to the imported project.
If any of the previous conditions are not met, user contributions are not mapped correctly. Instead, all GitLab user
associations are changed to the user who performed the import. That user becomes an author of merge requests created by
other users. Supplementary comments mentioning original authors are:
- Added for comments, merge request approvals, linked tasks, and items.
- Not added for the merge request or issue creator, added or removed labels, and merged-by information.
### Edit project export files
You can add or remove data from export files. For example, you can:
- Manually add users public emails to the `project_members.ndjson` file.
- Trim CI pipelines by removing lines from the `ci_pipelines.ndjson` file.
To edit a project export file:
1. Extract the exported `.tar.gz` file.
1. Edit the appropriate file. For example, `tree/project/project_members.ndjson`.
1. Compress the files back to a `.tar.gz` file.
You can also make sure that all members were exported by checking the `project_members.ndjson` file.
### Compatibility
{{< history >}}
- Support for JSON-formatted project file exports [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/389888) in GitLab 15.11.
{{< /history >}}
Project file exports are in NDJSON format.
You can import project file exports that were exported from a version of GitLab up to two
[minor](../../../policy/maintenance.md#versioning) versions behind.
For example:
| Destination version | Compatible source versions |
|:--------------------|:---------------------------|
| 13.0 | 13.0, 12.10, 12.9 |
| 13.1 | 13.1, 13.0, 12.10 |
### Configure file exports as an import source
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Before you can migrate projects on GitLab Self-Managed using file exports, GitLab administrators must:
1. [Enable file exports](../../../administration/settings/import_and_export_settings.md#enable-project-export) on the source
instance.
1. Enable file exports as an import source for the destination instance. On GitLab.com, file exports are already enabled
as an import source.
To enable file exports as an import source for the destination instance:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings > General**.
1. Expand **Import and export settings**.
1. Scroll to **Import sources**.
1. Select the **GitLab export** checkbox.
### Between CE and EE
You can export projects from the [Community Edition to the Enterprise Edition](https://about.gitlab.com/install/ce-or-ee/)
and vice versa, assuming [compatibility](#compatibility) is met.
If you're exporting a project from the Enterprise Edition to the Community Edition, you may lose
data that is retained only in the Enterprise Edition. For more information, see
[downgrading from EE to CE](../../../downgrade_ee_to_ce/_index.md).
### Export a project and its data
Before you can import a project, you must export it.
Prerequisites:
- Review the list of [items that are exported](#project-items-that-are-exported). Not all items are exported.
- You must have at least the Maintainer role for the project.
- For significantly improved performance for repositories with a large number of Git references, use GitLab 18.0 or later. For more information, see our
[blog post about decreasing GitLab repository backup times](https://about.gitlab.com/blog/2025/06/05/how-we-decreased-gitlab-repo-backup-times-from-48-hours-to-41-minutes/).
To export a project and its data, follow these steps:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > General**.
1. Expand **Advanced**.
1. Select **Export project**.
1. After the export is generated, you can:
- Follow a link contained in an email that you should receive.
- Refresh the project settings page and in the **Export project** area, select **Download export**.
The export is generated in your configured `shared_path`, a temporary shared directory, and then
moved to your configured `uploads_directory`. Every 24 hours, a worker deletes these export files.
#### Project items that are exported
Exported project items depend on the version of GitLab you use. To determine if a
specific project item is exported:
1. Check the [`exporters` array](https://gitlab.com/gitlab-org/gitlab/-/blob/b819a6aa6d53573980dd9ee4a1bfe597d69e88e5/app/services/projects/import_export/export_service.rb#L24).
1. Check the [`project/import_export.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/project/import_export.yml)
file for projects for your GitLab version. For example, <https://gitlab.com/gitlab-org/gitlab/-/blob/16-8-stable-ee/lib/gitlab/import_export/project/import_export.yml> for GitLab 16.8.
For a quick overview, items that are exported include:
- Project and wiki repositories
- Project uploads
- Project configuration, excluding integrations
- Issues
- Issue comments
- Issue iterations ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96184) in GitLab 15.4)
- Issue resource state events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Issue resource milestone events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Issue resource iteration events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Merge requests
- Merge request diffs
- Merge request comments
- Merge request resource state events ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4)
- Merge request multiple assignees ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Merge request reviewers ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Merge request approvers ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339520) in GitLab 15.3)
- Commit comments ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/391601) in GitLab 15.10)
- Labels
- Milestones
- Snippets
- Releases
- Time tracking and other project entities
- Design management files and data
- LFS objects
- Issue boards
- CI/CD pipelines
- Pipeline schedules (inactive and assigned to the user who initiated the import)
- Protected branches and tags
- Push rules
- Emoji reactions
- Direct project members
(if you have at least the Maintainer role for the exported project's group)
- Inherited project members as direct project members
(if you have the Owner role for the exported project's group or administrator access to the instance)
- Some merge request approval rules:
- [Approvals for protected branches](../merge_requests/approvals/rules.md#approvals-for-protected-branches)
- [Eligible approvers](../merge_requests/approvals/rules.md#eligible-approvers)
- Vulnerability report ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/501466) in GitLab 17.7)
#### Project items that are not exported
Items that are **not** exported include:
- [Child pipeline history](https://gitlab.com/gitlab-org/gitlab/-/issues/221088)
- Pipeline triggers
- Build traces and artifacts
- Package and container registry images
- CI/CD variables
- CI/CD job token allowlist
- Webhooks
- Any encrypted tokens
- [Number of required approvals](https://gitlab.com/gitlab-org/gitlab/-/issues/221087)
- Repository size limits
- Deploy keys allowed to push to protected branches
- Secure files
- [Activity logs for Git-related events](https://gitlab.com/gitlab-org/gitlab/-/issues/214700) (for example, pushing and creating tags)
- Security policies associated with your project
- Links between issues and linked items
- Links to related merge requests
- Pipeline schedule variables
### Import a project and its data
You can import a project and its data. The amount of data you can import depends on the maximum import file size:
- On GitLab Self-Managed, administrators can
[set maximum import file size](#set-maximum-import-file-size).
- On GitLab.com, the value is [set to 5 GB](../../gitlab_com/_index.md#account-and-limit-settings).
{{< alert type="warning" >}}
Only import projects from sources you trust. If you import a project from an untrusted source, it
may be possible for an attacker to steal your sensitive data.
{{< /alert >}}
#### Prerequisites
{{< history >}}
- Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
{{< /history >}}
- You must have [exported the project and its data](#export-a-project-and-its-data).
- Compare GitLab versions and ensure you are importing to a GitLab version that is the same or later
than the GitLab version you exported from.
- Review [compatibility](#compatibility) for any issues.
- At least the Maintainer role on the destination group to migrate to.
#### Import a project
To import a project:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New project/repository**.
1. Select **Import project**.
1. In **Import project from**, select **GitLab export**.
1. Enter your project name and URL. Then select the file you exported previously.
1. Select **Import project**.
You can query the status of an import by using the [API](../../../api/project_import_export.md#import-status).
The query might return an import error or exceptions.
#### Changes to imported items
Exported items are imported with the following changes:
- Project members with the Owner role are imported with the Maintainer role.
- If an imported project contains merge requests originating from forks, new branches associated with these merge
requests are created in the project. Therefore, the number of branches in the new project can be more than in the
source project.
- If the `Internal` visibility level [is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects),
all imported projects are given `Private` visibility.
Deploy keys aren't imported. To use deploy keys, you must enable them in your imported project and update protected branches.
#### Import large projects
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have a larger project, consider [using a Rake task](../../../administration/raketasks/project_import_export.md#import-large-projects).
### Set maximum import file size
{{< details >}}
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
Administrators can set the maximum import file size one of two ways:
- With the `max_import_size` option in the [Application settings API](../../../api/settings.md#update-application-settings).
- In the [**Admin** area UI](../../../administration/settings/import_and_export_settings.md#max-import-size).
The default is `0` (unlimited).
### Rate limits
To help avoid abuse, by default, users are rate limited to:
| Request type | Limit |
|:----------------|:--------------------------------|
| Export | 6 projects per minute |
| Download export | 1 download per project per minute |
| Import | 6 projects per minute |
## Migrate groups by uploading an export file (deprecated)
{{< history >}}
- [Deprecated](https://gitlab.com/groups/gitlab-org/-/epics/4619) in GitLab 14.6.
{{< /history >}}
{{< alert type="warning" >}}
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/-/epics/4619) in GitLab 14.6 and replaced by
[migrating groups by direct transfer](../../group/import/_index.md). However, this feature is still recommended for migrating groups between
offline systems. To follow progress on an alternative solution for [offline environments](../../application_security/offline_deployments/_index.md), see
[the relevant epic](https://gitlab.com/groups/gitlab-org/-/epics/8985).
{{< /alert >}}
Prerequisites:
- Owner role on the group to migrate.
Using file exports, you can:
- Export any group to a file and upload that file to another GitLab instance or to another location on the same instance.
- Use either the GitLab UI or the [API](../../../api/group_import_export.md).
- Migrate groups one by one, then export and import each project for the groups one by one.
GitLab maps user contributions correctly when an admin access token is used to perform the import. GitLab does not map
user contributions correctly when you are importing from a GitLab Self-Managed instance to GitLab.com. Correct mapping of user
contributions when importing from a GitLab Self-Managed instance to GitLab.com can be preserved with paid involvement of
Professional Services team.
### Additional information
- Exports are stored in a temporary directory and are deleted every 24 hours by a specific worker.
- To preserve group-level relationships from imported projects, export and import groups first so that projects can
be imported into the desired group structure.
- Imported groups are given a `private` visibility level, unless imported into a parent group.
- If imported into a parent group, a subgroup inherits the same level of visibility unless otherwise restricted.
- You can export groups from the [Community Edition to the Enterprise Edition](https://about.gitlab.com/install/ce-or-ee/)
and vice versa. The Enterprise Edition retains some group data that isn't part of the Community Edition. If you're
exporting a group from the Enterprise Edition to the Community Edition, you may lose this data. For more information,
see [downgrading from EE to CE](../../../downgrade_ee_to_ce/_index.md).
The maximum import file size depends on whether you import to GitLab Self-Managed or GitLab.com:
- If importing to a GitLab Self-Managed instance, you can import a import file of any size. Administrators can change
this behavior using either:
- The `max_import_size` option in the [Application settings API](../../../api/settings.md#update-application-settings).
- The [**Admin** area](../../../administration/settings/account_and_limit_settings.md).
- On GitLab.com, you can import groups using import files of no more than
[5 GB](../../gitlab_com/_index.md#account-and-limit-settings) in size.
### Compatibility
{{< history >}}
- Support for JSON-formatted project file exports [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/383682) in GitLab 15.8.
{{< /history >}}
Group file exports are in NDJSON format.
You can import group file exports that were exported from a version of GitLab up to two
[minor](../../../policy/maintenance.md#versioning) versions behind.
For example:
| Destination version | Compatible source versions |
|:--------------------|:---------------------------|
| 13.0 | 13.0, 12.10, 12.9 |
| 13.1 | 13.1, 13.0, 12.10 |
### Group items that are exported
The [`import_export.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/group/import_export.yml)
file for groups lists items exported and imported when migrating groups using file exports. View this file in the branch
for your version of GitLab to check which items can be imported to the destination GitLab instance. For example,
[`import_export.yml` on the `16-8-stable-ee` branch](https://gitlab.com/gitlab-org/gitlab/-/blob/16-8-stable-ee/lib/gitlab/import_export/group/import_export.yml).
Group items that are exported include:
- Milestones
- Group Labels (without associated label priorities)
- Boards and Board Lists
- Badges
- Subgroups (including all the aforementioned data)
- Epics
- Epic resource state events. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/291983) in GitLab 15.4.
- Events
- [Wikis](../wiki/group.md)
- Iterations cadences. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95372) in GitLab 15.4.
### Group items that are not exported
Items that are **not** exported include:
- Projects
- Runner tokens
- SAML discovery tokens
- Uploads
### Preparation
- To preserve the member list and their respective permissions on imported groups, review the users in these groups. Make
sure these users exist before importing the desired groups.
- Users must set a public email in the source GitLab instance that matches their confirmed primary email in the
destination GitLab instance. Most users receive an email asking them to confirm their email address.
### Export a group
Prerequisites:
- You must have the Owner role for the group.
To export the contents of a group:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. In the **Advanced** section, select **Export group**.
1. After the export is generated, you can:
- Follow a link contained in an email that you should receive.
- Refresh the group settings page and in the **Export project** area, select **Download export**.
### Import the group
To import the group:
1. On the left sidebar, at the top, select **Create new** ({{< icon name="plus" >}}) and **New group**.
1. Select **Import group**.
1. In the **Import group from file** section, enter a group name and accept or modify the associated group URL.
1. Select **Choose file**.
1. Select the GitLab export file you want to import.
1. To begin importing, select **Import**.
### Rate limits
To help avoid abuse, by default, users are rate limited to:
| Request Type | Limit |
|-----------------|-------|
| Export | 6 groups per minute |
| Download export | 1 download per group per minute |
| Import | 6 groups per minute |
## Related topics
- [Project import and export API](../../../api/project_import_export.md)
- [Project import and export administration Rake tasks](../../../administration/raketasks/project_import_export.md)
- [Migrating GitLab groups](../../group/import/_index.md)
- [Group import and export API](../../../api/group_import_export.md)
- [Migrate groups by direct transfer](../../group/import/_index.md).
|
https://docs.gitlab.com/user/project/migrate_projects
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/migrate_projects.md
|
2025-08-13
|
doc/user/project/settings
|
[
"doc",
"user",
"project",
"settings"
] |
migrate_projects.md
| null | null | null | null | null |
<!-- markdownlint-disable -->
This document was moved to [another location](../working_with_projects.md).
<!-- This redirect file can be deleted after <2025-10-01>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
---
redirect_to: ../working_with_projects.md
remove_date: '2025-10-01'
breadcrumbs:
- doc
- user
- project
- settings
---
<!-- markdownlint-disable -->
This document was moved to [another location](../working_with_projects.md).
<!-- This redirect file can be deleted after <2025-10-01>. -->
<!-- Redirects that point to other docs in the same project expire in three months. -->
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
<!-- Before deletion, see: https://docs.gitlab.com/development/documentation/redirects -->
|
https://docs.gitlab.com/user/project/project_access_tokens
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/project_access_tokens.md
|
2025-08-13
|
doc/user/project/settings
|
[
"doc",
"user",
"project",
"settings"
] |
project_access_tokens.md
|
Software Supply Chain Security
|
Authentication
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Project access tokens
|
Authentication, create, revoke, and token expiration.
|
{{< details >}}
Tier: Premium, Ultimate
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386041) for trial subscriptions in GitLab 16.1.
{{< /history >}}
Project access tokens are similar to passwords, except you can [limit access to resources](#scopes-for-a-project-access-token),
select a limited role, and provide an expiry date.
{{< alert type="note" >}}
Actual access to a project is controlled by a combination of [roles and permissions](../../permissions.md), and the [token scopes](#scopes-for-a-project-access-token).
{{< /alert >}}
Use a project access token to authenticate:
- With the [GitLab API](../../../api/rest/authentication.md#personalprojectgroup-access-tokens).
- With Git, when using HTTP Basic Authentication, use:
- Any non-blank value as a username.
- The project access token as the password.
{{< alert type="note" >}}
On GitLab SaaS, you can use project access tokens with a Premium or Ultimate subscription. With a
[trial license](https://about.gitlab.com/free-trial/) you can also create one project access token.
On GitLab Self-Managed instances, you can use project access tokens with any subscription. If
you have the Free tier, you can [restrict the creation of project access tokens](#restrict-the-creation-of-project-access-tokens) to limit potential abuse.
{{< /alert >}}
Project access tokens are similar to [group access tokens](../../group/settings/group_access_tokens.md)
and [personal access tokens](../../profile/personal_access_tokens.md), but are scoped only to the associated project.
You cannot use project access tokens to access resources that belong to other projects.
On GitLab Self-Managed instances, project access tokens are subject to the same [maximum lifetime limits](../../../administration/settings/account_and_limit_settings.md#limit-the-lifetime-of-access-tokens) as personal access tokens if the limit is set.
You cannot use project access tokens to create other group, project, or personal access tokens.
Project access tokens inherit the [default prefix setting](../../../administration/settings/account_and_limit_settings.md#personal-access-token-prefix)
configured for personal access tokens.
## Create a project access token
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89114) in GitLab 15.1, Owners can select Owner role for project access tokens.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/348660) in GitLab 15.3, default expiration of 30 days and default role of Guest is populated in the UI.
- Ability to create non-expiring project access tokens [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/392855) in GitLab 16.0.
- Maximum allowable lifetime limit [extended to 400 days](https://gitlab.com/gitlab-org/gitlab/-/issues/461901) in GitLab 17.6 [with a flag](../../../administration/feature_flags/_index.md) named `buffered_token_expiration_limit`. Disabled by default.
- Project access token description [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443819) in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of the extended maximum allowable lifetime limit is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
{{< alert type="warning" >}}
The ability to create project access tokens without an expiry date was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/369122) in GitLab 15.4 and [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/392855) in GitLab 16.0. For more information on expiry dates added to existing tokens, see the documentation on [access token expiration](#access-token-expiration).
{{< /alert >}}
To create a project access token:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Access tokens**.
1. Select **Add new token**.
1. In **Token name**, enter a name. The token name is visible to any user with permissions to view the project.
1. Optional. In **Token description**, enter a description for the token.
1. In **Expiration date**, enter an expiry date for the token.
- The token expires on that date at midnight UTC. A token with the expiration date of 2024-01-01 expires at 00:00:00 UTC on 2024-01-01.
- If you do not enter an expiry date, the expiry date is automatically set to 30 days later than the current date.
- By default, this date can be a maximum of 365 days later than the current date. In GitLab 17.6 or later, you can [extend this limit to 400 days](https://gitlab.com/gitlab-org/gitlab/-/issues/461901).
- An instance-wide [maximum lifetime](../../../administration/settings/account_and_limit_settings.md#limit-the-lifetime-of-access-tokens) setting can limit the maximum allowable lifetime in GitLab Self-Managed instances.
1. Select a role for the token.
1. Select the [desired scopes](#scopes-for-a-project-access-token).
1. Select **Create project access token**.
A project access token is displayed. Save the project access token somewhere safe. After you leave or refresh the page, you can't view it again.
{{< alert type="warning" >}}
Project access tokens are treated as [internal users](../../../administration/internal_users.md).
If an internal user creates a project access token, that token is able to access
all projects that have visibility level set to [Internal](../../public_access.md).
{{< /alert >}}
## Revoke or rotate a project access token
{{< history >}}
- Ability to view expired and revoked tokens [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.3 [with a flag](../../../administration/feature_flags/_index.md) named `retain_resource_access_token_user_after_revoke`. Disabled by default.
- Ability to view expired and revoked tokens until they are automatically deleted and [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/471683) in GitLab 17.9. Feature flag `retain_resource_access_token_user_after_revoke` removed.
{{< /history >}}
In GitLab 17.9 and later, you can view both active and inactive project
access tokens on the access tokens page.
The inactive project access tokens table displays revoked and expired tokens until they are [automatically deleted](#inactive-token-retention).
To revoke or rotate a project access token:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Access tokens**.
1. For the relevant token, select **Revoke** ({{< icon name="remove" >}}) or **Rotate** ({{< icon name="retry" >}}).
1. On the confirmation dialog, select **Revoke** or **Rotate**.
## Scopes for a project access token
{{< history >}}
- `k8s_proxy` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422408) in GitLab 16.4 [with a flag](../../../administration/feature_flags/_index.md) named `k8s_proxy_pat`. Enabled by default.
- Feature flag `k8s_proxy_pat` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131518) in GitLab 16.5.
- `self_rotate` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178111) in GitLab 17.9. Enabled by default.
{{< /history >}}
The scope determines the actions you can perform when you authenticate with a project access token.
{{< alert type="note" >}}
See the warning in [create a project access token](#create-a-project-access-token) regarding internal projects.
{{< /alert >}}
| Scope | Description |
|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `api` | Grants complete read and write access to the scoped project API, including the [container registry](../../packages/container_registry/_index.md), the [dependency proxy](../../packages/dependency_proxy/_index.md), and the [package registry](../../packages/package_registry/_index.md). |
| `read_api` | Grants read access to the scoped project API, including the [package registry](../../packages/package_registry/_index.md). |
| `read_registry` | Grants read access (pull) to the [container registry](../../packages/container_registry/_index.md) images if a project is private and authorization is required. |
| `write_registry` | Grants write access (push) to the [container registry](../../packages/container_registry/_index.md). You need both read and write access to push images. |
| `read_repository` | Grants read access (pull) to the repository. |
| `write_repository` | Grants read and write access (pull and push) to the repository. |
| `create_runner` | Grants permission to create runners in the project. |
| `manage_runner` | Grants permission to manage runners in the project. |
| `ai_features` | Grants permission to perform API actions for GitLab Duo. This scope is designed to work with the GitLab Duo Plugin for JetBrains. For all other extensions, see scope requirements. |
| `k8s_proxy` | Grants permission to perform Kubernetes API calls using the agent for Kubernetes in the project. |
| `self_rotate` | Grants permission to rotate this token using the [personal access token API](../../../api/personal_access_tokens.md#rotate-a-personal-access-token). Does not allow rotation of other tokens. |
## Restrict the creation of project access tokens
To limit potential abuse, you can restrict users from creating tokens for a group hierarchy. This setting is only configurable for a top-level group and applies to every downstream project and subgroup. Any existing project access tokens remain valid until their expiration date or until manually revoked.
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. In **Permissions**, clear the **Users can create project access tokens and group access tokens in this group** checkbox.
## Access token expiration
Whether your existing project access tokens have expiry dates automatically applied
depends on what GitLab offering you have, and when you upgraded to GitLab 16.0 or later:
- On GitLab.com, during the 16.0 milestone, existing project access tokens without
an expiry date were automatically given an expiry date of 365 days later than the current date.
- On GitLab Self-Managed, if you upgraded from GitLab 15.11 or earlier to GitLab 16.0 or later:
- On or before July 23, 2024, existing project access tokens without an expiry
date were automatically given an expiry date of 365 days later than the current date.
This change is a breaking change.
- On or after July 24, 2024, existing project access tokens without an expiry
date did not have an expiry date set.
On GitLab Self-Managed, if you do a new install of one of the following GitLab
versions, your existing project access tokens do not have expiry dates
automatically applied:
- 16.0.9
- 16.1.7
- 16.2.10
- 16.3.8
- 16.4.6
- 16.5.9
- 16.6.9
- 16.7.9
- 16.8.9
- 16.9.10
- 16.10.9
- 16.11.7
- 17.0.5
- 17.1.3
- 17.2.1
### Project access token expiry emails
{{< history >}}
- 60 and 30 day expiry notifications [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464040) in GitLab 17.6 [with a flag](../../../administration/feature_flags/_index.md) named `expiring_pats_30d_60d_notifications`. Disabled by default.
- 60 and 30 day notifications [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173792) in GitLab 17.7. Feature flag `expiring_pats_30d_60d_notifications` removed.
- Notifications to inherited group members [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/463016) in GitLab 17.7 [with a flag](../../../administration/feature_flags/_index.md) named `pat_expiry_inherited_members_notification`. Disabled by default.
- Feature flag `pat_expiry_inherited_members_notification` [enabled by default in GitLab 17.10](https://gitlab.com/gitlab-org/gitlab/-/issues/393772).
- Feature flag `pat_expiry_inherited_members_notification` removed in GitLab `17.11`
{{< /history >}}
GitLab runs a check every day at 1:00 AM UTC to identify project access tokens that are expiring in the near future. Members of the project with at least the Maintainer role are notified by email when these tokens expire in a certain number of days. The number of days differs depending on the version of GitLab:
- In GitLab 17.6 and later, project maintainers and owners are notified by email when the check identifies their project access tokens as expiring in the next 60 days. An additional email is sent when the check identifies their project access tokens as expiring in the next 30 days.
- Project maintainers and owners are notified by email when the check identifies their project access tokens as expiring in the next seven days.
- In GitLab 17.7 and later, project members who have inherited the Owner or Maintainer role due to the project belonging to a group can also receive notification emails. You can enable this by changing:
- The [group setting](../../group/manage.md#expiry-emails-for-group-and-project-access-tokens) in any of the parent groups of the project.
- On GitLab Self-Managed, the [instance setting](../../../administration/settings/email.md#group-and-project-access-token-expiry-emails-to-inherited-members).
Your expired access tokens are listed in the [inactive project access tokens table](#revoke-or-rotate-a-project-access-token) until they are [automatically deleted](#inactive-token-retention).
## Bot users for projects
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.2 [with a flag](../../../administration/feature_flags/_index.md) named `retain_resource_access_token_user_after_revoke`. Disabled by default. When enabled new bot users are made members with no expiry date and, when the token is later revoked or expires, the bot user is retained for 30 days.
- Inactive bot users retention is [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.9. Feature flag `retain_resource_access_token_user_after_revoke` removed.
{{< /history >}}
Bot users for projects are [GitLab-created non-billable users](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users).
Each time you create a project access token, a bot user is created and added to the project.
This user is not a billable user, so it does not count toward the license limit.
The bot users for projects have [permissions](../../permissions.md#project-members-permissions) that correspond with the
selected role and [scope](#scopes-for-a-project-access-token) of the project access token.
- The name is set to the name of the token.
- The username is set to `project_{project_id}_bot_{random_string}`. For example, `project_123_bot_4ffca233d8298ea1`.
- The email is set to `project_{project_id}_bot_{random_string}@noreply.{Gitlab.config.gitlab.host}`. For example, `project_123_bot_4ffca233d8298ea1@noreply.example.com`.
API calls made with a project access token are associated with the corresponding bot user.
Bot users for projects:
- Are included in a project's member list but cannot be modified.
- Cannot be added to any other project.
- Can have a maximum role of Owner for a project. For more information, see
[Create a project access token](../../../api/project_access_tokens.md#create-a-project-access-token).
When the project access token is [revoked](#revoke-or-rotate-a-project-access-token):
- The bot user is retained as per [inactive token retention setting](#inactive-token-retention).
- After 30 days the bot user is deleted. All records are moved to a system-wide user with the username [Ghost User](../../profile/account/delete_account.md#associated-records).
See also [Bot users for groups](../../group/settings/group_access_tokens.md#bot-users-for-groups).
## Inactive token retention
By default, GitLab deletes group and project access tokens and their [token family](../../../api/personal_access_tokens.md#automatic-reuse-detection) 30 days after the last active token from the token family becomes inactive. This removes all tokens in the token family and the associated bot user and migrates the bot user contributions to a system-wide "Ghost User".
To modify the retention period for inactive tokens:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings** > **General**.
1. Expand **Account and limit**.
1. In the **Inactive project and group access token retention period** text box, modify the retention period.
- If a number is defined, all group and project access tokens are deleted after they are inactive for the specified number of days.
- If the field is blank, inactive tokens are never deleted.
1. Select **Save changes**.
You can also use the [application settings API](../../../api/settings.md) to modify the `inactive_resource_access_tokens_delete_after_days` attribute.
## Token availability
More than one project access token is only available in paid subscriptions. In Premium and Ultimate trial subscriptions, only one project access token is included. For more information, see the ["What is included" section of the GitLab Trial FAQ](https://about.gitlab.com/free-trial/#what-is-included-in-my-free-trial-what-is-excluded).
## Related topics
- [Project access tokens API](../../../api/project_access_tokens.md)
|
---
stage: Software Supply Chain Security
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Project access tokens
description: Authentication, create, revoke, and token expiration.
breadcrumbs:
- doc
- user
- project
- settings
---
{{< details >}}
Tier: Premium, Ultimate
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/386041) for trial subscriptions in GitLab 16.1.
{{< /history >}}
Project access tokens are similar to passwords, except you can [limit access to resources](#scopes-for-a-project-access-token),
select a limited role, and provide an expiry date.
{{< alert type="note" >}}
Actual access to a project is controlled by a combination of [roles and permissions](../../permissions.md), and the [token scopes](#scopes-for-a-project-access-token).
{{< /alert >}}
Use a project access token to authenticate:
- With the [GitLab API](../../../api/rest/authentication.md#personalprojectgroup-access-tokens).
- With Git, when using HTTP Basic Authentication, use:
- Any non-blank value as a username.
- The project access token as the password.
{{< alert type="note" >}}
On GitLab SaaS, you can use project access tokens with a Premium or Ultimate subscription. With a
[trial license](https://about.gitlab.com/free-trial/) you can also create one project access token.
On GitLab Self-Managed instances, you can use project access tokens with any subscription. If
you have the Free tier, you can [restrict the creation of project access tokens](#restrict-the-creation-of-project-access-tokens) to limit potential abuse.
{{< /alert >}}
Project access tokens are similar to [group access tokens](../../group/settings/group_access_tokens.md)
and [personal access tokens](../../profile/personal_access_tokens.md), but are scoped only to the associated project.
You cannot use project access tokens to access resources that belong to other projects.
On GitLab Self-Managed instances, project access tokens are subject to the same [maximum lifetime limits](../../../administration/settings/account_and_limit_settings.md#limit-the-lifetime-of-access-tokens) as personal access tokens if the limit is set.
You cannot use project access tokens to create other group, project, or personal access tokens.
Project access tokens inherit the [default prefix setting](../../../administration/settings/account_and_limit_settings.md#personal-access-token-prefix)
configured for personal access tokens.
## Create a project access token
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89114) in GitLab 15.1, Owners can select Owner role for project access tokens.
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/348660) in GitLab 15.3, default expiration of 30 days and default role of Guest is populated in the UI.
- Ability to create non-expiring project access tokens [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/392855) in GitLab 16.0.
- Maximum allowable lifetime limit [extended to 400 days](https://gitlab.com/gitlab-org/gitlab/-/issues/461901) in GitLab 17.6 [with a flag](../../../administration/feature_flags/_index.md) named `buffered_token_expiration_limit`. Disabled by default.
- Project access token description [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/443819) in GitLab 17.7.
{{< /history >}}
{{< alert type="flag" >}}
The availability of the extended maximum allowable lifetime limit is controlled by a feature flag.
For more information, see the history.
{{< /alert >}}
{{< alert type="warning" >}}
The ability to create project access tokens without an expiry date was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/369122) in GitLab 15.4 and [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/392855) in GitLab 16.0. For more information on expiry dates added to existing tokens, see the documentation on [access token expiration](#access-token-expiration).
{{< /alert >}}
To create a project access token:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Access tokens**.
1. Select **Add new token**.
1. In **Token name**, enter a name. The token name is visible to any user with permissions to view the project.
1. Optional. In **Token description**, enter a description for the token.
1. In **Expiration date**, enter an expiry date for the token.
- The token expires on that date at midnight UTC. A token with the expiration date of 2024-01-01 expires at 00:00:00 UTC on 2024-01-01.
- If you do not enter an expiry date, the expiry date is automatically set to 30 days later than the current date.
- By default, this date can be a maximum of 365 days later than the current date. In GitLab 17.6 or later, you can [extend this limit to 400 days](https://gitlab.com/gitlab-org/gitlab/-/issues/461901).
- An instance-wide [maximum lifetime](../../../administration/settings/account_and_limit_settings.md#limit-the-lifetime-of-access-tokens) setting can limit the maximum allowable lifetime in GitLab Self-Managed instances.
1. Select a role for the token.
1. Select the [desired scopes](#scopes-for-a-project-access-token).
1. Select **Create project access token**.
A project access token is displayed. Save the project access token somewhere safe. After you leave or refresh the page, you can't view it again.
{{< alert type="warning" >}}
Project access tokens are treated as [internal users](../../../administration/internal_users.md).
If an internal user creates a project access token, that token is able to access
all projects that have visibility level set to [Internal](../../public_access.md).
{{< /alert >}}
## Revoke or rotate a project access token
{{< history >}}
- Ability to view expired and revoked tokens [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.3 [with a flag](../../../administration/feature_flags/_index.md) named `retain_resource_access_token_user_after_revoke`. Disabled by default.
- Ability to view expired and revoked tokens until they are automatically deleted and [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/471683) in GitLab 17.9. Feature flag `retain_resource_access_token_user_after_revoke` removed.
{{< /history >}}
In GitLab 17.9 and later, you can view both active and inactive project
access tokens on the access tokens page.
The inactive project access tokens table displays revoked and expired tokens until they are [automatically deleted](#inactive-token-retention).
To revoke or rotate a project access token:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > Access tokens**.
1. For the relevant token, select **Revoke** ({{< icon name="remove" >}}) or **Rotate** ({{< icon name="retry" >}}).
1. On the confirmation dialog, select **Revoke** or **Rotate**.
## Scopes for a project access token
{{< history >}}
- `k8s_proxy` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422408) in GitLab 16.4 [with a flag](../../../administration/feature_flags/_index.md) named `k8s_proxy_pat`. Enabled by default.
- Feature flag `k8s_proxy_pat` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131518) in GitLab 16.5.
- `self_rotate` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178111) in GitLab 17.9. Enabled by default.
{{< /history >}}
The scope determines the actions you can perform when you authenticate with a project access token.
{{< alert type="note" >}}
See the warning in [create a project access token](#create-a-project-access-token) regarding internal projects.
{{< /alert >}}
| Scope | Description |
|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `api` | Grants complete read and write access to the scoped project API, including the [container registry](../../packages/container_registry/_index.md), the [dependency proxy](../../packages/dependency_proxy/_index.md), and the [package registry](../../packages/package_registry/_index.md). |
| `read_api` | Grants read access to the scoped project API, including the [package registry](../../packages/package_registry/_index.md). |
| `read_registry` | Grants read access (pull) to the [container registry](../../packages/container_registry/_index.md) images if a project is private and authorization is required. |
| `write_registry` | Grants write access (push) to the [container registry](../../packages/container_registry/_index.md). You need both read and write access to push images. |
| `read_repository` | Grants read access (pull) to the repository. |
| `write_repository` | Grants read and write access (pull and push) to the repository. |
| `create_runner` | Grants permission to create runners in the project. |
| `manage_runner` | Grants permission to manage runners in the project. |
| `ai_features` | Grants permission to perform API actions for GitLab Duo. This scope is designed to work with the GitLab Duo Plugin for JetBrains. For all other extensions, see scope requirements. |
| `k8s_proxy` | Grants permission to perform Kubernetes API calls using the agent for Kubernetes in the project. |
| `self_rotate` | Grants permission to rotate this token using the [personal access token API](../../../api/personal_access_tokens.md#rotate-a-personal-access-token). Does not allow rotation of other tokens. |
## Restrict the creation of project access tokens
To limit potential abuse, you can restrict users from creating tokens for a group hierarchy. This setting is only configurable for a top-level group and applies to every downstream project and subgroup. Any existing project access tokens remain valid until their expiration date or until manually revoked.
1. On the left sidebar, select **Search or go to** and find your group.
This group must be at the top level.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. In **Permissions**, clear the **Users can create project access tokens and group access tokens in this group** checkbox.
## Access token expiration
Whether your existing project access tokens have expiry dates automatically applied
depends on what GitLab offering you have, and when you upgraded to GitLab 16.0 or later:
- On GitLab.com, during the 16.0 milestone, existing project access tokens without
an expiry date were automatically given an expiry date of 365 days later than the current date.
- On GitLab Self-Managed, if you upgraded from GitLab 15.11 or earlier to GitLab 16.0 or later:
- On or before July 23, 2024, existing project access tokens without an expiry
date were automatically given an expiry date of 365 days later than the current date.
This change is a breaking change.
- On or after July 24, 2024, existing project access tokens without an expiry
date did not have an expiry date set.
On GitLab Self-Managed, if you do a new install of one of the following GitLab
versions, your existing project access tokens do not have expiry dates
automatically applied:
- 16.0.9
- 16.1.7
- 16.2.10
- 16.3.8
- 16.4.6
- 16.5.9
- 16.6.9
- 16.7.9
- 16.8.9
- 16.9.10
- 16.10.9
- 16.11.7
- 17.0.5
- 17.1.3
- 17.2.1
### Project access token expiry emails
{{< history >}}
- 60 and 30 day expiry notifications [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/464040) in GitLab 17.6 [with a flag](../../../administration/feature_flags/_index.md) named `expiring_pats_30d_60d_notifications`. Disabled by default.
- 60 and 30 day notifications [generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173792) in GitLab 17.7. Feature flag `expiring_pats_30d_60d_notifications` removed.
- Notifications to inherited group members [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/463016) in GitLab 17.7 [with a flag](../../../administration/feature_flags/_index.md) named `pat_expiry_inherited_members_notification`. Disabled by default.
- Feature flag `pat_expiry_inherited_members_notification` [enabled by default in GitLab 17.10](https://gitlab.com/gitlab-org/gitlab/-/issues/393772).
- Feature flag `pat_expiry_inherited_members_notification` removed in GitLab `17.11`
{{< /history >}}
GitLab runs a check every day at 1:00 AM UTC to identify project access tokens that are expiring in the near future. Members of the project with at least the Maintainer role are notified by email when these tokens expire in a certain number of days. The number of days differs depending on the version of GitLab:
- In GitLab 17.6 and later, project maintainers and owners are notified by email when the check identifies their project access tokens as expiring in the next 60 days. An additional email is sent when the check identifies their project access tokens as expiring in the next 30 days.
- Project maintainers and owners are notified by email when the check identifies their project access tokens as expiring in the next seven days.
- In GitLab 17.7 and later, project members who have inherited the Owner or Maintainer role due to the project belonging to a group can also receive notification emails. You can enable this by changing:
- The [group setting](../../group/manage.md#expiry-emails-for-group-and-project-access-tokens) in any of the parent groups of the project.
- On GitLab Self-Managed, the [instance setting](../../../administration/settings/email.md#group-and-project-access-token-expiry-emails-to-inherited-members).
Your expired access tokens are listed in the [inactive project access tokens table](#revoke-or-rotate-a-project-access-token) until they are [automatically deleted](#inactive-token-retention).
## Bot users for projects
{{< history >}}
- [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.2 [with a flag](../../../administration/feature_flags/_index.md) named `retain_resource_access_token_user_after_revoke`. Disabled by default. When enabled new bot users are made members with no expiry date and, when the token is later revoked or expires, the bot user is retained for 30 days.
- Inactive bot users retention is [generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/462217) in GitLab 17.9. Feature flag `retain_resource_access_token_user_after_revoke` removed.
{{< /history >}}
Bot users for projects are [GitLab-created non-billable users](../../../subscriptions/manage_users_and_seats.md#criteria-for-non-billable-users).
Each time you create a project access token, a bot user is created and added to the project.
This user is not a billable user, so it does not count toward the license limit.
The bot users for projects have [permissions](../../permissions.md#project-members-permissions) that correspond with the
selected role and [scope](#scopes-for-a-project-access-token) of the project access token.
- The name is set to the name of the token.
- The username is set to `project_{project_id}_bot_{random_string}`. For example, `project_123_bot_4ffca233d8298ea1`.
- The email is set to `project_{project_id}_bot_{random_string}@noreply.{Gitlab.config.gitlab.host}`. For example, `project_123_bot_4ffca233d8298ea1@noreply.example.com`.
API calls made with a project access token are associated with the corresponding bot user.
Bot users for projects:
- Are included in a project's member list but cannot be modified.
- Cannot be added to any other project.
- Can have a maximum role of Owner for a project. For more information, see
[Create a project access token](../../../api/project_access_tokens.md#create-a-project-access-token).
When the project access token is [revoked](#revoke-or-rotate-a-project-access-token):
- The bot user is retained as per [inactive token retention setting](#inactive-token-retention).
- After 30 days the bot user is deleted. All records are moved to a system-wide user with the username [Ghost User](../../profile/account/delete_account.md#associated-records).
See also [Bot users for groups](../../group/settings/group_access_tokens.md#bot-users-for-groups).
## Inactive token retention
By default, GitLab deletes group and project access tokens and their [token family](../../../api/personal_access_tokens.md#automatic-reuse-detection) 30 days after the last active token from the token family becomes inactive. This removes all tokens in the token family and the associated bot user and migrates the bot user contributions to a system-wide "Ghost User".
To modify the retention period for inactive tokens:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Settings** > **General**.
1. Expand **Account and limit**.
1. In the **Inactive project and group access token retention period** text box, modify the retention period.
- If a number is defined, all group and project access tokens are deleted after they are inactive for the specified number of days.
- If the field is blank, inactive tokens are never deleted.
1. Select **Save changes**.
You can also use the [application settings API](../../../api/settings.md) to modify the `inactive_resource_access_tokens_delete_after_days` attribute.
## Token availability
More than one project access token is only available in paid subscriptions. In Premium and Ultimate trial subscriptions, only one project access token is included. For more information, see the ["What is included" section of the GitLab Trial FAQ](https://about.gitlab.com/free-trial/#what-is-included-in-my-free-trial-what-is-excluded).
## Related topics
- [Project access tokens API](../../../api/project_access_tokens.md)
|
https://docs.gitlab.com/user/project/import_export_troubleshooting
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/import_export_troubleshooting.md
|
2025-08-13
|
doc/user/project/settings
|
[
"doc",
"user",
"project",
"settings"
] |
import_export_troubleshooting.md
|
Create
|
Import
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Troubleshooting file export project migrations
|
Troubleshooting file export project migrations. Covers common errors, performance issues, and solutions.
|
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have problems with [migrating projects by using file exports](import_export.md), see the possible solutions below.
## Troubleshooting commands
Finds information about the status of the import and further logs using the JID,
using the [Rails console](../../../administration/operations/rails_console.md):
```ruby
Project.find_by_full_path('group/project').import_state.slice(:jid, :status, :last_error)
> {"jid"=>"414dec93f941a593ea1a6894", "status"=>"finished", "last_error"=>nil}
```
```shell
# Logs
grep JID /var/log/gitlab/sidekiq/current
grep "Import/Export error" /var/log/gitlab/sidekiq/current
grep "Import/Export backtrace" /var/log/gitlab/sidekiq/current
tail /var/log/gitlab/gitlab-rails/importer.log
```
## Project fails to import due to mismatch
If the [instance runners enablement](../../../ci/runners/runners_scope.md#enable-instance-runners-for-a-project)
does not match between the exported project, and the project import, the project fails to import.
Review [issue 276930](https://gitlab.com/gitlab-org/gitlab/-/issues/276930), and either:
- Ensure instance runners are enabled in both the source and destination projects.
- Disable instance runners on the parent group when you import the project.
## Users missing from imported project
If users aren't imported with imported projects, see the [preserving user contributions](import_export.md#preserving-user-contributions) requirements.
A common reason for missing users is that the [public email setting](../../profile/_index.md#set-your-public-email) isn't configured for users.
To resolve this issue, ask users to configure this setting using the GitLab UI.
If there are too many users for manual configuration to be feasible,
you can set all user profiles to use a public email address using the
[Rails console](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
```ruby
User.where("public_email IS NULL OR public_email = '' ").find_each do |u|
next if u.bot?
puts "Setting #{u.username}'s currently empty public email to #{u.email}…"
u.public_email = u.email
u.save!
end
```
## Import workarounds for large repositories
[Maximum import size limitations](import_export.md#import-a-project-and-its-data)
can prevent an import from being successful. If changing the import limits is not possible, you can
try one of the workarounds listed here.
### Workaround option 1
The following local workflow can be used to temporarily
reduce the repository size for another import attempt:
1. Create a temporary working directory from the export:
```shell
EXPORT=<filename-without-extension>
mkdir "$EXPORT"
tar -xf "$EXPORT".tar.gz --directory="$EXPORT"/
cd "$EXPORT"/
git clone project.bundle
# Prevent interference with recreating an importable file later
mv project.bundle ../"$EXPORT"-original.bundle
mv ../"$EXPORT".tar.gz ../"$EXPORT"-original.tar.gz
git switch --create smaller-tmp-main
```
1. To reduce the repository size, work on this `smaller-tmp-main` branch:
[identify and remove large files](../repository/repository_size.md#methods-to-reduce-repository-size)
or [interactively rebase and fixup](../../../topics/git/git_rebase.md#interactive-rebase)
to reduce the number of commits.
```shell
# Reduce the .git/objects/pack/ file size
cd project
git reflog expire --expire=now --all
git gc --prune=now --aggressive
# Prepare recreating an importable file
git bundle create ../project.bundle <default-branch-name>
cd ..
mv project/ ../"$EXPORT"-project
cd ..
# Recreate an importable file
tar -czf "$EXPORT"-smaller.tar.gz --directory="$EXPORT"/ .
```
1. Import this new, smaller file into GitLab.
1. In a full clone of the original repository,
use `git remote set-url origin <new-url> && git push --force --all`
to complete the import.
1. Update the imported repository's
[branch protection rules](../repository/branches/protected.md) and
its [default branch](../repository/branches/default.md), and
delete the temporary, `smaller-tmp-main` branch, and
the local, temporary data.
### Workaround option 2
{{< alert type="note" >}}
This workaround does not account for LFS objects.
{{< /alert >}}
Rather than attempting to push all changes at once, this workaround:
- Separates the project import from the Git Repository import
- Incrementally pushes the repository to GitLab
1. Make a local clone of the repository to migrate. In a later step, you push this clone outside of
the project export.
1. Download the export and remove the `project.bundle` (which contains the Git repository):
```shell
tar -czvf new_export.tar.gz --exclude='project.bundle' @old_export.tar.gz
```
1. Import the export without a Git repository. It asks you to confirm to import without a
repository.
1. Save this bash script as a file and run it after adding the appropriate origin.
```shell
#!/bin/sh
# ASSUMPTIONS:
# - The GitLab location is "origin"
# - The default branch is "main"
# - This will attempt to push in chunks of 500 MB (dividing the total size by 500 MB).
# Decrease this size to push in smaller chunks if you still receive timeouts.
git gc
SIZE=$(git count-objects -v 2> /dev/null | grep size-pack | awk '{print $2}')
# Be conservative and try to push 2 GB at a time
# (given this assumes each commit is the same size - which is wrong)
BATCHES=$(($SIZE / 500000))
TOTAL_COMMITS=$(git rev-list --count HEAD)
if (( BATCHES > TOTAL_COMMITS )); then
BATCHES=$TOTAL_COMMITS
fi
INCREMENTS=$(( ($TOTAL_COMMITS / $BATCHES) - 1 ))
for (( BATCH=BATCHES; BATCH>=1; BATCH-- ))
do
COMMIT_NUM=$(( $BATCH - $INCREMENTS ))
COMMIT_SHA=$(git log -n $COMMIT_NUM --format=format:%H | tail -1)
git push -u origin ${COMMIT_SHA}:refs/heads/main
done
git push -u origin main
git push -u origin --all
git push -u origin --tags
```
## Sidekiq process fails to export a project
Occasionally the Sidekiq process can fail to export a project, for example if
it is terminated during execution.
GitLab.com users should [contact Support](https://about.gitlab.com/support/#contact-support) to resolve this issue.
GitLab Self-Managed administrators can use the Rails console to bypass the Sidekiq process and
manually trigger the project export:
```ruby
project = Project.find(1)
current_user = User.find_by(username: 'my-user-name')
RequestStore.begin!
ActiveRecord::Base.logger = Logger.new(STDOUT)
params = {}
::Projects::ImportExport::ExportService.new(project, current_user, params).execute(nil)
```
This makes the export available through the UI, but does not trigger an email to the user.
To manually trigger the project export and send an email:
```ruby
project = Project.find(1)
current_user = User.find_by(username: 'my-user-name')
RequestStore.begin!
ActiveRecord::Base.logger = Logger.new(STDOUT)
params = {}
ProjectExportWorker.new.perform(current_user.id, project.id)
```
## Manually execute export steps
You usually export a project through [the web interface](import_export.md#export-a-project-and-its-data) or through [the API](../../../api/project_import_export.md). Exporting using these
methods can sometimes fail without giving enough information to troubleshoot. In these cases,
[open a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session) and loop through
[all the defined exporters](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/projects/import_export/export_service.rb).
Execute each line individually, rather than pasting the entire block at once, so you can see any
errors each command returns.
```ruby
# User needs to have permission to export
u = User.find_by_username('someuser')
p = Project.find_by_full_path('some/project')
e = Projects::ImportExport::ExportService.new(p,u)
e.send(:version_saver).send(:save)
e.send(:repo_saver).send(:save)
e.send(:avatar_saver).send(:save)
e.send(:project_tree_saver).send(:save)
e.send(:uploads_saver).send(:save)
e.send(:wiki_repo_saver).send(:save)
e.send(:lfs_saver).send(:save)
e.send(:snippets_repo_saver).send(:save)
e.send(:design_repo_saver).send(:save)
## continue using `e.send(:exporter_name).send(:save)` going through the list of exporters
# The following line should show you the export_path similar to /var/opt/gitlab/gitlab-rails/shared/tmp/gitlab_exports/@hashed/49/94/4994....
s = Gitlab::ImportExport::Saver.new(exportable: p, shared: p.import_export_shared, user: u)
# Prior to GitLab 17.0, the `user` parameter was not supported. If you encounter an
# error with the above or are unsure whether or not to supply the `user`
# argument, use the following check:
Gitlab::ImportExport::Saver.instance_method(:initialize).parameters.include?([:keyreq, :user])
# If the preceding check returns false, omit the user argument:
s = Gitlab::ImportExport::Saver.new(exportable: p, shared: p.import_export_shared)
# To try and upload use:
s.send(:compress_and_save)
s.send(:save_upload)
```
After the project is successfully uploaded, the exported project is located in a `.tar.gz` file in `/var/opt/gitlab/gitlab-rails/uploads/-/system/import_export_upload/export_file/`.
## Import using the REST API fails when using a group access token
[Group access tokens](../../group/settings/group_access_tokens.md)
don't work for project or group import operations. When a group access token initiates an import,
the import fails with this message:
```plaintext
Error adding importer user to Project members.
Validation failed: User project bots cannot be added to other groups / projects
```
To use [Import REST API](../../../api/project_import_export.md),
pass regular user account credentials such as [personal access tokens](../../profile/personal_access_tokens.md).
## Error: `PG::QueryCanceled: ERROR: canceling statement due to statement timeout`
Some migrations can time out with the error: `PG::QueryCanceled: ERROR: canceling statement due to statement timeout`.
One way to avoid this problem is to have the migration batch size reduced. This makes a migration less likely to time
out, but makes migrations slower.
To have the batch sized reduced, you must have a feature flag enabled. For more information, see
[issue 456948](https://gitlab.com/gitlab-org/gitlab/-/issues/456948).
## Error: `command exited with error code 15 and Unable to save [FILTERED] into [FILTERED]`
You might get the following error in logs when you migrate projects by using file exports:
```plaintext
command exited with error code 15 and Unable to save [FILTERED] into [FILTERED]
```
This error occurs during export or import when Sidekiq receives a `SIGTERM`, often while executing the `tar` command.
In Kubernetes environments like GitLab.com and GitLab Dedicated, the operating system triggers `SIGTERM` signals
due to memory or disk shortage, code deployments, or instance upgrades.
To identify the root cause, an administrator should investigate why Kubernetes terminated the instance.
In non-Kubernetes environments, this error might occur if the instance is terminated while executing the `tar` command.
However, this error does not occur due to disk shortage, so memory shortage is the most likely cause.
If you get this error:
- When you export a file, GitLab retries the export until the maximum number of retries is reached and marks the export as failed.
- When you import a file, you must retry the import yourself. GitLab does not retry the import automatically.
## Troubleshooting performance issues
Read through the current performance problems using the Import/Export below.
### OOM errors
Out of memory (OOM) errors are usually caused by the [Sidekiq Memory Killer](../../../administration/sidekiq/sidekiq_memory_killer.md):
```shell
SIDEKIQ_MEMORY_KILLER_MAX_RSS = 2000000
SIDEKIQ_MEMORY_KILLER_HARD_LIMIT_RSS = 3000000
SIDEKIQ_MEMORY_KILLER_GRACE_TIME = 900
```
An import status `started`, and the following Sidekiq logs signal a memory issue:
```shell
WARN: Work still in progress <struct with JID>
```
### Timeouts
Timeout errors occur due to the `Gitlab::Import::StuckProjectImportJobsWorker` marking the process as failed:
```ruby
module Gitlab
module Import
class StuckProjectImportJobsWorker
include Gitlab::Import::StuckImportJob
# ...
end
end
end
module Gitlab
module Import
module StuckImportJob
# ...
IMPORT_JOBS_EXPIRATION = 15.hours.to_i
# ...
def perform
stuck_imports_without_jid_count = mark_imports_without_jid_as_failed!
stuck_imports_with_jid_count = mark_imports_with_jid_as_failed!
track_metrics(stuck_imports_with_jid_count, stuck_imports_without_jid_count)
end
# ...
end
end
end
```
```shell
Marked stuck import jobs as failed. JIDs: xyz
```
```plaintext
+-----------+ +-----------------------------------+
|Export Job |--->| Calls ActiveRecord `as_json` and |
+-----------+ | `to_json` on all project models |
+-----------------------------------+
+-----------+ +-----------------------------------+
|Import Job |--->| Loads all JSON in memory, then |
+-----------+ | inserts into the DB in batches |
+-----------------------------------+
```
### Problems and solutions
[Slow JSON](https://gitlab.com/gitlab-org/gitlab/-/issues/25251) loading/dumping models from the database:
- [split the worker](https://gitlab.com/gitlab-org/gitlab/-/issues/25252) |
- Batch export
- Optimize SQL
- Move away from `ActiveRecord` callbacks (difficult)
High memory usage (see also some [analysis](https://gitlab.com/gitlab-org/gitlab/-/issues/18857)):
- DB Commit sweet spot that uses less memory
- [Netflix Fast JSON API](https://github.com/Netflix/fast_jsonapi) may help
- Batch reading/writing to disk and any SQL
|
---
stage: Create
group: Import
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Troubleshooting file export project migrations
description: Troubleshooting file export project migrations. Covers common errors,
performance issues, and solutions.
breadcrumbs:
- doc
- user
- project
- settings
---
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you have problems with [migrating projects by using file exports](import_export.md), see the possible solutions below.
## Troubleshooting commands
Finds information about the status of the import and further logs using the JID,
using the [Rails console](../../../administration/operations/rails_console.md):
```ruby
Project.find_by_full_path('group/project').import_state.slice(:jid, :status, :last_error)
> {"jid"=>"414dec93f941a593ea1a6894", "status"=>"finished", "last_error"=>nil}
```
```shell
# Logs
grep JID /var/log/gitlab/sidekiq/current
grep "Import/Export error" /var/log/gitlab/sidekiq/current
grep "Import/Export backtrace" /var/log/gitlab/sidekiq/current
tail /var/log/gitlab/gitlab-rails/importer.log
```
## Project fails to import due to mismatch
If the [instance runners enablement](../../../ci/runners/runners_scope.md#enable-instance-runners-for-a-project)
does not match between the exported project, and the project import, the project fails to import.
Review [issue 276930](https://gitlab.com/gitlab-org/gitlab/-/issues/276930), and either:
- Ensure instance runners are enabled in both the source and destination projects.
- Disable instance runners on the parent group when you import the project.
## Users missing from imported project
If users aren't imported with imported projects, see the [preserving user contributions](import_export.md#preserving-user-contributions) requirements.
A common reason for missing users is that the [public email setting](../../profile/_index.md#set-your-public-email) isn't configured for users.
To resolve this issue, ask users to configure this setting using the GitLab UI.
If there are too many users for manual configuration to be feasible,
you can set all user profiles to use a public email address using the
[Rails console](../../../administration/operations/rails_console.md#starting-a-rails-console-session):
```ruby
User.where("public_email IS NULL OR public_email = '' ").find_each do |u|
next if u.bot?
puts "Setting #{u.username}'s currently empty public email to #{u.email}…"
u.public_email = u.email
u.save!
end
```
## Import workarounds for large repositories
[Maximum import size limitations](import_export.md#import-a-project-and-its-data)
can prevent an import from being successful. If changing the import limits is not possible, you can
try one of the workarounds listed here.
### Workaround option 1
The following local workflow can be used to temporarily
reduce the repository size for another import attempt:
1. Create a temporary working directory from the export:
```shell
EXPORT=<filename-without-extension>
mkdir "$EXPORT"
tar -xf "$EXPORT".tar.gz --directory="$EXPORT"/
cd "$EXPORT"/
git clone project.bundle
# Prevent interference with recreating an importable file later
mv project.bundle ../"$EXPORT"-original.bundle
mv ../"$EXPORT".tar.gz ../"$EXPORT"-original.tar.gz
git switch --create smaller-tmp-main
```
1. To reduce the repository size, work on this `smaller-tmp-main` branch:
[identify and remove large files](../repository/repository_size.md#methods-to-reduce-repository-size)
or [interactively rebase and fixup](../../../topics/git/git_rebase.md#interactive-rebase)
to reduce the number of commits.
```shell
# Reduce the .git/objects/pack/ file size
cd project
git reflog expire --expire=now --all
git gc --prune=now --aggressive
# Prepare recreating an importable file
git bundle create ../project.bundle <default-branch-name>
cd ..
mv project/ ../"$EXPORT"-project
cd ..
# Recreate an importable file
tar -czf "$EXPORT"-smaller.tar.gz --directory="$EXPORT"/ .
```
1. Import this new, smaller file into GitLab.
1. In a full clone of the original repository,
use `git remote set-url origin <new-url> && git push --force --all`
to complete the import.
1. Update the imported repository's
[branch protection rules](../repository/branches/protected.md) and
its [default branch](../repository/branches/default.md), and
delete the temporary, `smaller-tmp-main` branch, and
the local, temporary data.
### Workaround option 2
{{< alert type="note" >}}
This workaround does not account for LFS objects.
{{< /alert >}}
Rather than attempting to push all changes at once, this workaround:
- Separates the project import from the Git Repository import
- Incrementally pushes the repository to GitLab
1. Make a local clone of the repository to migrate. In a later step, you push this clone outside of
the project export.
1. Download the export and remove the `project.bundle` (which contains the Git repository):
```shell
tar -czvf new_export.tar.gz --exclude='project.bundle' @old_export.tar.gz
```
1. Import the export without a Git repository. It asks you to confirm to import without a
repository.
1. Save this bash script as a file and run it after adding the appropriate origin.
```shell
#!/bin/sh
# ASSUMPTIONS:
# - The GitLab location is "origin"
# - The default branch is "main"
# - This will attempt to push in chunks of 500 MB (dividing the total size by 500 MB).
# Decrease this size to push in smaller chunks if you still receive timeouts.
git gc
SIZE=$(git count-objects -v 2> /dev/null | grep size-pack | awk '{print $2}')
# Be conservative and try to push 2 GB at a time
# (given this assumes each commit is the same size - which is wrong)
BATCHES=$(($SIZE / 500000))
TOTAL_COMMITS=$(git rev-list --count HEAD)
if (( BATCHES > TOTAL_COMMITS )); then
BATCHES=$TOTAL_COMMITS
fi
INCREMENTS=$(( ($TOTAL_COMMITS / $BATCHES) - 1 ))
for (( BATCH=BATCHES; BATCH>=1; BATCH-- ))
do
COMMIT_NUM=$(( $BATCH - $INCREMENTS ))
COMMIT_SHA=$(git log -n $COMMIT_NUM --format=format:%H | tail -1)
git push -u origin ${COMMIT_SHA}:refs/heads/main
done
git push -u origin main
git push -u origin --all
git push -u origin --tags
```
## Sidekiq process fails to export a project
Occasionally the Sidekiq process can fail to export a project, for example if
it is terminated during execution.
GitLab.com users should [contact Support](https://about.gitlab.com/support/#contact-support) to resolve this issue.
GitLab Self-Managed administrators can use the Rails console to bypass the Sidekiq process and
manually trigger the project export:
```ruby
project = Project.find(1)
current_user = User.find_by(username: 'my-user-name')
RequestStore.begin!
ActiveRecord::Base.logger = Logger.new(STDOUT)
params = {}
::Projects::ImportExport::ExportService.new(project, current_user, params).execute(nil)
```
This makes the export available through the UI, but does not trigger an email to the user.
To manually trigger the project export and send an email:
```ruby
project = Project.find(1)
current_user = User.find_by(username: 'my-user-name')
RequestStore.begin!
ActiveRecord::Base.logger = Logger.new(STDOUT)
params = {}
ProjectExportWorker.new.perform(current_user.id, project.id)
```
## Manually execute export steps
You usually export a project through [the web interface](import_export.md#export-a-project-and-its-data) or through [the API](../../../api/project_import_export.md). Exporting using these
methods can sometimes fail without giving enough information to troubleshoot. In these cases,
[open a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session) and loop through
[all the defined exporters](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/projects/import_export/export_service.rb).
Execute each line individually, rather than pasting the entire block at once, so you can see any
errors each command returns.
```ruby
# User needs to have permission to export
u = User.find_by_username('someuser')
p = Project.find_by_full_path('some/project')
e = Projects::ImportExport::ExportService.new(p,u)
e.send(:version_saver).send(:save)
e.send(:repo_saver).send(:save)
e.send(:avatar_saver).send(:save)
e.send(:project_tree_saver).send(:save)
e.send(:uploads_saver).send(:save)
e.send(:wiki_repo_saver).send(:save)
e.send(:lfs_saver).send(:save)
e.send(:snippets_repo_saver).send(:save)
e.send(:design_repo_saver).send(:save)
## continue using `e.send(:exporter_name).send(:save)` going through the list of exporters
# The following line should show you the export_path similar to /var/opt/gitlab/gitlab-rails/shared/tmp/gitlab_exports/@hashed/49/94/4994....
s = Gitlab::ImportExport::Saver.new(exportable: p, shared: p.import_export_shared, user: u)
# Prior to GitLab 17.0, the `user` parameter was not supported. If you encounter an
# error with the above or are unsure whether or not to supply the `user`
# argument, use the following check:
Gitlab::ImportExport::Saver.instance_method(:initialize).parameters.include?([:keyreq, :user])
# If the preceding check returns false, omit the user argument:
s = Gitlab::ImportExport::Saver.new(exportable: p, shared: p.import_export_shared)
# To try and upload use:
s.send(:compress_and_save)
s.send(:save_upload)
```
After the project is successfully uploaded, the exported project is located in a `.tar.gz` file in `/var/opt/gitlab/gitlab-rails/uploads/-/system/import_export_upload/export_file/`.
## Import using the REST API fails when using a group access token
[Group access tokens](../../group/settings/group_access_tokens.md)
don't work for project or group import operations. When a group access token initiates an import,
the import fails with this message:
```plaintext
Error adding importer user to Project members.
Validation failed: User project bots cannot be added to other groups / projects
```
To use [Import REST API](../../../api/project_import_export.md),
pass regular user account credentials such as [personal access tokens](../../profile/personal_access_tokens.md).
## Error: `PG::QueryCanceled: ERROR: canceling statement due to statement timeout`
Some migrations can time out with the error: `PG::QueryCanceled: ERROR: canceling statement due to statement timeout`.
One way to avoid this problem is to have the migration batch size reduced. This makes a migration less likely to time
out, but makes migrations slower.
To have the batch sized reduced, you must have a feature flag enabled. For more information, see
[issue 456948](https://gitlab.com/gitlab-org/gitlab/-/issues/456948).
## Error: `command exited with error code 15 and Unable to save [FILTERED] into [FILTERED]`
You might get the following error in logs when you migrate projects by using file exports:
```plaintext
command exited with error code 15 and Unable to save [FILTERED] into [FILTERED]
```
This error occurs during export or import when Sidekiq receives a `SIGTERM`, often while executing the `tar` command.
In Kubernetes environments like GitLab.com and GitLab Dedicated, the operating system triggers `SIGTERM` signals
due to memory or disk shortage, code deployments, or instance upgrades.
To identify the root cause, an administrator should investigate why Kubernetes terminated the instance.
In non-Kubernetes environments, this error might occur if the instance is terminated while executing the `tar` command.
However, this error does not occur due to disk shortage, so memory shortage is the most likely cause.
If you get this error:
- When you export a file, GitLab retries the export until the maximum number of retries is reached and marks the export as failed.
- When you import a file, you must retry the import yourself. GitLab does not retry the import automatically.
## Troubleshooting performance issues
Read through the current performance problems using the Import/Export below.
### OOM errors
Out of memory (OOM) errors are usually caused by the [Sidekiq Memory Killer](../../../administration/sidekiq/sidekiq_memory_killer.md):
```shell
SIDEKIQ_MEMORY_KILLER_MAX_RSS = 2000000
SIDEKIQ_MEMORY_KILLER_HARD_LIMIT_RSS = 3000000
SIDEKIQ_MEMORY_KILLER_GRACE_TIME = 900
```
An import status `started`, and the following Sidekiq logs signal a memory issue:
```shell
WARN: Work still in progress <struct with JID>
```
### Timeouts
Timeout errors occur due to the `Gitlab::Import::StuckProjectImportJobsWorker` marking the process as failed:
```ruby
module Gitlab
module Import
class StuckProjectImportJobsWorker
include Gitlab::Import::StuckImportJob
# ...
end
end
end
module Gitlab
module Import
module StuckImportJob
# ...
IMPORT_JOBS_EXPIRATION = 15.hours.to_i
# ...
def perform
stuck_imports_without_jid_count = mark_imports_without_jid_as_failed!
stuck_imports_with_jid_count = mark_imports_with_jid_as_failed!
track_metrics(stuck_imports_with_jid_count, stuck_imports_without_jid_count)
end
# ...
end
end
end
```
```shell
Marked stuck import jobs as failed. JIDs: xyz
```
```plaintext
+-----------+ +-----------------------------------+
|Export Job |--->| Calls ActiveRecord `as_json` and |
+-----------+ | `to_json` on all project models |
+-----------------------------------+
+-----------+ +-----------------------------------+
|Import Job |--->| Loads all JSON in memory, then |
+-----------+ | inserts into the DB in batches |
+-----------------------------------+
```
### Problems and solutions
[Slow JSON](https://gitlab.com/gitlab-org/gitlab/-/issues/25251) loading/dumping models from the database:
- [split the worker](https://gitlab.com/gitlab-org/gitlab/-/issues/25252) |
- Batch export
- Optimize SQL
- Move away from `ActiveRecord` callbacks (difficult)
High memory usage (see also some [analysis](https://gitlab.com/gitlab-org/gitlab/-/issues/18857)):
- DB Commit sweet spot that uses less memory
- [Netflix Fast JSON API](https://github.com/Netflix/fast_jsonapi) may help
- Batch reading/writing to disk and any SQL
|
https://docs.gitlab.com/user/project/group
|
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/user/project/group.md
|
2025-08-13
|
doc/user/project/wiki
|
[
"doc",
"user",
"project",
"wiki"
] |
group.md
|
Plan
|
Knowledge
|
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
Group wikis
| null |
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you use GitLab groups to manage multiple projects, some of your documentation
might span multiple groups. You can create group wikis, instead of [project wikis](_index.md),
to ensure all group members have the correct access permissions to contribute.
Group wikis are similar to [project wikis](_index.md), with a few limitations:
- [Git LFS](../../../topics/git/lfs/_index.md) is not supported.
- Changes to group wikis don't show up in the [group's activity feed](../../group/manage.md#group-activity-analytics).
For updates, follow [the epic that tracks feature parity with project wikis](https://gitlab.com/groups/gitlab-org/-/epics/2782).
Similar to project wikis, group members with at least the Developer role
can edit group wikis. Group wiki repositories can be moved using the
[Group repository storage moves API](../../../api/group_repository_storage_moves.md).
## View a group wiki
To access a group wiki:
1. On the left sidebar, select **Search or go to** and find your group.
1. To display the wiki, either:
- On the left sidebar, select **Plan > Wiki**.
- On any page in the group, use the <kbd>g</kbd> + <kbd>w</kbd>
[wiki keyboard shortcut](../../shortcuts.md).
## Export a group wiki
Users with the Owner role in a group can
[import or export a group wiki](../settings/import_export.md#migrate-groups-by-uploading-an-export-file-deprecated) when they
import or export a group.
Content created in a group wiki is not deleted when an account is downgraded or a
GitLab trial ends. The group wiki data is exported whenever the group owner of
the wiki is exported.
To access the group wiki data from the export file if the feature is no longer
available, you have to:
1. Extract the [export file tarball](../settings/import_export.md#migrate-groups-by-uploading-an-export-file-deprecated)
with this command, replacing `FILENAME` with your file's name:
`tar -xvzf FILENAME.tar.gz`
1. Browse to the `repositories` directory. This directory contains a
[Git bundle](https://git-scm.com/docs/git-bundle) with the extension `.wiki.bundle`.
1. Clone the Git bundle into a new repository, replacing `FILENAME` with
your bundle's name: `git clone FILENAME.wiki.bundle`
All files in the wiki are available in this Git repository.
## Configure group wiki visibility
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/208412) in GitLab 15.0.
{{< /history >}}
Wikis are enabled by default in GitLab. Group [administrators](../../permissions.md)
can enable or disable a group wiki through the group settings.
To open group settings:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Scroll to **Wiki** and select one of these options:
- **Enabled**: For public groups, everyone can access the wiki. For internal groups, only authenticated users can access the wiki.
- **Private**: Only group members can access the wiki.
- **Disabled**: The wiki isn't accessible, and cannot be downloaded.
1. Select **Save changes**.
## Delete the contents of a group wiki
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can delete the contents of a group wiki with the Rails console. You can then populate the wiki with new content.
{{< alert type="warning" >}}
This operation deletes all data in the wiki.
{{< /alert >}}
{{< alert type="warning" >}}
This command changes data directly and could be damaging if not run correctly.
You should run these instructions in a test environment first. Keep a backup of the
instance ready so you can restore the instance, if necessary.
{{< /alert >}}
Prerequisites:
- You must be an administrator.
To delete all of the data from a group wiki and recreate it in a blank state:
1. [Start a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session).
1. Run these commands:
```ruby
# Enter your group's path
g = Group.find_by_full_path('<group-name>')
# This command deletes the wiki group from the filesystem.
g.wiki.repository.remove
# Refresh the wiki repository state.
g.wiki.repository.expire_exists_cache
```
All data from the wiki has been cleared, and the wiki is ready for use.
## Related topics
- [Wiki settings for administrators](../../../administration/wikis/_index.md)
- [Project wikis API](../../../api/wikis.md)
- [Group repository storage moves API](../../../api/group_repository_storage_moves.md)
- [Group wikis API](../../../api/group_wikis.md)
- [Wiki keyboard shortcuts](../../shortcuts.md#wiki-pages)
- [Epic: Feature parity with project wikis](https://gitlab.com/groups/gitlab-org/-/epics/2782)
|
---
stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with
this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
title: Group wikis
breadcrumbs:
- doc
- user
- project
- wiki
---
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
If you use GitLab groups to manage multiple projects, some of your documentation
might span multiple groups. You can create group wikis, instead of [project wikis](_index.md),
to ensure all group members have the correct access permissions to contribute.
Group wikis are similar to [project wikis](_index.md), with a few limitations:
- [Git LFS](../../../topics/git/lfs/_index.md) is not supported.
- Changes to group wikis don't show up in the [group's activity feed](../../group/manage.md#group-activity-analytics).
For updates, follow [the epic that tracks feature parity with project wikis](https://gitlab.com/groups/gitlab-org/-/epics/2782).
Similar to project wikis, group members with at least the Developer role
can edit group wikis. Group wiki repositories can be moved using the
[Group repository storage moves API](../../../api/group_repository_storage_moves.md).
## View a group wiki
To access a group wiki:
1. On the left sidebar, select **Search or go to** and find your group.
1. To display the wiki, either:
- On the left sidebar, select **Plan > Wiki**.
- On any page in the group, use the <kbd>g</kbd> + <kbd>w</kbd>
[wiki keyboard shortcut](../../shortcuts.md).
## Export a group wiki
Users with the Owner role in a group can
[import or export a group wiki](../settings/import_export.md#migrate-groups-by-uploading-an-export-file-deprecated) when they
import or export a group.
Content created in a group wiki is not deleted when an account is downgraded or a
GitLab trial ends. The group wiki data is exported whenever the group owner of
the wiki is exported.
To access the group wiki data from the export file if the feature is no longer
available, you have to:
1. Extract the [export file tarball](../settings/import_export.md#migrate-groups-by-uploading-an-export-file-deprecated)
with this command, replacing `FILENAME` with your file's name:
`tar -xvzf FILENAME.tar.gz`
1. Browse to the `repositories` directory. This directory contains a
[Git bundle](https://git-scm.com/docs/git-bundle) with the extension `.wiki.bundle`.
1. Clone the Git bundle into a new repository, replacing `FILENAME` with
your bundle's name: `git clone FILENAME.wiki.bundle`
All files in the wiki are available in this Git repository.
## Configure group wiki visibility
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/208412) in GitLab 15.0.
{{< /history >}}
Wikis are enabled by default in GitLab. Group [administrators](../../permissions.md)
can enable or disable a group wiki through the group settings.
To open group settings:
1. On the left sidebar, select **Search or go to** and find your group.
1. Select **Settings > General**.
1. Expand **Permissions and group features**.
1. Scroll to **Wiki** and select one of these options:
- **Enabled**: For public groups, everyone can access the wiki. For internal groups, only authenticated users can access the wiki.
- **Private**: Only group members can access the wiki.
- **Disabled**: The wiki isn't accessible, and cannot be downloaded.
1. Select **Save changes**.
## Delete the contents of a group wiki
{{< details >}}
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
{{< /details >}}
You can delete the contents of a group wiki with the Rails console. You can then populate the wiki with new content.
{{< alert type="warning" >}}
This operation deletes all data in the wiki.
{{< /alert >}}
{{< alert type="warning" >}}
This command changes data directly and could be damaging if not run correctly.
You should run these instructions in a test environment first. Keep a backup of the
instance ready so you can restore the instance, if necessary.
{{< /alert >}}
Prerequisites:
- You must be an administrator.
To delete all of the data from a group wiki and recreate it in a blank state:
1. [Start a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session).
1. Run these commands:
```ruby
# Enter your group's path
g = Group.find_by_full_path('<group-name>')
# This command deletes the wiki group from the filesystem.
g.wiki.repository.remove
# Refresh the wiki repository state.
g.wiki.repository.expire_exists_cache
```
All data from the wiki has been cleared, and the wiki is ready for use.
## Related topics
- [Wiki settings for administrators](../../../administration/wikis/_index.md)
- [Project wikis API](../../../api/wikis.md)
- [Group repository storage moves API](../../../api/group_repository_storage_moves.md)
- [Group wikis API](../../../api/group_wikis.md)
- [Wiki keyboard shortcuts](../../shortcuts.md#wiki-pages)
- [Epic: Feature parity with project wikis](https://gitlab.com/groups/gitlab-org/-/epics/2782)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.