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

Add latest changes from gitlab-org/gitlab@master

parent 5afd8575
No related branches found
No related tags found
No related merge requests found
Showing
with 129 additions and 34 deletions
Loading
Loading
@@ -50,7 +50,7 @@ docs lint:
- .default-retry
- .default-only
- .only:changes-docs
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint"
image: "registry.gitlab.com/gitlab-org/gitlab-docs:docs-lint"
stage: test
dependencies: []
script:
Loading
Loading
Loading
Loading
@@ -327,7 +327,7 @@ group :metrics do
gem 'influxdb', '~> 0.2', require: false
 
# Prometheus
gem 'prometheus-client-mmap', '~> 0.9.10'
gem 'prometheus-client-mmap', '~> 0.10.0'
gem 'raindrops', '~> 0.18'
end
 
Loading
Loading
Loading
Loading
@@ -749,7 +749,7 @@ GEM
parser
unparser
procto (0.0.3)
prometheus-client-mmap (0.9.10)
prometheus-client-mmap (0.10.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
Loading
Loading
@@ -1292,7 +1292,7 @@ DEPENDENCIES
pg (~> 1.1)
png_quantizator (~> 0.2.1)
premailer-rails (~> 1.10.3)
prometheus-client-mmap (~> 0.9.10)
prometheus-client-mmap (~> 0.10.0)
pry-byebug (~> 3.5.1)
pry-rails (~> 0.3.4)
rack (~> 2.0.7)
Loading
Loading
Loading
Loading
@@ -386,22 +386,19 @@
margin: 5px;
}
 
.issue-boards-sidebar {
.right-sidebar.issue-boards-sidebar {
.gutter-toggle {
bottom: 15px;
width: 22px;
color: $gray-darkest;
padding-left: $gl-padding-32;
 
svg {
position: absolute;
top: 50%;
right: 0;
margin-top: (-11px / 2);
}
&:hover {
path {
fill: $gray-darkest;
}
height: $gl-font-size-12;
width: $gl-font-size-12;
}
}
 
Loading
Loading
Loading
Loading
@@ -173,6 +173,20 @@
margin-top: 7px;
}
 
.gutter-toggle {
margin-left: 20px;
padding-left: 10px;
&:hover {
color: $gl-text-color;
}
&:hover,
&:focus {
text-decoration: none;
}
}
.block {
@include clearfix;
padding: $gl-padding 0;
Loading
Loading
@@ -195,20 +209,6 @@
margin-top: 0;
}
 
.gutter-toggle {
margin-left: 20px;
padding-left: 10px;
&:hover {
color: $gl-text-color;
}
&:hover,
&:focus {
text-decoration: none;
}
}
&.assignee {
.author-link {
display: block;
Loading
Loading
Loading
Loading
@@ -23,6 +23,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def index
@environments = project.environments
.with_state(params[:scope] || :available)
@project = ProjectPresenter.new(project, current_user: current_user)
 
respond_to do |format|
format.html
Loading
Loading
@@ -31,6 +32,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
 
render json: {
environments: serialize_environments(request, response, params[:nested]),
review_app: serialize_review_app,
available_count: project.environments.available.count,
stopped_count: project.environments.stopped.count
}
Loading
Loading
@@ -242,6 +244,10 @@ class Projects::EnvironmentsController < Projects::ApplicationController
.represent(@environments)
end
 
def serialize_review_app
ReviewAppSetupSerializer.new(current_user: @current_user).represent(@project)
end
def authorize_stop_environment!
access_denied! unless can?(current_user, :stop_environment, environment)
end
Loading
Loading
Loading
Loading
@@ -276,8 +276,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end
 
def kubernetes_cluster_anchor_data
if current_user && can?(current_user, :create_cluster, project)
if can_instantiate_cluster?
if clusters.empty?
AnchorData.new(false,
statistic_icon + _('Add Kubernetes cluster'),
Loading
Loading
@@ -294,7 +293,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end
 
def gitlab_ci_anchor_data
if current_user && can_current_user_push_code? && repository.gitlab_ci_yml.blank? && !auto_devops_enabled?
if cicd_missing?
AnchorData.new(false,
statistic_icon + _('Set up CI/CD'),
add_ci_yml_path)
Loading
Loading
@@ -326,8 +325,28 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
count_of_extra_topics_not_shown > 0
end
 
def can_setup_review_app?
strong_memoize(:can_setup_review_app) do
(can_instantiate_cluster? && all_clusters_empty?) || cicd_missing?
end
end
def all_clusters_empty?
strong_memoize(:all_clusters_empty) do
project.all_clusters.empty?
end
end
private
 
def cicd_missing?
current_user && can_current_user_push_code? && repository.gitlab_ci_yml.blank? && !auto_devops_enabled?
end
def can_instantiate_cluster?
current_user && can?(current_user, :create_cluster, project)
end
def filename_path(filename)
if blob = repository.public_send(filename) # rubocop:disable GitlabSecurity/PublicSend
project_blob_path(
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
def evidence_file_path
return unless release.evidence.present?
 
evidence_project_release_url(project, tag, format: :json)
evidence_project_release_url(project, release.to_param, format: :json)
end
 
private
Loading
Loading
# frozen_string_literal: true
class ReviewAppSetupEntity < Grape::Entity
include RequestAwareEntity
expose :can_setup_review_app?, as: :can_setup_review_app
expose :all_clusters_empty?, as: :all_clusters_empty, if: -> (_, _) { project.can_setup_review_app? } do |project|
project.all_clusters_empty?
end
expose :review_snippet, if: -> (_, _) { project.can_setup_review_app? } do |_|
YAML.safe_load(File.read(Rails.root.join('lib', 'gitlab', 'ci', 'snippets', 'review_app_default.yml'))).to_s
end
private
def current_user
request.current_user
end
def project
object
end
end
# frozen_string_literal: true
class ReviewAppSetupSerializer < BaseSerializer
entity ReviewAppSetupEntity
end
Loading
Loading
@@ -5,9 +5,17 @@ module Prometheus
include ReactiveCaching
include Gitlab::Utils::StrongMemoize
 
self.reactive_cache_key = ->(service) { service.cache_key }
self.reactive_cache_key = ->(service) { [] }
self.reactive_cache_lease_timeout = 30.seconds
self.reactive_cache_refresh_interval = 30.seconds
# reactive_cache_refresh_interval should be set to a value higher than
# reactive_cache_lifetime. If the refresh_interval is less than lifetime
# then the ReactiveCachingWorker will re-query prometheus for this
# PromQL query even though it's (probably) already been picked up by
# the frontend
# refresh_interval should be set less than lifetime only if this data
# is expected to change *and* be fetched again by the frontend
self.reactive_cache_refresh_interval = 90.seconds
self.reactive_cache_lifetime = 1.minute
self.reactive_cache_worker_finder = ->(_id, *args) { from_cache(*args) }
 
Loading
Loading
Loading
Loading
@@ -8,6 +8,6 @@ module ClusterQueue
 
included do
queue_namespace :gcp_cluster
feature_category :kubernetes_configuration
feature_category :kubernetes_management
end
end
Loading
Loading
@@ -4,7 +4,7 @@ class GroupDestroyWorker
include ApplicationWorker
include ExceptionBacktrace
 
feature_category :groups
feature_category :subgroups
 
def perform(group_id, user_id)
begin
Loading
Loading
---
title: Improve link generation performance
merge_request: 22426
author:
type: performance
---
title: Authenticate API requests with job tokens for Rack::Attack
merge_request: 21412
author:
type: fixed
---
title: Increase size of issue boards sidebar collapse button
merge_request:
author:
type: fixed
---
title: Fix releases page when tag contains a slash
merge_request: 22527
author:
type: fixed
---
title: Disable Prometheus metrics if initialization fails
merge_request: 22355
author:
type: fixed
---
title: When sidekiq-cluster is asked to shutdown, actively terminate any sidekiq processes that don't finish cleanly in short order
merge_request: 21796
author:
type: fixed
---
title: Reduce redis key size for the Prometheus proxy and the amount of queries by half
merge_request: 20006
author:
type: performance
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