Skip to content
Snippets Groups Projects
Commit d8791851 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent fa478f18
No related branches found
No related tags found
No related merge requests found
Showing
with 85 additions and 63 deletions
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.34"
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
 
stages:
- sync
Loading
Loading
Loading
Loading
@@ -78,7 +78,7 @@
- .default-retry
- .default-before_script
- .assets-compile-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.34-docker-19.03.1
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
stage: prepare
services:
- docker:19.03.0-dind
Loading
Loading
Loading
Loading
@@ -9,6 +9,8 @@
- unknown_failure
- api_failure
- runner_system_failure
- job_execution_timeout
- stuck_or_timeout_failure
 
.default-before_script:
before_script:
Loading
Loading
@@ -203,7 +205,7 @@
- name: redis:alpine
 
.use-pg10:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.34"
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
services:
- name: postgres:10.9
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
Loading
Loading
@@ -217,7 +219,7 @@
- name: elasticsearch:6.4.2
 
.use-pg10-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.34"
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
services:
- name: postgres:10.9
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
Loading
Loading
Loading
Loading
@@ -343,6 +343,8 @@ RSpec/HaveGitlabHttpStatus:
- 'ee/spec/controllers/*.rb'
- 'spec/controllers/projects/**/*.rb'
- 'ee/spec/controllers/projects/**/*.rb'
- 'spec/controllers/groups/**/*.rb'
- 'ee/spec/controllers/groups/**/*.rb'
- 'spec/requests/*.rb'
- 'ee/spec/requests/*.rb'
 
Loading
Loading
import $ from 'jquery';
import Chart from 'chart.js';
import _ from 'underscore';
import { barChartOptions, pieChartOptions } from '~/lib/utils/chart_utils';
 
document.addEventListener('DOMContentLoaded', () => {
Loading
Loading
@@ -40,7 +38,7 @@ document.addEventListener('DOMContentLoaded', () => {
backgroundColor: 'rgba(220,220,220,0.5)',
borderColor: 'rgba(220,220,220,1)',
borderWidth: 1,
data: _.values(data),
data: Object.values(data),
},
],
});
Loading
Loading
Loading
Loading
@@ -46,10 +46,14 @@ module Metrics
# Returns a new dashboard Hash, supplemented with DB info
def process_dashboard
::Gitlab::Metrics::Dashboard::Processor
.new(project, raw_dashboard, sequence, params)
.new(project, raw_dashboard, sequence, process_params)
.process
end
 
def process_params
params
end
# @return [String] Relative filepath of the dashboard yml
def dashboard_path
params[:dashboard_path]
Loading
Loading
---
title: Create an environment for self monitoring project
merge_request: 24403
author:
type: added
Loading
Loading
@@ -42,9 +42,9 @@ The current stages are:
## Default image
 
The default image is currently
`registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.34`.
`registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34`.
 
It includes Ruby 2.6.5, Go 1.12, Git 2.24, Git LFS 2.9, Chrome 73, Node 12, Yarn 1.16,
It includes Ruby 2.6.5, Go 1.12, Git 2.24, Git LFS 2.9, Chrome 73, Node 12, Yarn 1.21,
PostgreSQL 9.6, and Graphics Magick 1.3.33.
 
The images used in our pipelines are configured in the
Loading
Loading
@@ -71,8 +71,8 @@ These common definitions are:
 
- `.default-tags`: Ensures a job has the `gitlab-org` tag to ensure it's using
our dedicated runners.
- `.default-retry`: Allows a job to retry upon `unknown_failure`, `api_failure`,
`runner_system_failure`.
- `.default-retry`: Allows a job to [retry](../ci/yaml/README.md#retry) upon `unknown_failure`, `api_failure`,
`runner_system_failure`, `job_execution_timeout`, or `stuck_or_timeout_failure`.
- `.default-before_script`: Allows a job to use a default `before_script` definition
suitable for Ruby/Rails tasks that may need a database running (e.g. tests).
- `.default-cache`: Allows a job to use a default `cache` definition suitable for
Loading
Loading
Loading
Loading
@@ -15,6 +15,7 @@ module Gitlab
:create_group,
:create_project,
:save_project_id,
:create_environment,
:add_prometheus_manual_configuration,
:track_event
 
Loading
Loading
@@ -80,6 +81,17 @@ module Gitlab
end
end
 
def create_environment(result)
environment = ::Environment.new(project_id: result[:project].id, name: 'production')
if environment.save
success(result)
else
log_error("Could not create environment for the Self monitoring project. Errors: %{errors}" % { errors: environment.errors.full_messages })
error(_('Could not create environment'))
end
end
def add_prometheus_manual_configuration(result)
return success(result) unless prometheus_enabled?
return success(result) unless prometheus_listen_address.present?
Loading
Loading
Loading
Loading
@@ -93,8 +93,6 @@ module Gitlab
#
redis.expire(key, EXPIRATION)
end
record_metrics(redis.memory("USAGE", key))
end
 
# Subsequent read_file calls would need the latest cache.
Loading
Loading
@@ -103,10 +101,6 @@ module Gitlab
clear_memoization(:cacheable_files)
end
 
def record_metrics(memory_usage)
self.class.gitlab_redis_diff_caching_memory_usage_bytes.observe({}, memory_usage)
end
def file_paths
strong_memoize(:file_paths) do
diff_files.collect(&:file_path)
Loading
Loading
Loading
Loading
@@ -34,6 +34,8 @@ module Gitlab
# cluster, one of [:admin, :project, :group]
# @param options - grafana_url [String] URL pointing
# to a grafana dashboard panel
# @param options - prometheus_alert_id [Integer] ID of
# a PrometheusAlert. For dashboard embeds.
# @return [Hash]
def find(project, user, options = {})
service_for(options)
Loading
Loading
Loading
Loading
@@ -5379,6 +5379,9 @@ msgstr ""
msgid "Could not create Wiki Repository at this time. Please try again later."
msgstr ""
 
msgid "Could not create environment"
msgstr ""
msgid "Could not create group"
msgstr ""
 
Loading
Loading
Loading
Loading
@@ -25,6 +25,6 @@ describe Groups::AvatarsController do
 
delete :destroy, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
Loading
Loading
@@ -33,7 +33,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do
list_boards
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'text/html'
end
end
Loading
Loading
@@ -76,7 +76,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do
list_boards format: :json
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json'
end
end
Loading
Loading
@@ -111,7 +111,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do
read_board board: board
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'text/html'
end
end
Loading
Loading
@@ -148,7 +148,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do
read_board board: board, format: :json
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json'
end
end
Loading
Loading
@@ -160,7 +160,7 @@ describe Groups::BoardsController do
 
read_board board: another_board
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
Loading
Loading
@@ -142,7 +142,7 @@ describe Groups::ChildrenController do
 
get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'returns an array with one element when only one result is matched' do
Loading
Loading
@@ -185,7 +185,7 @@ describe Groups::ChildrenController do
 
get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 3 }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'includes pagination headers' do
Loading
Loading
@@ -316,7 +316,7 @@ describe Groups::ChildrenController do
it 'correctly calculates the counts' do
get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
@@ -328,7 +328,7 @@ describe Groups::ChildrenController do
 
get :index, params: { group_id: group }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ describe Groups::Clusters::ApplicationsController do
expect(ClusterInstallAppWorker).to receive(:perform_async).with(application, anything).once
 
expect { subject }.to change { current_application.count }
expect(response).to have_http_status(:no_content)
expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.application_helm).to be_scheduled
end
 
Loading
Loading
@@ -54,7 +54,7 @@ describe Groups::Clusters::ApplicationsController do
 
it 'return 404' do
expect { subject }.not_to change { current_application.count }
expect(response).to have_http_status(:not_found)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -62,7 +62,7 @@ describe Groups::Clusters::ApplicationsController do
let(:application) { 'unkwnown-app' }
 
it 'return 404' do
is_expected.to have_http_status(:not_found)
is_expected.to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -72,7 +72,7 @@ describe Groups::Clusters::ApplicationsController do
end
 
it 'returns 400' do
is_expected.to have_http_status(:bad_request)
is_expected.to have_gitlab_http_status(:bad_request)
end
end
end
Loading
Loading
@@ -107,7 +107,7 @@ describe Groups::Clusters::ApplicationsController do
it "schedules an application update" do
expect(ClusterPatchAppWorker).to receive(:perform_async).with(application.name, anything).once
 
is_expected.to have_http_status(:no_content)
is_expected.to have_gitlab_http_status(:no_content)
 
expect(cluster.application_cert_manager).to be_scheduled
end
Loading
Loading
@@ -118,13 +118,13 @@ describe Groups::Clusters::ApplicationsController do
cluster.destroy!
end
 
it { is_expected.to have_http_status(:not_found) }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
 
context 'when application is unknown' do
let(:application_name) { 'unkwnown-app' }
 
it { is_expected.to have_http_status(:not_found) }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
 
context 'when application is already scheduled' do
Loading
Loading
@@ -132,7 +132,7 @@ describe Groups::Clusters::ApplicationsController do
application.make_scheduled!
end
 
it { is_expected.to have_http_status(:bad_request) }
it { is_expected.to have_gitlab_http_status(:bad_request) }
end
end
 
Loading
Loading
Loading
Loading
@@ -654,7 +654,7 @@ describe Groups::ClustersController do
go(format: :json)
 
cluster.reload
expect(response).to have_http_status(:no_content)
expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.enabled).to be_falsey
expect(cluster.name).to eq('my-new-cluster-name')
expect(cluster).not_to be_managed
Loading
Loading
@@ -674,7 +674,7 @@ describe Groups::ClustersController do
it 'rejects changes' do
go(format: :json)
 
expect(response).to have_http_status(:bad_request)
expect(response).to have_gitlab_http_status(:bad_request)
end
end
end
Loading
Loading
Loading
Loading
@@ -100,7 +100,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -113,7 +113,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -126,7 +126,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -168,7 +168,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -180,7 +180,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -210,7 +210,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -222,7 +222,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do
subject
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe Groups::GroupMembersController do
it 'renders index with 200 status code' do
get :index, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index)
end
 
Loading
Loading
@@ -105,7 +105,7 @@ describe Groups::GroupMembersController do
access_level: Gitlab::Access::GUEST
}
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
expect(group.users).not_to include group_user
end
end
Loading
Loading
@@ -173,7 +173,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do
delete :destroy, params: { group_id: group, id: 42 }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
 
Loading
Loading
@@ -186,7 +186,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do
delete :destroy, params: { group_id: group, id: member }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
expect(group.members).to include member
end
end
Loading
Loading
@@ -223,7 +223,7 @@ describe Groups::GroupMembersController do
it 'returns 404' do
delete :leave, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -244,7 +244,7 @@ describe Groups::GroupMembersController do
it 'supports json request' do
delete :leave, params: { group_id: group }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['notice']).to eq "You left the \"#{group.name}\" group."
end
end
Loading
Loading
@@ -257,7 +257,7 @@ describe Groups::GroupMembersController do
it 'cannot removes himself from the group' do
delete :leave, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
 
Loading
Loading
@@ -304,7 +304,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do
post :approve_access_request, params: { group_id: group, id: 42 }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
 
Loading
Loading
@@ -317,7 +317,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do
post :approve_access_request, params: { group_id: group, id: member }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
expect(group.members).not_to include member
end
end
Loading
Loading
@@ -348,7 +348,7 @@ describe Groups::GroupMembersController do
it 'is successful' do
get :index, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -356,7 +356,7 @@ describe Groups::GroupMembersController do
it 'is successful' do
post :create, params: { group_id: group, users: user, access_level: Gitlab::Access::GUEST }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
 
Loading
Loading
@@ -370,7 +370,7 @@ describe Groups::GroupMembersController do
},
format: :js
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -378,7 +378,7 @@ describe Groups::GroupMembersController do
it 'is successful' do
delete :destroy, params: { group_id: group, id: membership }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
 
Loading
Loading
@@ -388,7 +388,7 @@ describe Groups::GroupMembersController do
 
post :request_access, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
 
Loading
Loading
@@ -397,7 +397,7 @@ describe Groups::GroupMembersController do
access_request = create(:group_member, :access_request, group: group)
post :approve_access_request, params: { group_id: group, id: access_request }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
 
Loading
Loading
@@ -407,7 +407,7 @@ describe Groups::GroupMembersController do
 
delete :leave, params: { group_id: group }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
 
Loading
Loading
@@ -415,7 +415,7 @@ describe Groups::GroupMembersController do
it 'is successful' do
post :resend_invite, params: { group_id: group, id: membership }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
end
Loading
Loading
Loading
Loading
@@ -53,7 +53,7 @@ describe Groups::LabelsController do
 
post :toggle_subscription, params: { group_id: group.to_param, id: label.to_param }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment