@@ -16,7 +16,7 @@ Get a list of project dependencies. This API partially mirroring
...
@@ -16,7 +16,7 @@ Get a list of project dependencies. This API partially mirroring
This list can be generated only for [languages and package managers](../user/application_security/dependency_scanning/index.md#supported-languages-and-package-managers)
This list can be generated only for [languages and package managers](../user/application_security/dependency_scanning/index.md#supported-languages-and-package-managers)
supported by Gemnasium.
supported by Gemnasium.
```
```plaintext
GET /projects/:id/dependencies
GET /projects/:id/dependencies
GET /projects/:id/dependencies?package_manager=maven
GET /projects/:id/dependencies?package_manager=maven
GET /projects/:id/dependencies?package_manager=yarn,bundler
GET /projects/:id/dependencies?package_manager=yarn,bundler
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `key` | string | yes | The `key` of a variable |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `key` | string | yes | The `key` of a variable |
Creates a new project group. Available only for users who can create groups.
Creates a new project group. Available only for users who can create groups.
```
```plaintext
POST /groups
POST /groups
```
```
...
@@ -500,7 +500,7 @@ Parameters:
...
@@ -500,7 +500,7 @@ Parameters:
Transfer a project to the Group namespace. Available only to instance administrators, although an [alternative API endpoint](projects.md#transfer-a-project-to-a-new-namespace) is available which does not require instance administrator access. Transferring projects may fail when tagged packages exist in the project's repository.
Transfer a project to the Group namespace. Available only to instance administrators, although an [alternative API endpoint](projects.md#transfer-a-project-to-a-new-namespace) is available which does not require instance administrator access. Transferring projects may fail when tagged packages exist in the project's repository.
Updates the project group. Only available to group owners and administrators.
Updates the project group. Only available to group owners and administrators.
```
```plaintext
PUT /groups/:id
PUT /groups/:id
```
```
...
@@ -548,7 +548,6 @@ PUT /groups/:id
...
@@ -548,7 +548,6 @@ PUT /groups/:id
```shell
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/groups/5?name=Experimental"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/groups/5?name=Experimental"
```
```
This endpoint returns:
This endpoint returns:
...
@@ -639,7 +638,7 @@ This endpoint either:
...
@@ -639,7 +638,7 @@ This endpoint either:
- Removes group, and queues a background job to delete all projects in the group as well.
- Removes group, and queues a background job to delete all projects in the group as well.
- Since [GitLab 12.8](https://gitlab.com/gitlab-org/gitlab/issues/33257), on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers, marks a group for deletion. The deletion will happen 7 days later by default, but this can be changed in the [instance settings](../user/admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
- Since [GitLab 12.8](https://gitlab.com/gitlab-org/gitlab/issues/33257), on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers, marks a group for deletion. The deletion will happen 7 days later by default, but this can be changed in the [instance settings](../user/admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
```
```plaintext
DELETE /groups/:id
DELETE /groups/:id
```
```
...
@@ -671,7 +670,7 @@ Parameters:
...
@@ -671,7 +670,7 @@ Parameters:
Get all groups that match your string in their name or path.
Get all groups that match your string in their name or path.
```
```plaintext
GET /groups?search=foobar
GET /groups?search=foobar
```
```
...
@@ -695,7 +694,7 @@ These are different from [System Hooks](system_hooks.md) that are system wide an
...
@@ -695,7 +694,7 @@ These are different from [System Hooks](system_hooks.md) that are system wide an
Get a list of group hooks
Get a list of group hooks
```
```plaintext
GET /groups/:id/hooks
GET /groups/:id/hooks
```
```
...
@@ -712,7 +711,7 @@ Get a specific hook for a group.
...
@@ -712,7 +711,7 @@ Get a specific hook for a group.
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) |
| `hook_id` | integer | yes | The ID of a group hook |
| `hook_id` | integer | yes | The ID of a group hook |
```
```plaintext
GET /groups/:id/hooks/:hook_id
GET /groups/:id/hooks/:hook_id
```
```
...
@@ -739,7 +738,7 @@ GET /groups/:id/hooks/:hook_id
...
@@ -739,7 +738,7 @@ GET /groups/:id/hooks/:hook_id
Adds a hook to a specified group.
Adds a hook to a specified group.
```
```plaintext
POST /groups/:id/hooks
POST /groups/:id/hooks
```
```
...
@@ -763,7 +762,7 @@ POST /groups/:id/hooks
...
@@ -763,7 +762,7 @@ POST /groups/:id/hooks
Edits a hook for a specified group.
Edits a hook for a specified group.
```
```plaintext
PUT /groups/:id/hooks/:hook_id
PUT /groups/:id/hooks/:hook_id
```
```
...
@@ -789,7 +788,7 @@ PUT /groups/:id/hooks/:hook_id
...
@@ -789,7 +788,7 @@ PUT /groups/:id/hooks/:hook_id
Removes a hook from a group. This is an idempotent method and can be called multiple times.
Removes a hook from a group. This is an idempotent method and can be called multiple times.
Either the hook is available or not.
Either the hook is available or not.
```
```plaintext
DELETE /groups/:id/hooks/:hook_id
DELETE /groups/:id/hooks/:hook_id
```
```
...
@@ -806,7 +805,7 @@ Group audit events can be accessed via the [Group Audit Events API](audit_events
...
@@ -806,7 +805,7 @@ Group audit events can be accessed via the [Group Audit Events API](audit_events
Syncs the group with its linked LDAP group. Only available to group owners and administrators.
Syncs the group with its linked LDAP group. Only available to group owners and administrators.
```
```plaintext
POST /groups/:id/ldap_sync
POST /groups/:id/ldap_sync
```
```
...
@@ -826,7 +825,7 @@ List, add, and delete LDAP group links.
...
@@ -826,7 +825,7 @@ List, add, and delete LDAP group links.
Lists LDAP group links.
Lists LDAP group links.
```
```plaintext
GET /groups/:id/ldap_group_links
GET /groups/:id/ldap_group_links
```
```
...
@@ -838,7 +837,7 @@ Parameters:
...
@@ -838,7 +837,7 @@ Parameters:
Adds an LDAP group link.
Adds an LDAP group link.
```
```plaintext
POST /groups/:id/ldap_group_links
POST /groups/:id/ldap_group_links
```
```
...
@@ -853,7 +852,7 @@ Parameters:
...
@@ -853,7 +852,7 @@ Parameters:
Deletes an LDAP group link.
Deletes an LDAP group link.
```
```plaintext
DELETE /groups/:id/ldap_group_links/:cn
DELETE /groups/:id/ldap_group_links/:cn
```
```
...
@@ -864,7 +863,7 @@ Parameters:
...
@@ -864,7 +863,7 @@ Parameters:
Deletes a LDAP group link for a specific LDAP provider
Deletes a LDAP group link for a specific LDAP provider
```
```plaintext
DELETE /groups/:id/ldap_group_links/:provider/:cn
DELETE /groups/:id/ldap_group_links/:provider/:cn
```
```
...
@@ -880,13 +879,13 @@ By default, groups only get 20 namespaces at a time because the API results are
...
@@ -880,13 +879,13 @@ By default, groups only get 20 namespaces at a time because the API results are
To get more (up to 100), pass the following as an argument to the API call:
To get more (up to 100), pass the following as an argument to the API call:
@@ -17,7 +17,7 @@ The access levels are defined in the `Gitlab::Access` module. Currently, these l
...
@@ -17,7 +17,7 @@ The access levels are defined in the `Gitlab::Access` module. Currently, these l
Gets a list of group or project members viewable by the authenticated user.
Gets a list of group or project members viewable by the authenticated user.
Returns only direct members and not inherited members through ancestors groups.
Returns only direct members and not inherited members through ancestors groups.
```
```plaintext
GET /groups/:id/members
GET /groups/:id/members
GET /projects/:id/members
GET /projects/:id/members
```
```
...
@@ -72,7 +72,7 @@ Gets a list of group or project members viewable by the authenticated user, incl
...
@@ -72,7 +72,7 @@ Gets a list of group or project members viewable by the authenticated user, incl
When a user is a member of the project/group and of one or more ancestor groups the user is returned only once with the project `access_level` (if exists)
When a user is a member of the project/group and of one or more ancestor groups the user is returned only once with the project `access_level` (if exists)
or the `access_level` for the user in the first group which they belong to in the project groups ancestors chain.
or the `access_level` for the user in the first group which they belong to in the project groups ancestors chain.
```
```plaintext
GET /groups/:id/members/all
GET /groups/:id/members/all
GET /projects/:id/members/all
GET /projects/:id/members/all
```
```
...
@@ -136,7 +136,7 @@ Example response:
...
@@ -136,7 +136,7 @@ Example response:
Gets a member of a group or project. Returns only direct members and not inherited members through ancestor groups.
Gets a member of a group or project. Returns only direct members and not inherited members through ancestor groups.
```
```plaintext
GET /groups/:id/members/:user_id
GET /groups/:id/members/:user_id
GET /projects/:id/members/:user_id
GET /projects/:id/members/:user_id
```
```
...
@@ -173,7 +173,7 @@ Example response:
...
@@ -173,7 +173,7 @@ Example response:
Gets a member of a group or project, including members inherited through ancestor groups. See the corresponding [endpoint to list all inherited members](#list-all-members-of-a-group-or-project-including-inherited-members) for details.
Gets a member of a group or project, including members inherited through ancestor groups. See the corresponding [endpoint to list all inherited members](#list-all-members-of-a-group-or-project-including-inherited-members) for details.
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes. |
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes. |
| `default_artifacts_expire_in` | string | no | Set the default expiration time for each job's artifacts. |
| `default_artifacts_expire_in` | string | no | Set the default expiration time for each job's artifacts. |
| `default_branch_protection` | integer | no | Determine if developers can push to master. Can take: `0` _(not protected, both developers and maintainers can push new commits, force push, or delete the branch)_, `1` _(partially protected, developers and maintainers can push new commits, but cannot force push or delete the branch)_ or `2` _(fully protected, developers cannot push new commits, but maintainers can; no-one can force push or delete the branch)_ as a parameter. Default is `2`. |
| `default_branch_protection` | integer | no | Determine if developers can push to master. Can take: `0` _(not protected, both developers and maintainers can push new commits, force push, or delete the branch)_, `1` _(partially protected, developers and maintainers can push new commits, but cannot force push, or delete, the branch)_ or `2` _(fully protected, developers cannot push new commits, but maintainers can; no-one can force push or delete the branch)_ as a parameter. Default is `2`. |
| `default_ci_config_path` | string | no | Default CI configuration path for new projects (`.gitlab-ci.yml` if not set). |
| `default_ci_config_path` | string | no | Default CI configuration path for new projects (`.gitlab-ci.yml` if not set). |
| `default_group_visibility` | string | no | What visibility level new groups receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
| `default_group_visibility` | string | no | What visibility level new groups receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
| `default_project_creation` | integer | no | Default project creation protection. Can take: `0` _(No one)_, `1` _(Maintainers)_ or `2` _(Developers + Maintainers)_|
| `default_project_creation` | integer | no | Default project creation protection. Can take: `0` _(No one)_, `1` _(Maintainers)_ or `2` _(Developers + Maintainers)_|
...
@@ -230,7 +230,7 @@ are listed in the descriptions of the relevant settings.
...
@@ -230,7 +230,7 @@ are listed in the descriptions of the relevant settings.
| `elasticsearch_namespace_ids` | array of integers | no | **(PREMIUM)** The namespaces to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
| `elasticsearch_namespace_ids` | array of integers | no | **(PREMIUM)** The namespaces to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
| `elasticsearch_project_ids` | array of integers | no | **(PREMIUM)** The projects to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
| `elasticsearch_project_ids` | array of integers | no | **(PREMIUM)** The projects to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
| `elasticsearch_url` | string | no | **(PREMIUM)** The url to use for connecting to Elasticsearch. Use a comma-separated list to support cluster (e.g., `http://localhost:9200, http://localhost:9201"`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (e.g., `http://<username>:<password>@<elastic_host>:9200/`). |
| `elasticsearch_url` | string | no | **(PREMIUM)** The url to use for connecting to Elasticsearch. Use a comma-separated list to support cluster (for example, `http://localhost:9200, http://localhost:9201"`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (for example, `http://<username>:<password>@<elastic_host>:9200/`). |
| `email_additional_text` | string | no | **(PREMIUM)** Additional text added to the bottom of every email for legal/auditing/compliance reasons |
| `email_additional_text` | string | no | **(PREMIUM)** Additional text added to the bottom of every email for legal/auditing/compliance reasons |
| `email_author_in_body` | boolean | no | Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead. |
| `email_author_in_body` | boolean | no | Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead. |
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
...
@@ -323,23 +323,23 @@ are listed in the descriptions of the relevant settings.
...
@@ -323,23 +323,23 @@ are listed in the descriptions of the relevant settings.
| `slack_app_id` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app id of the Slack-app. |
| `slack_app_id` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app id of the Slack-app. |
| `slack_app_secret` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app secret of the Slack-app. |
| `slack_app_secret` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app secret of the Slack-app. |
| `slack_app_verification_token` | string | required by: `slack_app_enabled` | **(PREMIUM)** The verification token of the Slack-app. |
| `slack_app_verification_token` | string | required by: `slack_app_enabled` | **(PREMIUM)** The verification token of the Slack-app. |
| `snowplow_app_id` | string | no | The Snowplow site name / application id. (e.g.`gitlab`) |
| `snowplow_app_id` | string | no | The Snowplow site name / application id. (for example,`gitlab`) |
| `snowplow_iglu_registry_url` | string | no | The Snowplow base Iglu Schema Registry URL to use for custom context and self describing events'|
| `snowplow_iglu_registry_url` | string | no | The Snowplow base Iglu Schema Registry URL to use for custom context and self describing events'|
| `sourcegraph_enabled` | boolean | no | Enables Sourcegraph integration. Default is `false`. **If enabled, requires**`sourcegraph_url`. |
| `sourcegraph_enabled` | boolean | no | Enables Sourcegraph integration. Default is `false`. **If enabled, requires**`sourcegraph_url`. |
| `sourcegraph_url` | string | required by: `sourcegraph_enabled` | The Sourcegraph instance URL for integration. |
| `sourcegraph_url` | string | required by: `sourcegraph_enabled` | The Sourcegraph instance URL for integration. |
| `sourcegraph_public_only` | boolean | no | Blocks Sourcegraph from being loaded on private and internal projects. Default is `true`. |
| `sourcegraph_public_only` | boolean | no | Blocks Sourcegraph from being loaded on private and internal projects. Default is `true`. |
| `terminal_max_session_time` | integer | no | Maximum time for web terminal websocket connection (in seconds). Set to `0` for unlimited time. |
| `terminal_max_session_time` | integer | no | Maximum time for web terminal websocket connection (in seconds). Set to `0` for unlimited time. |
| `terms` | text | required by: `enforce_terms` | (**Required by:**`enforce_terms`) Markdown content for the ToS. |
| `terms` | text | required by: `enforce_terms` | (**Required by:**`enforce_terms`) Markdown content for the ToS. |
| `throttle_authenticated_api_enabled` | boolean | no | (**If enabled, requires:**`throttle_authenticated_api_period_in_seconds` and `throttle_authenticated_api_requests_per_period`) Enable authenticated API request rate limit. Helps reduce request volume (e.g. from crawlers or abusive bots). |
| `throttle_authenticated_api_enabled` | boolean | no | (**If enabled, requires:**`throttle_authenticated_api_period_in_seconds` and `throttle_authenticated_api_requests_per_period`) Enable authenticated API request rate limit. Helps reduce request volume (for example, from crawlers or abusive bots). |
| `throttle_authenticated_api_period_in_seconds` | integer | required by: `throttle_authenticated_api_enabled` | Rate limit period in seconds. |
| `throttle_authenticated_api_period_in_seconds` | integer | required by: `throttle_authenticated_api_enabled` | Rate limit period in seconds. |
| `throttle_authenticated_api_requests_per_period` | integer | required by: `throttle_authenticated_api_enabled` | Max requests per period per user. |
| `throttle_authenticated_api_requests_per_period` | integer | required by: `throttle_authenticated_api_enabled` | Max requests per period per user. |
| `throttle_authenticated_web_enabled` | boolean | no | (**If enabled, requires:**`throttle_authenticated_web_period_in_seconds` and `throttle_authenticated_web_requests_per_period`) Enable authenticated web request rate limit. Helps reduce request volume (e.g. from crawlers or abusive bots). |
| `throttle_authenticated_web_enabled` | boolean | no | (**If enabled, requires:**`throttle_authenticated_web_period_in_seconds` and `throttle_authenticated_web_requests_per_period`) Enable authenticated web request rate limit. Helps reduce request volume (for example, from crawlers or abusive bots). |
| `throttle_authenticated_web_period_in_seconds` | integer | required by: `throttle_authenticated_web_enabled` | Rate limit period in seconds. |
| `throttle_authenticated_web_period_in_seconds` | integer | required by: `throttle_authenticated_web_enabled` | Rate limit period in seconds. |
| `throttle_authenticated_web_requests_per_period` | integer | required by: `throttle_authenticated_web_enabled` | Max requests per period per user. |
| `throttle_authenticated_web_requests_per_period` | integer | required by: `throttle_authenticated_web_enabled` | Max requests per period per user. |
| `throttle_unauthenticated_enabled` | boolean | no | (**If enabled, requires:**`throttle_unauthenticated_period_in_seconds` and `throttle_unauthenticated_requests_per_period`) Enable unauthenticated request rate limit. Helps reduce request volume (e.g. from crawlers or abusive bots). |
| `throttle_unauthenticated_enabled` | boolean | no | (**If enabled, requires:**`throttle_unauthenticated_period_in_seconds` and `throttle_unauthenticated_requests_per_period`) Enable unauthenticated request rate limit. Helps reduce request volume (for example, from crawlers or abusive bots). |
| `throttle_unauthenticated_period_in_seconds` | integer | required by: `throttle_unauthenticated_enabled` | Rate limit period in seconds. |
| `throttle_unauthenticated_period_in_seconds` | integer | required by: `throttle_unauthenticated_enabled` | Rate limit period in seconds. |
| `throttle_unauthenticated_requests_per_period` | integer | required by: `throttle_unauthenticated_enabled` | Max requests per period per IP. |
| `throttle_unauthenticated_requests_per_period` | integer | required by: `throttle_unauthenticated_enabled` | Max requests per period per IP. |
| `time_tracking_limit_to_hours` | boolean | no | Limit display of time tracking units to hours. Default is `false`. |
| `time_tracking_limit_to_hours` | boolean | no | Limit display of time tracking units to hours. Default is `false`. |
On password update, user will be forced to change it upon next login.
On password update, user will be forced to change it upon next login.
Note, at the moment this method does only return a `404` error,
Note, at the moment this method does only return a `404` error,
even in cases where a `409` (Conflict) would be more appropriate,
even in cases where a `409` (Conflict) would be more appropriate.
e.g. when renaming the email address to some existing one.
For example, when renaming the email address to some existing one.
## Delete authentication identity from user
## Delete authentication identity from user
...
@@ -1389,7 +1389,7 @@ The activities that update the timestamp are:
...
@@ -1389,7 +1389,7 @@ The activities that update the timestamp are:
- Git HTTP/SSH activities (such as clone, push)
- Git HTTP/SSH activities (such as clone, push)
- User logging in into GitLab
- User logging in into GitLab
- User visiting pages related to Dashboards, Projects, Issues and Merge Requests ([introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/54947) in GitLab 11.8)
- User visiting pages related to Dashboards, Projects, Issues, and Merge Requests ([introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/54947) in GitLab 11.8)
- User using the API
- User using the API
By default, it shows the activity for all users in the last 6 months, but this can be
By default, it shows the activity for all users in the last 6 months, but this can be
...
@@ -1403,7 +1403,7 @@ Parameters:
...
@@ -1403,7 +1403,7 @@ Parameters:
| Attribute | Type | Required | Description |
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| --------- | ---- | -------- | ----------- |
| `from` | string | no | Date string in the format YEAR-MONTH-DAY, e.g.`2016-03-11`. Defaults to 6 months ago. |
| `from` | string | no | Date string in the format YEAR-MONTH-DAY. For example,`2016-03-11`. Defaults to 6 months ago. |
@@ -44,7 +44,7 @@ All these operations will put all files into a `build` folder, which is ready to
...
@@ -44,7 +44,7 @@ All these operations will put all files into a `build` folder, which is ready to
## How to transfer files to a live server
## How to transfer files to a live server
You have multiple options: rsync, scp, sftp and so on. For now, we will use scp.
You have multiple options: rsync, scp, sftp, and so on. For now, we will use scp.
To make this work, you need to add a GitLab CI/CD Variable (accessible on `gitlab.example/your-project-name/variables`). That variable will be called `STAGING_PRIVATE_KEY` and it's the **private** SSH key of your server.
To make this work, you need to add a GitLab CI/CD Variable (accessible on `gitlab.example/your-project-name/variables`). That variable will be called `STAGING_PRIVATE_KEY` and it's the **private** SSH key of your server.
Laravel is a high quality web framework written in PHP.
Laravel is a high quality web framework written in PHP.
It has a great community with a [fantastic documentation](https://laravel.com/docs).
It has a great community with a [fantastic documentation](https://laravel.com/docs).
Aside from the usual routing, controllers, requests, responses, views, and (blade) templates, out of the box Laravel provides plenty of additional services such as cache, events, localization, authentication and many others.
Aside from the usual routing, controllers, requests, responses, views, and (blade) templates, out of the box Laravel provides plenty of additional services such as cache, events, localization, authentication, and many others.
We will use [Envoy](https://laravel.com/docs/master/envoy) as an SSH task runner based on PHP.
We will use [Envoy](https://laravel.com/docs/master/envoy) as an SSH task runner based on PHP.
It uses a clean, minimal [Blade syntax](https://laravel.com/docs/master/blade) to set up tasks that can run on remote servers, such as, cloning your project from the repository, installing the Composer dependencies, and running [Artisan commands](https://laravel.com/docs/master/artisan).
It uses a clean, minimal [Blade syntax](https://laravel.com/docs/master/blade) to set up tasks that can run on remote servers, such as, cloning your project from the repository, installing the Composer dependencies, and running [Artisan commands](https://laravel.com/docs/master/artisan).
...
@@ -82,7 +82,7 @@ git push -u origin master
...
@@ -82,7 +82,7 @@ git push -u origin master
## Configure the production server
## Configure the production server
Before we begin setting up Envoy and GitLab CI/CD, let's quickly make sure the production server is ready for deployment.
Before we begin setting up Envoy and GitLab CI/CD, let's quickly make sure the production server is ready for deployment.
We have installed LEMP stack which stands for Linux, NGINX, MySQL and PHP on our Ubuntu 16.04.
We have installed LEMP stack which stands for Linux, NGINX, MySQL, and PHP on our Ubuntu 16.04.
### Create a new user
### Create a new user
...
@@ -194,7 +194,7 @@ To start, we create an `Envoy.blade.php` in the root of our app with a simple ta
...
@@ -194,7 +194,7 @@ To start, we create an `Envoy.blade.php` in the root of our app with a simple ta
@endtask
@endtask
```
```
As you may expect, we have an array within `@servers` directive at the top of the file, which contains a key named `web` with a value of the server's address (e.g.`deployer@192.168.1.1`).
As you may expect, we have an array within `@servers` directive at the top of the file, which contains a key named `web` with a value of the server's address (for example,`deployer@192.168.1.1`).
Then within our `@task` directive we define the bash commands that should be run on the server when the task is executed.
Then within our `@task` directive we define the bash commands that should be run on the server when the task is executed.
On the local machine use the `run` command to run Envoy tasks.
On the local machine use the `run` command to run Envoy tasks.
![Pipeline mini graph sorting](img/pipelines_mini_graph_sorting.png)
![Pipeline mini graph sorting](img/pipelines_mini_graph_sorting.png)
### How pipeline duration is calculated
Total running time for a given pipeline excludes retries and pending
(queued) time.
Each job is represented as a `Period`, which consists of:
-`Period#first` (when the job started).
-`Period#last` (when the job finished).
A simple example is:
- A (1, 3)
- B (2, 4)
- C (6, 7)
In the example:
- A begins at 1 and ends at 3.
- B begins at 2 and ends at 4.
- C begins at 6 and ends at 7.
Visually, it can be viewed as:
```text
0 1 2 3 4 5 6 7
AAAAAAA
BBBBBBB
CCCC
```
The union of A, B, and C is (1, 4) and (6, 7). Therefore, the total running time is:
```text
(4 - 1) + (7 - 6) => 4
```
### How pipeline quotas are used
Each user has a personal pipeline quota that tracks the usage of shared runners in all personal projects.
Each group has a [usage quota](../subscriptions/index.md#ci-pipeline-minutes) that tracks the usage of shared runners for all projects created within the group.
When a pipeline is triggered, regardless of who triggered it, the pipeline quota for the project owner's [namespace](../user/group/index.md#namespaces) is used. In this case, the namespace can be the user or group that owns the project.
### Expanding and collapsing job log sections
### Expanding and collapsing job log sections
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/14664) in GitLab
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/14664) in GitLab
...
@@ -203,6 +159,65 @@ this line should be hidden when collapsed
...
@@ -203,6 +159,65 @@ this line should be hidden when collapsed
section_end:1560896353:my_first_section\r\e[0K
section_end:1560896353:my_first_section\r\e[0K
```
```
### Pipeline success and duration charts
> - Introduced in GitLab 3.1.1 as Commit Stats, and later renamed to Pipeline Charts.
> - [Renamed](https://gitlab.com/gitlab-org/gitlab/issues/38318) to CI / CD Analytics in GitLab 12.8.
GitLab tracks the history of your pipeline successes and failures, as well as how long each pipeline ran. To view this information, go to **Analytics > CI / CD Analytics**.
Each user has a personal pipeline quota that tracks the usage of shared runners in all personal projects.
Each group has a [usage quota](../subscriptions/index.md#ci-pipeline-minutes) that tracks the usage of shared runners for all projects created within the group.
When a pipeline is triggered, regardless of who triggered it, the pipeline quota for the project owner's [namespace](../user/group/index.md#namespaces) is used. In this case, the namespace can be the user or group that owns the project.
### How pipeline duration is calculated
Total running time for a given pipeline excludes retries and pending
(queued) time.
Each job is represented as a `Period`, which consists of:
-`Period#first` (when the job started).
-`Period#last` (when the job finished).
A simple example is:
- A (1, 3)
- B (2, 4)
- C (6, 7)
In the example:
- A begins at 1 and ends at 3.
- B begins at 2 and ends at 4.
- C begins at 6 and ends at 7.
Visually, it can be viewed as:
```text
0 1 2 3 4 5 6 7
AAAAAAA
BBBBBBB
CCCC
```
The union of A, B, and C is (1, 4) and (6, 7). Therefore, the total running time is:
```text
(4 - 1) + (7 - 6) => 4
```
## Configuring pipelines
## Configuring pipelines
Pipelines, and their component jobs and stages, are defined in the [`.gitlab-ci.yml`](yaml/README.md) file for each project.
Pipelines, and their component jobs and stages, are defined in the [`.gitlab-ci.yml`](yaml/README.md) file for each project.
@@ -89,7 +89,7 @@ that it does so in the most appropriate way, that it satisfies all requirements,
...
@@ -89,7 +89,7 @@ that it does so in the most appropriate way, that it satisfies all requirements,
and that there are no remaining bugs, logical problems, uncovered edge cases,
and that there are no remaining bugs, logical problems, uncovered edge cases,
or known vulnerabilities. The best way to do this, and to avoid unnecessary
or known vulnerabilities. The best way to do this, and to avoid unnecessary
back-and-forth with reviewers, is to perform a self-review of your own merge
back-and-forth with reviewers, is to perform a self-review of your own merge
request, following the [Code Review](#reviewing-code) guidelines.
request, following the [Code Review](#reviewing-a-merge-request) guidelines.
To reach the required level of confidence in their solution, an author is expected
To reach the required level of confidence in their solution, an author is expected
to involve other people in the investigation and implementation processes as
to involve other people in the investigation and implementation processes as
...
@@ -129,7 +129,7 @@ This
...
@@ -129,7 +129,7 @@ This
### The responsibility of the reviewer
### The responsibility of the reviewer
[Review the merge request](#reviewing-code) thoroughly. When you are confident
[Review the merge request](#reviewing-a-merge-request) thoroughly. When you are confident
that it meets all requirements, you should:
that it meets all requirements, you should:
- Click the Approve button.
- Click the Approve button.
...
@@ -211,7 +211,7 @@ Instead these should be sent to the [Release Manager](https://about.gitlab.com/c
...
@@ -211,7 +211,7 @@ Instead these should be sent to the [Release Manager](https://about.gitlab.com/c
mentioning them; this will ensure they see it if their notification level is
mentioning them; this will ensure they see it if their notification level is
set to "mentioned" and other people will understand they don't have to respond.
set to "mentioned" and other people will understand they don't have to respond.
### Having your code reviewed
### Having your merge request reviewed
Please keep in mind that code review is a process that can take multiple
Please keep in mind that code review is a process that can take multiple
iterations, and reviewers may spot things later that they may not have seen the
iterations, and reviewers may spot things later that they may not have seen the
...
@@ -244,52 +244,17 @@ first time.
...
@@ -244,52 +244,17 @@ first time.
If you want to have your merge request reviewed, you can assign it to any reviewer. The list of reviewers can be found on [Engineering projects](https://about.gitlab.com/handbook/engineering/projects/) page.
If you want to have your merge request reviewed, you can assign it to any reviewer. The list of reviewers can be found on [Engineering projects](https://about.gitlab.com/handbook/engineering/projects/) page.
You can also use `ready for review` label. That means that your merge request is ready to be reviewed and any reviewer can pick it. It is recommended to use that label only if there isn't time pressure and make sure the merge request is assigned to a reviewer.
You can also use `workflow::ready for review` label. That means that your merge request is ready to be reviewed and any reviewer can pick it. It is recommended to use that label only if there isn't time pressure and make sure the merge request is assigned to a reviewer.
When your merge request was reviewed and can be passed to a maintainer you can either pick a specific maintainer or use a label `ready for merge`.
When your merge request was reviewed and can be passed to a maintainer you can either pick a specific maintainer or use a label `ready for merge`.
It is responsibility of the author of a merge request that the merge request is reviewed. If it stays in `ready for review` state too long it is recommended to assign it to a specific reviewer.
It is responsibility of the author of a merge request that the merge request is reviewed. If it stays in `ready for review` state too long it is recommended to assign it to a specific reviewer.
### List of merge requests ready for review
#### List of merge requests ready for review
Developers who have capacity can regularly check the list of [merge requests to review](https://gitlab.com/groups/gitlab-org/-/merge_requests?scope=all&utf8=%E2%9C%93&state=opened&label_name%5B%5D=ready%20for%20review) and assign any merge request they want to review.
Developers who have capacity can regularly check the list of [merge requests to review](https://gitlab.com/groups/gitlab-org/-/merge_requests?state=opened&label_name%5B%5D=workflow%3A%3Aready%20for%20review) and assign any merge request they want to review.
### Review turnaround time
### Reviewing a merge request
Since [unblocking others is always a top priority](https://about.gitlab.com/handbook/values/#global-optimization),
reviewers are expected to review assigned merge requests in a timely manner,
even when this may negatively impact their other tasks and priorities.
Doing so allows everyone involved in the merge request to iterate faster as the
context is fresh in memory, and improves contributors' experience significantly.
#### Review-response SLO
To ensure swift feedback to ready-to-review code, we maintain a `Review-response` Service-level Objective (SLO). The SLO is defined as:
> - review-response SLO = (time when first review response is provided) - (time MR is assigned to reviewer) < 2 business days
If you don't think you'll be able to review a merge request within the `Review-response` SLO
time frame, let the author know as soon as possible and try to help them find
another reviewer or maintainer who will be able to, so that they can be unblocked
and get on with their work quickly.
If you think you are at capacity and are unable to accept any more reviews until
some have been completed, communicate this through your GitLab status by setting
the `:red_circle:` emoji and mentioning that you are at capacity in the status
text. This will guide contributors to pick a different reviewer, helping us to
this through your GitLab.com Status, authors are expected to realize this and
find a different reviewer themselves.
When a merge request author has been blocked for longer than
the `Review-response` SLO, they are free to remind the reviewer through Slack or assign
another reviewer.
### Reviewing code
Understand why the change is necessary (fixes a bug, improves the user
Understand why the change is necessary (fixes a bug, improves the user
experience, refactors the existing code). Then:
experience, refactors the existing code). Then:
...
@@ -310,26 +275,47 @@ experience, refactors the existing code). Then:
...
@@ -310,26 +275,47 @@ experience, refactors the existing code). Then:
"LGTM :thumbsup:", or "Just a couple things to address."
"LGTM :thumbsup:", or "Just a couple things to address."
- Assign the merge request to the author if changes are required following your
- Assign the merge request to the author if changes are required following your
review.
review.
- Set the milestone before merging a merge request.
- Ensure the target branch is not too far behind master. If
### Merging a merge request
[master is red](https://about.gitlab.com/handbook/engineering/workflow/#broken-master),
it should be no more than 100 commits behind.
Before taking the decision to merge:
- Set the milestone.
- Consider warnings and errors from danger bot, code quality, and other reports.
- Consider warnings and errors from danger bot, code quality, and other reports.
Unless a strong case can be made for the violation, these should be resolved
Unless a strong case can be made for the violation, these should be resolved
before merge.
before merge. A comment must to be posted if the MR is merged with any failed job.
- Ensure a passing CI pipeline or if [master is broken](https://about.gitlab.com/handbook/engineering/workflow/#broken-master), post a comment mentioning the failure happens in master with a
link to the ~"master:broken" issue.
When ready to merge:
- Avoid accepting a merge request before the job succeeds. Of course, "Merge
When Pipeline Succeeds" (MWPS) is fine.
- If you set the MR to "Merge When Pipeline Succeeds", you should take over
subsequent revisions for anything that would be spotted after that.
- Consider using the [Squash and
- Consider using the [Squash and
merge][squash-and-merge] feature when the merge request has a lot of commits.
feature when the merge request has a lot of commits.
When merging code a maintainer should only use the squash feature if the
When merging code a maintainer should only use the squash feature if the
author has already set this option or if the merge request clearly contains a
author has already set this option or if the merge request clearly contains a
messy commit history that is intended to be squashed.
messy commit history that is intended to be squashed.
-**Start a new merge request pipeline with the `Run Pipeline` button in the merge
request's "Pipelines" tab, and enable "Merge When Pipeline Succeeds" (MWPS).** Note that:
- If the **latest [Pipeline for Merged Results](../ci/merge_request_pipelines/pipelines_for_merged_results/#pipelines-for-merged-results-premium)** finished less than 2 hours ago, you
might merge without starting a new pipeline as the merge request is close
enough to `master`.
- If the merge request is from a fork, check how far behind `master` the
source branch is. If it's more than 100 commits behind, ask the author to
rebase it before merging.
- If [master is broken](https://about.gitlab.com/handbook/engineering/workflow/#broken-master),
in addition to the two above rules, check that any failure also happens
in `master` and post a link to the ~"master:broken" issue before clicking the
red "Merge" button.
- When you set the MR to "Merge When Pipeline Succeeds", you should take over
subsequent revisions for anything that would be spotted after that.
this through your GitLab.com Status, authors are expected to realize this and
find a different reviewer themselves.
When a merge request author has been blocked for longer than
the `Review-response` SLO, they are free to remind the reviewer through Slack or assign
another reviewer.
## Examples
## Examples
How code reviews are conducted can surprise new contributors. Here are some examples of code reviews that should help to orient you as to what to expect.
How code reviews are conducted can surprise new contributors. Here are some examples of code reviews that should help to orient you as to what to expect.
# is deployed and GITLAB_WORKHORSE_VERSION is updated accordingly.
requires:file,types: [::API::Validations::Types::WorkhorseFile,File],desc: 'The project export file to be imported'# rubocop:disable Scalability/FileUploads
optional:name,type: String,desc: 'The name of the project to be imported. Defaults to the path of the project if not provided.'
optional:name,type: String,desc: 'The name of the project to be imported. Defaults to the path of the project if not provided.'
optional:namespace,type: String,desc: "The ID or name of the namespace that the project will be imported into. Defaults to the current user's namespace."
optional:namespace,type: String,desc: "The ID or name of the namespace that the project will be imported into. Defaults to the current user's namespace."
optional:overwrite,type: Boolean,default: false,desc: 'If there is a project in the same namespace and with the same name overwrite it'
optional:overwrite,type: Boolean,default: false,desc: 'If there is a project in the same namespace and with the same name overwrite it'
...
@@ -38,12 +59,24 @@ module API
...
@@ -38,12 +59,24 @@ module API
desc: 'New project params to override values in the export'do
desc: 'New project params to override values in the export'do
use:optional_project_params
use:optional_project_params
end
end
optional'file.path',type: String,desc: 'Path to locally stored body (generated by Workhorse)'
optional'file.name',type: String,desc: 'Real filename as send in Content-Disposition (generated by Workhorse)'
optional'file.type',type: String,desc: 'Real content type as send in Content-Type (generated by Workhorse)'
optional'file.size',type: Integer,desc: 'Real size of file (generated by Workhorse)'
optional'file.md5',type: String,desc: 'MD5 checksum of the file (generated by Workhorse)'
optional'file.sha1',type: String,desc: 'SHA1 checksum of the file (generated by Workhorse)'
optional'file.sha256',type: String,desc: 'SHA256 checksum of the file (generated by Workhorse)'
optional'file.etag',type: String,desc: 'Etag of the file (generated by Workhorse)'
optional'file.remote_id',type: String,desc: 'Remote_id of the file (generated by Workhorse)'
optional'file.remote_url',type: String,desc: 'Remote_url of the file (generated by Workhorse)'
end
end
desc'Create a new project import'do
desc'Create a new project import'do
detail'This feature was introduced in GitLab 10.6.'
detail'This feature was introduced in GitLab 10.6.'