Commit d6404862 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 1e5ef4fb
import { GlDeprecatedButton, GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
* Renders the Monitoring (Metrics) link in environments table.
export default {
components: {
directives: {
GlTooltip: GlTooltipDirective,
......@@ -26,15 +25,14 @@ export default {
class="monitoring-url d-none d-sm-none d-md-block"
class="monitoring-url gl-display-none gl-display-sm-none gl-display-md-block"
rel="noopener noreferrer nofollow"
<gl-icon name="chart" />
title: Migrating to gl-button in Environments table
merge_request: 40444
type: changed
title: Add first OpenAPI specification file
merge_request: 35868
author: winniehell
type: other
......@@ -603,9 +603,9 @@ or `gitlab-ctl promote-to-primary-node`, either:
bug]( was
If the above does not work, another possible reason is that you have paused replication
from the original primary node before attempting to promote this node.
### Message: ActiveRecord::RecordInvalid: Validation failed: Enabled Geo primary node cannot be disabled
This error may occur if you have paused replication from the original primary node before attempting to promote this node.
To double check this, you can do the following:
- Get the current secondary node's ID using:
......@@ -4,6 +4,8 @@ Automate GitLab via a simple and powerful API.
The main GitLab API is a [REST]( API. Therefore, documentation in this section assumes knowledge of REST concepts.
There is also a partial [OpenAPI definition](, which allows you to test the API directly from the GitLab user interface. Contributions are welcome.
## Available API resources
For a list of the available resources and their endpoints, see
openapi: "3.0.0"
description: |
An OpenAPI definition for the GitLab REST API.
Only one API resource/endpoint is currently included.
The intent is to expand this to match the entire Markdown documentation of the API:
<>. Contributions are welcome.
When viewing this on, you can test API calls directly from the browser
against the `` instance, if you are logged in.
The feature uses the current [GitLab session cookie](,
so each request is made using your account.
Read more at <>.
version: "v4"
title: "GitLab API"
termsOfService: ""
name: "CC BY-SA 4.0"
url: ""
- url: ""
$ref: "v4/version.yaml"
# Markdown documentation:
- version
summary: "Retrieve version information for this GitLab instance."
operationId: "getVersion"
description: "unauthorized operation"
description: "successful operation"
title: "VersionResponse"
type: "object"
type: "string"
type: "string"
version: "13.3.0-pre"
revision: "f2b05afebb0"
......@@ -13,10 +13,12 @@ Always use an [Entity](
## Documentation
API endpoints must come with [documentation](documentation/, unless it is internal or behind a feature flag.
Each new or updated API endpoint must come with documentation, unless it is internal or behind a feature flag.
The docs should be in the same merge request, or, if strictly necessary,
in a follow-up with the same milestone as the original merge request.
See the [Documentation Style Guide RESTful API section](documentation/ for details on documenting API resources in Markdown as well as in OpenAPI definition files.
## Methods and parameters description
Every method must be described using the [Grape DSL](
......@@ -1738,8 +1738,13 @@ For guidance on developing GitLab with feature flags, see
## RESTful API
Here is a list of must-have items for RESTful API documentation. Use them in the
exact order that appears on this document. Further explanation is given below.
REST API resources are documented in Markdown under [`/doc/api`]( Each resource has its own Markdown file, which is linked from ``.
When modifying the Markdown, also update the corresponding [OpenAPI definition]( if one exists for the resource.
If not, consider creating one. Match the latest [OpenAPI 3.0.x specification](
(For more information, see the discussion in [this issue](
In the Markdown doc for a resource (AKA endpoint):
- Every method must have the REST API request. For example:
......@@ -241,14 +241,16 @@ def access_check!(actor, params)
break { success: false, message: "Invalid token expiry date: '#{params[:expires_at]}'" }
access_token = nil
result =
user, name: params[:name], scopes: params[:scopes], expires_at: expires_at
).execute, user: user).execute! do |user|
access_token = user.personal_access_tokens.create!(
name: params[:name], scopes: params[:scopes], expires_at: expires_at
unless result.status == :success
break { success: false, message: "Failed to create token: #{result.message}" }
access_token = result.payload[:personal_access_token]
{ success: true, token: access_token.token, scopes: access_token.scopes, expires_at: access_token.expires_at }
import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import { GlButton } from '@gitlab/ui';
import MonitoringComponent from '~/environments/components/environment_monitoring.vue';
describe('Monitoring Component', () => {
......@@ -15,8 +15,8 @@ describe('Monitoring Component', () => {
const findIcons = () => wrapper.findAll(GlIcon);
const findIconsByName = name => findIcons().filter(icon => icon.props('name') === name);
const findButtons = () => wrapper.findAll(GlButton);
const findButtonsByIcon = icon => findButtons().filter(button => button.props('icon') === icon);
beforeEach(() => {
......@@ -30,7 +30,7 @@ describe('Monitoring Component', () => {
it('should render a link to environment monitoring page', () => {
......@@ -55,7 +55,7 @@
[4, 10].each do |max_storage_concurrency|
context "max_storage_concurrency #{max_storage_concurrency}" do
context "max_storage_concurrency #{max_storage_concurrency}", quarantine: '' do
it 'creates the expected number of threads' do
expect(Thread).to receive(:new)
.exactly(storage_keys.length * (max_storage_concurrency + 1)).times
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