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

Add latest changes from gitlab-org/gitlab@12-7-stable-ee

parent 680a5284
No related branches found
No related tags found
No related merge requests found
Showing
with 121 additions and 70 deletions
Loading
Loading
@@ -4,7 +4,6 @@ entry.
 
## 12.7.0
 
- No changes.
### Security (6 changes, 2 of them are from the community)
 
- Ensure content matches extension on image uploads. !20697
Loading
Loading
12.7.0
12.7.0-ee
Loading
Loading
@@ -374,7 +374,7 @@ export default {
 
<div
:data-can-create-note="getNoteableData.current_user.can_create_note"
class="files d-flex"
class="files d-flex prepend-top-default"
>
<div
v-show="showTreeList"
Loading
Loading
<script>
/* eslint-disable @gitlab/vue-i18n/no-bare-strings */
import { mapActions, mapGetters, mapState } from 'vuex';
import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
Loading
Loading
@@ -62,6 +63,9 @@ export default {
showDropdowns() {
return !this.commit && this.mergeRequestDiffs.length;
},
fileTreeIcon() {
return this.showTreeList ? 'collapse-left' : 'expand-left';
},
toggleFileBrowserTitle() {
return this.showTreeList ? __('Hide file browser') : __('Show file browser');
},
Loading
Loading
@@ -87,7 +91,7 @@ export default {
</script>
 
<template>
<div class="mr-version-controls border-top">
<div class="mr-version-controls border-top border-bottom">
<div
class="mr-version-menus-container content-block"
:class="{
Loading
Loading
@@ -104,17 +108,17 @@ export default {
:title="toggleFileBrowserTitle"
@click="toggleShowTreeList"
>
<icon name="file-tree" />
<icon :name="fileTreeIcon" />
</button>
<div v-if="showDropdowns" class="d-flex align-items-center compare-versions-container">
{{ __('Compare') }}
Changes between
<compare-versions-dropdown
:other-versions="mergeRequestDiffs"
:merge-request-version="mergeRequestDiff"
:show-commit-count="true"
class="mr-version-dropdown"
/>
{{ __('and') }}
and
<compare-versions-dropdown
:other-versions="comparableDiffs"
:base-version-path="baseVersionPath"
Loading
Loading
Loading
Loading
@@ -123,20 +123,6 @@ export default {
}
return s__('MRDiff|Show full file');
},
changedFile() {
const {
new_path: changed,
deleted_file: deleted,
new_file: tempFile,
...diffFile
} = this.diffFile;
return {
...diffFile,
changed: Boolean(changed),
deleted,
tempFile,
};
},
},
mounted() {
polyfillSticky(this.$refs.header);
Loading
Loading
@@ -235,7 +221,7 @@ export default {
 
<div
v-if="!diffFile.submodule && addMergeRequestButtons"
class="file-actions d-none d-sm-flex align-items-center"
class="file-actions d-none d-sm-block"
>
<diff-stats :added-lines="diffFile.added_lines" :removed-lines="diffFile.removed_lines" />
<div class="btn-group" role="group">
Loading
Loading
<script>
import Icon from '~/vue_shared/components/icon.vue';
import { n__ } from '~/locale';
 
export default {
components: { Icon },
props: {
addedLines: {
type: Number,
Loading
Loading
@@ -19,7 +21,7 @@ export default {
},
computed: {
filesText() {
return n__('file', 'files', this.diffFilesLength);
return n__('File', 'Files', this.diffFilesLength);
},
isCompareVersionsHeader() {
return Boolean(this.diffFilesLength);
Loading
Loading
@@ -37,21 +39,14 @@ export default {
}"
>
<div v-if="diffFilesLength !== null" class="diff-stats-group">
<span class="text-secondary bold">{{ diffFilesLength }} {{ filesText }}</span>
<icon name="doc-code" class="diff-stats-icon text-secondary" />
<strong>{{ diffFilesLength }} {{ filesText }}</strong>
</div>
<div
class="diff-stats-group cgreen d-flex align-items-center"
:class="{ bold: isCompareVersionsHeader }"
>
<span>+</span>
<span class="js-file-addition-line">{{ addedLines }}</span>
<div class="diff-stats-group cgreen">
<icon name="file-addition" class="diff-stats-icon" /> <strong>{{ addedLines }}</strong>
</div>
<div
class="diff-stats-group cred d-flex align-items-center"
:class="{ bold: isCompareVersionsHeader }"
>
<span>-</span>
<span class="js-file-deletion-line">{{ removedLines }}</span>
<div class="diff-stats-group cred">
<icon name="file-deletion" class="diff-stats-icon" /> <strong>{{ removedLines }}</strong>
</div>
</div>
</template>
Loading
Loading
@@ -4,6 +4,7 @@ import { GlTooltipDirective } from '@gitlab/ui';
import { s__, sprintf } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
import FileRow from '~/vue_shared/components/file_row.vue';
import FileRowStats from './file_row_stats.vue';
 
export default {
directives: {
Loading
Loading
@@ -47,6 +48,9 @@ export default {
return acc;
}, []);
},
fileRowExtraComponent() {
return this.hideFileStats ? null : FileRowStats;
},
},
methods: {
...mapActions('diffs', ['toggleTreeOpen', 'scrollToFile']),
Loading
Loading
@@ -54,8 +58,8 @@ export default {
this.search = '';
},
},
searchPlaceholder: sprintf(s__('MergeRequest|Search files (%{modifier_key}P)'), {
modifier_key: /Mac/i.test(navigator.userAgent) ? '' : 'Ctrl+',
searchPlaceholder: sprintf(s__('MergeRequest|Filter files or search with %{modifier_key}+p'), {
modifier_key: /Mac/i.test(navigator.userAgent) ? 'cmd' : 'ctrl',
}),
};
</script>
Loading
Loading
@@ -93,6 +97,7 @@ export default {
:file="file"
:level="0"
:hide-extra-on-tree="true"
:extra-component="fileRowExtraComponent"
:show-changed-icon="true"
@toggleTreeOpen="toggleTreeOpen"
@clickFile="scrollToFile"
Loading
Loading
Loading
Loading
@@ -36,17 +36,12 @@ export default {
required: false,
default: true,
},
showChangedStatus: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
changedIcon() {
// False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
// eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings
const suffix = this.showStagedIcon ? '-solid' : '';
const suffix = !this.file.changed && this.file.staged && this.showStagedIcon ? '-solid' : '';
 
return `${getCommitIconMap(this.file).icon}${suffix}`;
},
Loading
Loading
@@ -91,8 +86,8 @@ export default {
<span
v-gl-tooltip.right
:title="tooltipTitle"
:class="[{ 'ml-auto': isCentered }, changedIconClass]"
class="file-changed-icon d-flex align-items-center "
:class="{ 'ml-auto': isCentered }"
class="file-changed-icon d-inline-block"
>
<icon v-if="showIcon" :name="changedIcon" :size="size" :class="changedIconClass" />
</span>
Loading
Loading
<script>
import Icon from '~/vue_shared/components/icon.vue';
import FileHeader from '~/vue_shared/components/file_row_header.vue';
import FileIcon from '~/vue_shared/components/file_icon.vue';
import ChangedFileIcon from '~/vue_shared/components/changed_file_icon.vue';
Loading
Loading
@@ -8,6 +9,7 @@ export default {
components: {
FileHeader,
FileIcon,
Icon,
ChangedFileIcon,
},
props: {
Loading
Loading
@@ -24,7 +26,6 @@ export default {
required: false,
default: null,
},
hideExtraOnTree: {
type: Boolean,
required: false,
Loading
Loading
@@ -142,17 +143,17 @@ export default {
@mouseleave="toggleDropdown(false)"
>
<div class="file-row-name-container">
<span ref="textOutput" :style="levelIndentation" class="file-row-name str-truncated d-flex">
<span ref="textOutput" :style="levelIndentation" class="file-row-name str-truncated">
<file-icon
v-if="!showChangedIcon || file.type === 'tree'"
class="file-row-icon text-secondary mr-1"
class="file-row-icon"
:file-name="file.name"
:loading="file.loading"
:folder="isTree"
:opened="file.opened"
:size="16"
/>
<file-icon v-else :file-name="file.name" :size="16" css-classes="top mr-1" />
<changed-file-icon v-else :file="file" :size="16" class="append-right-5" />
{{ file.name }}
</span>
<component
Loading
Loading
@@ -162,7 +163,6 @@ export default {
:dropdown-open="dropdownOpen"
@toggle="toggleDropdown($event)"
/>
<changed-file-icon :file="file" :size="16" class="append-right-5" />
</div>
</div>
<template v-if="file.opened || file.isHeader">
Loading
Loading
@@ -172,6 +172,7 @@ export default {
:file="childFile"
:level="childFilesLevel"
:hide-extra-on-tree="hideExtraOnTree"
:extra-component="extraComponent"
:show-changed-icon="showChangedIcon"
@toggleTreeOpen="toggleTreeOpen"
@clickFile="clickedFile"
Loading
Loading
Loading
Loading
@@ -14,9 +14,9 @@
cursor: pointer;
 
@media (min-width: map-get($grid-breakpoints, md)) {
// The `+11` is to ensure the file header border shows when scrolled -
// The `-1` below is to prevent two borders from clashing up against eachother -
// the bottom of the compare-versions header and the top of the file header
$mr-file-header-top: $mr-version-controls-height + $header-height + $mr-tabs-height + 11;
$mr-file-header-top: $mr-version-controls-height + $header-height + $mr-tabs-height - 1;
 
position: -webkit-sticky;
position: sticky;
Loading
Loading
@@ -552,7 +552,7 @@ table.code {
 
.diff-stats {
align-items: center;
padding: 0 1rem;
padding: 0 0.25rem;
 
.diff-stats-group {
padding: 0 0.25rem;
Loading
Loading
@@ -564,7 +564,7 @@ table.code {
 
&.is-compare-versions-header {
.diff-stats-group {
padding: 0 0.25rem;
padding: 0 0.5rem;
}
}
}
Loading
Loading
@@ -1059,8 +1059,8 @@ table.code {
.diff-tree-list {
position: -webkit-sticky;
position: sticky;
$top-pos: $header-height + $mr-tabs-height + $mr-version-controls-height + 11px;
top: $header-height + $mr-tabs-height + $mr-version-controls-height + 11px;
$top-pos: $header-height + $mr-tabs-height + $mr-version-controls-height + 10px;
top: $header-height + $mr-tabs-height + $mr-version-controls-height + 10px;
max-height: calc(100vh - #{$top-pos});
z-index: 202;
 
Loading
Loading
@@ -1097,7 +1097,10 @@ table.code {
 
.tree-list-scroll {
max-height: 100%;
padding-top: $grid-size;
padding-bottom: $grid-size;
border-top: 1px solid $border-color;
border-bottom: 1px solid $border-color;
overflow-y: scroll;
overflow-x: auto;
}
Loading
Loading
Loading
Loading
@@ -708,7 +708,7 @@
.mr-version-controls {
position: relative;
z-index: 203;
background: $white-light;
background: $gray-light;
color: $gl-text-color;
margin-top: -1px;
 
Loading
Loading
@@ -732,7 +732,7 @@
}
 
.content-block {
padding: $gl-padding;
padding: $gl-padding-top $gl-padding;
border-bottom: 0;
}
 
Loading
Loading
Loading
Loading
@@ -394,6 +394,11 @@ class User < ApplicationRecord
Gitlab::CurrentSettings.minimum_password_length..Devise.password_length.max
end
 
# Generate a random password that conforms to the current password length settings
def random_password
Devise.friendly_token(password_length.max)
end
# Devise method overridden to allow sign in with email or username
def find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
Loading
Loading
Loading
Loading
@@ -222,6 +222,7 @@ class ProjectPolicy < BasePolicy
enable :read_deployment
enable :read_merge_request
enable :read_sentry_issue
enable :update_sentry_issue
enable :read_prometheus
end
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ module ErrorTracking
return unauthorized if unauthorized
 
begin
response = fetch
response = perform
rescue Sentry::Client::Error => e
return error(e.message, :bad_request)
rescue Sentry::Client::MissingKeysError => e
Loading
Loading
@@ -22,7 +22,7 @@ module ErrorTracking
 
private
 
def fetch
def perform
raise NotImplementedError,
"#{self.class} does not implement #{__method__}"
end
Loading
Loading
@@ -62,5 +62,9 @@ module ErrorTracking
def can_read?
can?(current_user, :read_sentry_issue, project)
end
def can_update?
can?(current_user, :update_sentry_issue, project)
end
end
end
Loading
Loading
@@ -4,7 +4,7 @@ module ErrorTracking
class IssueDetailsService < ErrorTracking::BaseService
private
 
def fetch
def perform
project_error_tracking_setting.issue_details(issue_id: params[:issue_id])
end
 
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ module ErrorTracking
class IssueLatestEventService < ErrorTracking::BaseService
private
 
def fetch
def perform
project_error_tracking_setting.issue_latest_event(issue_id: params[:issue_id])
end
 
Loading
Loading
Loading
Loading
@@ -4,6 +4,16 @@ module ErrorTracking
class IssueUpdateService < ErrorTracking::BaseService
private
 
def perform
response = fetch
unless parse_errors(response).present?
response[:closed_issue_iid] = update_related_issue&.iid
end
response
end
def fetch
project_error_tracking_setting.update_issue(
issue_id: params[:issue_id],
Loading
Loading
@@ -11,12 +21,58 @@ module ErrorTracking
)
end
 
def update_related_issue
issue = related_issue
return unless issue
close_and_create_note(issue)
end
def close_and_create_note(issue)
return unless resolving? && issue.opened?
processed_issue = close_issue(issue)
return unless processed_issue.reset.closed?
create_system_note(processed_issue)
processed_issue
end
def close_issue(issue)
Issues::CloseService
.new(project, current_user)
.execute(issue, system_note: false)
end
def create_system_note(issue)
SystemNoteService.close_after_error_tracking_resolve(issue, project, current_user)
end
def related_issue
SentryIssueFinder
.new(project, current_user: current_user)
.execute(params[:issue_id])
&.issue
end
def resolving?
update_params[:status] == 'resolved'
end
def update_params
params.except(:issue_id)
end
 
def parse_response(response)
{ updated: response[:updated].present? }
{
updated: response[:updated].present?,
closed_issue_iid: response[:closed_issue_iid]
}
end
def check_permissions
return error('Error Tracking is not enabled') unless enabled?
return error('Access denied', :unauthorized) unless can_update?
end
end
end
Loading
Loading
@@ -12,7 +12,7 @@ module ErrorTracking
 
private
 
def fetch
def perform
project_error_tracking_setting.list_sentry_issues(
issue_status: issue_status,
limit: limit,
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ module ErrorTracking
 
private
 
def fetch
def perform
project_error_tracking_setting.list_sentry_projects
end
 
Loading
Loading
Loading
Loading
@@ -3,9 +3,6 @@
module PagesDomains
class CreateAcmeOrderService
attr_reader :pages_domain
# TODO: remove this hack after https://gitlab.com/gitlab-org/gitlab/issues/30146 is implemented
# This makes GitLab automatically retry the certificate obtaining process every 2 hours if process wasn't finished
SHORT_EXPIRATION_DELAY = 2.hours
 
def initialize(pages_domain)
@pages_domain = pages_domain
Loading
Loading
@@ -20,7 +17,7 @@ module PagesDomains
private_key = OpenSSL::PKey::RSA.new(4096)
saved_order = pages_domain.acme_orders.create!(
url: order.url,
expires_at: [order.expires, SHORT_EXPIRATION_DELAY.from_now].min,
expires_at: order.expires,
private_key: private_key.to_pem,
 
challenge_token: challenge.token,
Loading
Loading
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