Commit d94ed2a4 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent e56fd471
...@@ -166,6 +166,7 @@ export default { ...@@ -166,6 +166,7 @@ export default {
:href="lineHref" :href="lineHref"
@click="setHighlightedRow(lineCode)" @click="setHighlightedRow(lineCode)"
> >
{{ lineNumber }}
</a> </a>
<diff-gutter-avatars <diff-gutter-avatars
v-if="shouldShowAvatarsOnGutter" v-if="shouldShowAvatarsOnGutter"
......
...@@ -485,10 +485,6 @@ table.code { ...@@ -485,10 +485,6 @@ table.code {
} }
} }
} }
&:not(.js-unfold-bottom) a::before {
content: attr(data-linenumber);
}
} }
&.line_content { &.line_content {
......
---
title: Replace line diff number css selector with actual HTML inside MRs
merge_request:
author: Oregand
type: other
---
title: Disable Marginalia line backtrace in production
merge_request: 26199
author:
type: performance
...@@ -9,7 +9,13 @@ require 'marginalia' ...@@ -9,7 +9,13 @@ require 'marginalia'
# Refer: https://github.com/basecamp/marginalia/blob/v1.8.0/lib/marginalia/railtie.rb#L67 # Refer: https://github.com/basecamp/marginalia/blob/v1.8.0/lib/marginalia/railtie.rb#L67
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Marginalia::ActiveRecordInstrumentation) ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Marginalia::ActiveRecordInstrumentation)
Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class, :line] Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class]
# As mentioned in https://github.com/basecamp/marginalia/pull/93/files,
# adding :line has some overhead because a regexp on the backtrace has
# to be run on every SQL query. Only enable this in development because
# we've seen it slow things down.
Marginalia::Comment.components << :line if Rails.env.development?
Gitlab::Marginalia.set_application_name Gitlab::Marginalia.set_application_name
......
...@@ -355,7 +355,7 @@ curl --head --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example ...@@ -355,7 +355,7 @@ curl --head --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example
The response will then be: The response will then be:
``` ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Cache-Control: no-cache Cache-Control: no-cache
Content-Length: 1103 Content-Length: 1103
...@@ -415,7 +415,7 @@ curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab ...@@ -415,7 +415,7 @@ curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab
The response header includes a link to the next page. For example: The response header includes a link to the next page. For example:
``` ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
... ...
Link: <https://gitlab.example.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=asc&id_after=42>; rel="next" Link: <https://gitlab.example.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=asc&id_after=42>; rel="next"
...@@ -540,7 +540,7 @@ Such errors appear in two cases: ...@@ -540,7 +540,7 @@ Such errors appear in two cases:
When an attribute is missing, you will get something like: When an attribute is missing, you will get something like:
``` ```http
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
{ {
...@@ -551,7 +551,7 @@ Content-Type: application/json ...@@ -551,7 +551,7 @@ Content-Type: application/json
When a validation error occurs, error messages will be different. They will When a validation error occurs, error messages will be different. They will
hold all details of validation errors: hold all details of validation errors:
``` ```http
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
{ {
...@@ -589,7 +589,7 @@ follows: ...@@ -589,7 +589,7 @@ follows:
When you try to access an API URL that does not exist you will receive 404 Not Found. When you try to access an API URL that does not exist you will receive 404 Not Found.
``` ```http
HTTP/1.1 404 Not Found HTTP/1.1 404 Not Found
Content-Type: application/json Content-Type: application/json
{ {
......
...@@ -6,7 +6,7 @@ You can read more about [triggering pipelines through the API](../ci/triggers/RE ...@@ -6,7 +6,7 @@ You can read more about [triggering pipelines through the API](../ci/triggers/RE
Get a list of project's build triggers. Get a list of project's build triggers.
``` ```plaintext
GET /projects/:id/triggers GET /projects/:id/triggers
``` ```
...@@ -14,7 +14,7 @@ GET /projects/:id/triggers ...@@ -14,7 +14,7 @@ GET /projects/:id/triggers
|-----------|---------|----------|---------------------| |-----------|---------|----------|---------------------|
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
``` ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers"
``` ```
...@@ -36,7 +36,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a ...@@ -36,7 +36,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Get details of project's build trigger. Get details of project's build trigger.
``` ```plaintext
GET /projects/:id/triggers/:trigger_id GET /projects/:id/triggers/:trigger_id
``` ```
...@@ -45,7 +45,7 @@ GET /projects/:id/triggers/:trigger_id ...@@ -45,7 +45,7 @@ GET /projects/:id/triggers/:trigger_id
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `trigger_id` | integer | yes | The trigger id | | `trigger_id` | integer | yes | The trigger id |
``` ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers/5" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers/5"
``` ```
...@@ -65,7 +65,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a ...@@ -65,7 +65,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Create a trigger for a project. Create a trigger for a project.
``` ```plaintext
POST /projects/:id/triggers POST /projects/:id/triggers
``` ```
...@@ -74,7 +74,7 @@ POST /projects/:id/triggers ...@@ -74,7 +74,7 @@ POST /projects/:id/triggers
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `description` | string | yes | The trigger name | | `description` | string | yes | The trigger name |
``` ```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form description="my description" "https://gitlab.example.com/api/v4/projects/1/triggers" curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form description="my description" "https://gitlab.example.com/api/v4/projects/1/triggers"
``` ```
...@@ -94,7 +94,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form descrip ...@@ -94,7 +94,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form descrip
Update a trigger for a project. Update a trigger for a project.
``` ```plaintext
PUT /projects/:id/triggers/:trigger_id PUT /projects/:id/triggers/:trigger_id
``` ```
...@@ -104,7 +104,7 @@ PUT /projects/:id/triggers/:trigger_id ...@@ -104,7 +104,7 @@ PUT /projects/:id/triggers/:trigger_id
| `trigger_id` | integer | yes | The trigger id | | `trigger_id` | integer | yes | The trigger id |
| `description` | string | no | The trigger name | | `description` | string | no | The trigger name |
``` ```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form description="my description" "https://gitlab.example.com/api/v4/projects/1/triggers/10" curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form description="my description" "https://gitlab.example.com/api/v4/projects/1/triggers/10"
``` ```
...@@ -124,7 +124,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form descript ...@@ -124,7 +124,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form descript
Remove a project's build trigger. Remove a project's build trigger.
``` ```plaintext
DELETE /projects/:id/triggers/:trigger_id DELETE /projects/:id/triggers/:trigger_id
``` ```
...@@ -133,6 +133,6 @@ DELETE /projects/:id/triggers/:trigger_id ...@@ -133,6 +133,6 @@ DELETE /projects/:id/triggers/:trigger_id
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `trigger_id` | integer | yes | The trigger id | | `trigger_id` | integer | yes | The trigger id |
``` ```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers/5" curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/triggers/5"
``` ```
...@@ -9,7 +9,7 @@ GitLab supports links links to `http`, `https`, and `ftp` assets. ...@@ -9,7 +9,7 @@ GitLab supports links links to `http`, `https`, and `ftp` assets.
Get assets as links from a Release. Get assets as links from a Release.
``` ```plaintext
GET /projects/:id/releases/:tag_name/assets/links GET /projects/:id/releases/:tag_name/assets/links
``` ```
...@@ -47,7 +47,7 @@ Example response: ...@@ -47,7 +47,7 @@ Example response:
Get an asset as a link from a Release. Get an asset as a link from a Release.
``` ```plaintext
GET /projects/:id/releases/:tag_name/assets/links/:link_id GET /projects/:id/releases/:tag_name/assets/links/:link_id
``` ```
...@@ -78,7 +78,7 @@ Example response: ...@@ -78,7 +78,7 @@ Example response:
Create an asset as a link from a Release. Create an asset as a link from a Release.
``` ```plaintext
POST /projects/:id/releases/:tag_name/assets/links POST /projects/:id/releases/:tag_name/assets/links
``` ```
...@@ -114,7 +114,7 @@ Example response: ...@@ -114,7 +114,7 @@ Example response:
Update an asset as a link from a Release. Update an asset as a link from a Release.
``` ```plaintext
PUT /projects/:id/releases/:tag_name/assets/links/:link_id PUT /projects/:id/releases/:tag_name/assets/links/:link_id
``` ```
...@@ -150,7 +150,7 @@ Example response: ...@@ -150,7 +150,7 @@ Example response:
Delete an asset as a link from a Release. Delete an asset as a link from a Release.
``` ```plaintext
DELETE /projects/:id/releases/:tag_name/assets/links/:link_id DELETE /projects/:id/releases/:tag_name/assets/links/:link_id
``` ```
......
...@@ -751,7 +751,7 @@ Search within the specified project. ...@@ -751,7 +751,7 @@ Search within the specified project.
If a user is not a member of a project and the project is private, a `GET` request on that project will result to a `404` status code. If a user is not a member of a project and the project is private, a `GET` request on that project will result to a `404` status code.
``` ```plaintext
GET /projects/:id/search GET /projects/:id/search
``` ```
......
...@@ -10,7 +10,7 @@ administrator in order to perform this action. ...@@ -10,7 +10,7 @@ administrator in order to perform this action.
List the current [application settings](#list-of-settings-that-can-be-accessed-via-api-calls) List the current [application settings](#list-of-settings-that-can-be-accessed-via-api-calls)
of the GitLab instance. of the GitLab instance.
``` ```plaintext
GET /application/settings GET /application/settings
``` ```
...@@ -90,7 +90,7 @@ the `file_template_project_id`, `deletion_adjourned_period`, or the `geo_node_al ...@@ -90,7 +90,7 @@ the `file_template_project_id`, `deletion_adjourned_period`, or the `geo_node_al
Use an API call to modify GitLab instance Use an API call to modify GitLab instance
[application settings](#list-of-settings-that-can-be-accessed-via-api-calls). [application settings](#list-of-settings-that-can-be-accessed-via-api-calls).
``` ```plaintext
PUT /application/settings PUT /application/settings
``` ```
......
...@@ -10,7 +10,7 @@ of Sidekiq, its jobs, queues, and processes. ...@@ -10,7 +10,7 @@ of Sidekiq, its jobs, queues, and processes.
List information about all the registered queues, their backlog and their List information about all the registered queues, their backlog and their
latency. latency.
``` ```plaintext
GET /sidekiq/queue_metrics GET /sidekiq/queue_metrics
``` ```
...@@ -35,7 +35,7 @@ Example response: ...@@ -35,7 +35,7 @@ Example response:
List information about all the Sidekiq workers registered to process your queues. List information about all the Sidekiq workers registered to process your queues.
``` ```plaintext
GET /sidekiq/process_metrics GET /sidekiq/process_metrics
``` ```
...@@ -77,7 +77,7 @@ Example response: ...@@ -77,7 +77,7 @@ Example response:
List information about the jobs that Sidekiq has performed. List information about the jobs that Sidekiq has performed.
``` ```plaintext
GET /sidekiq/job_stats GET /sidekiq/job_stats
``` ```
...@@ -102,7 +102,7 @@ Example response: ...@@ -102,7 +102,7 @@ Example response:
List all the currently available information about Sidekiq. List all the currently available information about Sidekiq.
``` ```plaintext
GET /sidekiq/compound_metrics GET /sidekiq/compound_metrics
``` ```
......
...@@ -8,7 +8,7 @@ administrator in order to perform this action. ...@@ -8,7 +8,7 @@ administrator in order to perform this action.
NOTE: **Note:** NOTE: **Note:**
These statistics are approximate. These statistics are approximate.
``` ```plaintext
GET /application/statistics GET /application/statistics
``` ```
......
...@@ -7,7 +7,7 @@ Every API call to suggestions must be authenticated. ...@@ -7,7 +7,7 @@ Every API call to suggestions must be authenticated.
Applies a suggested patch in a merge request. Users must be Applies a suggested patch in a merge request. Users must be
at least [Developer](../user/permissions.md) to perform such action. at least [Developer](../user/permissions.md) to perform such action.
``` ```plaintext
PUT /suggestions/:id/apply PUT /suggestions/:id/apply
``` ```
......
...@@ -11,7 +11,7 @@ Read more about [system hooks](../system_hooks/system_hooks.md). ...@@ -11,7 +11,7 @@ Read more about [system hooks](../system_hooks/system_hooks.md).
Get a list of all system hooks. Get a list of all system hooks.
``` ```plaintext
GET /hooks GET /hooks
``` ```
...@@ -42,7 +42,7 @@ Example response: ...@@ -42,7 +42,7 @@ Example response:
Add a new system hook. Add a new system hook.
``` ```plaintext
POST /hooks POST /hooks
``` ```
...@@ -81,7 +81,7 @@ Example response: ...@@ -81,7 +81,7 @@ Example response:
## Test system hook ## Test system hook
``` ```plaintext
GET /hooks/:id GET /hooks/:id
``` ```
...@@ -112,7 +112,7 @@ Example response: ...@@ -112,7 +112,7 @@ Example response:
Deletes a system hook. Deletes a system hook.
``` ```plaintext
DELETE /hooks/:id DELETE /hooks/:id
``` ```
......
...@@ -6,7 +6,7 @@ Get a list of repository tags from a project, sorted by name in reverse ...@@ -6,7 +6,7 @@ Get a list of repository tags from a project, sorted by name in reverse
alphabetical order. This endpoint can be accessed without authentication if the alphabetical order. This endpoint can be accessed without authentication if the
repository is publicly accessible. repository is publicly accessible.
``` ```plaintext
GET /projects/:id/repository/tags GET /projects/:id/repository/tags
``` ```
...@@ -57,7 +57,7 @@ Parameters: ...@@ -57,7 +57,7 @@ Parameters:
Get a specific repository tag determined by its name. This endpoint can be Get a specific repository tag determined by its name. This endpoint can be
accessed without authentication if the repository is publicly accessible. accessed without authentication if the repository is publicly accessible.
``` ```plaintext
GET /projects/:id/repository/tags/:tag_name GET /projects/:id/repository/tags/:tag_name
``` ```
...@@ -104,7 +104,7 @@ Example Response: ...@@ -104,7 +104,7 @@ Example Response:
Creates a new tag in the repository that points to the supplied ref. Creates a new tag in the repository that points to the supplied ref.
``` ```plaintext
POST /projects/:id/repository/tags POST /projects/:id/repository/tags
``` ```
...@@ -164,7 +164,7 @@ status code `405` with an explaining error message is returned. ...@@ -164,7 +164,7 @@ status code `405` with an explaining error message is returned.
Deletes a tag of a repository with given name. Deletes a tag of a repository with given name.
``` ```plaintext
DELETE /projects/:id/repository/tags/:tag_name DELETE /projects/:id/repository/tags/:tag_name
``` ```
...@@ -178,7 +178,7 @@ Parameters: ...@@ -178,7 +178,7 @@ Parameters:
Add release notes to the existing Git tag. If there Add release notes to the existing Git tag. If there
already exists a release for the given tag, status code `409` is returned. already exists a release for the given tag, status code `409` is returned.
``` ```plaintext
POST /projects/:id/repository/tags/:tag_name/release POST /projects/:id/repository/tags/:tag_name/release
``` ```
...@@ -210,7 +210,7 @@ Response: ...@@ -210,7 +210,7 @@ Response:
Updates the release notes of a given release. Updates the release notes of a given release.
``` ```plaintext
PUT /projects/:id/repository/tags/:tag_name/release PUT /projects/:id/repository/tags/:tag_name/release
``` ```
......
...@@ -12,7 +12,7 @@ information on Dockerfiles, see the ...@@ -12,7 +12,7 @@ information on Dockerfiles, see the
Get all Dockerfile templates. Get all Dockerfile templates.
``` ```plaintext
GET /templates/dockerfiles GET /templates/dockerfiles
``` ```
...@@ -99,7 +99,7 @@ Example response: ...@@ -99,7 +99,7 @@ Example response:
Get a single Dockerfile template. Get a single Dockerfile template.
``` ```plaintext
GET /templates/dockerfiles/:key GET /templates/dockerfiles/:key
``` ```
......
...@@ -13,7 +13,7 @@ resources available online. ...@@ -13,7 +13,7 @@ resources available online.
Get all license templates. Get all license templates.
``` ```plaintext
GET /templates/licenses GET /templates/licenses
``` ```
...@@ -110,7 +110,7 @@ Example response: ...@@ -110,7 +110,7 @@ Example response:
Get a single license template. You can pass parameters to replace the license Get a single license template. You can pass parameters to replace the license
placeholder. placeholder.
``` ```plaintext
GET /templates/licenses/:key GET /templates/licenses/:key
``` ```
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Returns a list of todos. When no filter is applied, it returns all pending todos Returns a list of todos. When no filter is applied, it returns all pending todos
for the current user. Different filters allow the user to precise the request. for the current user. Different filters allow the user to precise the request.
``` ```plaintext
GET /todos GET /todos
``` ```
...@@ -184,7 +184,7 @@ Example Response: ...@@ -184,7 +184,7 @@ Example Response:
Marks a single pending todo given by its ID for the current user as done. The Marks a single pending todo given by its ID for the current user as done. The
todo marked as done is returned in the response. todo marked as done is returned in the response.
``` ```plaintext
POST /todos/:id/mark_as_done POST /todos/:id/mark_as_done
``` ```
...@@ -280,7 +280,7 @@ Example Response: ...@@ -280,7 +280,7 @@ Example Response:
Marks all pending todos for the current user as done. It returns the HTTP status code `204` with an empty response. Marks all pending todos for the current user as done. It returns the HTTP status code `204` with an empty response.
``` ```plaintext
POST /todos/mark_as_done POST /todos/mark_as_done
``` ```
......
...@@ -10,7 +10,7 @@ This function takes pagination parameters `page` and `per_page` to restrict the ...@@ -10,7 +10,7 @@ This function takes pagination parameters `page` and `per_page` to restrict the
### For normal users ### For normal users
``` ```plaintext
GET /users GET /users
``` ```
...@@ -39,13 +39,13 @@ You can also search for users by name or primary email using `?search=`. For exa ...@@ -39,13 +39,13 @@ You can also search for users by name or primary email using `?search=`. For exa
In addition, you can lookup users by username: In addition, you can lookup users by username:
``` ```plaintext
GET /users?username=:username GET /users?username=:username
``` ```
For example: For example:
``` ```plaintext
GET /users?username=jack_smith GET /users?username=jack_smith
``` ```
...@@ -53,11 +53,11 @@ In addition, you can filter users based on states eg. `blocked`, `active` ...@@ -53,11 +53,11 @@ In addition, you can filter users based on states eg. `blocked`, `active`
This works only to filter users who are `blocked` or `active`. This works only to filter users who are `blocked` or `active`.
It does not support `active=false` or `blocked=false`. It does not support `active=false` or `blocked=false`.
``` ```plaintext
GET /users?active=true GET /users?active=true
``` ```
``` ```plaintext
GET /users?blocked=true GET /users?blocked=true
``` ```
...@@ -66,7 +66,7 @@ Username search is case insensitive. ...@@ -66,7 +66,7 @@ Username search is case insensitive.
### For admins ### For admins
``` ```plaintext
GET /users GET /users
``` ```
...@@ -187,13 +187,13 @@ the `group_saml` provider option: ...@@ -187,13 +187,13 @@ the `group_saml` provider option:
You can lookup users by external UID and provider: You can lookup users by external UID and provider:
``` ```plaintext
GET /users?extern_uid=:extern_uid&provider=:provider GET /users?extern_uid=:extern_uid&provider=:provider
``` ```
For example: For example:
``` ```plaintext
GET /users?extern_uid=1234567&provider=github GET /users?extern_uid=1234567&provider=github
``` ```
...@@ -201,19 +201,19 @@ You can search for users who are external with: `/users?external=true` ...@@ -201,19 +201,19 @@ You can search for users who are external with: `/users?external=true`
You can search users by creation date time range with: You can search users by creation date time range with:
``` ```plaintext
GET /users?created_before=2001-01-02T00:00:00.060Z&created_after=1999-01-02T00:00:00.060 GET /users?created_before=2001-01-02T00:00:00.060Z&created_after=1999-01-02T00:00:00.060
``` ```
You can filter by [custom attributes](custom_attributes.md) with: You can filter by [custom attributes](custom_attributes.md) with:
``` ```plaintext
GET /users?custom_attributes[key]=value&custom_attributes[other_key]=other_value GET /users?custom_attributes[key]=value&custom_attributes[other_key]=other_value
``` ```
You can include the users' [custom attributes](custom_attributes.md) in the response with: You can include the users' [custom attributes](custom_attributes.md) in the response with:
``` ```plaintext
GET /users?with_custom_attributes=true GET /users?with_custom_attributes=true
``` ```
...@@ -223,7 +223,7 @@ Get a single user. ...@@ -223,7 +223,7 @@ Get a single user.
### For user ### For user
``` ```plaintext
GET /users/:id GET /users/:id
``` ```
...@@ -253,7 +253,7 @@ Parameters: ...@@ -253,7 +253,7 @@ Parameters:
### For admin ### For admin
``` ```plaintext
GET /users/:id GET /users/:id
``` ```
...@@ -340,7 +340,7 @@ see the `group_saml` option: ...@@ -340,7 +340,7 @@ see the `group_saml` option:
You can include the user's [custom attributes](custom_attributes.md) in the response with: You can include the user's [custom attributes](custom_attributes.md) in the response with:
``` ```plaintext
GET /users/:id?with_custom_attributes=true GET /users/:id?with_custom_attributes=true
``` ```
...@@ -358,7 +358,7 @@ over `password`. In addition, `reset_password` and ...@@ -358,7 +358,7 @@ over `password`. In addition, `reset_password` and
NOTE: **Note:** NOTE: **Note:**
From [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29888/), `private_profile` will default to `false`. From [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29888/), `private_profile` will default to `false`.
``` ```plaintext
POST /users POST /users
``` ```
...@@ -399,7 +399,7 @@ Parameters: ...@@ -399,7 +399,7 @@ Parameters:
Modifies an existing user. Only administrators can change attributes of a user. Modifies an existing user. Only administrators can change attributes of a user.
``` ```plaintext
PUT /users/:id PUT /users/:id
``` ```
...@@ -445,7 +445,7 @@ For example, when renaming the email address to some existing one. ...@@ -445,7 +445,7 @@ For example, when renaming the email address to some existing one.
Deletes a user's authentication identity using the provider name associated with that identity. Available only for administrators. Deletes a user's authentication identity using the provider name associated with that identity. Available only for administrators.
``` ```plaintext
DELETE /users/:id/identities/:provider DELETE /users/:id/identities/:provider
``` ```
...@@ -459,7 +459,7 @@ Parameters: ...@@ -459,7 +459,7 @@ Parameters:
Deletes a user. Available only for administrators. Deletes a user. Available only for administrators.
This returns a `204 No Content` status code if the operation was successfully, `404` if the resource was not found or `409` if the user cannot be soft deleted. This returns a `204 No Content` status code if the operation was successfully, `404` if the resource was not found or `409` if the user cannot be soft deleted.
``` ```plaintext
DELETE /users/:id DELETE /users/:id
``` ```
...@@ -474,7 +474,7 @@ Parameters: ...@@ -474,7 +474,7 @@ Parameters:
Gets currently authenticated user. Gets currently authenticated user.
``` ```plaintext
GET /user GET /user
``` ```
...@@ -522,7 +522,7 @@ Parameters: ...@@ -522,7 +522,7 @@ Parameters:
- `sudo` (optional) - the ID of a user to make the call in their place - `sudo` (optional) - the ID of a user to make the call in their place
``` ```plaintext
GET /user GET /user
``` ```
...@@ -571,7 +571,7 @@ GET /user ...@@ -571,7 +571,7 @@ GET /user
Get the status of the currently signed in user. Get the status of the currently signed in user.
``` ```plaintext
GET /user/status GET /user/status
``` ```
...@@ -593,7 +593,7 @@ Example response: ...@@ -593,7 +593,7 @@ Example response:
Get the status of a user. Get the status of a user.
``` ```plaintext
GET /users/:id_or_username/status GET /users/:id_or_username/status
``` ```
...@@ -619,7 +619,7 @@ Example response: ...@@ -619,7 +619,7 @@ Example response:
Set the status of the current user. Set the status of the current user.
``` ```plaintext
PUT /user/status PUT /user/status
``` ```
...@@ -652,7 +652,7 @@ Get the counts (same as in top right menu) of the currently signed in user. ...@@ -652,7 +652,7 @@ Get the counts (same as in top right menu) of the currently signed in user.
| --------- | ---- | ----------- | | --------- | ---- | ----------- |
| `merge_requests` | number | Merge requests that are active and assigned to current user. | | `merge_requests` | number | Merge requests that are active and assigned to current user. |
``` ```plaintext
GET /user_counts GET /user_counts
``` ```
...@@ -676,7 +676,7 @@ Please refer to the [List of user projects](projects.md#list-user-projects). ...@@ -676,7 +676,7 @@ Please refer to the [List of user projects](projects.md#list-user-projects).
Get a list of currently authenticated user's SSH keys. Get a list of currently authenticated user's SSH keys.
``` ```plaintext
GET /user/keys GET /user/keys
``` ```
...@@ -705,7 +705,7 @@ Parameters: ...@@ -705,7 +705,7 @@ Parameters:
Get a list of a specified user's SSH keys. Get a list of a specified user's SSH keys.
``` ```plaintext
GET /users/:id_or_username/keys GET /users/:id_or_username/keys
``` ```
...@@ -717,7 +717,7 @@ GET /users/:id_or_username/keys ...@@ -717,7 +717,7 @@ GET /users/:id_or_username/keys
Get a single key. Get a single key.
``` ```plaintext
GET /user/keys/:key_id GET /user/keys/:key_id
``` ```
...@@ -738,7 +738,7 @@ Parameters: ...@@ -738,7 +738,7 @@ Parameters:
Creates a new key owned by the currently authenticated user. Creates a new key owned by the currently authenticated user.
``` ```plaintext
POST /user/keys POST /user/keys
``` ```
...@@ -776,7 +776,7 @@ error occurs a `400 Bad Request` is returned with a message explaining the error ...@@ -776,7 +776,7 @@ error occurs a `400 Bad Request` is returned with a message explaining the error
Create new key owned by specified user. Available only for admin Create new key owned by specified user. Available only for admin
``` ```plaintext
POST /users/:id/keys POST /users/:id/keys
``` ```
...@@ -791,7 +791,7 @@ Parameters: ...@@ -791,7 +791,7 @@ Parameters:
Deletes key owned by currently authenticated user. Deletes key owned by currently authenticated user.
This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found.
``` ```plaintext
DELETE /user/keys/:key_id DELETE /user/keys/:key_id
``` ```
...@@ -803,7 +803,7 @@ Parameters: ...@@ -803,7 +803,7 @@ Parameters:
Deletes key owned by a specified user. Available only for admin. Deletes key owned by a specified user. Available only for admin.
``` ```plaintext
DELETE /users/:id/keys/:key_id DELETE /users/:id/keys/:key_id
``` ```
...@@ -816,7 +816,7 @@ Parameters: ...@@ -816,7 +816,7 @@ Parameters:
Get a list of currently authenticated user's GPG keys. Get a list of currently authenticated user's GPG keys.
``` ```plaintext
GET /user/gpg_keys GET /user/gpg_keys
``` ```
...@@ -840,7 +840,7 @@ Example response: ...@@ -840,7 +840,7 @@ Example response:
Get a specific GPG key of currently authenticated user. Get a specific GPG key of currently authenticated user.
``` ```plaintext
GET /user/gpg_keys/:key_id GET /user/gpg_keys/:key_id
``` ```
...@@ -868,7 +868,7 @@ Example response: ...@@ -868,7 +868,7 @@ Example response:
Creates a new GPG key owned by the currently authenticated user. Creates a new GPG key owned by the currently authenticated user.
``` ```plaintext
POST /user/gpg_keys POST /user/gpg_keys
``` ```
...@@ -898,7 +898,7 @@ Example response: ...@@ -898,7 +898,7 @@ Example response:
Delete a GPG key owned by currently authenticated user. Delete a GPG key owned by currently authenticated user.
``` ```plaintext
DELETE /user/gpg_keys/:key_id DELETE /user/gpg_keys/:key_id
``` ```
...@@ -918,7 +918,7 @@ Returns `204 No Content` on success, or `404 Not found` if the key cannot be fou ...@@ -918,7 +918,7 @@ Returns `204 No Content` on success, or `404 Not found` if the key cannot be fou
Get a list of a specified user's GPG keys. Available only for admins. Get a list of a specified user's GPG keys. Available only for admins.
``` ```plaintext
GET /users/:id/gpg_keys GET /users/:id/gpg_keys
``` ```
...@@ -948,7 +948,7 @@ Example response: ...@@ -948,7 +948,7 @@ Example response:
Get a specific GPG key for a given user. Available only for admins. Get a specific GPG key for a given user. Available only for admins.
``` ```plaintext
GET /users/:id/gpg_keys/:key_id GET /users/:id/gpg_keys/:key_id
``` ```
...@@ -977,7 +977,7 @@ Example response: ...@@ -977,7 +977,7 @@ Example response:
Create new GPG key owned by the specified user. Available only for admins. Create new GPG key owned by the specified user. Available only for admins.
``` ```plaintext
POST /users/:id/gpg_keys POST /users/:id/gpg_keys
``` ```
...@@ -1008,7 +1008,7 @@ Example response: ...@@ -1008,7 +1008,7 @@ Example response:
Delete a GPG key owned by a specified user. Available only for admins. Delete a GPG key owned by a specified user. Available only for admins.
``` ```plaintext
DELETE /users/:id/gpg_keys/:key_id DELETE /users/:id/gpg_keys/:key_id
``` ```
...@@ -1027,7 +1027,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitl ...@@ -1027,7 +1027,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitl
Get a list of currently authenticated user's emails. Get a list of currently authenticated user's emails.
``` ```plaintext
GET /user/emails GET /user/emails
``` ```
...@@ -1052,7 +1052,7 @@ Parameters: ...@@ -1052,7 +1052,7 @@ Parameters:
Get a list of a specified user's emails. Available only for admin Get a list of a specified user's emails. Available only for admin
``` ```plaintext
GET /users/:id/emails GET /users/:id/emails
``` ```
...@@ -1064,7 +1064,7 @@ Parameters: ...@@ -1064,7 +1064,7 @@ Parameters:
Get a single email. Get a single email.
``` ```plaintext
GET /user/emails/:email_id GET /user/emails/:email_id
``` ```
...@@ -1083,7 +1083,7 @@ Parameters: ...@@ -1083,7 +1083,7 @@ Parameters:
Creates a new email owned by the currently authenticated user. Creates a new email owned by the currently authenticated user.
``` ```plaintext
POST /user/emails POST /user/emails
``` ```
...@@ -1115,7 +1115,7 @@ error occurs a `400 Bad Request` is returned with a message explaining the error ...@@ -1115,7 +1115,7 @@ error occurs a `400 Bad Request` is returned with a message explaining the error
Create new email owned by specified user. Available only for admin Create new email owned by specified user. Available only for admin
``` ```plaintext
POST /users/:id/emails POST /users/:id/emails
``` ```
...@@ -1130,7 +1130,7 @@ Parameters: ...@@ -1130,7 +1130,7 @@ Parameters:
Deletes email owned by currently authenticated user. Deletes email owned by currently authenticated user.
This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found.
``` ```plaintext
DELETE /user/emails/:email_id DELETE /user/emails/:email_id
``` ```
...@@ -1142,7 +1142,7 @@ Parameters: ...@@ -1142,7 +1142,7 @@ Parameters:
Deletes email owned by a specified user. Available only for admin. Deletes email owned by a specified user. Available only for admin.
``` ```plaintext
DELETE /users/:id/emails/:email_id DELETE /users/:id/emails/:email_id
``` ```
...@@ -1155,7 +1155,7 @@ Parameters: ...@@ -1155,7 +1155,7 @@ Parameters:
Blocks the specified user. Available only for admin. Blocks the specified user. Available only for admin.
``` ```plaintext
POST /users/:id/block POST /users/:id/block
``` ```
...@@ -1170,7 +1170,7 @@ Will return `201 OK` on success, `404 User Not Found` is user cannot be found or ...@@ -1170,7 +1170,7 @@ Will return `201 OK` on success, `404 User Not Found` is user cannot be found or
Unblocks the specified user. Available only for admin. Unblocks the specified user. Available only for admin.
``` ```plaintext
POST /users/:id/unblock POST /users/:id/unblock
``` ```
...@@ -1187,7 +1187,7 @@ Will return `201 OK` on success, `404 User Not Found` is user cannot be found or ...@@ -1187,7 +1187,7 @@ Will return `201 OK` on success, `404 User Not Found` is user cannot be found or
Deactivates the specified user. Available only for admin. Deactivates the specified user. Available only for admin.
``` ```plaintext
POST /users/:id/deactivate POST /users/:id/deactivate
``` ```
...@@ -1209,7 +1209,7 @@ Returns: ...@@ -1209,7 +1209,7 @@ Returns:
Activates the specified user. Available only for admin. Activates the specified user. Available only for admin.
``` ```plaintext
POST /users/:id/activate POST /users/:id/activate
``` ```
...@@ -1234,7 +1234,7 @@ Please refer to the [Events API documentation](events.md#get-user-contribution-e ...@@ -1234,7 +1234,7 @@ Please refer to the [Events API documentation](events.md#get-user-contribution-e
It retrieves every impersonation token of the user. Use the pagination It retrieves every impersonation token of the user. Use the pagination
parameters `page` and `per_page` to restrict the list of impersonation tokens. parameters `page` and `per_page` to restrict the list of impersonation tokens.
``` ```plaintext
GET /users/:user_id/impersonation_tokens GET /users/:user_id/impersonation_tokens
``` ```
...@@ -1245,7 +1245,7 @@ Parameters: ...@@ -1245,7 +1245,7 @@ Parameters:
| `user_id` | integer | yes | The ID of the user | | `user_id` | integer | yes | The ID of the user |
| `state` | string | no | filter tokens based on state (`all`, `active`, `inactive`) | | `state` | string | no | filter tokens based on state (`all`, `active`, `inactive`) |
``` ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens
``` ```
...@@ -1286,7 +1286,7 @@ Example response: ...@@ -1286,7 +1286,7 @@ Example response:
It shows a user's impersonation token. It shows a user's impersonation token.
``` ```plaintext
GET /users/:user_id/impersonation_tokens/:impersonation_token_id GET /users/:user_id/impersonation_tokens/:impersonation_token_id
``` ```
...@@ -1297,7 +1297,7 @@ Parameters: ...@@ -1297,7 +1297,7 @@ Parameters:
| `user_id` | integer | yes | The ID of the user | | `user_id` | integer | yes | The ID of the user |
| `impersonation_token_id` | integer | yes | The ID of the impersonation token | | `impersonation_token_id` | integer | yes | The ID of the impersonation token |
``` ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens/2 curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens/2
``` ```
...@@ -1328,7 +1328,7 @@ You are only able to create impersonation tokens to impersonate the user and per ...@@ -1328,7 +1328,7 @@ You are only able to create impersonation tokens to impersonate the user and per
both API calls and Git reads and writes. The user will not see these tokens in their profile both API calls and Git reads and writes. The user will not see these tokens in their profile
settings page. settings page.
``` ```plaintext
POST /users/:user_id/impersonation_tokens POST /users/:user_id/impersonation_tokens
``` ```
...@@ -1339,7 +1339,7 @@ POST /users/:user_id/impersonation_tokens ...@@ -1339,7 +1339,7 @@ POST /users/:user_id/impersonation_tokens
| `expires_at` | date | no | The expiration date of the impersonation token in ISO format (`YYYY-MM-DD`)| | `expires_at` | date | no | The expiration date of the impersonation token in ISO format (`YYYY-MM-DD`)|
| `scopes` | array | yes | The array of scopes of the impersonation token (`api`, `read_user`) | | `scopes` | array | yes | The array of scopes of the impersonation token (`api`, `read_user`) |
``` ```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "name=mytoken" --data "expires_at=2017-04-04" --data "scopes[]=api" https://gitlab.example.com/api/v4/users/42/impersonation_tokens curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "name=mytoken" --data "expires_at=2017-04-04" --data "scopes[]=api" https://gitlab.example.com/api/v4/users/42/impersonation_tokens
``` ```
...@@ -1367,11 +1367,11 @@ Example response: ...@@ -1367,11 +1367,11 @@ Example response:
It revokes an impersonation token. It revokes an impersonation token.
``` ```plaintext
DELETE /users/:user_id/impersonation_tokens/:impersonation_token_id DELETE /users/:user_id/impersonation_tokens/:impersonation_token_id
``` ```
``` ```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens/1 curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/impersonation_tokens/1
``` ```
...@@ -1398,7 +1398,7 @@ The activities that update the timestamp are: ...@@ -1398,7 +1398,7 @@ The activities that update the timestamp are:
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
amended by using the `from` parameter. amended by using the `from` parameter.
``` ```plaintext
GET /user/activities GET /user/activities
``` ```
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
Retrieve version information for this GitLab instance. Responds `200 OK` for Retrieve version information for this GitLab instance. Responds `200 OK` for
authenticated users. authenticated users.
``` ```plaintext
GET /version GET /version
``` ```
......
...@@ -10,7 +10,7 @@ feedback from [Visual Reviews](../ci/review_apps/index.md#visual-reviews-starter ...@@ -10,7 +10,7 @@ feedback from [Visual Reviews](../ci/review_apps/index.md#visual-reviews-starter
Creates a new thread to a single project merge request. This is similar to creating Creates a new thread to a single project merge request. This is similar to creating
a note but other comments (replies) can be added to it later. a note but other comments (replies) can be added to it later.
``` ```plaintext
POST /projects/:id/merge_requests/:merge_request_iid/visual_review_discussions POST /projects/:id/merge_requests/:merge_request_iid/visual_review_discussions
``` ```
......
...@@ -34,7 +34,7 @@ Read more on [pagination](README.md#pagination). ...@@ -34,7 +34,7 @@ Read more on [pagination](README.md#pagination).
List all of a project's vulnerability findings. List all of a project's vulnerability findings.
``` ```plaintext
GET /projects/:id/vulnerability_findings GET /projects/:id/vulnerability_findings
GET /projects/:id/vulnerability_findings?report_type=sast GET /projects/:id/vulnerability_findings?report_type=sast
GET /projects/:id/vulnerability_findings?report_type=container_scanning GET /projects/:id/vulnerability_findings?report_type=container_scanning
......
...@@ -8,7 +8,7 @@ Available only in APIv4. ...@@ -8,7 +8,7 @@ Available only in APIv4.
Get all wiki pages for a given project. Get all wiki pages for a given project.
``` ```plaintext
GET /projects/:id/wikis GET /projects/:id/wikis
``` ```
...@@ -49,7 +49,7 @@ Example response: ...@@ -49,7 +49,7 @@ Example response:
Get a wiki page for a given project. Get a wiki page for a given project.
``` ```plaintext
GET /projects/:id/wikis/:slug GET /projects/:id/wikis/:slug
``` ```
...@@ -77,7 +77,7 @@ Example response: ...@@ -77,7 +77,7 @@ Example response:
Creates a new wiki page for the given repository with the given title, slug, and content. Creates a new wiki page for the given repository with the given title, slug, and content.
``` ```plaintext
POST /projects/:id/wikis POST /projects/:id/wikis
``` ```
...@@ -107,7 +107,7 @@ Example response: ...@@ -107,7 +107,7 @@ Example response:
Updates an existing wiki page. At least one parameter is required to update the wiki page. Updates an existing wiki page. At least one parameter is required to update the wiki page.
``` ```plaintext
PUT /projects/:id/wikis/:slug PUT /projects/:id/wikis/:slug
``` ```
...@@ -138,7 +138,7 @@ Example response: ...@@ -138,7 +138,7 @@ Example response:
Deletes a wiki page with a given slug. Deletes a wiki page with a given slug.
``` ```plaintext
DELETE /projects/:id/wikis/:slug DELETE /projects/:id/wikis/:slug
``` ```
...@@ -160,7 +160,7 @@ On success the HTTP status code is `204` and no JSON response is expected. ...@@ -160,7 +160,7 @@ On success the HTTP status code is `204` and no JSON response is expected.
Uploads a file to the attachment folder inside the wiki's repository. The Uploads a file to the attachment folder inside the wiki's repository. The
attachment folder is the `uploads` folder. attachment folder is the `uploads` folder.
``` ```plaintext
POST /projects/:id/wikis/attachments POST /projects/:id/wikis/attachments
``` ```
......
...@@ -131,26 +131,26 @@ Supported formats (named colors are not supported): ...@@ -131,26 +131,26 @@ Supported formats (named colors are not supported):
Color written inside backticks will be followed by a color "chip": Color written inside backticks will be followed by a color "chip":
```markdown ```markdown
`#F00` - `#F00`
`#F00A` - `#F00A`
`#FF0000` - `#FF0000`
`#FF0000AA` - `#FF0000AA`
`RGB(0,255,0)` - `RGB(0,255,0)`
`RGB(0%,100%,0%)` - `RGB(0%,100%,0%)`
`RGBA(0,255,0,0.3)` - `RGBA(0,255,0,0.3)`
`HSL(540,70%,50%)` - `HSL(540,70%,50%)`
`HSLA(540,70%,50%,0.3)` - `HSLA(540,70%,50%,0.3)`
``` ```
`#F00` - `#F00`
`#F00A` - `#F00A`
`#FF0000` - `#FF0000`
`#FF0000AA` - `#FF0000AA`
`RGB(0,255,0)` - `RGB(0,255,0)`
`RGB(0%,100%,0%)` - `RGB(0%,100%,0%)`
`RGBA(0,255,0,0.3)` - `RGBA(0,255,0,0.3)`
`HSL(540,70%,50%)` - `HSL(540,70%,50%)`
`HSLA(540,70%,50%,0.3)` - `HSLA(540,70%,50%,0.3)`
### Diagrams and flowcharts ### Diagrams and flowcharts
...@@ -581,7 +581,7 @@ Quote break. ...@@ -581,7 +581,7 @@ Quote break.
GFM extends the standard Markdown standard by also supporting multiline blockquotes GFM extends the standard Markdown standard by also supporting multiline blockquotes
fenced by `>>>`: fenced by `>>>`:
``` ```markdown
>>> >>>
If you paste a message from somewhere else If you paste a message from somewhere else
...@@ -630,7 +630,7 @@ def function(): ...@@ -630,7 +630,7 @@ def function():
3-backtick fences. 3-backtick fences.
~~~ ~~~
``` ```plaintext
~~~ ~~~
Tildes are OK too. Tildes are OK too.
~~~ ~~~
...@@ -638,20 +638,20 @@ Tildes are OK too. ...@@ -638,20 +638,20 @@ Tildes are OK too.
The three examples above render as: The three examples above render as:
``` ```python
def function(): def function():
#indenting works just fine in the fenced code block #indenting works just fine in the fenced code block
s = "Python code" s = "Python code"
print s print s
``` ```
``` ```plaintext
Using 4 spaces Using 4 spaces
is like using is like using
3-backtick fences. 3-backtick fences.
``` ```
~~~ ~~~plaintext
Tildes are OK too. Tildes are OK too.
~~~ ~~~
...@@ -668,7 +668,7 @@ code when it is inline. ...@@ -668,7 +668,7 @@ code when it is inline.
Blocks of code are fenced by lines with three back-ticks ```` ``` ```` or three tildes `~~~`, and have Blocks of code are fenced by lines with three back-ticks ```` ``` ```` or three tildes `~~~`, and have
the language identified at the end of the first fence: the language identified at the end of the first fence:
~~~ ~~~markdown
```javascript ```javascript
var s = "JavaScript syntax highlighting"; var s = "JavaScript syntax highlighting";
alert(s); alert(s);
...@@ -714,7 +714,7 @@ markdown = Redcarpet.new("Hello World!") ...@@ -714,7 +714,7 @@ markdown = Redcarpet.new("Hello World!")
puts markdown.to_html puts markdown.to_html
``` ```
``` ```plaintext
No language indicated, so no syntax highlighting. No language indicated, so no syntax highlighting.
s = "There is no highlighting for this." s = "There is no highlighting for this."
But let's throw in a <b>tag</b>. But let's throw in a <b>tag</b>.
...@@ -756,7 +756,7 @@ dealing with code and names that often appear with multiple underscores. As a re ...@@ -756,7 +756,7 @@ dealing with code and names that often appear with multiple underscores. As a re
GFM extends the standard Markdown standard by ignoring multiple underlines in words, GFM extends the standard Markdown standard by ignoring multiple underlines in words,
to allow better rendering of Markdown documents discussing code: to allow better rendering of Markdown documents discussing code:
```md ```markdown
perform_complicated_task perform_complicated_task
do_this_and_do_that_and_another_thing do_this_and_do_that_and_another_thing
...@@ -852,7 +852,7 @@ The IDs are generated from the content of the header according to the following ...@@ -852,7 +852,7 @@ The IDs are generated from the content of the header according to the following
Example: Example:
``` ```markdown
# This header has spaces in it # This header has spaces in it
## This header has a :thumbsup: in it ## This header has a :thumbsup: in it
# This header has Unicode in it: 한글 # This header has Unicode in it: 한글
...@@ -973,7 +973,7 @@ class for the list of allowed HTML tags and attributes. In addition to the defau ...@@ -973,7 +973,7 @@ class for the list of allowed HTML tags and attributes. In addition to the defau
<dd>Is something people use sometimes.</dd> <dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML <em>tags</em> will <b>always</b> work.</dd> <dd>Does *not* work **very** well. HTML <em>tags</em> will <b>work</b>, in most cases.</dd>
</dl> </dl>
``` ```
...@@ -982,7 +982,7 @@ class for the list of allowed HTML tags and attributes. In addition to the defau ...@@ -982,7 +982,7 @@ class for the list of allowed HTML tags and attributes. In addition to the defau
<dd>Is something people use sometimes.</dd> <dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML <em>tags</em> will <b>always</b> work.</dd> <dd>Does *not* work **very** well. HTML <em>tags</em> will <b>work</b>, in most cases.</dd>
</dl> </dl>
--- ---
...@@ -993,12 +993,12 @@ are separated into their own lines: ...@@ -993,12 +993,12 @@ are separated into their own lines:
```html ```html
<dl> <dl>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML tags will always work.</dd> <dd>Does *not* work **very** well. HTML tags will work, in most cases.</dd>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd> <dd>
Does *not* work **very** well. HTML tags will always work. Does *not* work **very** well. HTML tags will work, in most cases.
</dd> </dd>
</dl> </dl>
...@@ -1008,12 +1008,12 @@ are separated into their own lines: ...@@ -1008,12 +1008,12 @@ are separated into their own lines:
<dl> <dl>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. HTML tags will always work.</dd> <dd>Does *not* work **very** well. HTML tags will work, in most cases.</dd>
<dt>Markdown in HTML</dt> <dt>Markdown in HTML</dt>
<dd> <dd>
Does <em>not</em> work <b>very</b> well. HTML tags will always work. Does <em>not</em> work <b>very</b> well. HTML tags will work, in most cases.
</dd> </dd>
</dl> </dl>
...@@ -1148,7 +1148,7 @@ A new line due to the previous backslash. ...@@ -1148,7 +1148,7 @@ A new line due to the previous backslash.
There are two ways to create links, inline-style and reference-style: There are two ways to create links, inline-style and reference-style:
```md ```markdown
- This is an [inline-style link](https://www.google.com) - This is an [inline-style link](https://www.google.com)
- This is a [link to a repository file in the same directory](index.md) - This is a [link to a repository file in the same directory](index.md)
- This is a [relative link to a readme one directory higher](../README.md) - This is a [relative link to a readme one directory higher](../README.md)
...@@ -1319,7 +1319,7 @@ the paragraph will appear outside the list, instead of properly indented under t ...@@ -1319,7 +1319,7 @@ the paragraph will appear outside the list, instead of properly indented under t
Example: Example:
``` ```markdown
1. First ordered list item 1. First ordered list item
Paragraph of first item. Paragraph of first item.
......
...@@ -39,7 +39,7 @@ conan --version ...@@ -39,7 +39,7 @@ conan --version
You should see the Conan version printed in the output: You should see the Conan version printed in the output:
``` ```plaintext
Conan version 1.20.5 Conan version 1.20.5
``` ```
......
...@@ -49,7 +49,7 @@ npm --version ...@@ -49,7 +49,7 @@ npm --version
You should see the NPM version printed in the output: You should see the NPM version printed in the output:
``` ```plaintext
6.10.3 6.10.3
``` ```
...@@ -67,7 +67,7 @@ yarn --version ...@@ -67,7 +67,7 @@ yarn --version
You should see the version printed like so: You should see the version printed like so:
``` ```plaintext
1.19.1 1.19.1
``` ```
......
...@@ -26,7 +26,7 @@ nuget help ...@@ -26,7 +26,7 @@ nuget help
You should see something similar to: You should see something similar to:
``` ```plaintext
NuGet Version: 5.2.0.6090 NuGet Version: 5.2.0.6090
usage: NuGet <command> [args] [options] usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command. Type 'NuGet help <command>' for help on a specific command.
......
...@@ -91,7 +91,7 @@ It is possible to use [quick actions](quick_actions.md) within description templ ...@@ -91,7 +91,7 @@ It is possible to use [quick actions](quick_actions.md) within description templ
Here is an example for a Bug report template: Here is an example for a Bug report template:
``` ```plaintext
Summary Summary
(Summarize the bug encountered concisely) (Summarize the bug encountered concisely)
......
...@@ -56,7 +56,7 @@ We are working on making this configurable in the future. ...@@ -56,7 +56,7 @@ We are working on making this configurable in the future.
For example, to show the issue number `1001` under the `gitlab-org/gitlab` For example, to show the issue number `1001` under the `gitlab-org/gitlab`
project, you would do: project, you would do:
``` ```plaintext
/gitlab gitlab-org/gitlab issue show 1001 /gitlab gitlab-org/gitlab issue show 1001
``` ```
......
...@@ -25,7 +25,7 @@ allow GitLab to send messages only to *one* room. ...@@ -25,7 +25,7 @@ allow GitLab to send messages only to *one* room.
1. In the "Send messages to this room by posting this URL" column, you should 1. In the "Send messages to this room by posting this URL" column, you should
see a URL in the format: see a URL in the format:
``` ```plaintext
https://api.hipchat.com/v2/room/<room>/notification?auth_token=<token> https://api.hipchat.com/v2/room/<room>/notification?auth_token=<token>
``` ```
......
...@@ -11,7 +11,7 @@ See the project homepage for further info: <https://gitlab.com/esr/irker> ...@@ -11,7 +11,7 @@ See the project homepage for further info: <https://gitlab.com/esr/irker>
You will first need an Irker daemon. You can download the Irker code from its You will first need an Irker daemon. You can download the Irker code from its
repository on <https://gitlab.com/esr/irker>: repository on <https://gitlab.com/esr/irker>:
``` ```shell
git clone https://gitlab.com/esr/irker.git git clone https://gitlab.com/esr/irker.git
``` ```
......
...@@ -119,7 +119,7 @@ link back to GitLab. This means that in comments in merge requests and commits ...@@ -119,7 +119,7 @@ link back to GitLab. This means that in comments in merge requests and commits
referencing an issue, e.g., `PROJECT-7`, will add a comment in Jira issue in the referencing an issue, e.g., `PROJECT-7`, will add a comment in Jira issue in the
format: format:
``` ```plaintext
USER mentioned this issue in RESOURCE_NAME of [PROJECT_NAME|LINK_TO_COMMENT]: USER mentioned this issue in RESOURCE_NAME of [PROJECT_NAME|LINK_TO_COMMENT]:
ENTITY_TITLE ENTITY_TITLE
``` ```
......
...@@ -13,13 +13,13 @@ integration services must be enabled. ...@@ -13,13 +13,13 @@ integration services must be enabled.
- Average Memory Usage (MB): - Average Memory Usage (MB):
``` ```prometheus
avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024 avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024
``` ```
- Average CPU Utilization (%): - Average CPU Utilization (%):
``` ```prometheus
avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name)) avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))
``` ```
...@@ -48,12 +48,12 @@ These metrics expect the [Deployment](https://kubernetes.io/docs/concepts/worklo ...@@ -48,12 +48,12 @@ These metrics expect the [Deployment](https://kubernetes.io/docs/concepts/worklo
- Average Memory Usage (MB) - Average Memory Usage (MB)
``` ```prometheus
avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024 avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024
``` ```
- Average CPU Utilization (%) - Average CPU Utilization (%)
``` ```prometheus
avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name)) avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))
``` ```
...@@ -101,14 +101,14 @@ allowing pulling and pushing Docker images from within the CI job. ...@@ -101,14 +101,14 @@ allowing pulling and pushing Docker images from within the CI job.
GitLab would create a special checkout URL like: GitLab would create a special checkout URL like:
``` ```plaintext
https://gitlab-ci-token:<project-runners-token>/gitlab.com/gitlab-org/gitlab-foss.git https://gitlab-ci-token:<project-runners-token>/gitlab.com/gitlab-org/gitlab-foss.git
``` ```
And then the users could also use it in their CI jobs all Docker related And then the users could also use it in their CI jobs all Docker related
commands to interact with GitLab Container Registry. For example: commands to interact with GitLab Container Registry. For example:
``` ```shell
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
``` ```
...@@ -173,14 +173,14 @@ As a user: ...@@ -173,14 +173,14 @@ As a user:
The [Job environment variable][jobenv] `CI_JOB_TOKEN` can be used to The [Job environment variable][jobenv] `CI_JOB_TOKEN` can be used to
authenticate any clones of dependent repositories. For example: authenticate any clones of dependent repositories. For example:
``` ```shell
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/<user>/<mydependentrepo>.git git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/<user>/<mydependentrepo>.git
``` ```
It can also be used for system-wide authentication It can also be used for system-wide authentication
(only do this in a docker container, it will overwrite ~/.netrc): (only do this in a docker container, it will overwrite ~/.netrc):
``` ```shell
echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
``` ```
......
...@@ -155,6 +155,10 @@ describe('DiffTableCell', () => { ...@@ -155,6 +155,10 @@ describe('DiffTableCell', () => {
}); });
}); });
it('renders the correct line number', () => {
expect(findLineNumber().text()).toEqual(TEST_LINE_NUMBER.toString());
});
it('on click, dispatches setHighlightedRow', () => { it('on click, dispatches setHighlightedRow', () => {
expect(store.dispatch).not.toHaveBeenCalled(); expect(store.dispatch).not.toHaveBeenCalled();
......
...@@ -59,7 +59,6 @@ describe 'Marginalia spec' do ...@@ -59,7 +59,6 @@ describe 'Marginalia spec' do
"application" => "test", "application" => "test",
"controller" => "marginalia_test", "controller" => "marginalia_test",
"action" => "first_user", "action" => "first_user",
"line" => "/spec/support/helpers/query_recorder.rb",
"correlation_id" => correlation_id "correlation_id" => correlation_id
} }
end end
...@@ -116,7 +115,6 @@ describe 'Marginalia spec' do ...@@ -116,7 +115,6 @@ describe 'Marginalia spec' do
{ {
"application" => "sidekiq", "application" => "sidekiq",
"job_class" => "MarginaliaTestJob", "job_class" => "MarginaliaTestJob",
"line" => "/spec/support/sidekiq_middleware.rb",
"correlation_id" => sidekiq_job['correlation_id'], "correlation_id" => sidekiq_job['correlation_id'],
"jid" => sidekiq_job['jid'] "jid" => sidekiq_job['jid']
} }
...@@ -145,7 +143,6 @@ describe 'Marginalia spec' do ...@@ -145,7 +143,6 @@ describe 'Marginalia spec' do
let(:component_map) do let(:component_map) do
{ {
"application" => "sidekiq", "application" => "sidekiq",
"line" => "/lib/gitlab/i18n.rb",
"jid" => delivery_job.job_id, "jid" => delivery_job.job_id,
"job_class" => delivery_job.arguments.first "job_class" => delivery_job.arguments.first
} }
......
...@@ -14,9 +14,6 @@ describe ActiveRecord::QueryRecorder do ...@@ -14,9 +14,6 @@ describe ActiveRecord::QueryRecorder do
TestQueries.first TestQueries.first
end end
# Test first_only flag works as expected
expect(control.find_query(/.*query_recorder_spec.rb.*/, 0, first_only: true))
.to eq(control.find_query(/.*query_recorder_spec.rb.*/, 0).first)
# Check #find_query # Check #find_query
expect(control.find_query(/.*/, 0).size) expect(control.find_query(/.*/, 0).size)
.to eq(control.data.keys.size) .to eq(control.data.keys.size)
...@@ -32,9 +29,7 @@ describe ActiveRecord::QueryRecorder do ...@@ -32,9 +29,7 @@ describe ActiveRecord::QueryRecorder do
# Ensure memoization value match the raw value above # Ensure memoization value match the raw value above
expect(control.count).to eq(control.log.size) expect(control.count).to eq(control.log.size)
# Ensure we have only two sources of queries # Ensure we have only two sources of queries
expect(control.data.keys.size).to eq(2) expect(control.data.keys.size).to eq(1)
# Ensure we detect only queries from this file
expect(control.data.keys.find_all { |i| i.match(/query_recorder_spec.rb/) }.count).to eq(2)
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment