Read about our upcoming Code of Conduct on this issue

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

Add latest changes from gitlab-org/gitlab@master

parent ecd722bcca91
...@@ -18,8 +18,6 @@ import Icon from '~/vue_shared/components/icon.vue'; ...@@ -18,8 +18,6 @@ import Icon from '~/vue_shared/components/icon.vue';
import { getParameterValues, mergeUrlParams, redirectTo } from '~/lib/utils/url_utility'; import { getParameterValues, mergeUrlParams, redirectTo } from '~/lib/utils/url_utility';
import invalidUrl from '~/lib/utils/invalid_url'; import invalidUrl from '~/lib/utils/invalid_url';
import DateTimePicker from './date_time_picker/date_time_picker.vue'; import DateTimePicker from './date_time_picker/date_time_picker.vue';
import MonitorTimeSeriesChart from './charts/time_series.vue';
import MonitorSingleStatChart from './charts/single_stat.vue';
import GraphGroup from './graph_group.vue'; import GraphGroup from './graph_group.vue';
import EmptyState from './empty_state.vue'; import EmptyState from './empty_state.vue';
import TrackEventDirective from '~/vue_shared/directives/track_event'; import TrackEventDirective from '~/vue_shared/directives/track_event';
...@@ -28,8 +26,6 @@ import { getTimeDiff, isValidDate, getAddMetricTrackingOptions } from '../utils' ...@@ -28,8 +26,6 @@ import { getTimeDiff, isValidDate, getAddMetricTrackingOptions } from '../utils'
export default { export default {
components: { components: {
VueDraggable, VueDraggable,
MonitorTimeSeriesChart,
MonitorSingleStatChart,
PanelType, PanelType,
GraphGroup, GraphGroup,
EmptyState, EmptyState,
......
<script> <script>
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import { getParameterValues, removeParams } from '~/lib/utils/url_utility'; import { getParameterValues, removeParams } from '~/lib/utils/url_utility';
import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue';
import GraphGroup from './graph_group.vue'; import GraphGroup from './graph_group.vue';
import MonitorTimeSeriesChart from './charts/time_series.vue';
import { sidebarAnimationDuration } from '../constants'; import { sidebarAnimationDuration } from '../constants';
import { getTimeDiff } from '../utils'; import { getTimeDiff } from '../utils';
...@@ -11,7 +11,7 @@ let sidebarMutationObserver; ...@@ -11,7 +11,7 @@ let sidebarMutationObserver;
export default { export default {
components: { components: {
GraphGroup, GraphGroup,
MonitorTimeSeriesChart, PanelType,
}, },
props: { props: {
dashboardUrl: { dashboardUrl: {
...@@ -92,16 +92,13 @@ export default { ...@@ -92,16 +92,13 @@ export default {
<template> <template>
<div class="metrics-embed" :class="{ 'd-inline-flex col-lg-6 p-0': isSingleChart }"> <div class="metrics-embed" :class="{ 'd-inline-flex col-lg-6 p-0': isSingleChart }">
<div v-if="charts.length" class="row w-100 m-n2 pb-4"> <div v-if="charts.length" class="row w-100 m-n2 pb-4">
<monitor-time-series-chart <panel-type
v-for="graphData in charts" v-for="(graphData, graphIndex) in charts"
:key="graphData.title" :key="`panel-type-${graphIndex}`"
class="w-100" class="w-100"
clipboard-text=""
:graph-data="graphData" :graph-data="graphData"
:container-width="elWidth"
:group-id="dashboardUrl" :group-id="dashboardUrl"
:project-path="null"
:show-border="true"
:single-embed="isSingleChart"
/> />
</div> </div>
</div> </div>
......
...@@ -47,6 +47,11 @@ export default { ...@@ -47,6 +47,11 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
groupId: {
type: String,
required: false,
default: 'panel-type-chart',
},
}, },
computed: { computed: {
...mapState('monitoringDashboard', ['deploymentData', 'projectPath']), ...mapState('monitoringDashboard', ['deploymentData', 'projectPath']),
...@@ -117,7 +122,7 @@ export default { ...@@ -117,7 +122,7 @@ export default {
:deployment-data="deploymentData" :deployment-data="deploymentData"
:project-path="projectPath" :project-path="projectPath"
:thresholds="getGraphAlertValues(graphData.metrics)" :thresholds="getGraphAlertValues(graphData.metrics)"
group-id="panel-type-chart" :group-id="groupId"
> >
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<alert-widget <alert-widget
......
...@@ -5,11 +5,9 @@ import initNotes from '~/init_notes'; ...@@ -5,11 +5,9 @@ import initNotes from '~/init_notes';
import snippetEmbed from '~/snippet/snippet_embed'; import snippetEmbed from '~/snippet/snippet_embed';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
if (!gon.features.snippetsVue) { new LineHighlighter(); // eslint-disable-line no-new
new LineHighlighter(); // eslint-disable-line no-new new BlobViewer(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new initNotes();
initNotes(); new ZenMode(); // eslint-disable-line no-new
new ZenMode(); // eslint-disable-line no-new snippetEmbed();
snippetEmbed();
}
}); });
...@@ -28,6 +28,7 @@ def diffs_batch ...@@ -28,6 +28,7 @@ def diffs_batch
positions = @merge_request.note_positions_for_paths(diffs.diff_file_paths, current_user) positions = @merge_request.note_positions_for_paths(diffs.diff_file_paths, current_user)
diffs.unfold_diff_files(positions.unfoldable) diffs.unfold_diff_files(positions.unfoldable)
diffs.write_cache
options = { options = {
merge_request: @merge_request, merge_request: @merge_request,
......
...@@ -34,3 +34,5 @@ def new_gpg_key_email(gpg_key_id) ...@@ -34,3 +34,5 @@ def new_gpg_key_email(gpg_key_id)
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
end end
Emails::Profile.prepend_if_ee('EE::Emails::Profile')
...@@ -5,6 +5,7 @@ module Ci ...@@ -5,6 +5,7 @@ module Ci
# We should migrate this object to actual database record in the future # We should migrate this object to actual database record in the future
class LegacyStage class LegacyStage
include StaticModel include StaticModel
include Presentable
attr_reader :pipeline, :name attr_reader :pipeline, :name
......
...@@ -27,8 +27,6 @@ class MergeRequest < ApplicationRecord ...@@ -27,8 +27,6 @@ class MergeRequest < ApplicationRecord
SORTING_PREFERENCE_FIELD = :merge_requests_sort SORTING_PREFERENCE_FIELD = :merge_requests_sort
prepend_if_ee('::EE::MergeRequest') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :target_project, class_name: "Project" belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project" belongs_to :source_project, class_name: "Project"
belongs_to :merge_user, class_name: "User" belongs_to :merge_user, class_name: "User"
...@@ -1531,3 +1529,5 @@ def expire_etag_cache ...@@ -1531,3 +1529,5 @@ def expire_etag_cache
Gitlab::EtagCaching::Store.new.touch(key) Gitlab::EtagCaching::Store.new.touch(key)
end end
end end
MergeRequest.prepend_if_ee('::EE::MergeRequest')
...@@ -70,3 +70,5 @@ def self.redis_shared_state_key(user_id) ...@@ -70,3 +70,5 @@ def self.redis_shared_state_key(user_id)
"gitlab:personal_access_token:#{user_id}" "gitlab:personal_access_token:#{user_id}"
end end
end end
PersonalAccessToken.prepend_if_ee('EE::PersonalAccessToken')
# frozen_string_literal: true
module Ci
class LegacyStagePresenter < Gitlab::View::Presenter::Delegated
presents :legacy_stage
def latest_ordered_statuses
preload_statuses(legacy_stage.statuses.latest_ordered)
end
def retried_ordered_statuses
preload_statuses(legacy_stage.statuses.retried_ordered)
end
private
def preload_statuses(statuses)
statuses.tap do |statuses|
# rubocop: disable CodeReuse/ActiveRecord
ActiveRecord::Associations::Preloader.new.preload(preloadable_statuses(statuses), :tags)
# rubocop: enable CodeReuse/ActiveRecord
end
end
def preloadable_statuses(statuses)
statuses.reject do |status|
status.instance_of?(::GenericCommitStatus) || status.instance_of?(::Ci::Bridge)
end
end
end
end
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
= f.label :session_expire_delay, _('Session duration (minutes)'), class: 'label-light' = f.label :session_expire_delay, _('Session duration (minutes)'), class: 'label-light'
= f.number_field :session_expire_delay, class: 'form-control' = f.number_field :session_expire_delay, class: 'form-control'
%span.form-text.text-muted#session_expire_delay_help_block= _('GitLab restart is required to apply changes') %span.form-text.text-muted#session_expire_delay_help_block= _('GitLab restart is required to apply changes')
= render_if_exists 'admin/application_settings/personal_access_token_expiration_policy', form: f
.form-group .form-group
= f.label :user_oauth_applications, _('User OAuth applications'), class: 'label-bold' = f.label :user_oauth_applications, _('User OAuth applications'), class: 'label-bold'
.form-check .form-check
......
- stage = stage.present(current_user: current_user)
%tr %tr
%th{ colspan: 10 } %th{ colspan: 10 }
%strong %strong
...@@ -6,8 +8,8 @@ ...@@ -6,8 +8,8 @@
= ci_icon_for_status(stage.status) = ci_icon_for_status(stage.status)
&nbsp; &nbsp;
= stage.name.titleize = stage.name.titleize
= render stage.statuses.latest_ordered, stage: false, ref: false, pipeline_link: false, allow_retry: true = render stage.latest_ordered_statuses, stage: false, ref: false, pipeline_link: false, allow_retry: true
= render stage.statuses.retried_ordered, stage: false, ref: false, pipeline_link: false, retried: true = render stage.retried_ordered_statuses, stage: false, ref: false, pipeline_link: false, retried: true
%tr %tr
%td{ colspan: 10 } %td{ colspan: 10 }
&nbsp; &nbsp;
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
.form-group.col-md-6 .form-group.col-md-6
= f.label :expires_at, _('Expires at'), class: 'label-bold' = f.label :expires_at, _('Expires at'), class: 'label-bold'
.input-icon-wrapper .input-icon-wrapper
= render_if_exists 'personal_access_tokens/callout_max_personal_access_token_lifetime'
= f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD' = f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD'
.form-group .form-group
......
...@@ -4,16 +4,13 @@ ...@@ -4,16 +4,13 @@
- breadcrumb_title @snippet.to_reference - breadcrumb_title @snippet.to_reference
- page_title "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") - page_title "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets")
- if Feature.enabled?(:snippets_vue) = render 'shared/snippets/header'
#js-snippet-view{ 'data-qa-selector': 'snippet_view' }
- else
= render 'shared/snippets/header'
.personal-snippets .personal-snippets
%article.file-holder.snippet-file-content %article.file-holder.snippet-file-content
= render 'shared/snippets/blob' = render 'shared/snippets/blob'
.row-content-block.top-block.content-component-block .row-content-block.top-block.content-component-block
= render 'award_emoji/awards_block', awardable: @snippet, inline: true = render 'award_emoji/awards_block', awardable: @snippet, inline: true
#notes.limited-width-notes= render "shared/notes/notes_with_form", :autocomplete => false #notes.limited-width-notes= render "shared/notes/notes_with_form", :autocomplete => false
---
title: Preserve merge train history
merge_request: 19864
author:
type: changed
...@@ -123,3 +123,5 @@ ...@@ -123,3 +123,5 @@
- [refresh_license_compliance_checks, 2] - [refresh_license_compliance_checks, 2]
- [design_management_new_version, 1] - [design_management_new_version, 1]
- [epics, 2] - [epics, 2]
- [personal_access_tokens, 1]
# frozen_string_literal: true
class AddMaxPersonalAccessTokenLifetimeToApplicationSettings < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :application_settings, :max_personal_access_token_lifetime, :integer
end
end
# frozen_string_literal: true
class AddStateToMergeTrains < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
MERGE_TRAIN_STATUS_CREATED = 0 # Equivalent to MergeTrain.statuses[:created]
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default :merge_trains, :status, :integer, limit: 2, default: MERGE_TRAIN_STATUS_CREATED
end
def down
remove_column :merge_trains, :status
end
end
# frozen_string_literal: true
class AddIndexOnPersonalAccessTokensUserIdAndExpiresAt < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_pat_on_user_id_and_expires_at'
disable_ddl_transaction!
def up
add_concurrent_index :personal_access_tokens, [:user_id, :expires_at], name: INDEX_NAME, using: :btree
end
def down
remove_concurrent_index_by_name :personal_access_tokens, INDEX_NAME
end
end
# frozen_string_literal: true
class AddIndexOnStatusToMergeTrains < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_for_status_per_branch_per_project'
disable_ddl_transaction!
def up
add_concurrent_index :merge_trains, [:target_project_id, :target_branch, :status], name: INDEX_NAME
remove_concurrent_index :merge_trains, :target_project_id
end
def down
add_concurrent_index :merge_trains, :target_project_id
remove_concurrent_index :merge_trains, [:target_project_id, :target_branch, :status], name: INDEX_NAME
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