summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GITLAB_WORKHORSE_VERSION2
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_gutter_content.vue6
-rw-r--r--app/assets/javascripts/diffs/components/diff_table_cell.vue10
-rw-r--r--app/assets/javascripts/diffs/components/inline_diff_table_row.vue6
-rw-r--r--app/assets/javascripts/diffs/components/parallel_diff_table_row.vue6
-rw-r--r--app/assets/javascripts/diffs/constants.js2
-rw-r--r--app/assets/javascripts/diffs/store/mutations.js8
-rw-r--r--app/assets/javascripts/environments/components/environment_external_url.vue9
-rw-r--r--app/assets/javascripts/environments/components/environment_item.vue6
-rw-r--r--app/assets/javascripts/environments/components/environment_monitoring.vue8
-rw-r--r--app/assets/javascripts/environments/components/environment_rollback.vue17
-rw-r--r--app/assets/javascripts/environments/components/environment_stop.vue14
-rw-r--r--app/assets/javascripts/environments/components/environment_terminal_button.vue7
-rw-r--r--app/assets/javascripts/environments/components/stop_environment_modal.vue6
-rw-r--r--app/assets/javascripts/jobs/components/job_app.vue6
-rw-r--r--app/assets/javascripts/notes/components/notes_app.vue6
-rw-r--r--app/assets/javascripts/vue_shared/components/changed_file_icon.vue8
-rw-r--r--app/assets/javascripts/vue_shared/components/ci_badge_link.vue6
-rw-r--r--app/assets/javascripts/vue_shared/components/commit.vue7
-rw-r--r--app/assets/javascripts/vue_shared/components/icon.vue2
-rw-r--r--app/controllers/projects/blob_controller.rb2
-rw-r--r--app/controllers/projects/merge_requests/diffs_controller.rb6
-rw-r--r--app/models/diff_note.rb45
-rw-r--r--app/services/merge_requests/reload_diffs_service.rb4
-rw-r--r--app/services/notes/base_service.rb15
-rw-r--r--app/services/notes/create_service.rb3
-rw-r--r--app/services/notes/destroy_service.rb4
-rw-r--r--changelogs/unreleased/51259-ci-cd-tooltips.yml6
-rw-r--r--changelogs/unreleased/53640-follow-up-from-resolve-redesign-activity-feed.yml4
-rw-r--r--changelogs/unreleased/osw-comment-on-any-line-on-diffs.yml5
-rw-r--r--changelogs/unreleased/upgrade-workhorse-7-1-0.yml5
-rw-r--r--doc/administration/auth/okta.md2
-rw-r--r--doc/administration/monitoring/prometheus/gitlab_metrics.md2
-rw-r--r--doc/ci/yaml/README.md2
-rw-r--r--doc/install/database_mysql.md48
-rw-r--r--doc/university/training/topics/additional_resources.md12
-rw-r--r--doc/university/training/topics/tags.md2
-rw-r--r--doc/university/training/user_training.md2
-rw-r--r--lib/gitlab/ci/config/entry/job.rb3
-rw-r--r--lib/gitlab/diff/file.rb19
-rw-r--r--lib/gitlab/diff/line.rb13
-rw-r--r--lib/gitlab/diff/lines_unfolder.rb235
-rw-r--r--lib/gitlab/diff/position.rb12
-rw-r--r--spec/controllers/projects/blob_controller_spec.rb4
-rw-r--r--spec/features/merge_request/user_posts_diff_notes_spec.rb13
-rw-r--r--spec/javascripts/diffs/store/mutations_spec.js4
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb10
-rw-r--r--spec/lib/gitlab/diff/file_spec.rb46
-rw-r--r--spec/lib/gitlab/diff/lines_unfolder_spec.rb750
-rw-r--r--spec/services/merge_requests/reload_diffs_service_spec.rb21
-rw-r--r--spec/services/notes/create_service_spec.rb51
-rw-r--r--spec/services/notes/destroy_service_spec.rb33
-rw-r--r--spec/support/helpers/test_env.rb5
-rw-r--r--vendor/gitignore/Android.gitignore4
-rw-r--r--vendor/gitignore/Delphi.gitignore3
-rw-r--r--vendor/gitignore/Elixir.gitignore1
-rw-r--r--vendor/gitignore/Global/Images.gitignore63
-rw-r--r--vendor/gitignore/Global/NetBeans.gitignore2
-rw-r--r--vendor/gitignore/Global/PSoCCreator.gitignore18
-rw-r--r--vendor/gitignore/Global/Xcode.gitignore74
-rw-r--r--vendor/gitignore/Laravel.gitignore2
-rw-r--r--vendor/gitignore/Magento.gitignore2
-rw-r--r--vendor/gitignore/Node.gitignore3
-rw-r--r--vendor/gitignore/Python.gitignore3
-rw-r--r--vendor/gitignore/Rails.gitignore1
-rw-r--r--vendor/gitignore/Unity.gitignore1
-rw-r--r--vendor/licenses.csv52
67 files changed, 393 insertions, 1366 deletions
diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION
index 4122521804f..a3fcc7121bb 100644
--- a/GITLAB_WORKHORSE_VERSION
+++ b/GITLAB_WORKHORSE_VERSION
@@ -1 +1 @@
-7.0.0 \ No newline at end of file
+7.1.0
diff --git a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
index e31a3546b69..f4a9be19496 100644
--- a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
@@ -55,6 +55,11 @@ export default {
required: false,
default: false,
},
+ isContextLine: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
isHover: {
type: Boolean,
required: false,
@@ -76,6 +81,7 @@ export default {
this.showCommentButton &&
this.isHover &&
!this.isMatchLine &&
+ !this.isContextLine &&
!this.isMetaLine &&
!this.hasDiscussions
);
diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue
index e26aa9c9b00..5d9a0b123fe 100644
--- a/app/assets/javascripts/diffs/components/diff_table_cell.vue
+++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue
@@ -3,6 +3,7 @@ import { mapGetters } from 'vuex';
import DiffLineGutterContent from './diff_line_gutter_content.vue';
import {
MATCH_LINE_TYPE,
+ CONTEXT_LINE_TYPE,
EMPTY_CELL_TYPE,
OLD_LINE_TYPE,
OLD_NO_NEW_LINE_TYPE,
@@ -70,6 +71,9 @@ export default {
isMatchLine() {
return this.line.type === MATCH_LINE_TYPE;
},
+ isContextLine() {
+ return this.line.type === CONTEXT_LINE_TYPE;
+ },
isMetaLine() {
const { type } = this.line;
@@ -84,7 +88,11 @@ export default {
[type]: type,
[LINE_UNFOLD_CLASS_NAME]: this.isMatchLine,
[LINE_HOVER_CLASS_NAME]:
- this.isLoggedIn && this.isHover && !this.isMatchLine && !this.isMetaLine,
+ this.isLoggedIn &&
+ this.isHover &&
+ !this.isMatchLine &&
+ !this.isContextLine &&
+ !this.isMetaLine,
};
},
lineNumber() {
diff --git a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
index 44c05e4b634..542acd3d930 100644
--- a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
+++ b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
@@ -4,6 +4,8 @@ import DiffTableCell from './diff_table_cell.vue';
import {
NEW_LINE_TYPE,
OLD_LINE_TYPE,
+ CONTEXT_LINE_TYPE,
+ CONTEXT_LINE_CLASS_NAME,
PARALLEL_DIFF_VIEW_TYPE,
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
@@ -39,9 +41,13 @@ export default {
},
computed: {
...mapGetters('diffs', ['isInlineView']),
+ isContextLine() {
+ return this.line.type === CONTEXT_LINE_TYPE;
+ },
classNameMap() {
return {
[this.line.type]: this.line.type,
+ [CONTEXT_LINE_CLASS_NAME]: this.isContextLine,
[PARALLEL_DIFF_VIEW_TYPE]: this.isParallelView,
};
},
diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
index 39312cddfce..fcc3b3e9117 100644
--- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
+++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
@@ -5,6 +5,8 @@ import DiffTableCell from './diff_table_cell.vue';
import {
NEW_LINE_TYPE,
OLD_LINE_TYPE,
+ CONTEXT_LINE_TYPE,
+ CONTEXT_LINE_CLASS_NAME,
OLD_NO_NEW_LINE_TYPE,
PARALLEL_DIFF_VIEW_TYPE,
NEW_NO_NEW_LINE_TYPE,
@@ -41,8 +43,12 @@ export default {
};
},
computed: {
+ isContextLine() {
+ return this.line.left && this.line.left.type === CONTEXT_LINE_TYPE;
+ },
classNameMap() {
return {
+ [CONTEXT_LINE_CLASS_NAME]: this.isContextLine,
[PARALLEL_DIFF_VIEW_TYPE]: true,
};
},
diff --git a/app/assets/javascripts/diffs/constants.js b/app/assets/javascripts/diffs/constants.js
index f5f5c0ffc29..78a39baa4cb 100644
--- a/app/assets/javascripts/diffs/constants.js
+++ b/app/assets/javascripts/diffs/constants.js
@@ -3,6 +3,7 @@ export const PARALLEL_DIFF_VIEW_TYPE = 'parallel';
export const MATCH_LINE_TYPE = 'match';
export const OLD_NO_NEW_LINE_TYPE = 'old-nonewline';
export const NEW_NO_NEW_LINE_TYPE = 'new-nonewline';
+export const CONTEXT_LINE_TYPE = 'context';
export const EMPTY_CELL_TYPE = 'empty-cell';
export const COMMENT_FORM_TYPE = 'commentForm';
export const DIFF_NOTE_TYPE = 'DiffNote';
@@ -21,6 +22,7 @@ export const LINE_SIDE_RIGHT = 'right-side';
export const DIFF_VIEW_COOKIE_NAME = 'diff_view';
export const LINE_HOVER_CLASS_NAME = 'is-over';
export const LINE_UNFOLD_CLASS_NAME = 'unfold js-unfold';
+export const CONTEXT_LINE_CLASS_NAME = 'diff-expanded';
export const UNFOLD_COUNT = 20;
export const COUNT_OF_AVATARS_IN_GUTTER = 3;
diff --git a/app/assets/javascripts/diffs/store/mutations.js b/app/assets/javascripts/diffs/store/mutations.js
index e651c197968..a7eea2c1449 100644
--- a/app/assets/javascripts/diffs/store/mutations.js
+++ b/app/assets/javascripts/diffs/store/mutations.js
@@ -65,13 +65,7 @@ export default {
const { highlightedDiffLines, parallelDiffLines } = diffFile;
removeMatchLine(diffFile, lineNumbers, bottom);
-
- const lines = addLineReferences(contextLines, lineNumbers, bottom).map(line => ({
- ...line,
- lineCode: line.lineCode || `${fileHash}_${line.oldLine}_${line.newLine}`,
- discussions: line.discussions || [],
- }));
-
+ const lines = addLineReferences(contextLines, lineNumbers, bottom);
addContextLines({
inlineLines: highlightedDiffLines,
parallelLines: parallelDiffLines,
diff --git a/app/assets/javascripts/environments/components/environment_external_url.vue b/app/assets/javascripts/environments/components/environment_external_url.vue
index 7446196de13..1e8a892c0b8 100644
--- a/app/assets/javascripts/environments/components/environment_external_url.vue
+++ b/app/assets/javascripts/environments/components/environment_external_url.vue
@@ -1,7 +1,7 @@
<script>
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
-import tooltip from '../../vue_shared/directives/tooltip';
-import { s__ } from '../../locale';
+import { s__ } from '~/locale';
/**
* Renders the external url link in environments table.
@@ -11,7 +11,7 @@ export default {
Icon,
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
externalUrl: {
@@ -28,12 +28,11 @@ export default {
</script>
<template>
<a
- v-tooltip
+ v-gl-tooltip
:title="title"
:aria-label="title"
:href="externalUrl"
class="btn external-url"
- data-container="body"
target="_blank"
rel="noopener noreferrer nofollow"
>
diff --git a/app/assets/javascripts/environments/components/environment_item.vue b/app/assets/javascripts/environments/components/environment_item.vue
index 41f59447905..50b0e9747ee 100644
--- a/app/assets/javascripts/environments/components/environment_item.vue
+++ b/app/assets/javascripts/environments/components/environment_item.vue
@@ -1,7 +1,7 @@
<script>
import Timeago from 'timeago.js';
import _ from 'underscore';
-import tooltip from '~/vue_shared/directives/tooltip';
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import { humanize } from '~/lib/utils/text_utility';
import Icon from '~/vue_shared/components/icon.vue';
@@ -36,7 +36,7 @@ export default {
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
@@ -455,7 +455,7 @@ export default {
class="gl-responsive-table-row"
role="row">
<div
- v-tooltip
+ v-gl-tooltip
:title="model.name"
class="table-section section-wrap section-15 text-truncate"
role="gridcell"
diff --git a/app/assets/javascripts/environments/components/environment_monitoring.vue b/app/assets/javascripts/environments/components/environment_monitoring.vue
index 26bec125445..7c723fa8979 100644
--- a/app/assets/javascripts/environments/components/environment_monitoring.vue
+++ b/app/assets/javascripts/environments/components/environment_monitoring.vue
@@ -2,9 +2,8 @@
/**
* Renders the Monitoring (Metrics) link in environments table.
*/
-import { GlButton } from '@gitlab-org/gitlab-ui';
+import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
-import tooltip from '../../vue_shared/directives/tooltip';
export default {
components: {
@@ -12,7 +11,7 @@ export default {
GlButton,
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
monitoringUrl: {
@@ -29,12 +28,11 @@ export default {
</script>
<template>
<gl-button
- v-tooltip
+ v-gl-tooltip
:href="monitoringUrl"
:title="title"
:aria-label="title"
class="monitoring-url d-none d-sm-none d-md-block"
- data-container="body"
rel="noopener noreferrer nofollow"
variant="default"
>
diff --git a/app/assets/javascripts/environments/components/environment_rollback.vue b/app/assets/javascripts/environments/components/environment_rollback.vue
index 69856abc2d5..298469e6482 100644
--- a/app/assets/javascripts/environments/components/environment_rollback.vue
+++ b/app/assets/javascripts/environments/components/environment_rollback.vue
@@ -6,21 +6,18 @@
* Makes a post request when the button is clicked.
*/
import { s__ } from '~/locale';
+import { GlTooltipDirective, GlLoadingIcon } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
-import tooltip from '~/vue_shared/directives/tooltip';
import eventHub from '../event_hub';
-import { GlLoadingIcon } from '@gitlab-org/gitlab-ui';
export default {
components: {
Icon,
GlLoadingIcon,
},
-
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
-
props: {
retryUrl: {
type: String,
@@ -57,21 +54,21 @@ export default {
</script>
<template>
<button
- v-tooltip
+ v-gl-tooltip
:disabled="isLoading"
:title="title"
type="button"
class="btn d-none d-sm-none d-md-block"
@click="onClick"
>
-
<icon
v-if="isLastDeployment"
- name="repeat" />
+ name="repeat"
+ />
<icon
v-else
- name="redo"/>
-
+ name="redo"
+ />
<gl-loading-icon v-if="isLoading" />
</button>
</template>
diff --git a/app/assets/javascripts/environments/components/environment_stop.vue b/app/assets/javascripts/environments/components/environment_stop.vue
index a814b3405f5..327c96a93e9 100644
--- a/app/assets/javascripts/environments/components/environment_stop.vue
+++ b/app/assets/javascripts/environments/components/environment_stop.vue
@@ -5,49 +5,42 @@
*/
import $ from 'jquery';
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
import { s__ } from '~/locale';
import eventHub from '../event_hub';
import LoadingButton from '../../vue_shared/components/loading_button.vue';
-import tooltip from '../../vue_shared/directives/tooltip';
export default {
components: {
Icon,
LoadingButton,
},
-
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
-
props: {
environment: {
type: Object,
required: true,
},
},
-
data() {
return {
isLoading: false,
};
},
-
computed: {
title() {
return s__('Environments|Stop environment');
},
},
-
mounted() {
eventHub.$on('stopEnvironment', this.onStopEnvironment);
},
-
beforeDestroy() {
eventHub.$off('stopEnvironment', this.onStopEnvironment);
},
-
methods: {
onClick() {
$(this.$el).tooltip('dispose');
@@ -63,12 +56,11 @@ export default {
</script>
<template>
<loading-button
- v-tooltip
+ v-gl-tooltip
:loading="isLoading"
:title="title"
:aria-label="title"
container-class="btn btn-danger d-none d-sm-none d-md-block"
- data-container="body"
data-toggle="modal"
data-target="#stop-environment-modal"
@click="onClick"
diff --git a/app/assets/javascripts/environments/components/environment_terminal_button.vue b/app/assets/javascripts/environments/components/environment_terminal_button.vue
index 350417e5ad0..b8b909f350c 100644
--- a/app/assets/javascripts/environments/components/environment_terminal_button.vue
+++ b/app/assets/javascripts/environments/components/environment_terminal_button.vue
@@ -3,15 +3,15 @@
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
-import tooltip from '../../vue_shared/directives/tooltip';
export default {
components: {
Icon,
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
terminalPath: {
@@ -29,12 +29,11 @@ export default {
</script>
<template>
<a
- v-tooltip
+ v-gl-tooltip
:title="title"
:aria-label="title"
:href="terminalPath"
class="btn terminal-button d-none d-sm-none d-md-block"
- data-container="body"
>
<icon name="terminal" />
</a>
diff --git a/app/assets/javascripts/environments/components/stop_environment_modal.vue b/app/assets/javascripts/environments/components/stop_environment_modal.vue
index 657cc8cd1aa..6397f6caf1b 100644
--- a/app/assets/javascripts/environments/components/stop_environment_modal.vue
+++ b/app/assets/javascripts/environments/components/stop_environment_modal.vue
@@ -1,7 +1,7 @@
<script>
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import GlModal from '~/vue_shared/components/gl_modal.vue';
import { s__, sprintf } from '~/locale';
-import tooltip from '~/vue_shared/directives/tooltip';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import eventHub from '../event_hub';
@@ -15,7 +15,7 @@ export default {
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
@@ -67,7 +67,7 @@ export default {
>
Stopping
<span
- v-tooltip
+ v-gl-tooltip
:title="environment.name"
class="text-truncate ml-1 mr-1 flex-fill"
>{{ environment.name }}</span>
diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue
index 35104c80694..90216b04e92 100644
--- a/app/assets/javascripts/jobs/components/job_app.vue
+++ b/app/assets/javascripts/jobs/components/job_app.vue
@@ -240,16 +240,16 @@ export default {
:erased-at="job.erased_at"
/>
- <div
+ <div
v-if="job.archived"
ref="sticky"
class="js-archived-job prepend-top-default archived-sticky sticky-top"
>
- <icon
+ <icon
name="lock"
class="align-text-bottom"
/>
-
+
{{ __('This job is archived. Only the complete pipeline can be retried.') }}
</div>
<!--job log -->
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue
index ed5ac112dc0..e555279a6ac 100644
--- a/app/assets/javascripts/notes/components/notes_app.vue
+++ b/app/assets/javascripts/notes/components/notes_app.vue
@@ -50,6 +50,7 @@ export default {
},
data() {
return {
+ isFetching: false,
currentFilter: null,
};
},
@@ -141,6 +142,10 @@ export default {
return discussion.individual_note ? { note: discussion.notes[0] } : { discussion };
},
fetchNotes() {
+ if (this.isFetching) return null;
+
+ this.isFetching = true;
+
return this.fetchDiscussions({ path: this.getNotesDataByProp('discussionsPath') })
.then(() => {
this.initPolling();
@@ -149,6 +154,7 @@ export default {
this.setLoadingState(false);
this.setNotesFetchedState(true);
eventHub.$emit('fetchedNotesData');
+ this.isFetching = false;
})
.then(() => this.$nextTick())
.then(() => this.checkLocationHash())
diff --git a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
index 8684005e0fb..766fc211bf5 100644
--- a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
+++ b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
@@ -1,5 +1,5 @@
<script>
-import tooltip from '~/vue_shared/directives/tooltip';
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
import { pluralize } from '~/lib/utils/text_utility';
import { __, sprintf } from '~/locale';
@@ -10,7 +10,7 @@ export default {
Icon,
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
file: {
@@ -79,10 +79,8 @@ export default {
<template>
<span
- v-tooltip
+ v-gl-tooltip.right
:title="tooltipTitle"
- data-container="body"
- data-placement="right"
class="file-changed-icon ml-auto"
>
<icon
diff --git a/app/assets/javascripts/vue_shared/components/ci_badge_link.vue b/app/assets/javascripts/vue_shared/components/ci_badge_link.vue
index c60052fec50..6780254827f 100644
--- a/app/assets/javascripts/vue_shared/components/ci_badge_link.vue
+++ b/app/assets/javascripts/vue_shared/components/ci_badge_link.vue
@@ -1,6 +1,6 @@
<script>
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import CiIcon from './ci_icon.vue';
-import tooltip from '../directives/tooltip';
/**
* Renders CI Badge link with CI icon and status text based on
* API response shared between all places where it is used.
@@ -27,7 +27,7 @@ export default {
CiIcon,
},
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
props: {
status: {
@@ -50,7 +50,7 @@ export default {
</script>
<template>
<a
- v-tooltip
+ v-gl-tooltip
:href="status.details_path"
:class="cssClass"
:title="!showText ? status.text : ''"
diff --git a/app/assets/javascripts/vue_shared/components/commit.vue b/app/assets/javascripts/vue_shared/components/commit.vue
index 151eee75d44..b1139f34e41 100644
--- a/app/assets/javascripts/vue_shared/components/commit.vue
+++ b/app/assets/javascripts/vue_shared/components/commit.vue
@@ -1,11 +1,11 @@
<script>
+import { GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import UserAvatarLink from './user_avatar/user_avatar_link.vue';
-import tooltip from '../directives/tooltip';
import Icon from '../../vue_shared/components/icon.vue';
export default {
directives: {
- tooltip,
+ GlTooltip: GlTooltipDirective,
},
components: {
UserAvatarLink,
@@ -124,11 +124,10 @@ export default {
</div>
<a
- v-tooltip
+ v-gl-tooltip
:href="commitRef.ref_url"
:title="commitRef.name"
class="ref-name"
- data-container="body"
>
{{ commitRef.name }}
</a>
diff --git a/app/assets/javascripts/vue_shared/components/icon.vue b/app/assets/javascripts/vue_shared/components/icon.vue
index cddebfae115..a25841fc02f 100644
--- a/app/assets/javascripts/vue_shared/components/icon.vue
+++ b/app/assets/javascripts/vue_shared/components/icon.vue
@@ -1,6 +1,6 @@
<script>
// only allow classes in images.scss e.g. s12
-const validSizes = [8, 10, 12, 16, 18, 24, 32, 48, 72];
+const validSizes = [8, 10, 12, 14, 16, 18, 24, 32, 48, 72];
let iconValidator = () => true;
/*
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 2a6fe3b9c97..c02ec407262 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -122,7 +122,7 @@ class Projects::BlobController < Projects::ApplicationController
@lines.map! do |line|
# These are marked as context lines but are loaded from blobs.
# We also have context lines loaded from diffs in other places.
- diff_line = Gitlab::Diff::Line.new(line, nil, nil, nil, nil)
+ diff_line = Gitlab::Diff::Line.new(line, 'context', nil, nil, nil)
diff_line.rich_text = line
diff_line
end
diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb
index 740f41c0642..5307cd0720a 100644
--- a/app/controllers/projects/merge_requests/diffs_controller.rb
+++ b/app/controllers/projects/merge_requests/diffs_controller.rb
@@ -22,12 +22,6 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
def render_diffs
@environment = @merge_request.environments_for(current_user).last
- notes_grouped_by_path = @notes.group_by { |note| note.position.file_path }
-
- @diffs.diff_files.each do |diff_file|
- notes = notes_grouped_by_path.fetch(diff_file.file_path, [])
- notes.each { |note| diff_file.unfold_diff_lines(note.position) }
- end
@diffs.write_cache
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb
index c32008aa9c7..5f59e4832db 100644
--- a/app/models/diff_note.rb
+++ b/app/models/diff_note.rb
@@ -66,10 +66,6 @@ class DiffNote < Note
self.original_position.diff_refs == diff_refs
end
- def discussion_first_note?
- self == discussion.first_note
- end
-
private
def enqueue_diff_file_creation_job
@@ -82,33 +78,26 @@ class DiffNote < Note
end
def should_create_diff_file?
- on_text? && note_diff_file.nil? && discussion_first_note?
+ on_text? && note_diff_file.nil? && self == discussion.first_note
end
def fetch_diff_file
- file =
- if note_diff_file
- diff = Gitlab::Git::Diff.new(note_diff_file.to_hash)
- Gitlab::Diff::File.new(diff,
- repository: project.repository,
- diff_refs: original_position.diff_refs)
- elsif created_at_diff?(noteable.diff_refs)
- # We're able to use the already persisted diffs (Postgres) if we're
- # presenting a "current version" of the MR discussion diff.
- # So no need to make an extra Gitaly diff request for it.
- # As an extra benefit, the returned `diff_file` already
- # has `highlighted_diff_lines` data set from Redis on
- # `Diff::FileCollection::MergeRequestDiff`.
- noteable.diffs(original_position.diff_options).diff_files.first
- else
- original_position.diff_file(self.project.repository)
- end
-
- # Since persisted diff files already have its content "unfolded"
- # there's no need to make it pass through the unfolding process.
- file&.unfold_diff_lines(position) unless note_diff_file
-
- file
+ if note_diff_file
+ diff = Gitlab::Git::Diff.new(note_diff_file.to_hash)
+ Gitlab::Diff::File.new(diff,
+ repository: project.repository,
+ diff_refs: original_position.diff_refs)
+ elsif created_at_diff?(noteable.diff_refs)
+ # We're able to use the already persisted diffs (Postgres) if we're
+ # presenting a "current version" of the MR discussion diff.
+ # So no need to make an extra Gitaly diff request for it.
+ # As an extra benefit, the returned `diff_file` already
+ # has `highlighted_diff_lines` data set from Redis on
+ # `Diff::FileCollection::MergeRequestDiff`.
+ noteable.diffs(original_position.diff_options).diff_files.first
+ else
+ original_position.diff_file(self.project.repository)
+ end
end
def supported?
diff --git a/app/services/merge_requests/reload_diffs_service.rb b/app/services/merge_requests/reload_diffs_service.rb
index c64b2e99b52..b47d8f3f63a 100644
--- a/app/services/merge_requests/reload_diffs_service.rb
+++ b/app/services/merge_requests/reload_diffs_service.rb
@@ -29,6 +29,10 @@ module MergeRequests
# rubocop: disable CodeReuse/ActiveRecord
def clear_cache(new_diff)
+ # Executing the iteration we cache highlighted diffs for each diff file of
+ # MergeRequestDiff.
+ cacheable_collection(new_diff).write_cache
+
# Remove cache for all diffs on this MR. Do not use the association on the
# model, as that will interfere with other actions happening when
# reloading the diff.
diff --git a/app/services/notes/base_service.rb b/app/services/notes/base_service.rb
deleted file mode 100644
index 431ff6c11c4..00000000000
--- a/app/services/notes/base_service.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-module Notes
- class BaseService < ::BaseService
- def clear_noteable_diffs_cache(note)
- noteable = note.noteable
-
- if note.is_a?(DiffNote) &&
- note.discussion_first_note? &&
- note.position.unfolded_diff?(project.repository)
- noteable.diffs.clear_cache
- end
- end
- end
-end
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index e03789e3ca9..049e6c5a871 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Notes
- class CreateService < ::Notes::BaseService
+ class CreateService < ::BaseService
def execute
merge_request_diff_head_sha = params.delete(:merge_request_diff_head_sha)
@@ -35,7 +35,6 @@ module Notes
if !only_commands && note.save
todo_service.new_note(note, current_user)
- clear_noteable_diffs_cache(note)
end
if command_params.present?
diff --git a/app/services/notes/destroy_service.rb b/app/services/notes/destroy_service.rb
index fa0c2c5c86b..64e9accd97f 100644
--- a/app/services/notes/destroy_service.rb
+++ b/app/services/notes/destroy_service.rb
@@ -1,13 +1,11 @@
# frozen_string_literal: true
module Notes
- class DestroyService < ::Notes::BaseService
+ class DestroyService < BaseService
def execute(note)
TodoService.new.destroy_target(note) do |note|
note.destroy
end
-
- clear_noteable_diffs_cache(note)
end
end
end
diff --git a/changelogs/unreleased/51259-ci-cd-tooltips.yml b/changelogs/unreleased/51259-ci-cd-tooltips.yml
new file mode 100644
index 00000000000..fc0010dbeba
--- /dev/null
+++ b/changelogs/unreleased/51259-ci-cd-tooltips.yml
@@ -0,0 +1,6 @@
+---
+title: Replaces tooltip directive with the new gl-tooltip directive for consistency
+ in some ci/cd code
+merge_request:
+author:
+type: other
diff --git a/changelogs/unreleased/53640-follow-up-from-resolve-redesign-activity-feed.yml b/changelogs/unreleased/53640-follow-up-from-resolve-redesign-activity-feed.yml
new file mode 100644
index 00000000000..66301329c52
--- /dev/null
+++ b/changelogs/unreleased/53640-follow-up-from-resolve-redesign-activity-feed.yml
@@ -0,0 +1,4 @@
+title: Adds new icon size to Vue icon component
+merge_request: 22899
+author:
+type: other
diff --git a/changelogs/unreleased/osw-comment-on-any-line-on-diffs.yml b/changelogs/unreleased/osw-comment-on-any-line-on-diffs.yml
deleted file mode 100644
index 7b48a94a993..00000000000
--- a/changelogs/unreleased/osw-comment-on-any-line-on-diffs.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Allow commenting on any diff line in Merge Requests
-merge_request: 22398
-author:
-type: added
diff --git a/changelogs/unreleased/upgrade-workhorse-7-1-0.yml b/changelogs/unreleased/upgrade-workhorse-7-1-0.yml
new file mode 100644
index 00000000000..b6df35e6d10
--- /dev/null
+++ b/changelogs/unreleased/upgrade-workhorse-7-1-0.yml
@@ -0,0 +1,5 @@
+---
+title: Update GitLab-Workhorse to v7.1.0
+merge_request: 22883
+author:
+type: other
diff --git a/doc/administration/auth/okta.md b/doc/administration/auth/okta.md
index 664657650d4..ae38094391b 100644
--- a/doc/administration/auth/okta.md
+++ b/doc/administration/auth/okta.md
@@ -11,7 +11,7 @@ The following documentation enables Okta as a SAML provider.
1. When the app screen comes up you see another button to **Create an App** and
choose SAML 2.0 on the next screen.
1. Now, very important, add a logo
- (you can choose it from https://about.gitlab.com/press/). You'll have to
+ (you can choose it from <https://about.gitlab.com/press/>). You'll have to
crop and resize it.
1. Next, you'll need the to fill in the SAML general config. Here's an example
image.
diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md
index 5700f640e4c..c9a2778b3a4 100644
--- a/doc/administration/monitoring/prometheus/gitlab_metrics.md
+++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md
@@ -45,7 +45,7 @@ The following metrics are available:
| redis_ping_success | Gauge | 9.4 | Whether or not the last redis ping succeeded |
| redis_ping_latency_seconds | Gauge | 9.4 | Round trip time of the redis ping |
| user_session_logins_total | Counter | 9.4 | Counter of how many users have logged in |
-| upload_file_does_not_exist | Counter | 10.7 | Number of times an upload record could not find its file |
+| upload_file_does_not_exist | Counter | 10.7 in EE, 11.5 in CE | Number of times an upload record could not find its file |
| failed_login_captcha_total | Gauge | 11.0 | Counter of failed CAPTCHA attempts during login |
| successful_login_captcha_total | Gauge | 11.0 | Counter of successful CAPTCHA attempts during login |
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index c827faace33..5cca9d86560 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -1510,7 +1510,7 @@ Possible values for `when` are:
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22631) in GitLab 11.5.
`parallel` allows you to configure how many instances of a job to run in
-parallel. This value has to be greater than or equal to two (2).
+parallel. This value has to be greater than or equal to two (2) and less or equal than 50.
This creates N instances of the same job that run in parallel. They're named
sequentially from `job_name 1/N` to `job_name N/N`.
diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md
index acaed53e052..4cb8ca4f3e7 100644
--- a/doc/install/database_mysql.md
+++ b/doc/install/database_mysql.md
@@ -1,15 +1,20 @@
# Database MySQL
-> **Note:**
-> - We do not recommend using MySQL due to various issues. For example, case
- [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html)
- and [problems](https://bugs.mysql.com/bug.php?id=65830) that
- [suggested](https://bugs.mysql.com/bug.php?id=50909)
- [fixes](https://bugs.mysql.com/bug.php?id=65830) [have](https://bugs.mysql.com/bug.php?id=63164).
+NOTE: **Note:**
+We do not recommend using MySQL due to various issues.
+For example, there have been bugs with case
+[(in)sensitivity](https://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html).
+
+Bugs relating to case sensitivity:
+
+- <https://bugs.mysql.com/bug.php?id=65830>
+- <https://bugs.mysql.com/bug.php?id=50909>
+- <https://bugs.mysql.com/bug.php?id=65830>
+- <https://bugs.mysql.com/bug.php?id=63164>
## Initial database setup
-```
+```sh
# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
@@ -84,8 +89,9 @@ GitLab 8.14 has introduced [a feature](https://gitlab.com/gitlab-org/gitlab-ce/m
Follow the below instructions to ensure you use the most up to date requirements for your GitLab MySQL Database.
**We are about to do the following:**
+
- Ensure you can enable `utf8mb4` encoding and `utf8mb4_general_ci` collation for your GitLab DB, tables and data.
-- Convert your GitLab tables and data from `utf8`/`utf8_general_ci` to `utf8mb4`/`utf8mb4_general_ci`
+- Convert your GitLab tables and data from `utf8`/`utf8_general_ci` to `utf8mb4`/`utf8mb4_general_ci`.
### Check for utf8mb4 support
@@ -130,7 +136,8 @@ We need to check, enable and maybe convert your existing GitLab DB tables to the
Whatever the results of your checks above, we now need to check if your GitLab database has been created using [InnoDB File-Per-Table Tablespaces](http://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) (i.e. `innodb_file_per_table` was set to **1** at initial setup time).
-> Note: This setting is [enabled by default](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_per_table) since MySQL 5.6.6.
+NOTE: **Note:**
+This setting is [enabled by default](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_per_table) since MySQL 5.6.6.
# Run this command with root privileges, replace the data dir if different:
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.ibd | wc -l
@@ -138,20 +145,19 @@ Whatever the results of your checks above, we now need to check if your GitLab d
# Run this command with root privileges, replace the data dir if different:
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.frm | wc -l
-
- **Case 1: a result > 0 for both commands**
-Congrats, your GitLab database uses the right InnoDB tablespace format.
+Congratulations, your GitLab database uses the right InnoDB tablespace format.
However, you must still ensure that any **future tables** created by GitLab will still use the right format:
- If `SELECT @@innodb_file_per_table` returned **1** previously, your server is running correctly.
- > It's however a requirement to check *now* that this setting is indeed persisted in your [my.cnf](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) file!
+ > It's however a requirement to check *now* that this setting is indeed persisted in your [`my.cnf`](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) file!
- If `SELECT @@innodb_file_per_table` returned **0** previously, your server is not running correctly.
- > [Enable innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) by running in a MySQL session as root the command `SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda;` and persist the two settings in your [my.cnf](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) file
+ > [Enable innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) by running in a MySQL session as root the command `SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda;` and persist the two settings in your [`my.cnf`](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) file.
Now, if you have a **different result** returned by the 2 commands above, it means you have a **mix of tables format** uses in your GitLab database. This can happen if your MySQL server had different values for `innodb_file_per_table` in its life and you updated GitLab at different moments with those inconsistent values. So keep reading.
@@ -172,7 +178,7 @@ Let's enable what we need on the running server:
# You can now quit the database session
mysql> \q
-> Now, **persist** [innodb_file_per_table](https://dev.mysql.com/doc/refman/5.6/en/tablespace-enabling.html) and [innodb_file_format](https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format-enabling.html) in your `my.cnf` file.
+> Now, **persist** [innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) and [innodb_file_format](https://dev.mysql.com/doc/refman/5.7/en/innodb-file-format-enabling.html) in your `my.cnf` file.
Ensure at this stage that your GitLab instance is indeed **stopped**.
@@ -184,7 +190,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
# Type the MySQL root password
mysql > use gitlabhq_production;
- # Safety check: you should still have those values set as follow:
+ # Safety check: you should still have those values set as follows:
mysql> SELECT @@innodb_file_per_table, @@innodb_file_format;
+-------------------------+----------------------+
| @@innodb_file_per_table | @@innodb_file_format |
@@ -203,7 +209,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
#### Check for proper InnoDB File Format, Row Format, Large Prefix and tables conversion
-We need to check, enable and probably convert your existing GitLab DB tables to use the [Barracuda InnoDB file format](https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format.html), the [DYNAMIC row format](https://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_dynamic_row_format) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) as a second prerequisite for supporting **utfb8mb4 with long indexes** used by recent GitLab databases.
+We need to check, enable and probably convert your existing GitLab DB tables to use the [Barracuda InnoDB file format](https://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html), the [DYNAMIC row format](https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_dynamic_row_format) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) as a second prerequisite for supporting **utfb8mb4 with long indexes** used by recent GitLab databases.
# Login to MySQL
mysql -u root -p
@@ -229,7 +235,7 @@ We need to check, enable and probably convert your existing GitLab DB tables to
| utf8 | utf8_general_ci |
+--------------------------+----------------------+
-> Now, ensure that [innodb_file_format](https://dev.mysql.com/doc/refman/5.6/en/tablespace-enabling.html) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) are **persisted** in your `my.cnf` file.
+> Now, ensure that [innodb_file_format](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) are **persisted** in your `my.cnf` file.
#### Tables and data conversion to utf8mb4
@@ -257,7 +263,7 @@ Now that you have a persistent MySQL setup, you can safely upgrade tables after
Ensure your GitLab database configuration file uses a proper connection encoding and collation:
-```sudo -u git -H editor config/database.yml```
+`sudo -u git -H editor config/database.yml`
production:
adapter: mysql2
@@ -266,19 +272,19 @@ Ensure your GitLab database configuration file uses a proper connection encoding
[Restart your GitLab instance](../administration/restart_gitlab.md).
-
## MySQL strings limits
After installation or upgrade, remember to run the `add_limits_mysql` Rake task:
**Omnibus GitLab installations**
-```
+
+```sh
sudo gitlab-rake add_limits_mysql
```
**Installations from source**
-```
+```sh
bundle exec rake add_limits_mysql RAILS_ENV=production
```
diff --git a/doc/university/training/topics/additional_resources.md b/doc/university/training/topics/additional_resources.md
index d01634df744..4871372d105 100644
--- a/doc/university/training/topics/additional_resources.md
+++ b/doc/university/training/topics/additional_resources.md
@@ -4,9 +4,9 @@ comments: false
# Additional Resources
-1. GitLab Documentation [http://docs.gitlab.com](http://docs.gitlab.com/)
-2. GUI Clients [http://git-scm.com/downloads/guis](http://git-scm.com/downloads/guis)
-3. Pro git book [http://git-scm.com/book](http://git-scm.com/book)
-4. Platzi Course [https://courses.platzi.com/courses/git-gitlab/](https://courses.platzi.com/courses/git-gitlab/)
-5. Code School tutorial [http://try.github.io/](http://try.github.io/)
-6. Contact Us at `subscribers@gitlab.com`
+1. GitLab Documentation: <http://docs.gitlab.com>.
+1. GUI Clients: <http://git-scm.com/downloads/guis>.
+1. Pro Git book: <http://git-scm.com/book>.
+1. Platzi Course: <https://courses.platzi.com/courses/git-gitlab/>.
+1. Code School tutorial: <http://try.github.io/>.
+1. Contact us at `subscribers@gitlab.com`.
diff --git a/doc/university/training/topics/tags.md b/doc/university/training/topics/tags.md
index 6333ceedbd7..9526bcbfb82 100644
--- a/doc/university/training/topics/tags.md
+++ b/doc/university/training/topics/tags.md
@@ -22,7 +22,7 @@ comments: false
**Additional resources**
-[http://git-scm.com/book/en/Git-Basics-Tagging](http://git-scm.com/book/en/Git-Basics-Tagging)
+<http://git-scm.com/book/en/Git-Basics-Tagging>
----------
diff --git a/doc/university/training/user_training.md b/doc/university/training/user_training.md
index f3a4d766522..ca3f777f403 100644
--- a/doc/university/training/user_training.md
+++ b/doc/university/training/user_training.md
@@ -385,7 +385,7 @@ Thank you for your hard work!
- GitLab Documentation: <http://docs.gitlab.com/>.
- GUI Clients: <http://git-scm.com/downloads/guis>.
-- Pro git book: <http://git-scm.com/book>.
+- Pro Git book: <http://git-scm.com/book>.
- Platzi Course: <https://courses.platzi.com/courses/git-gitlab/>.
- Code School tutorial: <http://try.github.io/>.
- Contact us at `subscribers@gitlab.com`.
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb
index 8e8c979f973..c8cb3248fa7 100644
--- a/lib/gitlab/ci/config/entry/job.rb
+++ b/lib/gitlab/ci/config/entry/job.rb
@@ -27,7 +27,8 @@ module Gitlab
validates :tags, array_of_strings: true
validates :allow_failure, boolean: true
validates :parallel, numericality: { only_integer: true,
- greater_than_or_equal_to: 2 }
+ greater_than_or_equal_to: 2,
+ less_than_or_equal_to: 50 }
validates :when,
inclusion: { in: %w[on_success on_failure always manual delayed],
message: 'should be on_success, on_failure, ' \
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
index 84595f8afd7..fb117baca9e 100644
--- a/lib/gitlab/diff/file.rb
+++ b/lib/gitlab/diff/file.rb
@@ -26,7 +26,6 @@ module Gitlab
@repository = repository
@diff_refs = diff_refs
@fallback_diff_refs = fallback_diff_refs
- @unfolded = false
# Ensure items are collected in the the batch
new_blob_lazy
@@ -136,24 +135,6 @@ module Gitlab
Gitlab::Diff::Parser.new.parse(raw_diff.each_line, diff_file: self).to_a
end
- # Changes diff_lines according to the given position. That is,
- # it checks whether the position requires blob lines into the diff
- # in order to be presented.
- def unfold_diff_lines(position)
- return unless position
-
- unfolder = Gitlab::Diff::LinesUnfolder.new(self, position)
-
- if unfolder.unfold_required?
- @diff_lines = unfolder.unfolded_diff_lines
- @unfolded = true
- end
- end
-
- def unfolded?
- @unfolded
- end
-
def highlighted_diff_lines
@highlighted_diff_lines ||=
Gitlab::Diff::Highlight.new(self, repository: self.repository).highlight
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
index 70063071ee7..5b67cd46c48 100644
--- a/lib/gitlab/diff/line.rb
+++ b/lib/gitlab/diff/line.rb
@@ -3,9 +3,9 @@ module Gitlab
class Line
SERIALIZE_KEYS = %i(line_code rich_text text type index old_pos new_pos).freeze
- attr_reader :line_code, :type, :old_pos, :new_pos
+ attr_reader :line_code, :type, :index, :old_pos, :new_pos
attr_writer :rich_text
- attr_accessor :text, :index
+ attr_accessor :text
def initialize(text, type, index, old_pos, new_pos, parent_file: nil, line_code: nil, rich_text: nil)
@text, @type, @index = text, type, index
@@ -19,14 +19,7 @@ module Gitlab
end
def self.init_from_hash(hash)
- new(hash[:text],
- hash[:type],
- hash[:index],
- hash[:old_pos],
- hash[:new_pos],
- parent_file: hash[:parent_file],
- line_code: hash[:line_code],
- rich_text: hash[:rich_text])
+ new(hash[:text], hash[:type], hash[:index], hash[:old_pos], hash[:new_pos], line_code: hash[:line_code], rich_text: hash[:rich_text])
end
def to_hash
diff --git a/lib/gitlab/diff/lines_unfolder.rb b/lib/gitlab/diff/lines_unfolder.rb
deleted file mode 100644
index 9306b7e16a2..00000000000
--- a/lib/gitlab/diff/lines_unfolder.rb
+++ /dev/null
@@ -1,235 +0,0 @@
-# frozen_string_literal: true
-
-# Given a position, calculates which Blob lines should be extracted, treated and
-# injected in the current diff file lines in order to present a "unfolded" diff.
-module Gitlab
- module Diff
- class LinesUnfolder
- include Gitlab::Utils::StrongMemoize
-
- UNFOLD_CONTEXT_SIZE = 3
-
- def initialize(diff_file, position)
- @diff_file = diff_file
- @blob = diff_file.old_blob
- @position = position
- @generate_top_match_line = true
- @generate_bottom_match_line = true
-
- # These methods update `@generate_top_match_line` and
- # `@generate_bottom_match_line`.
- @from_blob_line = calculate_from_blob_line!
- @to_blob_line = calculate_to_blob_line!
- end
-
- # Returns merged diff lines with required blob lines with correct
- # positions.
- def unfolded_diff_lines
- strong_memoize(:unfolded_diff_lines) do
- next unless unfold_required?
-
- merged_diff_with_blob_lines
- end
- end
-
- # Returns the extracted lines from the old blob which should be merged
- # with the current diff lines.
- def blob_lines
- strong_memoize(:blob_lines) do
- # Blob lines, unlike diffs, doesn't start with an empty space for
- # unchanged line, so the parsing and highlighting step can get fuzzy
- # without the following change.
- line_prefix = ' '
- blob_as_diff_lines = @blob.data.each_line.map { |line| "#{line_prefix}#{line}" }
-
- lines = Gitlab::Diff::Parser.new.parse(blob_as_diff_lines, diff_file: @diff_file).to_a
-
- from = from_blob_line - 1
- to = to_blob_line - 1
-
- lines[from..to]
- end
- end
-
- def unfold_required?
- strong_memoize(:unfold_required) do
- next false unless @diff_file.text?
- next false unless @position.unchanged?
- next false if @diff_file.new_file? || @diff_file.deleted_file?
- next false unless @position.old_line
- # Invalid position (MR import scenario)
- next false if @position.old_line > @blob.lines.size
- next false if @diff_file.diff_lines.empty?
- next false if @diff_file.line_for_position(@position)
- next false unless unfold_line
-
- true
- end
- end
-
- private
-
- attr_reader :from_blob_line, :to_blob_line
-
- def merged_diff_with_blob_lines
- lines = @diff_file.diff_lines
- match_line = unfold_line
- insert_index = bottom? ? -1 : match_line.index
-
- lines -= [match_line] unless bottom?
-
- lines.insert(insert_index, *blob_lines_with_matches)
-
- # The inserted blob lines have invalid indexes, so we need
- # to reindex them.
- reindex(lines)
-
- lines
- end
-
- # Returns 'unchanged' blob lines with recalculated `old_pos` and
- # `new_pos` and the recalculated new match line (needed if we for instance
- # we unfolded once, but there are still folded lines).
- def blob_lines_with_matches
- old_pos = from_blob_line
- new_pos = from_blob_line + offset
-
- new_blob_lines = []
-
- new_blob_lines.push(top_blob_match_line) if top_blob_match_line
-
- blob_lines.each do |line|
- new_blob_lines << Gitlab::Diff::Line.new(line.text, line.type, nil, old_pos, new_pos,
- parent_file: @diff_file)
-
- old_pos += 1
- new_pos += 1
- end
-
- new_blob_lines.push(bottom_blob_match_line) if bottom_blob_match_line
-
- new_blob_lines
- end
-
- def reindex(lines)
- lines.each_with_index { |line, i| line.index = i }
- end
-
- def top_blob_match_line
- strong_memoize(:top_blob_match_line) do
- next unless @generate_top_match_line
-
- old_pos = from_blob_line
- new_pos = from_blob_line + offset
-
- build_match_line(old_pos, new_pos)
- end
- end
-
- def bottom_blob_match_line
- strong_memoize(:bottom_blob_match_line) do
- # The bottom line match addition is already handled on
- # Diff::File#diff_lines_for_serializer
- next if bottom?
- next unless @generate_bottom_match_line
-
- position = line_after_unfold_position.old_pos
-
- old_pos = position
- new_pos = position + offset
-
- build_match_line(old_pos, new_pos)
- end
- end
-
- def build_match_line(old_pos, new_pos)
- blob_lines_length = blob_lines.length
- old_line_ref = [old_pos, blob_lines_length].join(',')
- new_line_ref = [new_pos, blob_lines_length].join(',')
- new_match_line_str = "@@ -#{old_line_ref}+#{new_line_ref} @@"
-
- Gitlab::Diff::Line.new(new_match_line_str, 'match', nil, old_pos, new_pos)
- end
-
- # Returns the first line position that should be extracted
- # from `blob_lines`.
- def calculate_from_blob_line!
- return unless unfold_required?
-
- from = comment_position - UNFOLD_CONTEXT_SIZE
-
- # There's no line before the match if it's in the top-most
- # position.
- prev_line_number = line_before_unfold_position&.old_pos || 0
-
- if from <= prev_line_number + 1
- @generate_top_match_line = false
- from = prev_line_number + 1
- end
-
- from
- end
-
- # Returns the last line position that should be extracted
- # from `blob_lines`.
- def calculate_to_blob_line!
- return unless unfold_required?
-
- to = comment_position + UNFOLD_CONTEXT_SIZE
-
- return to if bottom?
-
- next_line_number = line_after_unfold_position.old_pos
-
- if to >= next_line_number - 1
- @generate_bottom_match_line = false
- to = next_line_number - 1
- end
-
- to
- end
-
- def offset
- unfold_line.new_pos - unfold_line.old_pos
- end
-
- def line_before_unfold_position
- return unless index = unfold_line&.index
-
- @diff_file.diff_lines[index - 1] if index > 0
- end
-
- def line_after_unfold_position
- return unless index = unfold_line&.index
-
- @diff_file.diff_lines[index + 1] if index >= 0
- end
-
- def bottom?
- strong_memoize(:bottom) do
- @position.old_line > last_line.old_pos
- end
- end
-
- # Returns the line which needed to be expanded in order to send a comment
- # in `@position`.
- def unfold_line
- strong_memoize(:unfold_line) do
- next last_line if bottom?
-
- @diff_file.diff_lines.find do |line|
- line.old_pos > comment_position && line.type == 'match'
- end
- end
- end
-
- def comment_position
- @position.old_line
- end
-
- def last_line
- @diff_file.diff_lines.last
- end
- end
- end
-end
diff --git a/lib/gitlab/diff/position.rb b/lib/gitlab/diff/position.rb
index 7bfab2d808f..f967494199e 100644
--- a/lib/gitlab/diff/position.rb
+++ b/lib/gitlab/diff/position.rb
@@ -101,10 +101,6 @@ module Gitlab
@diff_refs ||= DiffRefs.new(base_sha: base_sha, start_sha: start_sha, head_sha: head_sha)
end
- def unfolded_diff?(repository)
- diff_file(repository)&.unfolded?
- end
-
def diff_file(repository)
return @diff_file if defined?(@diff_file)
@@ -138,13 +134,7 @@ module Gitlab
return unless diff_refs.complete?
return unless comparison = diff_refs.compare_in(repository.project)
- file = comparison.diffs(diff_options).diff_files.first
-
- # We need to unfold diff lines according to the position in order
- # to correctly calculate the line code and trace position changes.
- file&.unfold_diff_lines(self)
-
- file
+ comparison.diffs(diff_options).diff_files.first
end
def get_formatter_class(type)
diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb
index 5fdf7f1229d..28f7e4634a5 100644
--- a/spec/controllers/projects/blob_controller_spec.rb
+++ b/spec/controllers/projects/blob_controller_spec.rb
@@ -157,7 +157,7 @@ describe Projects::BlobController do
match_line = JSON.parse(response.body).first
- expect(match_line['type']).to be_nil
+ expect(match_line['type']).to eq('context')
end
it 'adds bottom match line when "t"o is less than blob size' do
@@ -177,7 +177,7 @@ describe Projects::BlobController do
match_line = JSON.parse(response.body).last
- expect(match_line['type']).to be_nil
+ expect(match_line['type']).to eq('context')
end
end
end
diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb
index 51b78d3e7d1..fa148715855 100644
--- a/spec/features/merge_request/user_posts_diff_notes_spec.rb
+++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb
@@ -85,13 +85,12 @@ describe 'Merge request > User posts diff notes', :js do
# `.line_holder` will be an unfolded line.
let(:line_holder) { first('#a5cc2925ca8258af241be7e5b0381edf30266302 .line_holder') }
- it 'allows commenting on the left side' do
- should_allow_commenting(line_holder, 'left')
+ it 'does not allow commenting on the left side' do
+ should_not_allow_commenting(line_holder, 'left')
end
- it 'allows commenting on the right side' do
- # Automatically shifts comment box to left side.
- should_allow_commenting(line_holder, 'right')
+ it 'does not allow commenting on the right side' do
+ should_not_allow_commenting(line_holder, 'right')
end
end
end
@@ -148,8 +147,8 @@ describe 'Merge request > User posts diff notes', :js do
# `.line_holder` will be an unfolded line.
let(:line_holder) { first('.line_holder[id="a5cc2925ca8258af241be7e5b0381edf30266302_1_1"]') }
- it 'allows commenting' do
- should_allow_commenting line_holder
+ it 'does not allow commenting' do
+ should_not_allow_commenting line_holder
end
end
diff --git a/spec/javascripts/diffs/store/mutations_spec.js b/spec/javascripts/diffs/store/mutations_spec.js
index 8821cde76f4..fed04cbaed8 100644
--- a/spec/javascripts/diffs/store/mutations_spec.js
+++ b/spec/javascripts/diffs/store/mutations_spec.js
@@ -98,7 +98,7 @@ describe('DiffsStoreMutations', () => {
it('should call utils.addContextLines with proper params', () => {
const options = {
lineNumbers: { oldLineNumber: 1, newLineNumber: 2 },
- contextLines: [{ oldLine: 1, newLine: 1, lineCode: 'ff9200_1_1', discussions: [] }],
+ contextLines: [{ oldLine: 1 }],
fileHash: 'ff9200',
params: {
bottom: true,
@@ -110,7 +110,7 @@ describe('DiffsStoreMutations', () => {
parallelDiffLines: [],
};
const state = { diffFiles: [diffFile] };
- const lines = [{ oldLine: 1, newLine: 1 }];
+ const lines = [{ oldLine: 1 }];
const findDiffFileSpy = spyOnDependency(mutations, 'findDiffFile').and.returnValue(diffFile);
const removeMatchLineSpy = spyOnDependency(mutations, 'removeMatchLine');
diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb
index ac9b0c674a5..57d4577a90c 100644
--- a/spec/lib/gitlab/ci/config/entry/job_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb
@@ -118,6 +118,16 @@ describe Gitlab::Ci::Config::Entry::Job do
end
end
+ context 'when it is bigger than 50' do
+ let(:config) { { parallel: 51 } }
+
+ it 'returns error about value too high' do
+ expect(entry).not_to be_valid
+ expect(entry.errors)
+ .to include 'job parallel must be less than or equal to 50'
+ end
+ end
+
context 'when it is not an integer' do
let(:config) { { parallel: 1.5 } }
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb
index 3417896e259..2f51642b58e 100644
--- a/spec/lib/gitlab/diff/file_spec.rb
+++ b/spec/lib/gitlab/diff/file_spec.rb
@@ -41,52 +41,6 @@ describe Gitlab::Diff::File do
end
end
- describe '#unfold_diff_lines' do
- let(:unfolded_lines) { double('expanded-lines') }
- let(:unfolder) { instance_double(Gitlab::Diff::LinesUnfolder) }
- let(:position) { instance_double(Gitlab::Diff::Position, old_line: 10) }
-
- before do
- allow(Gitlab::Diff::LinesUnfolder).to receive(:new) { unfolder }
- end
-
- context 'when unfold required' do
- before do
- allow(unfolder).to receive(:unfold_required?) { true }
- allow(unfolder).to receive(:unfolded_diff_lines) { unfolded_lines }
- end
-
- it 'changes @unfolded to true' do
- diff_file.unfold_diff_lines(position)
-
- expect(diff_file).to be_unfolded
- end
-
- it 'updates @diff_lines' do
- diff_file.unfold_diff_lines(position)
-
- expect(diff_file.diff_lines).to eq(unfolded_lines)
- end
- end
-
- context 'when unfold not required' do
- before do
- allow(unfolder).to receive(:unfold_required?) { false }
- end
-
- it 'keeps @unfolded false' do
- diff_file.unfold_diff_lines(position)
-
- expect(diff_file).not_to be_unfolded
- end
-
- it 'does not update @diff_lines' do
- expect { diff_file.unfold_diff_lines(position) }
- .not_to change(diff_file, :diff_lines)
- end
- end
- end
-
describe '#mode_changed?' do
it { expect(diff_file.mode_changed?).to be_falsey }
end
diff --git a/spec/lib/gitlab/diff/lines_unfolder_spec.rb b/spec/lib/gitlab/diff/lines_unfolder_spec.rb
deleted file mode 100644
index 8e00c8e0e30..00000000000
--- a/spec/lib/gitlab/diff/lines_unfolder_spec.rb
+++ /dev/null
@@ -1,750 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe Gitlab::Diff::LinesUnfolder do
- let(:raw_diff) do
- <<-DIFF.strip_heredoc
- @@ -7,9 +7,6 @@
- "tags": ["devel", "development", "nightly"],
- "desktop-file-name-prefix": "(Development) ",
- "finish-args": [
- - "--share=ipc", "--socket=x11",
- - "--socket=wayland",
- - "--talk-name=org.gnome.OnlineAccounts",
- "--talk-name=org.freedesktop.Tracker1",
- "--filesystem=home",
- "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*",
- @@ -62,7 +59,7 @@
- },
- {
- "name": "gnome-desktop",
- - "config-opts": ["--disable-debug-tools", "--disable-udev"],
- + "config-opts": ["--disable-debug-tools", "--disable-"],
- "sources": [
- {
- "type": "git",
- @@ -83,11 +80,6 @@
- "buildsystem": "meson",
- "builddir": true,
- "name": "nautilus",
- - "config-opts": [
- - "-Denable-desktop=false",
- - "-Denable-selinux=false",
- - "--libdir=/app/lib"
- - ],
- "sources": [
- {
- "type": "git",
- DIFF
- end
-
- let(:raw_old_blob) do
- <<-BLOB.strip_heredoc
- {
- "app-id": "org.gnome.Nautilus",
- "runtime": "org.gnome.Platform",
- "runtime-version": "master",
- "sdk": "org.gnome.Sdk",
- "command": "nautilus",
- "tags": ["devel", "development", "nightly"],
- "desktop-file-name-prefix": "(Development) ",
- "finish-args": [
- "--share=ipc", "--socket=x11",
- "--socket=wayland",
- "--talk-name=org.gnome.OnlineAccounts",
- "--talk-name=org.freedesktop.Tracker1",
- "--filesystem=home",
- "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*",
- "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",
- "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
- ],
- "cleanup": [ "/include", "/share/bash-completion" ],
- "modules": [
- {
- "name": "exiv2",
- "sources": [
- {
- "type": "archive",
- "url": "http://exiv2.org/builds/exiv2-0.26-trunk.tar.gz",
- "sha256": "c75e3c4a0811bf700d92c82319373b7a825a2331c12b8b37d41eb58e4f18eafb"
- },
- {
- "type": "shell",
- "commands": [
- "cp -f /usr/share/gnu-config/config.sub ./config/",
- "cp -f /usr/share/gnu-config/config.guess ./config/"
- ]
- }
- ]
- },
- {
- "name": "gexiv2",
- "config-opts": [ "--disable-introspection" ],
- "sources": [
- {
- "type": "git",
- "url": "https://git.gnome.org/browse/gexiv2"
- }
- ]
- },
- {
- "name": "tracker",
- "cleanup": [ "/bin", "/etc", "/libexec" ],
- "config-opts": [ "--disable-miner-apps", "--disable-static",
- "--disable-tracker-extract", "--disable-tracker-needle",
- "--disable-tracker-preferences", "--disable-artwork",
- "--disable-tracker-writeback", "--disable-miner-user-guides",
- "--with-bash-completion-dir=no" ],
- "sources": [
- {
- "type": "git",
- "url": "https://git.gnome.org/browse/tracker"
- }
- ]
- },
- {
- "name": "gnome-desktop",
- "config-opts": ["--disable-debug-tools", "--disable-udev"],
- "sources": [
- {
- "type": "git",
- "url": "https://git.gnome.org/browse/gnome-desktop"
- }
- ]
- },
- {
- "name": "gnome-autoar",
- "sources": [
- {
- "type": "git",
- "url": "https://git.gnome.org/browse/gnome-autoar"
- }
- ]
- },
- {
- "buildsystem": "meson",
- "builddir": true,
- "name": "nautilus",
- "config-opts": [
- "-Denable-desktop=false",
- "-Denable-selinux=false",
- "--libdir=/app/lib"
- ],
- "sources": [
- {
- "type": "git",
- "url": "https://gitlab.gnome.org/GNOME/nautilus.git"
- }
- ]
- }
- ]
- },
- {
- "app-id": "foo",
- "runtime": "foo",
- "runtime-version": "foo",
- "sdk": "foo",
- "command": "foo",
- "tags": ["foo", "bar", "kux"],
- "desktop-file-name-prefix": "(Foo) ",
- {
- "buildsystem": "meson",
- "builddir": true,
- "name": "nautilus",
- "sources": [
- {
- "type": "git",
- "url": "https://gitlab.gnome.org/GNOME/nautilus.git"
- }
- ]
- }
- },
- {
- "app-id": "foo",
- "runtime": "foo",
- "runtime-version": "foo",
- "sdk": "foo",
- "command": "foo",
- "tags": ["foo", "bar", "kux"],
- "desktop-file-name-prefix": "(Foo) ",
- {
- "buildsystem": "meson",
- "builddir": true,
- "name": "nautilus",
- "sources": [
- {
- "type": "git",
- "url": "https://gitlab.gnome.org/GNOME/nautilus.git"
- }
- ]
- }
- }
- BLOB
- end
-
- let(:project) { create(:project) }
-
- let(:old_blob) { Gitlab::Git::Blob.new(data: raw_old_blob) }
-
- let(:diff) do
- Gitlab::Git::Diff.new(diff: raw_diff,
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- a_mode: "100644",
- b_mode: "100644",
- new_file: false,
- renamed_file: false,
- deleted_file: false,
- too_large: false)
- end
-
- let(:diff_file) do
- Gitlab::Diff::File.new(diff, repository: project.repository)
- end
-
- before do
- allow(old_blob).to receive(:load_all_data!)
- allow(diff_file).to receive(:old_blob) { old_blob }
- end
-
- subject { described_class.new(diff_file, position) }
-
- context 'position requires a middle expansion and new match lines' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 43,
- new_line: 40)
- end
-
- context 'blob lines' do
- let(:expected_blob_lines) do
- [[40, 40, " \"config-opts\": [ \"--disable-introspection\" ],"],
- [41, 41, " \"sources\": ["],
- [42, 42, " {"],
- [43, 43, " \"type\": \"git\","],
- [44, 44, " \"url\": \"https://git.gnome.org/browse/gexiv2\""],
- [45, 45, " }"],
- [46, 46, " ]"]]
- end
-
- it 'returns the extracted blob lines correctly' do
- extracted_lines = subject.blob_lines
-
- expect(extracted_lines.size).to eq(7)
-
- extracted_lines.each_with_index do |line, i|
- expect([line.old_line, line.new_line, line.text]).to eq(expected_blob_lines[i])
- end
- end
- end
-
- context 'diff lines' do
- let(:expected_diff_lines) do
- [[7, 7, "@@ -7,9 +7,6 @@"],
- [7, 7, " \"tags\": [\"devel\", \"development\", \"nightly\"],"],
- [8, 8, " \"desktop-file-name-prefix\": \"(Development) \","],
- [9, 9, " \"finish-args\": ["],
- [10, 10, "- \"--share=ipc\", \"--socket=x11\","],
- [11, 10, "- \"--socket=wayland\","],
- [12, 10, "- \"--talk-name=org.gnome.OnlineAccounts\","],
- [13, 10, " \"--talk-name=org.freedesktop.Tracker1\","],
- [14, 11, " \"--filesystem=home\","],
- [15, 12, " \"--talk-name=org.gtk.vfs\", \"--talk-name=org.gtk.vfs.*\","],
-
- # New match line
- [40, 37, "@@ -40,7+37,7 @@"],
-
- # Injected blob lines
- [40, 37, " \"config-opts\": [ \"--disable-introspection\" ],"],
- [41, 38, " \"sources\": ["],
- [42, 39, " {"],
- [43, 40, " \"type\": \"git\","], # comment
- [44, 41, " \"url\": \"https://git.gnome.org/browse/gexiv2\""],
- [45, 42, " }"],
- [46, 43, " ]"],
- # end
-
- # Second match line
- [62, 59, "@@ -62,7+59,7 @@"],
-
- [62, 59, " },"],
- [63, 60, " {"],
- [64, 61, " \"name\": \"gnome-desktop\","],
- [65, 62, "- \"config-opts\": [\"--disable-debug-tools\", \"--disable-udev\"],"],
- [66, 62, "+ \"config-opts\": [\"--disable-debug-tools\", \"--disable-\"],"],
- [66, 63, " \"sources\": ["],
- [67, 64, " {"],
- [68, 65, " \"type\": \"git\","],
- [83, 80, "@@ -83,11 +80,6 @@"],
- [83, 80, " \"buildsystem\": \"meson\","],
- [84, 81, " \"builddir\": true,"],
- [85, 82, " \"name\": \"nautilus\","],
- [86, 83, "- \"config-opts\": ["],
- [87, 83, "- \"-Denable-desktop=false\","],
- [88, 83, "- \"-Denable-selinux=false\","],
- [89, 83, "- \"--libdir=/app/lib\""],
- [90, 83, "- ],"],
- [91, 83, " \"sources\": ["],
- [92, 84, " {"],
- [93, 85, " \"type\": \"git\","]]
- end
-
- it 'return merge of blob lines with diff lines correctly' do
- new_diff_lines = subject.unfolded_diff_lines
-
- expected_diff_lines.each_with_index do |expected_line, i|
- line = new_diff_lines[i]
-
- expect([line.old_pos, line.new_pos, line.text])
- .to eq([expected_line[0], expected_line[1], expected_line[2]])
- end
- end
-
- it 'merged lines have correct line codes' do
- new_diff_lines = subject.unfolded_diff_lines
-
- new_diff_lines.each_with_index do |line, i|
- old_pos, new_pos = expected_diff_lines[i][0], expected_diff_lines[i][1]
-
- unless line.type == 'match'
- expect(line.line_code).to eq(Gitlab::Git.diff_line_code(diff_file.file_path, new_pos, old_pos))
- end
- end
- end
- end
- end
-
- context 'position requires a middle expansion and no top match line' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 16,
- new_line: 17)
- end
-
- context 'blob lines' do
- let(:expected_blob_lines) do
- [[16, 16, " \"--filesystem=xdg-run/dconf\", \"--filesystem=~/.config/dconf:ro\","],
- [17, 17, " \"--talk-name=ca.desrt.dconf\", \"--env=DCONF_USER_CONFIG_DIR=.config/dconf\""],
- [18, 18, " ],"],
- [19, 19, " \"cleanup\": [ \"/include\", \"/share/bash-completion\" ],"]]
- end
-
- it 'returns the extracted blob lines correctly' do
- extracted_lines = subject.blob_lines
-
- expect(extracted_lines.size).to eq(4)
-
- extracted_lines.each_with_index do |line, i|
- expect([line.old_line, line.new_line, line.text]).to eq(expected_blob_lines[i])
- end
- end
- end
-
- context 'diff lines' do
- let(:expected_diff_lines) do
- [[7, 7, "@@ -7,9 +7,6 @@"],
- [7, 7, " \"tags\": [\"devel\", \"development\", \"nightly\"],"],
- [8, 8, " \"desktop-file-name-prefix\": \"(Development) \","],
- [9, 9, " \"finish-args\": ["],
- [10, 10, "- \"--share=ipc\", \"--socket=x11\","],
- [11, 10, "- \"--socket=wayland\","],
- [12, 10, "- \"--talk-name=org.gnome.OnlineAccounts\","],
- [13, 10, " \"--talk-name=org.freedesktop.Tracker1\","],
- [14, 11, " \"--filesystem=home\","],
- [15, 12, " \"--talk-name=org.gtk.vfs\", \"--talk-name=org.gtk.vfs.*\","],
- # No new match needed
-
- # Injected blob lines
- [16, 13, " \"--filesystem=xdg-run/dconf\", \"--filesystem=~/.config/dconf:ro\","],
- [17, 14, " \"--talk-name=ca.desrt.dconf\", \"--env=DCONF_USER_CONFIG_DIR=.config/dconf\""],
- [18, 15, " ],"],
- [19, 16, " \"cleanup\": [ \"/include\", \"/share/bash-completion\" ],"],
- # end
-
- # Second match line
- [62, 59, "@@ -62,4+59,4 @@"],
-
- [62, 59, " },"],
- [63, 60, " {"],
- [64, 61, " \"name\": \"gnome-desktop\","],
- [65, 62, "- \"config-opts\": [\"--disable-debug-tools\", \"--disable-udev\"],"],
- [66, 62, "+ \"config-opts\": [\"--disable-debug-tools\", \"--disable-\"],"],
- [66, 63, " \"sources\": ["],
- [67, 64, " {"],
- [68, 65, " \"type\": \"git\","],
- [83, 80, "@@ -83,11 +80,6 @@"],
- [83, 80, " \"buildsystem\": \"meson\","],
- [84, 81, " \"builddir\": true,"],
- [85, 82, " \"name\": \"nautilus\","],
- [86, 83, "- \"config-opts\": ["],
- [87, 83, "- \"-Denable-desktop=false\","],
- [88, 83, "- \"-Denable-selinux=false\","],
- [89, 83, "- \"--libdir=/app/lib\""],
- [90, 83, "- ],"],
- [91, 83, " \"sources\": ["],
- [92, 84, " {"],
- [93, 85, " \"type\": \"git\","]]
- end
-
- it 'return merge of blob lines with diff lines correctly' do
- new_diff_lines = subject.unfolded_diff_lines
-
- expected_diff_lines.each_with_index do |expected_line, i|
- line = new_diff_lines[i]
-
- expect([line.old_pos, line.new_pos, line.text])
- .to eq([expected_line[0], expected_line[1], expected_line[2]])
- end
- end
-
- it 'merged lines have correct line codes' do
- new_diff_lines = subject.unfolded_diff_lines
-
- new_diff_lines.each_with_index do |line, i|
- old_pos, new_pos = expected_diff_lines[i][0], expected_diff_lines[i][1]
-
- unless line.type == 'match'
- expect(line.line_code).to eq(Gitlab::Git.diff_line_code(diff_file.file_path, new_pos, old_pos))
- end
- end
- end
- end
- end
-
- context 'position requires a middle expansion and no bottom match line' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 82,
- new_line: 79)
- end
-
- context 'blob lines' do
- let(:expected_blob_lines) do
- [[79, 79, " }"],
- [80, 80, " ]"],
- [81, 81, " },"],
- [82, 82, " {"]]
- end
-
- it 'returns the extracted blob lines correctly' do
- extracted_lines = subject.blob_lines
-
- expect(extracted_lines.size).to eq(4)
-
- extracted_lines.each_with_index do |line, i|
- expect([line.old_line, line.new_line, line.text]).to eq(expected_blob_lines[i])
- end
- end
- end
-
- context 'diff lines' do
- let(:expected_diff_lines) do
- [[7, 7, "@@ -7,9 +7,6 @@"],
- [7, 7, " \"tags\": [\"devel\", \"development\", \"nightly\"],"],
- [8, 8, " \"desktop-file-name-prefix\": \"(Development) \","],
- [9, 9, " \"finish-args\": ["],
- [10, 10, "- \"--share=ipc\", \"--socket=x11\","],
- [11, 10, "- \"--socket=wayland\","],
- [12, 10, "- \"--talk-name=org.gnome.OnlineAccounts\","],
- [13, 10, " \"--talk-name=org.freedesktop.Tracker1\","],
- [14, 11, " \"--filesystem=home\","],
- [15, 12, " \"--talk-name=org.gtk.vfs\", \"--talk-name=org.gtk.vfs.*\","],
- [62, 59, "@@ -62,7 +59,7 @@"],
- [62, 59, " },"],
- [63, 60, " {"],
- [64, 61, " \"name\": \"gnome-desktop\","],
- [65, 62, "- \"config-opts\": [\"--disable-debug-tools\", \"--disable-udev\"],"],
- [66, 62, "+ \"config-opts\": [\"--disable-debug-tools\", \"--disable-\"],"],
- [66, 63, " \"sources\": ["],
- [67, 64, " {"],
- [68, 65, " \"type\": \"git\","],
-
- # New top match line
- [79, 76, "@@ -79,4+76,4 @@"],
-
- # Injected blob lines
- [79, 76, " }"],
- [80, 77, " ]"],
- [81, 78, " },"],
- [82, 79, " {"],
- # end
-
- # No new second match line
- [83, 80, " \"buildsystem\": \"meson\","],
- [84, 81, " \"builddir\": true,"],
- [85, 82, " \"name\": \"nautilus\","],
- [86, 83, "- \"config-opts\": ["],
- [87, 83, "- \"-Denable-desktop=false\","],
- [88, 83, "- \"-Denable-selinux=false\","],
- [89, 83, "- \"--libdir=/app/lib\""],
- [90, 83, "- ],"],
- [91, 83, " \"sources\": ["],
- [92, 84, " {"],
- [93, 85, " \"type\": \"git\","]]
- end
-
- it 'return merge of blob lines with diff lines correctly' do
- new_diff_lines = subject.unfolded_diff_lines
-
- expected_diff_lines.each_with_index do |expected_line, i|
- line = new_diff_lines[i]
-
- expect([line.old_pos, line.new_pos, line.text])
- .to eq([expected_line[0], expected_line[1], expected_line[2]])
- end
- end
-
- it 'merged lines have correct line codes' do
- new_diff_lines = subject.unfolded_diff_lines
-
- new_diff_lines.each_with_index do |line, i|
- old_pos, new_pos = expected_diff_lines[i][0], expected_diff_lines[i][1]
-
- unless line.type == 'match'
- expect(line.line_code).to eq(Gitlab::Git.diff_line_code(diff_file.file_path, new_pos, old_pos))
- end
- end
- end
- end
- end
-
- context 'position requires a short top expansion' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 6,
- new_line: 6)
- end
-
- context 'blob lines' do
- let(:expected_blob_lines) do
- [[3, 3, " \"runtime\": \"org.gnome.Platform\","],
- [4, 4, " \"runtime-version\": \"master\","],
- [5, 5, " \"sdk\": \"org.gnome.Sdk\","],
- [6, 6, " \"command\": \"nautilus\","]]
- end
-
- it 'returns the extracted blob lines correctly' do
- extracted_lines = subject.blob_lines
-
- expect(extracted_lines.size).to eq(4)
-
- extracted_lines.each_with_index do |line, i|
- expect([line.old_line, line.new_line, line.text]).to eq(expected_blob_lines[i])
- end
- end
- end
-
- context 'diff lines' do
- let(:expected_diff_lines) do
- # New match line
- [[3, 3, "@@ -3,4+3,4 @@"],
-
- # Injected blob lines
- [3, 3, " \"runtime\": \"org.gnome.Platform\","],
- [4, 4, " \"runtime-version\": \"master\","],
- [5, 5, " \"sdk\": \"org.gnome.Sdk\","],
- [6, 6, " \"command\": \"nautilus\","],
- # end
- [7, 7, " \"tags\": [\"devel\", \"development\", \"nightly\"],"],
- [8, 8, " \"desktop-file-name-prefix\": \"(Development) \","],
- [9, 9, " \"finish-args\": ["],
- [10, 10, "- \"--share=ipc\", \"--socket=x11\","],
- [11, 10, "- \"--socket=wayland\","],
- [12, 10, "- \"--talk-name=org.gnome.OnlineAccounts\","],
- [13, 10, " \"--talk-name=org.freedesktop.Tracker1\","],
- [14, 11, " \"--filesystem=home\","],
- [15, 12, " \"--talk-name=org.gtk.vfs\", \"--talk-name=org.gtk.vfs.*\","],
- [62, 59, "@@ -62,7 +59,7 @@"],
- [62, 59, " },"],
- [63, 60, " {"],
- [64, 61, " \"name\": \"gnome-desktop\","],
- [65, 62, "- \"config-opts\": [\"--disable-debug-tools\", \"--disable-udev\"],"],
- [66, 62, "+ \"config-opts\": [\"--disable-debug-tools\", \"--disable-\"],"],
- [66, 63, " \"sources\": ["],
- [67, 64, " {"],
- [68, 65, " \"type\": \"git\","],
- [83, 80, "@@ -83,11 +80,6 @@"],
- [83, 80, " \"buildsystem\": \"meson\","],
- [84, 81, " \"builddir\": true,"],
- [85, 82, " \"name\": \"nautilus\","],
- [86, 83, "- \"config-opts\": ["],
- [87, 83, "- \"-Denable-desktop=false\","],
- [88, 83, "- \"-Denable-selinux=false\","],
- [89, 83, "- \"--libdir=/app/lib\""],
- [90, 83, "- ],"],
- [91, 83, " \"sources\": ["],
- [92, 84, " {"],
- [93, 85, " \"type\": \"git\","]]
- end
-
- it 'return merge of blob lines with diff lines correctly' do
- new_diff_lines = subject.unfolded_diff_lines
-
- expected_diff_lines.each_with_index do |expected_line, i|
- line = new_diff_lines[i]
-
- expect([line.old_pos, line.new_pos, line.text])
- .to eq([expected_line[0], expected_line[1], expected_line[2]])
- end
- end
-
- it 'merged lines have correct line codes' do
- new_diff_lines = subject.unfolded_diff_lines
-
- new_diff_lines.each_with_index do |line, i|
- old_pos, new_pos = expected_diff_lines[i][0], expected_diff_lines[i][1]
-
- unless line.type == 'match'
- expect(line.line_code).to eq(Gitlab::Git.diff_line_code(diff_file.file_path, new_pos, old_pos))
- end
- end
- end
- end
- end
-
- context 'position sits between two match lines (no expasion needed)' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 64,
- new_line: 61)
- end
-
- context 'diff lines' do
- it 'returns nil' do
- expect(subject.unfolded_diff_lines).to be_nil
- end
- end
- end
-
- context 'position requires bottom expansion and new match lines' do
- let(:position) do
- Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
- head_sha: "1487062132228de836236c522fe52fed4980a46c",
- old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
- position_type: "text",
- old_line: 107,
- new_line: 99)
- end
-
- context 'blob lines' do
- let(:expected_blob_lines) do
- [[104, 104, " \"sdk\": \"foo\","],
- [105, 105, " \"command\": \"foo\","],
- [106, 106, " \"tags\": [\"foo\", \"bar\", \"kux\"],"],
- [107, 107, " \"desktop-file-name-prefix\": \"(Foo) \","],
- [108, 108, " {"],
- [109, 109, " \"buildsystem\": \"meson\","],
- [110, 110, " \"builddir\": true,"]]
- end
-
- it 'returns the extracted blob lines correctly' do
- extracted_lines = subject.blob_lines
-
- expect(extracted_lines.size).to eq(7)
-
- extracted_lines.each_with_index do |line, i|
- expect([line.old_line, line.new_line, line.text]).to eq(expected_blob_lines[i])
- end
- end
- end
-
- context 'diff lines' do
- let(:expected_diff_lines) do
- [[7, 7, "@@ -7,9 +7,6 @@"],
- [7, 7, " \"tags\": [\"devel\", \"development\", \"nightly\"],"],
- [8, 8, " \"desktop-file-name-prefix\": \"(Development) \","],
- [9, 9, " \"finish-args\": ["],
- [10, 10, "- \"--share=ipc\", \"--socket=x11\","],
- [11, 10, "- \"--socket=wayland\","],
- [12, 10, "- \"--talk-name=org.gnome.OnlineAccounts\","],
- [13, 10, " \"--talk-name=org.freedesktop.Tracker1\","],
- [14, 11, " \"--filesystem=home\","],
- [15, 12, " \"--talk-name=org.gtk.vfs\", \"--talk-name=org.gtk.vfs.*\","],
- [62, 59, "@@ -62,7 +59,7 @@"],
- [62, 59, " },"],
- [63, 60, " {"],
- [64, 61, " \"name\": \"gnome-desktop\","],
- [65, 62, "- \"config-opts\": [\"--disable-debug-tools\", \"--disable-udev\"],"],
- [66, 62, "+ \"config-opts\": [\"--disable-debug-tools\", \"--disable-\"],"],
- [66, 63, " \"sources\": ["],
- [67, 64, " {"],
- [68, 65, " \"type\": \"git\","],
- [83, 80, "@@ -83,11 +80,6 @@"],
- [83, 80, " \"buildsystem\": \"meson\","],
- [84, 81, " \"builddir\": true,"],
- [85, 82, " \"name\": \"nautilus\","],
- [86, 83, "- \"config-opts\": ["],
- [87, 83, "- \"-Denable-desktop=false\","],
- [88, 83, "- \"-Denable-selinux=false\","],
- [89, 83, "- \"--libdir=/app/lib\""],
- [90, 83, "- ],"],
- [91, 83, " \"sources\": ["],
- [92, 84, " {"],
- [93, 85, " \"type\": \"git\","],
- # New match line
- [104, 96, "@@ -104,7+96,7 @@"],
-
- # Injected blob lines
- [104, 96, " \"sdk\": \"foo\","],
- [105, 97, " \"command\": \"foo\","],
- [106, 98, " \"tags\": [\"foo\", \"bar\", \"kux\"],"],
- [107, 99, " \"desktop-file-name-prefix\": \"(Foo) \","],
- [108, 100, " {"],
- [109, 101, " \"buildsystem\": \"meson\","],
- [110, 102, " \"builddir\": true,"]]
- # end
- end
-
- it 'return merge of blob lines with diff lines correctly' do
- new_diff_lines = subject.unfolded_diff_lines
-
- expected_diff_lines.each_with_index do |expected_line, i|
- line = new_diff_lines[i]
-
- expect([line.old_pos, line.new_pos, line.text])
- .to eq([expected_line[0], expected_line[1], expected_line[2]])
- end
- end
-
- it 'merged lines have correct line codes' do
- new_diff_lines = subject.unfolded_diff_lines
-
- new_diff_lines.each_with_index do |line, i|
- old_pos, new_pos = expected_diff_lines[i][0], expected_diff_lines[i][1]
-
- unless line.type == 'match'
- expect(line.line_code).to eq(Gitlab::Git.diff_line_code(diff_file.file_path, new_pos, old_pos))
- end
- end
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/reload_diffs_service_spec.rb b/spec/services/merge_requests/reload_diffs_service_spec.rb
index 5acd01828cb..546c9f277c5 100644
--- a/spec/services/merge_requests/reload_diffs_service_spec.rb
+++ b/spec/services/merge_requests/reload_diffs_service_spec.rb
@@ -31,11 +31,32 @@ describe MergeRequests::ReloadDiffsService, :use_clean_rails_memory_store_cachin
end
context 'cache clearing' do
+ before do
+ allow_any_instance_of(Gitlab::Diff::File).to receive(:text?).and_return(true)
+ allow_any_instance_of(Gitlab::Diff::File).to receive(:diffable?).and_return(true)
+ end
+
+ it 'retrieves the diff files to cache the highlighted result' do
+ new_diff = merge_request.create_merge_request_diff
+ cache_key = new_diff.diffs_collection.cache_key
+
+ expect(merge_request).to receive(:create_merge_request_diff).and_return(new_diff)
+ expect(Rails.cache).to receive(:read).with(cache_key).and_call_original
+ expect(Rails.cache).to receive(:write).with(cache_key, anything, anything).and_call_original
+
+ subject.execute
+ end
+
it 'clears the cache for older diffs on the merge request' do
old_diff = merge_request.merge_request_diff
old_cache_key = old_diff.diffs_collection.cache_key
+ new_diff = merge_request.create_merge_request_diff
+ new_cache_key = new_diff.diffs_collection.cache_key
+ expect(merge_request).to receive(:create_merge_request_diff).and_return(new_diff)
expect(Rails.cache).to receive(:delete).with(old_cache_key).and_call_original
+ expect(Rails.cache).to receive(:read).with(new_cache_key).and_call_original
+ expect(Rails.cache).to receive(:write).with(new_cache_key, anything, anything).and_call_original
subject.execute
end
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb
index 80b015d4cd0..b1290fd0d47 100644
--- a/spec/services/notes/create_service_spec.rb
+++ b/spec/services/notes/create_service_spec.rb
@@ -57,57 +57,6 @@ describe Notes::CreateService do
end
end
- context 'noteable highlight cache clearing' do
- let(:project_with_repo) { create(:project, :repository) }
- let(:merge_request) do
- create(:merge_request, source_project: project_with_repo,
- target_project: project_with_repo)
- end
-
- let(:position) do
- Gitlab::Diff::Position.new(old_path: "files/ruby/popen.rb",
- new_path: "files/ruby/popen.rb",
- old_line: nil,
- new_line: 14,
- diff_refs: merge_request.diff_refs)
- end
-
- let(:new_opts) do
- opts.merge(in_reply_to_discussion_id: nil,
- type: 'DiffNote',
- noteable_type: 'MergeRequest',
- noteable_id: merge_request.id,
- position: position.to_h)
- end
-
- before do
- allow_any_instance_of(Gitlab::Diff::Position)
- .to receive(:unfolded_diff?) { true }
- end
-
- it 'clears noteable diff cache when it was unfolded for the note position' do
- expect_any_instance_of(Gitlab::Diff::HighlightCache).to receive(:clear)
-
- described_class.new(project_with_repo, user, new_opts).execute
- end
-
- it 'does not clear cache when note is not the first of the discussion' do
- prev_note =
- create(:diff_note_on_merge_request, noteable: merge_request,
- project: project_with_repo)
- reply_opts =
- opts.merge(in_reply_to_discussion_id: prev_note.discussion_id,
- type: 'DiffNote',
- noteable_type: 'MergeRequest',
- noteable_id: merge_request.id,
- position: position.to_h)
-
- expect(merge_request).not_to receive(:diffs)
-
- described_class.new(project_with_repo, user, reply_opts).execute
- end
- end
-
context 'note diff file' do
let(:project_with_repo) { create(:project, :repository) }
let(:merge_request) do
diff --git a/spec/services/notes/destroy_service_spec.rb b/spec/services/notes/destroy_service_spec.rb
index b1f4e87e8ea..64445be560e 100644
--- a/spec/services/notes/destroy_service_spec.rb
+++ b/spec/services/notes/destroy_service_spec.rb
@@ -21,38 +21,5 @@ describe Notes::DestroyService do
expect { described_class.new(project, user).execute(note) }
.to change { user.todos_pending_count }.from(1).to(0)
end
-
- context 'noteable highlight cache clearing' do
- let(:repo_project) { create(:project, :repository) }
- let(:merge_request) do
- create(:merge_request, source_project: repo_project,
- target_project: repo_project)
- end
-
- let(:note) do
- create(:diff_note_on_merge_request, project: repo_project,
- noteable: merge_request)
- end
-
- before do
- allow(note.position).to receive(:unfolded_diff?) { true }
- end
-
- it 'clears noteable diff cache when it was unfolded for the note position' do
- expect(merge_request).to receive_message_chain(:diffs, :clear_cache)
-
- described_class.new(repo_project, user).execute(note)
- end
-
- it 'does not clear cache when note is not the first of the discussion' do
- reply_note = create(:diff_note_on_merge_request, in_reply_to: note,
- project: repo_project,
- noteable: merge_request)
-
- expect(merge_request).not_to receive(:diffs)
-
- described_class.new(repo_project, user).execute(reply_note)
- end
- end
end
end
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index 9e87b877b93..1f00cdf7e92 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -162,8 +162,9 @@ module TestEnv
version: Gitlab::GitalyClient.expected_server_version,
task: "gitlab:gitaly:install[#{gitaly_dir},#{repos_path}]") do
- start_gitaly(gitaly_dir)
- end
+ Gitlab::SetupHelper.create_gitaly_configuration(gitaly_dir, { 'default' => repos_path }, force: true)
+ start_gitaly(gitaly_dir)
+ end
end
def start_gitaly(gitaly_dir)
diff --git a/vendor/gitignore/Android.gitignore b/vendor/gitignore/Android.gitignore
index 39b6783cef8..69eda01429a 100644
--- a/vendor/gitignore/Android.gitignore
+++ b/vendor/gitignore/Android.gitignore
@@ -1,6 +1,7 @@
# Built application files
*.apk
*.ap_
+*.aab
# Files for the ART/Dalvik VM
*.dex
@@ -43,8 +44,9 @@ captures/
.idea/caches
# Keystore files
-# Uncomment the following line if you do not want to check your keystore files in.
+# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
+#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
diff --git a/vendor/gitignore/Delphi.gitignore b/vendor/gitignore/Delphi.gitignore
index 000ee5f104b..9532800ba22 100644
--- a/vendor/gitignore/Delphi.gitignore
+++ b/vendor/gitignore/Delphi.gitignore
@@ -64,3 +64,6 @@ __recovery/
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
*.stat
+
+# Boss dependency manager vendor folder https://github.com/HashLoad/boss
+modules/
diff --git a/vendor/gitignore/Elixir.gitignore b/vendor/gitignore/Elixir.gitignore
index 86e4c3f3905..b263cd10f37 100644
--- a/vendor/gitignore/Elixir.gitignore
+++ b/vendor/gitignore/Elixir.gitignore
@@ -7,3 +7,4 @@ erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
+.elixir_ls/
diff --git a/vendor/gitignore/Global/Images.gitignore b/vendor/gitignore/Global/Images.gitignore
new file mode 100644
index 00000000000..97dcdbe6a95
--- /dev/null
+++ b/vendor/gitignore/Global/Images.gitignore
@@ -0,0 +1,63 @@
+# JPEG
+*.jpg
+*.jpeg
+*.jpe
+*.jif
+*.jfif
+*.jfi
+
+# JPEG 2000
+*.jp2
+*.j2k
+*.jpf
+*.jpx
+*.jpm
+*.mj2
+
+# JPEG XR
+*.jxr
+*.hdp
+*.wdp
+
+# Graphics Interchange Format
+*.gif
+
+# RAW
+*.raw
+
+# Web P
+*.webp
+
+# Portable Network Graphics
+*.png
+
+# Animated Portable Network Graphics
+*.apng
+
+# Multiple-image Network Graphics
+*.mng
+
+# Tagged Image File Format
+*.tiff
+*.tif
+
+# Scalable Vector Graphics
+*.svg
+*.svgz
+
+# Portable Document Format
+*.pdf
+
+# X BitMap
+*.xbm
+
+# BMP
+*.bmp
+*.dib
+
+# ICO
+*.ico
+
+# 3D Images
+*.3dm
+*.max
diff --git a/vendor/gitignore/Global/NetBeans.gitignore b/vendor/gitignore/Global/NetBeans.gitignore
index 254108cd23b..863bc7fa66e 100644
--- a/vendor/gitignore/Global/NetBeans.gitignore
+++ b/vendor/gitignore/Global/NetBeans.gitignore
@@ -1,4 +1,4 @@
-nbproject/private/
+**/nbproject/private/
build/
nbbuild/
dist/
diff --git a/vendor/gitignore/Global/PSoCCreator.gitignore b/vendor/gitignore/Global/PSoCCreator.gitignore
new file mode 100644
index 00000000000..15ae040bcda
--- /dev/null
+++ b/vendor/gitignore/Global/PSoCCreator.gitignore
@@ -0,0 +1,18 @@
+# Project Settings
+*.cywrk.*
+*.cyprj.*
+
+# Generated Assets and Resources
+Debug/
+Release/
+Export/
+*/codegentemp
+*/Generated_Source
+*_datasheet.pdf
+*_timing.html
+*.cycdx
+*.cyfit
+*.rpt
+*.svd
+*.log
+*.zip
diff --git a/vendor/gitignore/Global/Xcode.gitignore b/vendor/gitignore/Global/Xcode.gitignore
index cd0c7d3e45a..b01314d3a64 100644
--- a/vendor/gitignore/Global/Xcode.gitignore
+++ b/vendor/gitignore/Global/Xcode.gitignore
@@ -2,17 +2,11 @@
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
-## User settings
-xcuserdata/
-
-## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
-*.xcscmblueprint
-*.xccheckout
-
-## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
+## Build generated
build/
DerivedData/
-*.moved-aside
+
+## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
@@ -21,3 +15,65 @@ DerivedData/
!default.mode2v3
*.perspectivev3
!default.perspectivev3
+xcuserdata/
+
+## Other
+*.moved-aside
+*.xccheckout
+*.xcscmblueprint
+
+## Obj-C/Swift specific
+*.hmap
+*.ipa
+*.dSYM.zip
+*.dSYM
+
+## Playgrounds
+timeline.xctimeline
+playground.xcworkspace
+
+# Swift Package Manager
+#
+# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
+# Packages/
+# Package.pins
+# Package.resolved
+.build/
+
+# CocoaPods
+#
+# We recommend against adding the Pods directory to your .gitignore. However
+# you should judge for yourself, the pros and cons are mentioned at:
+# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
+#
+# Pods/
+#
+# Add this line if you want to avoid checking in source code from the Xcode workspace
+# *.xcworkspace
+
+# Carthage
+#
+# Add this line if you want to avoid checking in source code from Carthage dependencies.
+# Carthage/Checkouts
+
+Carthage/Build
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://docs.fastlane.tools/best-practices/source-control/#source-control
+
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots/**/*.png
+fastlane/test_output
+
+# Code Injection
+#
+# After new code Injection tools there's a generated folder /iOSInjectionProject
+# https://github.com/johnno1962/injectionforxcode
+
+iOSInjectionProject/
+
diff --git a/vendor/gitignore/Laravel.gitignore b/vendor/gitignore/Laravel.gitignore
index 67e2146f2bc..6552ddf8a06 100644
--- a/vendor/gitignore/Laravel.gitignore
+++ b/vendor/gitignore/Laravel.gitignore
@@ -1,4 +1,4 @@
-vendor/
+/vendor/
node_modules/
npm-debug.log
yarn-error.log
diff --git a/vendor/gitignore/Magento.gitignore b/vendor/gitignore/Magento.gitignore
index 6f1fa223992..abe6d79fedb 100644
--- a/vendor/gitignore/Magento.gitignore
+++ b/vendor/gitignore/Magento.gitignore
@@ -2,6 +2,8 @@
# Magento Default Files #
#--------------------------#
+/PATCH_*.sh
+
/app/etc/local.xml
/media/*
diff --git a/vendor/gitignore/Node.gitignore b/vendor/gitignore/Node.gitignore
index c221276ebae..e1da6ae8ea5 100644
--- a/vendor/gitignore/Node.gitignore
+++ b/vendor/gitignore/Node.gitignore
@@ -71,3 +71,6 @@ typings/
# Serverless directories
.serverless
+
+# FuseBox cache
+.fusebox/
diff --git a/vendor/gitignore/Python.gitignore b/vendor/gitignore/Python.gitignore
index 6f7a6d9c3d7..510c73d0fdb 100644
--- a/vendor/gitignore/Python.gitignore
+++ b/vendor/gitignore/Python.gitignore
@@ -109,3 +109,6 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json
+
+# Pyre type checker
+.pyre/
diff --git a/vendor/gitignore/Rails.gitignore b/vendor/gitignore/Rails.gitignore
index 78eb74fdc26..38ba1b5b38c 100644
--- a/vendor/gitignore/Rails.gitignore
+++ b/vendor/gitignore/Rails.gitignore
@@ -50,6 +50,7 @@ node_modules/
# Ignore precompiled javascript packs
/public/packs
/public/packs-test
+/public/assets
# Ignore yarn files
/yarn-error.log
diff --git a/vendor/gitignore/Unity.gitignore b/vendor/gitignore/Unity.gitignore
index 0210746b1a5..833e6d4291c 100644
--- a/vendor/gitignore/Unity.gitignore
+++ b/vendor/gitignore/Unity.gitignore
@@ -23,6 +23,7 @@ ExportedObj/
*.svd
*.pdb
*.opendb
+*.VC.db
# Unity3D generated meta files
*.pidb.meta
diff --git a/vendor/licenses.csv b/vendor/licenses.csv
index 5a7f7c0ebd1..ea3d3fd02f9 100644
--- a/vendor/licenses.csv
+++ b/vendor/licenses.csv
@@ -67,8 +67,9 @@
@babel/template,7.1.2,MIT
@babel/traverse,7.1.0,MIT
@babel/types,7.1.2,MIT
+@gitlab-org/gitlab-svgs,1.32.0,MIT
+@gitlab-org/gitlab-ui,1.10.0,MIT
@gitlab/svgs,1.35.0,MIT
-@gitlab-org/gitlab-ui,1.8.0,MIT
@sindresorhus/is,0.7.0,MIT
@types/jquery,2.0.48,MIT
@vue/component-compiler-utils,2.2.0,MIT
@@ -133,7 +134,6 @@ asciidoctor,1.5.6.2,MIT
asciidoctor-plantuml,0.0.8,MIT
asn1.js,4.10.1,MIT
assert,1.4.1,MIT
-asset_sync,2.4.0,MIT
assign-symbols,1.0.0,MIT
async-each,1.0.1,MIT
async-limiter,1.0.0,MIT
@@ -161,7 +161,6 @@ big.js,3.2.0,MIT
binary-extensions,1.11.0,MIT
binaryextensions,2.1.1,MIT
bindata,2.4.3,ruby
-blackst0ne-mermaid,7.1.0-fixed,MIT
bluebird,3.5.1,MIT
bn.js,4.11.8,MIT
body-parser,1.18.2,MIT
@@ -264,8 +263,8 @@ css-selector-tokenizer,0.7.0,MIT
css_parser,1.5.0,MIT
cssesc,0.1.0,MIT
cyclist,0.2.2,MIT*
-d3,3.5.17,New BSD
d3,4.12.2,New BSD
+d3,4.13.0,New BSD
d3-array,1.2.1,New BSD
d3-axis,1.0.8,New BSD
d3-brush,1.0.4,New BSD
@@ -278,6 +277,7 @@ d3-dsv,1.0.8,New BSD
d3-ease,1.0.3,New BSD
d3-force,1.1.0,New BSD
d3-format,1.2.1,New BSD
+d3-format,1.2.2,New BSD
d3-geo,1.9.1,New BSD
d3-hierarchy,1.1.5,New BSD
d3-interpolate,1.1.6,New BSD
@@ -289,6 +289,7 @@ d3-random,1.1.0,New BSD
d3-request,1.0.6,New BSD
d3-scale,1.0.7,New BSD
d3-selection,1.2.0,New BSD
+d3-selection,1.3.0,New BSD
d3-shape,1.2.0,New BSD
d3-time,1.0.8,New BSD
d3-time-format,2.1.1,New BSD
@@ -296,8 +297,8 @@ d3-timer,1.0.7,New BSD
d3-transition,1.1.1,New BSD
d3-voronoi,1.1.2,New BSD
d3-zoom,1.7.1,New BSD
-dagre-d3-renderer,0.4.24,MIT
-dagre-layout,0.8.0,MIT
+dagre-d3-renderer,0.5.8,MIT
+dagre-layout,0.8.8,MIT
date-now,0.1.4,MIT
dateformat,3.0.3,MIT
de-indent,1.0.2,MIT
@@ -328,7 +329,6 @@ device_detector,1.0.0,LGPL
devise,4.4.3,MIT
devise-two-factor,3.0.0,MIT
diff,3.5.0,New BSD
-diff-lcs,1.3,"MIT,Artistic-2.0,GPL-2.0+"
diffie-hellman,5.0.2,MIT
diffy,3.1.0,MIT
document-register-element,1.3.0,MIT
@@ -370,6 +370,7 @@ es6-promise,3.0.2,MIT
escape-html,1.0.3,MIT
escape-string-regexp,1.0.5,MIT
escape_utils,1.1.1,MIT
+escaper,2.5.3,MIT
eslint-scope,4.0.0,Simplified BSD
esrecurse,4.2.1,Simplified BSD
estraverse,4.2.0,Simplified BSD
@@ -447,12 +448,8 @@ get-value,2.0.6,MIT
get_process_mem,0.2.0,MIT
gettext_i18n_rails,1.8.0,MIT
gettext_i18n_rails_js,1.3.0,MIT
-gitaly-proto,0.118.1,MIT
-github-linguist,5.3.3,MIT
+gitaly-proto,0.123.0,MIT
github-markup,1.7.0,MIT
-gitlab-flowdock-git-hook,1.0.1,MIT
-gitlab-gollum-lib,4.2.7.5,MIT
-gitlab-grit,2.8.2,MIT
gitlab-markup,1.6.4,MIT
gitlab-sidekiq-fetcher,0.3.0,LGPL
gitlab_omniauth-ldap,2.0.4,MIT
@@ -461,13 +458,12 @@ glob-parent,3.1.0,ISC
global-modules-path,2.1.0,Apache 2.0
globalid,0.4.1,MIT
globals,11.7.0,MIT
-gollum-grit_adapter,1.0.1,MIT
gon,6.2.0,MIT
good-listener,1.2.2,MIT
google-api-client,0.23.4,Apache 2.0
-google-protobuf,3.5.1,New BSD
-googleapis-common-protos-types,1.0.1,Apache 2.0
-googleauth,0.6.2,Apache 2.0
+google-protobuf,3.6.1,New BSD
+googleapis-common-protos-types,1.0.2,Apache 2.0
+googleauth,0.6.6,Apache 2.0
got,8.3.0,MIT
gpgme,2.0.13,LGPL-2.1+
graceful-fs,4.1.11,ISC
@@ -476,9 +472,9 @@ grape-entity,0.7.1,MIT
grape-path-helpers,1.0.6,MIT
grape_logging,1.7.0,MIT
graphiql-rails,1.4.10,MIT
-graphlib,2.1.1,MIT
+graphlibrary,2.2.0,MIT
graphql,1.8.1,MIT
-grpc,1.11.0,Apache 2.0
+grpc,1.15.0,Apache 2.0
gzip-size,5.0.0,MIT
hamlit,2.8.8,MIT
hangouts-chat,0.0.5,MIT
@@ -572,6 +568,7 @@ is-plain-obj,1.1.0,MIT
is-plain-object,2.0.4,MIT
is-promise,2.1.0,MIT
is-regex,1.0.4,MIT
+is-regexp,1.0.0,MIT
is-retry-allowed,1.1.0,MIT
is-stream,1.1.0,MIT
is-symbol,1.0.2,MIT
@@ -620,7 +617,6 @@ lazy-cache,2.0.2,MIT
lcid,2.0.0,MIT
licensee,8.9.2,MIT
lie,3.1.1,MIT
-little-plugger,1.1.4,MIT
loader-runner,2.3.0,MIT
loader-utils,1.1.0,MIT
locale,2.1.2,"ruby,LGPLv3+"
@@ -635,7 +631,6 @@ lodash.get,4.4.2,MIT
lodash.isequal,4.5.0,MIT
lodash.mergewith,4.6.0,MIT
lodash.startcase,4.4.0,MIT
-logging,2.2.2,MIT
lograge,0.10.0,MIT
loofah,2.2.2,MIT
loose-envify,1.4.0,MIT
@@ -658,6 +653,7 @@ memoist,0.16.0,MIT
memory-fs,0.4.1,MIT
merge-descriptors,1.0.1,MIT
merge-source-map,1.1.0,MIT
+mermaid,8.0.0-rc.8,MIT
method_source,0.9.0,MIT
methods,1.1.2,MIT
micromatch,3.1.10,MIT
@@ -685,11 +681,10 @@ mississippi,2.0.0,Simplified BSD
mississippi,3.0.0,Simplified BSD
mixin-deep,1.3.1,MIT
mkdirp,0.5.1,MIT
-moment,2.19.2,MIT
+moment,2.22.2,MIT
monaco-editor,0.14.3,MIT
monaco-editor-webpack-plugin,1.5.4,MIT
mousetrap,1.4.6,Apache 2.0
-mousetrap-rails,1.4.6,"MIT,Apache"
move-concurrently,1.0.1,ISC
ms,2.0.0,MIT
ms,2.1.1,MIT
@@ -760,7 +755,7 @@ opener,1.5.1,(WTFPL OR MIT)
opn,4.0.2,MIT
org-ruby,0.9.12,MIT
orm_adapter,0.5.0,MIT
-os,0.9.6,MIT
+os,1.0.0,MIT
os-browserify,0.3.0,MIT
os-homedir,1.0.2,MIT
os-locale,3.0.1,MIT
@@ -806,7 +801,6 @@ pkg-dir,3.0.0,MIT
po_to_json,1.0.1,MIT
popper.js,1.14.3,MIT
posix-character-classes,0.1.1,MIT
-posix-spawn,0.3.13,MIT
postcss,6.0.23,MIT
postcss-modules-extract-imports,1.2.0,ISC
postcss-modules-local-by-default,1.2.0,MIT
@@ -830,6 +824,8 @@ prr,1.0.1,MIT
pseudomap,1.0.2,ISC
public-encrypt,4.0.0,MIT
public_suffix,3.0.3,MIT
+puma,3.12.0,New BSD
+puma_worker_killer,0.1.0,MIT
pump,2.0.1,MIT
pump,3.0.0,MIT
pumpify,1.4.0,MIT
@@ -929,7 +925,7 @@ ruby_parser,3.9.0,MIT
rubyntlm,0.6.2,MIT
rubypants,0.2.0,BSD
rufus-scheduler,3.4.0,MIT
-rugged,0.27.4,MIT
+rugged,0.27.5,MIT
run-async,2.3.0,MIT
run-queue,1.0.3,ISC
rw,1.3.3,New BSD
@@ -949,6 +945,7 @@ sawyer,0.8.1,MIT
sax,1.2.4,ISC
schema-utils,0.4.5,MIT
schema-utils,1.0.0,MIT
+scope-css,1.2.1,MIT
seed-fu,2.3.7,MIT
select,1.1.2,MIT
select2,3.5.2-browserify,Apache*
@@ -975,8 +972,9 @@ shebang-regex,1.0.0,MIT
sidekiq,5.2.1,LGPL
sidekiq-cron,0.6.0,MIT
signal-exit,3.0.2,ISC
-signet,0.8.1,Apache 2.0
+signet,0.11.0,Apache 2.0
slack-notifier,1.5.1,MIT
+slugify,1.3.1,MIT
smooshpack,0.0.48,LGPL
snapdragon,0.8.1,MIT
snapdragon-node,2.1.1,MIT
@@ -1012,9 +1010,9 @@ string-width,1.0.2,MIT
string-width,2.1.1,MIT
string_decoder,0.10.31,MIT
string_decoder,1.1.1,MIT
-stringex,2.8.4,MIT
strip-ansi,3.0.1,MIT
strip-ansi,4.0.0,MIT
+strip-css-comments,3.0.0,MIT
strip-eof,1.0.0,MIT
strip-json-comments,2.0.1,MIT
style-loader,0.23.0,MIT