Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-26 12:13:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-26 12:13:05 +0300
commitabc0c2c7700bc4dfb6adc23a9594b2b7be6bd051 (patch)
treefdfccb98a77c12fb8b5628069db96e47a3ff5fc9
parentf803bba164be7079e79137bfe5a15ca5748aee94 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/models/user.rb7
-rw-r--r--app/models/user_preference.rb3
-rw-r--r--doc/administration/audit_events.md7
-rw-r--r--doc/api/group_level_variables.md64
-rw-r--r--doc/api/instance_level_ci_variables.md49
-rw-r--r--doc/api/job_artifacts.md69
-rw-r--r--doc/api/jobs.md106
-rw-r--r--doc/api/merge_trains.md49
-rw-r--r--doc/api/pipeline_schedules.md120
-rw-r--r--doc/development/testing_guide/best_practices.md6
-rw-r--r--doc/update/index.md18
-rw-r--r--doc/user/application_security/offline_deployments/index.md3
-rw-r--r--lib/gitlab_settings/options.rb15
-rw-r--r--spec/frontend/projects/terraform_notification/terraform_notification_spec.js3
-rw-r--r--spec/lib/gitlab_settings/options_spec.rb14
15 files changed, 267 insertions, 266 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 4560eb1f9c7..791eb1b574f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -31,7 +31,6 @@ class User < ApplicationRecord
include RestrictedSignup
include StripAttribute
include EachBatch
- include SafelyChangeColumnDefault
DEFAULT_NOTIFICATION_LEVEL = :participating
@@ -60,8 +59,6 @@ class User < ApplicationRecord
INCOMING_MAIL_TOKEN_PREFIX = 'glimt-'
FEED_TOKEN_PREFIX = 'glft-'
- columns_changing_default :notified_of_own_activity
-
# lib/tasks/tokens.rake needs to be updated when changing mail and feed tokens
add_authentication_token_field :incoming_email_token, token_generator: -> { self.generate_incoming_mail_token }
add_authentication_token_field :feed_token, format_with_prefix: :prefix_for_feed_token
@@ -2066,6 +2063,7 @@ class User < ApplicationRecord
# override, from Devise
def lock_access!(opts = {})
Gitlab::AppLogger.info("Account Locked: username=#{username}")
+ audit_lock_access
super
end
@@ -2592,6 +2590,9 @@ class User < ApplicationRecord
def prefix_for_feed_token
FEED_TOKEN_PREFIX
end
+
+ # method overriden in EE
+ def audit_lock_access; end
end
User.prepend_mod_with('User')
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index 4d517408154..e527542e357 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -2,15 +2,12 @@
class UserPreference < ApplicationRecord
include IgnorableColumns
- include SafelyChangeColumnDefault
# We could use enums, but Rails 4 doesn't support multiple
# enum options with same name for multiple fields, also it creates
# extra methods that aren't really needed here.
NOTES_FILTERS = { all_notes: 0, only_comments: 1, only_activity: 2 }.freeze
- columns_changing_default :tab_width, :time_display_relative, :render_whitespace_in_code
-
belongs_to :user
scope :with_user, -> { joins(:user) }
diff --git a/doc/administration/audit_events.md b/doc/administration/audit_events.md
index e924da39145..a80d3421d34 100644
--- a/doc/administration/audit_events.md
+++ b/doc/administration/audit_events.md
@@ -362,6 +362,9 @@ GitLab generates audit events when a cluster agent token is created or revoked.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/276250) in GitLab 13.6, audit events for when a user is approved using the Admin Area.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/276921) in GitLab 13.6, audit events for when a user's personal access token is successfully or unsuccessfully created or revoked.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/298783) in GitLab 13.9, audit events for when a user requests access to an instance or is rejected using the Admin Area.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238177) in
+ GitLab 15.1, audit events when a user's two-factor authentication is disabled.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124169) in GitLab 16.2, audit events when a user's access is locked.
The following user actions on a GitLab instance generate instance audit events:
@@ -373,8 +376,8 @@ The following user actions on a GitLab instance generate instance audit events:
- Grant OAuth access.
- Failed second-factor authentication attempt.
- A user's personal access token was successfully or unsuccessfully created or revoked.
-- A user's two-factor authentication was disabled. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238177) in
- GitLab 15.1.
+- A user's two-factor authentication was disabled.
+- A user's access is locked.
#### User management
diff --git a/doc/api/group_level_variables.md b/doc/api/group_level_variables.md
index 921a9922c9b..56242e16478 100644
--- a/doc/api/group_level_variables.md
+++ b/doc/api/group_level_variables.md
@@ -6,8 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Group-level Variables API **(FREE)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/34519) in GitLab 9.5
-
## List group variables
Get list of a group's variables.
@@ -16,9 +14,9 @@ Get list of a group's variables.
GET /groups/:id/variables
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|---------------------|
-| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables"
@@ -55,10 +53,10 @@ Get the details of a group's specific variable.
GET /groups/:id/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|-----------------------|
-| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables/TEST_VARIABLE_1"
@@ -84,16 +82,16 @@ Create a new variable.
POST /groups/:id/variables
```
-| Attribute | Type | required | Description |
-|-----------------|---------|----------|-----------------------|
-| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
-| `value` | string | yes | The `value` of a variable |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
-| `protected` | boolean | no | Whether the variable is protected |
-| `masked` | boolean | no | Whether the variable is masked |
-| `raw` | boolean | no | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). |
-| `environment_scope` **(PREMIUM)** | string | no | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
+| Attribute | Type | Required | Description |
+|-----------------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
+| `value` | string | Yes | The `value` of a variable |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` |
+| `protected` | boolean | No | Whether the variable is protected |
+| `masked` | boolean | No | Whether the variable is masked |
+| `raw` | boolean | No | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). |
+| `environment_scope` **(PREMIUM)** | string | No | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -120,16 +118,16 @@ Update a group's variable.
PUT /groups/:id/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------------|---------|----------|-------------------------|
-| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable |
-| `value` | string | yes | The `value` of a variable |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
-| `protected` | boolean | no | Whether the variable is protected |
-| `masked` | boolean | no | Whether the variable is masked |
-| `raw` | boolean | no | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). |
-| `environment_scope` **(PREMIUM)** | string | no | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
+| Attribute | Type | Required | Description |
+|-----------------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable |
+| `value` | string | Yes | The `value` of a variable |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` |
+| `protected` | boolean | No | Whether the variable is protected |
+| `masked` | boolean | No | Whether the variable is masked |
+| `raw` | boolean | No | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). |
+| `environment_scope` **(PREMIUM)** | string | No | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -156,10 +154,10 @@ Remove a group's variable.
DELETE /groups/:id/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|-------------------------|
-| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable |
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" \
diff --git a/doc/api/instance_level_ci_variables.md b/doc/api/instance_level_ci_variables.md
index 840744bcae1..2bf9b209e20 100644
--- a/doc/api/instance_level_ci_variables.md
+++ b/doc/api/instance_level_ci_variables.md
@@ -6,9 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Instance-level CI/CD variables API **(FREE SELF)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0
-> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/218249) in GitLab 13.2.
-
## List all instance variables
Get the list of all instance-level variables.
@@ -50,9 +47,9 @@ Get the details of a specific instance-level variable.
GET /admin/ci/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|-----------------------|
-| `key` | string | yes | The `key` of a variable |
+| Attribute | Type | Required | Description |
+|-----------|---------|----------|-------------|
+| `key` | string | Yes | The `key` of a variable |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/admin/ci/variables/TEST_VARIABLE_1"
@@ -73,20 +70,20 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Create a new instance-level variable.
-[In GitLab 13.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/216097), the maximum number of allowed instance-level variables can be changed.
+The [maximum number of instance-level variables](../administration/instance_limits.md#number-of-instance-level-variables) can be changed.
```plaintext
POST /admin/ci/variables
```
-| Attribute | Type | required | Description |
-|-----------------|---------|----------|-----------------------|
-| `key` | string | yes | The `key` of a variable. Max 255 characters, only `A-Z`, `a-z`, `0-9`, and `_` are allowed. |
-| `value` | string | yes | The `value` of a variable. 10,000 characters allowed ([GitLab 13.3 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/220028)). |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file`. |
-| `protected` | boolean | no | Whether the variable is protected. |
-| `masked` | boolean | no | Whether the variable is masked. |
-| `raw` | boolean | no | Whether the variable is expandable. |
+| Attribute | Type | Required | Description |
+|-----------------|---------|----------|-------------|
+| `key` | string | Yes | The `key` of a variable. Maximum of 255 characters, only `A-Z`, `a-z`, `0-9`, and `_` are allowed. |
+| `value` | string | Yes | The `value` of a variable. Maximum of 10,000 characters. |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file`. |
+| `protected` | boolean | No | Whether the variable is protected. |
+| `masked` | boolean | No | Whether the variable is masked. |
+| `raw` | boolean | No | Whether the variable is expandable. |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -112,14 +109,14 @@ Update an instance-level variable.
PUT /admin/ci/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------------|---------|----------|-------------------------|
-| `key` | string | yes | The `key` of a variable. |
-| `value` | string | yes | The `value` of a variable. 10,000 characters allowed ([GitLab 13.3 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/220028)). |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file`. |
-| `protected` | boolean | no | Whether the variable is protected. |
-| `masked` | boolean | no | Whether the variable is masked. |
-| `raw` | boolean | no | Whether the variable is expandable. |
+| Attribute | Type | Required | Description |
+|-----------------|---------|----------|-------------|
+| `key` | string | Yes | The `key` of a variable. Maximum of 255 characters, only `A-Z`, `a-z`, `0-9`, and `_` are allowed. |
+| `value` | string | Yes | The `value` of a variable. Maximum of 10,000 characters. |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file`. |
+| `protected` | boolean | No | Whether the variable is protected. |
+| `masked` | boolean | No | Whether the variable is masked. |
+| `raw` | boolean | No | Whether the variable is expandable. |
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -145,9 +142,9 @@ Remove an instance-level variable.
DELETE /admin/ci/variables/:key
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|-------------------------|
-| `key` | string | yes | The `key` of a variable |
+| Attribute | Type | Required | Description |
+|-----------|--------|----------|-------------|
+| `key` | string | Yes | The `key` of a variable |
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/admin/ci/variables/VARIABLE_1"
diff --git a/doc/api/job_artifacts.md b/doc/api/job_artifacts.md
index afb8f294a18..d8343cb7c44 100644
--- a/doc/api/job_artifacts.md
+++ b/doc/api/job_artifacts.md
@@ -18,9 +18,9 @@ GET /projects/:id/jobs/:job_id/artifacts
| Attribute | Type | Required | Description |
|---------------------------|----------------|----------|-------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `job_id` | integer | yes | ID of a job. |
-| `job_token` **(PREMIUM)** | string | no | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
+| `job_token` **(PREMIUM)** | string | No | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
Example request using the `PRIVATE-TOKEN` header:
@@ -82,10 +82,10 @@ Parameters
| Attribute | Type | Required | Description |
|---------------------------|----------------|----------|-------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `ref_name` | string | yes | Branch or tag name in repository. HEAD or SHA references are not supported. |
-| `job` | string | yes | The name of the job. |
-| `job_token` **(PREMIUM)** | string | no | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `ref_name` | string | Yes | Branch or tag name in repository. HEAD or SHA references are not supported. |
+| `job` | string | Yes | The name of the job. |
+| `job_token` **(PREMIUM)** | string | No | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
Example request using the `PRIVATE-TOKEN` header:
@@ -128,9 +128,6 @@ Possible response status codes:
## Download a single artifact file by job ID
-> - Introduced in GitLab 10.0.
-> - The use of `CI_JOB_TOKEN` in the artifacts download API was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55042) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.10.
-
Download a single artifact file from a job with a specified ID from inside
the job's artifacts zipped archive. The file is extracted from the archive and
streamed to the client.
@@ -143,10 +140,10 @@ Parameters
| Attribute | Type | Required | Description |
|---------------------------|----------------|----------|-------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `job_id` | integer | yes | The unique job identifier. |
-| `artifact_path` | string | yes | Path to a file inside the artifacts archive. |
-| `job_token` **(PREMIUM)** | string | no | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | The unique job identifier. |
+| `artifact_path` | string | Yes | Path to a file inside the artifacts archive. |
+| `job_token` **(PREMIUM)** | string | No | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
Example request:
@@ -164,9 +161,6 @@ Possible response status codes:
## Download a single artifact file from specific tag or branch
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23538) in GitLab 11.5.
-> - The use of `CI_JOB_TOKEN` in the artifacts download API was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55042) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.10.
-
Download a single artifact file for a specific job of the latest **successful** pipeline
for the given reference name from inside the job's artifacts archive.
The file is extracted from the archive and streamed to the client.
@@ -174,10 +168,9 @@ The file is extracted from the archive and streamed to the client.
The artifact file provides more detail than what is available in the
[CSV export](../user/application_security/vulnerability_report/index.md#export-vulnerability-details).
-In [GitLab 13.5](https://gitlab.com/gitlab-org/gitlab/-/issues/201784) and later, artifacts
-for [parent and child pipelines](../ci/pipelines/downstream_pipelines.md#parent-child-pipelines) are searched in hierarchical
-order from parent to child. For example, if both parent and child pipelines have a
-job with the same name, the artifact from the parent pipeline is returned.
+Artifacts for [parent and child pipelines](../ci/pipelines/downstream_pipelines.md#parent-child-pipelines)
+are searched in hierarchical order from parent to child. For example, if both parent and child pipelines
+have a job with the same name, the artifact from the parent pipeline is returned.
```plaintext
GET /projects/:id/jobs/artifacts/:ref_name/raw/*artifact_path?job=name
@@ -187,11 +180,11 @@ Parameters:
| Attribute | Type | Required | Description |
|---------------------------|----------------|----------|-------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `ref_name` | string | yes | Branch or tag name in repository. `HEAD` or `SHA` references are not supported. |
-| `artifact_path` | string | yes | Path to a file inside the artifacts archive. |
-| `job` | string | yes | The name of the job. |
-| `job_token` **(PREMIUM)** | string | no | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `ref_name` | string | Yes | Branch or tag name in repository. `HEAD` or `SHA` references are not supported. |
+| `artifact_path` | string | Yes | Path to a file inside the artifacts archive. |
+| `job` | string | Yes | The name of the job. |
+| `job_token` **(PREMIUM)** | string | No | To be used with [triggers](../ci/jobs/ci_job_token.md#download-an-artifact-from-a-different-pipeline) for multi-project pipelines. It should be invoked only in a CI/CD job defined in the `.gitlab-ci.yml` file. The value is always `$CI_JOB_TOKEN`. The job associated with the `$CI_JOB_TOKEN` must be running when this token is used. |
Example request:
@@ -217,10 +210,10 @@ POST /projects/:id/jobs/:job_id/artifacts/keep
Parameters
-| Attribute | Type | Required | Description |
-|-----------|----------------|----------|--------------------------------------------------------------------------------------------------------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
+| `job_id` | integer | Yes | ID of a job. |
Example request:
@@ -264,8 +257,6 @@ Example response:
## Delete job artifacts
-> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/25522) in GitLab 11.9.
-
Delete artifacts of a job.
Prerequisites:
@@ -276,10 +267,10 @@ Prerequisites:
DELETE /projects/:id/jobs/:job_id/artifacts
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|----------|-----------------------------------------------------------------------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `job_id` | integer | yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
Example request:
@@ -305,9 +296,9 @@ By default, [artifacts from the most recent successful pipeline of each ref are
DELETE /projects/:id/artifacts
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|----------|-----------------------------------------------------------------------------|
-| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
Example request:
diff --git a/doc/api/jobs.md b/doc/api/jobs.md
index a28acfbd1a1..a48168c8362 100644
--- a/doc/api/jobs.md
+++ b/doc/api/jobs.md
@@ -21,10 +21,10 @@ pagination is recommended when requesting consecutive pages of results.
GET /projects/:id/jobs
```
-| Attribute | Type | Required | Description |
-|-----------|--------------------------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `scope` | string **or** array of strings | **{dotted-circle}** No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
+| Attribute | Type | Required | Description |
+|-----------|--------------------------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `scope` | string **or** array of strings | No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
```shell
curl --globoff --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs?scope[]=pending&scope[]=running"
@@ -172,16 +172,22 @@ Get a list of jobs for a pipeline.
By default, this request returns 20 results at a time because the API results [are paginated](rest/index.md#pagination)
+This endpoint:
+
+- [Returns data for any pipeline](pipelines.md#get-a-single-pipeline) including [child pipelines](../ci/pipelines/downstream_pipelines.md#parent-child-pipelines).
+- Does not return retried jobs in the response by default.
+- Sorts jobs by ID in descending order (newest first).
+
```plaintext
GET /projects/:id/pipelines/:pipeline_id/jobs
```
-| Attribute | Type | Required | Description |
-|-------------------|--------------------------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `pipeline_id` | integer | **{check-circle}** Yes | ID of a pipeline. Can also be obtained in CI jobs via the [predefined CI variable](../ci/variables/predefined_variables.md) `CI_PIPELINE_ID`. |
-| `scope` | string **or** array of strings | **{dotted-circle}** No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
-| `include_retried` | boolean | **{dotted-circle}** No | Include retried jobs in the response. Defaults to `false`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/272627) in GitLab 13.9. |
+| Attribute | Type | Required | Description |
+|-------------------|--------------------------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `pipeline_id` | integer | Yes | ID of a pipeline. Can also be obtained in CI jobs via the [predefined CI variable](../ci/variables/predefined_variables.md) `CI_PIPELINE_ID`. |
+| `scope` | string **or** array of strings | No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
+| `include_retried` | boolean | No | Include retried jobs in the response. Defaults to `false`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/272627) in GitLab 13.9. |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/6/jobs?scope[]=pending&scope[]=running"
@@ -323,16 +329,6 @@ Example of response
]
```
-In GitLab 13.3 and later, this endpoint [returns data for any pipeline](pipelines.md#get-a-single-pipeline)
-including [child pipelines](../ci/pipelines/downstream_pipelines.md#parent-child-pipelines).
-
-In GitLab 13.5 and later, this endpoint does not return retried jobs in the response
-by default. Additionally, jobs are sorted by ID in descending order (newest first).
-In earlier GitLab versions, jobs are sorted by ID in ascending order (oldest first).
-
-In GitLab 13.9 and later, this endpoint can include retried jobs in the response
-with `include_retried` set to `true`.
-
## List pipeline trigger jobs
Get a list of trigger jobs for a pipeline.
@@ -341,11 +337,11 @@ Get a list of trigger jobs for a pipeline.
GET /projects/:id/pipelines/:pipeline_id/bridges
```
-| Attribute | Type | Required | Description |
-|---------------|--------------------------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `pipeline_id` | integer | **{check-circle}** Yes | ID of a pipeline. |
-| `scope` | string **or** array of strings | **{dotted-circle}** No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
+| Attribute | Type | Required | Description |
+|---------------|--------------------------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `pipeline_id` | integer | Yes | ID of a pipeline. |
+| `scope` | string **or** array of strings | No | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, `waiting_for_resource`, or `manual`. All jobs are returned if `scope` is not provided. |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/6/bridges?scope[]=pending&scope[]=running"
@@ -425,8 +421,6 @@ Example of response
## Get job token's job
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51727) in GitLab 13.10.
-
Retrieve the job that generated a job token.
```plaintext
@@ -505,8 +499,6 @@ Example of response
## Get GitLab agent by `CI_JOB_TOKEN` **(PREMIUM)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/324269) in GitLab 13.11.
-
Retrieve the job that generated the `CI_JOB_TOKEN`, along with a list of allowed
[agents](../user/clusters/agent/index.md).
@@ -516,9 +508,9 @@ GET /job/allowed_agents
Supported attributes:
-| Attribute | Type | Required | Description |
-|----------------|----------|------------------------|-------------|
-| `CI_JOB_TOKEN` | string | **{check-circle}** Yes | Token value associated with the GitLab-provided `CI_JOB_TOKEN` variable. |
+| Attribute | Type | Required | Description |
+|----------------|--------|----------|-------------|
+| `CI_JOB_TOKEN` | string | Yes | Token value associated with the GitLab-provided `CI_JOB_TOKEN` variable. |
Example request:
@@ -584,10 +576,10 @@ Get a single job of a project
GET /projects/:id/jobs/:job_id
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/8"
@@ -665,10 +657,10 @@ Get a log (trace) of a specific job of a project:
GET /projects/:id/jobs/:job_id/trace
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
```shell
curl --location --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/8/trace"
@@ -689,10 +681,10 @@ Cancel a single job of a project
POST /projects/:id/jobs/:job_id/cancel
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/cancel"
@@ -743,10 +735,10 @@ Retry a single job of a project
POST /projects/:id/jobs/:job_id/retry
```
-| Attribute | Type | Required | Description |
-|-----------|----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/retry"
@@ -799,10 +791,10 @@ POST /projects/:id/jobs/:job_id/erase
Parameters
-| Attribute | Type | Required | Description |
-|-----------|----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
Example of request
@@ -860,11 +852,11 @@ For a job in manual status, trigger an action to start the job.
POST /projects/:id/jobs/:job_id/play
```
-| Attribute | Type | Required | Description |
-|----------------------------|-----------------|------------------------|-------------|
-| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `job_id` | integer | **{check-circle}** Yes | ID of a job. |
-| `job_variables_attributes` | array of hashes | **{dotted-circle}** No | An array containing the custom variables available to the job. [Introduced in](https://gitlab.com/gitlab-org/gitlab/-/issues/37267) GitLab 14.9. |
+| Attribute | Type | Required | Description |
+|----------------------------|-----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `job_id` | integer | Yes | ID of a job. |
+| `job_variables_attributes` | array of hashes | No | An array containing the custom variables available to the job. [Introduced in](https://gitlab.com/gitlab-org/gitlab/-/issues/37267) GitLab 14.9. |
Example request:
diff --git a/doc/api/merge_trains.md b/doc/api/merge_trains.md
index c041b01da04..536cf616a88 100644
--- a/doc/api/merge_trains.md
+++ b/doc/api/merge_trains.md
@@ -6,10 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Merge Trains API **(PREMIUM)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/36146) in GitLab 12.9.
-> - Using this API you can consume [Merge Train](../ci/pipelines/merge_trains.md) entries.
-
-Every API call to merge trains must be authenticated with at lease the Developer [role](../user/permissions.md).
+Every API call for [merge train](../ci/pipelines/merge_trains.md) must be authenticated with at lease the Developer [role](../user/permissions.md).
If a user is not a member of a project and the project is private, a `GET` request on that project returns a `404` status code.
@@ -31,11 +28,11 @@ GET /projects/:id/merge_trains
GET /projects/:id/merge_trains?scope=complete
```
-| Attribute | Type | Required | Description |
-| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `scope` | string | no | Return Merge Trains filtered by the given scope. Available scopes are `active` (to be merged) and `complete` (have been merged). |
-| `sort` | string | no | Return Merge Trains sorted in `asc` or `desc` order. Default is `desc`. |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `scope` | string | No | Return Merge Trains filtered by the given scope. Available scopes are `active` (to be merged) and `complete` (have been merged). |
+| `sort` | string | No | Return Merge Trains sorted in `asc` or `desc` order. Default: `desc`. |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/merge_trains"
@@ -95,12 +92,12 @@ GET /projects/:id/merge_trains/:target_branch
Supported attributes:
-| Attribute | Type | Required | Description |
-| --------------- | ---------------| -------- | ------------ |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `target_branch` | string | yes | The target branch of the merge train. |
-| `scope` | string | no | Return Merge Trains filtered by the given scope. Available scopes are `active` (to be merged) and `complete` (have been merged). |
-| `sort` | string | no | Return Merge Trains sorted in `asc` or `desc` order. Default is `desc`. |
+| Attribute | Type | Required | Description |
+|-----------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `target_branch` | string | Yes | The target branch of the merge train. |
+| `scope` | string | No | Return Merge Trains filtered by the given scope. Available scopes are `active` (to be merged) and `complete` (have been merged). |
+| `sort` | string | No | Return Merge Trains sorted in `asc` or `desc` order. Default: `desc`. |
Example request:
@@ -165,10 +162,10 @@ GET /projects/:id/merge_trains/merge_requests/:merge_request_iid
Supported attributes:
-| Attribute | Type | Required | Description |
-| ------------------- | -------------- | -------- | ------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `merge_request_iid` | integer | yes | The internal ID of the merge request. |
+| Attribute | Type | Required | Description |
+|---------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `merge_request_iid` | integer | Yes | The internal ID of the merge request. |
Example request:
@@ -231,13 +228,13 @@ POST /projects/:id/merge_trains/merge_requests/:merge_request_iid
Supported attributes:
-| Attribute | Type | Required | Description |
-| ------------------------------ | -------------- | -------- | ----------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
-| `merge_request_iid` | integer | yes | The internal ID of the merge request. |
-| `when_pipeline_succeeds` | boolean | no | If true, the merge request is added to the merge train when the pipeline succeeds. When false or unspecified, the merge request is added directly to the merge train. |
-| `sha` | string | no | If present, the SHA must match the `HEAD` of the source branch, otherwise the merge fails. |
-| `squash` | boolean | no | If true, the commits are squashed into a single commit on merge. |
+| Attribute | Type | Required | Description |
+|--------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `merge_request_iid` | integer | Yes | The internal ID of the merge request. |
+| `when_pipeline_succeeds` | boolean | No | If true, the merge request is added to the merge train when the pipeline succeeds. When false or unspecified, the merge request is added directly to the merge train. |
+| `sha` | string | No | If present, the SHA must match the `HEAD` of the source branch, otherwise the merge fails. |
+| `squash` | boolean | No | If true, the commits are squashed into a single commit on merge. |
Example request:
diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md
index 5dc0dead683..115e5b279b8 100644
--- a/doc/api/pipeline_schedules.md
+++ b/doc/api/pipeline_schedules.md
@@ -16,10 +16,10 @@ Get a list of the pipeline schedules of a project.
GET /projects/:id/pipeline_schedules
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|---------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `scope` | string | no | The scope of pipeline schedules, one of: `active`, `inactive` |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `scope` | string | No | The scope of pipeline schedules, must be one of: `active`, `inactive` |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules"
@@ -57,10 +57,10 @@ Get the pipeline schedule of a project.
GET /projects/:id/pipeline_schedules/:pipeline_schedule_id
```
-| Attribute | Type | required | Description |
-|--------------|---------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13"
@@ -115,8 +115,8 @@ Supported attributes:
| Attribute | Type | Required | Description |
|------------------------|----------------|----------|-------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID. |
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID. |
Example request:
@@ -163,14 +163,14 @@ Create a new pipeline schedule of a project.
POST /projects/:id/pipeline_schedules
```
-| Attribute | Type | required | Description |
-|-----------------|----------------|----------|-------------------------------------------------------------------------------------------------------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `description` | string | yes | The description of the pipeline schedule. |
-| `ref` | string | yes | The branch or tag name that is triggered. |
-| `cron` | string | yes | The [cron](https://en.wikipedia.org/wiki/Cron) schedule, for example: `0 1 * * *`. |
-| `cron_timezone` | string | no | The time zone supported by `ActiveSupport::TimeZone`, for example: `Pacific Time (US & Canada)` (default: `UTC`). |
-| `active` | boolean | no | The activation of pipeline schedule. If false is set, the pipeline schedule is initially deactivated (default: `true`). |
+| Attribute | Type | Required | Description |
+|-----------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `description` | string | Yes | The description of the pipeline schedule. |
+| `ref` | string | Yes | The branch or tag name that is triggered. |
+| `cron` | string | Yes | The [cron](https://en.wikipedia.org/wiki/Cron) schedule, for example: `0 1 * * *`. |
+| `cron_timezone` | string | No | The time zone supported by `ActiveSupport::TimeZone`, for example: `Pacific Time (US & Canada)` (default: `UTC`). |
+| `active` | boolean | No | The activation of pipeline schedule. If false is set, the pipeline schedule is initially deactivated (default: `true`). |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -203,21 +203,21 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
## Edit a pipeline schedule
-Updates the pipeline schedule of a project. Once the update is done, it is rescheduled automatically.
+Updates the pipeline schedule of a project. After the update is done, it is rescheduled automatically.
```plaintext
PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id
```
-| Attribute | Type | required | Description |
-|------------------------|----------------|----------|------------------------------------------------------------------------------------------------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user. |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID. |
-| `description` | string | no | The description of the pipeline schedule. |
-| `ref` | string | no | The branch or tag name that is triggered. |
-| `cron` | string | no | The [cron](https://en.wikipedia.org/wiki/Cron) schedule, for example: `0 1 * * *`. |
-| `cron_timezone` | string | no | The time zone supported by `ActiveSupport::TimeZone` (for example `Pacific Time (US & Canada)`), or `TZInfo::Timezone` (for example `America/Los_Angeles`). |
-| `active` | boolean | no | The activation of pipeline schedule. If false is set, the pipeline schedule is initially deactivated. |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID. |
+| `description` | string | No | The description of the pipeline schedule. |
+| `ref` | string | No | The branch or tag name that is triggered. |
+| `cron` | string | No | The [cron](https://en.wikipedia.org/wiki/Cron) schedule, for example: `0 1 * * *`. |
+| `cron_timezone` | string | No | The time zone supported by `ActiveSupport::TimeZone` (for example `Pacific Time (US & Canada)`), or `TZInfo::Timezone` (for example `America/Los_Angeles`). |
+| `active` | boolean | No | The activation of pipeline schedule. If false is set, the pipeline schedule is initially deactivated. |
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -260,10 +260,10 @@ Update the owner of the pipeline schedule of a project.
POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/take_ownership
```
-| Attribute | Type | required | Description |
-|---------------|---------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/take_ownership"
@@ -305,10 +305,10 @@ Delete the pipeline schedule of a project.
DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id
```
-| Attribute | Type | required | Description |
-|----------------|---------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13"
@@ -344,8 +344,6 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git
## Run a scheduled pipeline immediately
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/201786) in GitLab 12.8.
-
Trigger a new scheduled pipeline, which runs immediately. The next scheduled run
of this pipeline is not affected.
@@ -353,10 +351,10 @@ of this pipeline is not affected.
POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/play
```
-| Attribute | Type | required | Description |
-| ---------------- | --------- | ---------- | -------------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
Example request:
@@ -382,13 +380,13 @@ Create a new variable of a pipeline schedule.
POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables
```
-| Attribute | Type | required | Description |
-|------------------------|----------------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
-| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
-| `value` | string | yes | The `value` of a variable |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
+| `key` | string | Yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
+| `value` | string | Yes | The `value` of a variable |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "key=NEW_VARIABLE" \
@@ -411,13 +409,13 @@ Updates the variable of a pipeline schedule.
PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key
```
-| Attribute | Type | required | Description |
-|------------------------|----------------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
-| `key` | string | yes | The `key` of a variable |
-| `value` | string | yes | The `value` of a variable |
-| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
+| `key` | string | Yes | The `key` of a variable |
+| `value` | string | Yes | The `value` of a variable |
+| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` |
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -441,11 +439,11 @@ Delete the variable of a pipeline schedule.
DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key
```
-| Attribute | Type | required | Description |
-|------------------------|----------------|----------|--------------------------|
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `pipeline_schedule_id` | integer | yes | The pipeline schedule ID |
-| `key` | string | yes | The `key` of a variable |
+| Attribute | Type | Required | Description |
+|------------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `pipeline_schedule_id` | integer | Yes | The pipeline schedule ID |
+| `key` | string | Yes | The `key` of a variable |
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE"
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md
index 01b92f3c33a..e6756cd6c11 100644
--- a/doc/development/testing_guide/best_practices.md
+++ b/doc/development/testing_guide/best_practices.md
@@ -539,6 +539,12 @@ performance gains.
When combining tests, consider using `:aggregate_failures`, so that the full
results are available, and not just the first failure.
+#### In case you're stuck
+
+We have a `backend_testing_performance` [domain expertise](https://about.gitlab.com/handbook/engineering/workflow/code-review/#domain-experts) to list people that could help refactor slow backend specs.
+
+To find people that could help, search for `backend testing performance` on the [Engineering Projects page](https://about.gitlab.com/handbook/engineering/projects/), or look directly in [the `www-gitlab-org` project](https://gitlab.com/search?group_id=6543&nav_source=navbar&project_id=7764&repository_ref=master&scope=blobs&search=backend_testing_performance+path%3Adata%2Fteam_members%2F*&search_code=true).
+
### Feature category metadata
You must [set feature category metadata for each RSpec example](../feature_categorization/index.md#rspec-examples).
diff --git a/doc/update/index.md b/doc/update/index.md
index a7c9bdb0933..267ef6b0bda 100644
--- a/doc/update/index.md
+++ b/doc/update/index.md
@@ -326,6 +326,24 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
- Gitaly configuration changes significantly in Omnibus GitLab 16.0. You can begin migrating to the new structure in Omnibus GitLab 15.10 while backwards compatibility is
maintained in the lead up to Omnibus GitLab 16.0. [Read more about this change](#gitaly-omnibus-gitlab-configuration-structure-change).
+- You might encounter the following error while upgrading to GitLab 15.10 or later:
+
+ ```shell
+ STDOUT: rake aborted!
+ StandardError: An error has occurred, all later migrations canceled:
+ PG::CheckViolation: ERROR: check constraint "check_70f294ef54" is violated by some row
+ ```
+
+ This error is caused by a [batched background migration introduced in GitLab 15.8](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107701)
+ not being finalized before GitLab 15.10. To resolve this error:
+
+ 1. Execute the following SQL statement using the database console (`sudo gitlab-psql` for Linux package installs):
+
+ ```sql
+ UPDATE oauth_access_tokens SET expires_in = '7200' WHERE expires_in IS NULL;
+ ```
+
+ 1. [Re-run database migrations](../administration/raketasks/maintenance.md#run-incomplete-database-migrations).
### 15.9.0
diff --git a/doc/user/application_security/offline_deployments/index.md b/doc/user/application_security/offline_deployments/index.md
index 1ee4d9b2a19..63f3763cab9 100644
--- a/doc/user/application_security/offline_deployments/index.md
+++ b/doc/user/application_security/offline_deployments/index.md
@@ -7,6 +7,9 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Offline environments **(ULTIMATE SELF)**
+NOTE:
+To set up an offline environment, you must receive an [opt-out exemption of cloud licensing](https://about.gitlab.com/pricing/licensing-faq/cloud-licensing/#offline-cloud-licensing) prior to purchase. For more details, contact your GitLab sales representative.
+
It's possible to run most of the GitLab security scanners when not connected to the internet.
This document describes how to operate Secure Categories (that is, scanner types) in an offline
diff --git a/lib/gitlab_settings/options.rb b/lib/gitlab_settings/options.rb
index de3b6e50ccc..68555794436 100644
--- a/lib/gitlab_settings/options.rb
+++ b/lib/gitlab_settings/options.rb
@@ -121,10 +121,9 @@ module GitlabSettings
# Don't alter the internal keys
def stringify_keys!
- error_msg = "Warning: Do not mutate #{self.class} objects"
- raise "#{error_msg}: `#{__method__}`" unless Rails.env.production?
+ error_msg = "Warning: Do not mutate #{self.class} objects: `#{__method__}`"
- Gitlab::AppLogger.warn(error_msg, method: __method__)
+ Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: __method__)
to_hash.deep_stringify_keys
end
@@ -132,10 +131,9 @@ module GitlabSettings
# Don't alter the internal keys
def symbolize_keys!
- error_msg = "Warning: Do not mutate #{self.class} objects"
- raise "#{error_msg}: `#{__method__}`" unless Rails.env.production?
+ error_msg = "Warning: Do not mutate #{self.class} objects: `#{__method__}`"
- Gitlab::AppLogger.warn(error_msg, method: __method__)
+ Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: __method__)
to_hash.deep_symbolize_keys
end
@@ -151,10 +149,9 @@ module GitlabSettings
end
if @options.respond_to?(name)
- error_msg = "Calling a hash method on #{self.class}"
- raise "#{error_msg}: `#{name}`" unless Rails.env.production?
+ error_msg = "Calling a hash method on #{self.class}: `#{name}`"
- Gitlab::AppLogger.warn(error_msg, method: name)
+ Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: name)
return @options.public_send(name, *args, &block) # rubocop: disable GitlabSecurity/PublicSend
end
diff --git a/spec/frontend/projects/terraform_notification/terraform_notification_spec.js b/spec/frontend/projects/terraform_notification/terraform_notification_spec.js
index 1d0faebbcb2..89f4694d1f8 100644
--- a/spec/frontend/projects/terraform_notification/terraform_notification_spec.js
+++ b/spec/frontend/projects/terraform_notification/terraform_notification_spec.js
@@ -60,14 +60,15 @@ describe('TerraformNotificationBanner', () => {
describe('when close button is clicked', () => {
beforeEach(() => {
- wrapper.vm.$refs.calloutDismisser.dismiss = userCalloutDismissSpy;
findBanner().vm.$emit('close');
});
+
it('should send the dismiss event', () => {
expect(trackingSpy).toHaveBeenCalledWith(undefined, DISMISS_EVENT, {
label: EVENT_LABEL,
});
});
+
it('should call the dismiss callback', () => {
expect(userCalloutDismissSpy).toHaveBeenCalledTimes(1);
});
diff --git a/spec/lib/gitlab_settings/options_spec.rb b/spec/lib/gitlab_settings/options_spec.rb
index cd5a0adeecf..abb895032c9 100644
--- a/spec/lib/gitlab_settings/options_spec.rb
+++ b/spec/lib/gitlab_settings/options_spec.rb
@@ -12,9 +12,10 @@ RSpec.describe GitlabSettings::Options, :aggregate_failures, feature_category: :
it 'returns the unchanged internal hash' do
stub_rails_env('production')
- expect(Gitlab::AppLogger)
- .to receive(:warn)
- .with('Warning: Do not mutate GitlabSettings::Options objects', method: method)
+ expect(Gitlab::ErrorTracking)
+ .to receive(:track_and_raise_for_dev_exception)
+ .with(RuntimeError.new("Warning: Do not mutate GitlabSettings::Options objects: `#{method}`"), method: method)
+ .and_call_original
expect(options.send(method)).to be_truthy
end
@@ -233,9 +234,10 @@ RSpec.describe GitlabSettings::Options, :aggregate_failures, feature_category: :
it 'delegates the method to the internal options hash' do
stub_rails_env('production')
- expect(Gitlab::AppLogger)
- .to receive(:warn)
- .with('Calling a hash method on GitlabSettings::Options', method: :delete)
+ expect(Gitlab::ErrorTracking)
+ .to receive(:track_and_raise_for_dev_exception)
+ .with(RuntimeError.new('Calling a hash method on GitlabSettings::Options: `delete`'), method: :delete)
+ .and_call_original
expect { options.foo.delete('bar') }
.to change { options.to_hash }