This instance will be upgraded to Heptapod 0.26.0rc1 on 2021-10-26 at 14:30 UTC+2 (a few minutes of down time)

Commit a18e5f90 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent c29fcb5078aa
Please view this file on the master branch, on stable branches it's out of date.
## 12.4.2
### Fixed (1 change)
- Fix feature flag check for productivity analytics. !19025
## 12.4.1
### Security (6 changes)
......
/* eslint-disable func-names, consistent-return, camelcase, class-methods-use-this */
/* eslint-disable consistent-return, camelcase, class-methods-use-this */
// Zen Mode (full screen) textarea
//
......@@ -47,26 +47,16 @@ export default class ZenMode {
e.preventDefault();
return $(e.currentTarget).trigger('zen_mode:leave');
});
$(document).on(
'zen_mode:enter',
(function(_this) {
return function(e) {
return _this.enter(
$(e.target)
.closest('.md-area')
.find('.zen-backdrop'),
);
};
})(this),
);
$(document).on(
'zen_mode:leave',
(function(_this) {
return function() {
return _this.exit();
};
})(this),
);
$(document).on('zen_mode:enter', e => {
this.enter(
$(e.target)
.closest('.md-area')
.find('.zen-backdrop'),
);
});
$(document).on('zen_mode:leave', () => {
this.exit();
});
$(document).on('keydown', e => {
// Esc
if (e.keyCode === 27) {
......
......@@ -99,3 +99,13 @@
color: $gl-text-color-disabled;
}
}
.group-variable-list {
color: $gray-700;
.table-section:not(:first-child) {
@include media-breakpoint-down(sm) {
border-top: hidden;
}
}
}
......@@ -30,7 +30,8 @@ $status-box-line-height: 26px;
margin-bottom: $gl-padding-4;
}
.milestone-progress {
.milestone-progress,
.milestone-release-links {
a {
color: $blue-600;
}
......@@ -238,10 +239,6 @@ $status-box-line-height: 26px;
}
}
.milestone-range {
color: $gl-text-color-tertiary;
}
@include media-breakpoint-down(xs) {
.milestone-banner-text,
.milestone-banner-link {
......
# frozen_string_literal: true
class ContainerRepositoriesFinder
# id: group or project id
# container_type: :group or :project
def initialize(id:, container_type:)
@id = id
@type = container_type.to_sym
VALID_SUBJECTS = [Group, Project].freeze
def initialize(user:, subject:)
@user = user
@subject = subject
end
def execute
if project_type?
project.container_repositories
else
group.container_repositories
end
raise ArgumentError, "invalid subject_type" unless valid_subject_type?
return unless authorized?
return project_repositories if @subject.is_a?(Project)
return group_repositories if @subject.is_a?(Group)
end
private
attr_reader :id, :type
def valid_subject_type?
VALID_SUBJECTS.include?(@subject.class)
end
def project_repositories
return unless @subject.container_registry_enabled
def project_type?
type == :project
@subject.container_repositories
end
def project
Project.find(id)
def group_repositories
ContainerRepository.for_group_and_its_subgroups(@subject)
end
def group
Group.find(id)
def authorized?
Ability.allowed?(@user, :read_container_image, @subject)
end
end
......@@ -170,6 +170,15 @@ def milestone_merge_requests_tooltip_text(milestone)
content.join('<br />').html_safe
end
def recent_releases_with_counts(milestone)
total_count = milestone.releases.size
return [[], 0, 0] if total_count == 0
recent_releases = milestone.releases.recent.to_a
more_count = total_count - recent_releases.size
[recent_releases, total_count, more_count]
end
def milestone_tooltip_due_date(milestone)
if milestone.due_date
"#{milestone.due_date.to_s(:medium)} (#{remaining_days_in_words(milestone.due_date, milestone.start_date)})"
......
......@@ -12,6 +12,9 @@ class ContainerRepository < ApplicationRecord
scope :ordered, -> { order(:name) }
scope :with_api_entity_associations, -> { preload(project: [:route, { namespace: :route }]) }
scope :for_group_and_its_subgroups, ->(group) do
where(project_id: Project.for_group_and_its_subgroups(group).with_container_registry.select(:id))
end
# rubocop: disable CodeReuse/ServiceClass
def registry
......
......@@ -11,7 +11,7 @@ class GlobalMilestone
delegate :title, :state, :due_date, :start_date, :participants, :project,
:group, :expires_at, :closed?, :iid, :group_milestone?, :safe_title,
:milestoneish_id, :resource_parent, to: :milestone
:milestoneish_id, :resource_parent, :releases, to: :milestone
def to_hash
{
......
......@@ -395,6 +395,7 @@ class Project < ApplicationRecord
scope :with_project_feature, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id') }
scope :with_statistics, -> { includes(:statistics) }
scope :with_shared_runners, -> { where(shared_runners_enabled: true) }
scope :with_container_registry, -> { where(container_registry_enabled: true) }
scope :inside_path, ->(path) do
# We need routes alias rs for JOIN so it does not conflict with
# includes(:route) which we use in ProjectsFinder.
......
......@@ -28,12 +28,16 @@ class Release < ApplicationRecord
scope :sorted, -> { order(released_at: :desc) }
scope :preloaded, -> { includes(project: :namespace) }
scope :with_project_and_namespace, -> { includes(project: :namespace) }
scope :recent, -> { sorted.limit(MAX_NUMBER_TO_DISPLAY) }
delegate :repository, to: :project
after_commit :create_evidence!, on: :create
after_commit :notify_new_release, on: :create
MAX_NUMBER_TO_DISPLAY = 3
def to_param
CGI.escape(tag)
end
......
= _("These variables are configured in the parent group settings, and will be active in the current project in addition to the project variables.")
%h5
= _('Group variables (inherited)')
%p
= render "ci/group_variables/content"
- variables = @project.group.self_and_ancestors.map(&:variables).flatten
.row
.col-lg-12
.group-variable-list
= render 'ci/group_variables/variable_header'
- variables.each do |variable|
.group-variable-row.d-flex.w-100.border-bottom.pt-2.pb-2
.table-section.section-40.append-right-10.key
= variable.key
.table-section.section-40.append-right-10
%a.group-origin-link{ href: group_settings_ci_cd_path(variable.group) }
= variable.group.name
.group-variable-keys.d-flex.w-100.align-items-center.pb-2.border-bottom
.bold.table-section.section-40.append-right-10
= s_('Key')
.bold.table-section.section-40.append-right-10
= s_('Origin')
......@@ -24,3 +24,8 @@
= n_('Hide value', 'Hide values', @variables.size)
- else
= n_('Reveal value', 'Reveal values', @variables.size)
- if !@group && @project.group
.settings-header.border-top.prepend-top-20
= render 'ci/group_variables/header'
.settings-content.pr-0
= render 'ci/group_variables/index'
......@@ -12,8 +12,20 @@
- if @project || milestone.is_a?(GlobalMilestone) || milestone.group_milestone?
- if milestone.due_date || milestone.start_date
.milestone-range.append-bottom-5
.text-tertiary.append-bottom-5
= milestone_date_range(milestone)
- recent_releases, total_count, more_count = recent_releases_with_counts(milestone)
- unless total_count.zero?
.text-tertiary.append-bottom-5.milestone-release-links
= icon('rocket')
= n_('Release', 'Releases', total_count)
- recent_releases.each do |release|
= link_to release.name, project_releases_path(release.project, anchor: release.tag)
- unless release == recent_releases.last
&bull;
- if total_count > recent_releases.count
&bull;
= link_to n_('%{count} more release', '%{count} more releases', more_count) % { count: more_count }, project_releases_path(milestone.project)
%div
= render('shared/milestone_expired', milestone: milestone)
- if milestone.group_milestone?
......
---
title: Show inherited group variables in project view
merge_request: 18759
author:
type: added
---
title: Add links to associated releases on the Milestones page
merge_request: 16558
author:
type: added
......@@ -467,6 +467,13 @@ production: &base
# enabled: true
# primary_api_url: http://localhost:5000/ # internal address to the primary registry, will be used by GitLab to directly communicate with primary registry API
## Feature Flag https://docs.gitlab.com/ee/user/project/operations/feature_flags.html
feature_flags:
unleash:
# enabled: false
# url: https://gitlab.com/api/v4/feature_flags/unleash/<project_id>
# app_name: gitlab.com # Environment name of your GitLab instance
# instance_id: INSTANCE_ID
#
# 2. GitLab CI settings
......
......@@ -308,6 +308,13 @@
Settings.geo.registry_replication['enabled'] ||= false
end
#
# Unleash
#
Settings['feature_flags'] ||= Settingslogic.new({})
Settings.feature_flags['unleash'] ||= Settingslogic.new({})
Settings.feature_flags.unleash['enabled'] = false if Settings.feature_flags.unleash['enabled'].nil?
#
# External merge request diffs
#
......
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