From d081e00aa79079792b040af3323883f1f43830c5 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 24 Jun 2020 12:09:24 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../diffs/components/diff_table_cell.vue | 107 ++++++++---------- .../components/inline_diff_table_row.vue | 6 - .../diffs/components/inline_diff_view.vue | 1 - .../components/parallel_diff_table_row.vue | 6 - .../diffs/components/parallel_diff_view.vue | 1 - app/models/concerns/reactive_caching.rb | 8 +- app/models/environment.rb | 5 + app/models/merge_request.rb | 1 - changelogs/unreleased/update_android_ci.yml | 5 + config/initializers/01_secret_token.rb | 12 +- doc/development/application_secrets.md | 41 +++++++ doc/development/foreign_keys.md | 11 ++ doc/user/project/integrations/prometheus.md | 23 ++++ lib/gitlab/ci/templates/Android.gitlab-ci.yml | 63 ++++++++--- locale/gitlab.pot | 3 + spec/db/schema_spec.rb | 10 +- .../diffs/components/diff_table_cell_spec.js | 15 ++- spec/initializers/secret_token_spec.rb | 24 ++++ spec/models/concerns/reactive_caching_spec.rb | 34 +++--- spec/models/environment_spec.rb | 14 +++ .../lib/tooling/test_file_finder_spec.rb | 56 +++++++++ tooling/lib/tooling/test_file_finder.rb | 43 ++++--- 22 files changed, 350 insertions(+), 139 deletions(-) create mode 100644 changelogs/unreleased/update_android_ci.yml create mode 100644 doc/development/application_secrets.md diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue index 514d26862a3..198113e330a 100644 --- a/app/assets/javascripts/diffs/components/diff_table_cell.vue +++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue @@ -4,15 +4,13 @@ import { GlIcon } from '@gitlab/ui'; import { getParameterByName, parseBoolean } from '~/lib/utils/common_utils'; import DiffGutterAvatars from './diff_gutter_avatars.vue'; import { - MATCH_LINE_TYPE, CONTEXT_LINE_TYPE, LINE_POSITION_RIGHT, EMPTY_CELL_TYPE, - OLD_LINE_TYPE, OLD_NO_NEW_LINE_TYPE, + OLD_LINE_TYPE, NEW_NO_NEW_LINE_TYPE, LINE_HOVER_CLASS_NAME, - LINE_UNFOLD_CLASS_NAME, } from '../constants'; export default { @@ -29,10 +27,6 @@ export default { type: String, required: true, }, - contextLinesPath: { - type: String, - required: true, - }, isHighlighted: { type: Boolean, required: true, @@ -52,11 +46,6 @@ export default { required: false, default: '', }, - isContentLine: { - type: Boolean, - required: false, - default: false, - }, isBottom: { type: Boolean, required: false, @@ -68,6 +57,11 @@ export default { default: false, }, }, + data() { + return { + isCommentButtonRendered: false, + }; + }, computed: { ...mapGetters(['isLoggedIn']), lineCode() { @@ -81,13 +75,7 @@ export default { return `#${this.line.line_code || ''}`; }, shouldShowCommentButton() { - return ( - this.isHover && - !this.isMatchLine && - !this.isContextLine && - !this.isMetaLine && - !this.hasDiscussions - ); + return this.isHover && !this.isContextLine && !this.isMetaLine && !this.hasDiscussions; }, hasDiscussions() { return this.line.discussions && this.line.discussions.length > 0; @@ -99,6 +87,10 @@ export default { return this.showCommentButton && this.hasDiscussions; }, shouldRenderCommentButton() { + if (!this.isCommentButtonRendered) { + return false; + } + if (this.isLoggedIn && this.showCommentButton) { const isDiffHead = parseBoolean(getParameterByName('diff_head')); return !isDiffHead || gon.features?.mergeRefHeadComments; @@ -106,9 +98,6 @@ export default { return false; }, - isMatchLine() { - return this.line.type === MATCH_LINE_TYPE; - }, isContextLine() { return this.line.type === CONTEXT_LINE_TYPE; }, @@ -126,13 +115,8 @@ export default { type, { hll: this.isHighlighted, - [LINE_UNFOLD_CLASS_NAME]: this.isMatchLine, [LINE_HOVER_CLASS_NAME]: - this.isLoggedIn && - this.isHover && - !this.isMatchLine && - !this.isContextLine && - !this.isMetaLine, + this.isLoggedIn && this.isHover && !this.isContextLine && !this.isMetaLine, }, ]; }, @@ -140,6 +124,17 @@ export default { return this.lineType === OLD_LINE_TYPE ? this.line.old_line : this.line.new_line; }, }, + mounted() { + this.unwatchShouldShowCommentButton = this.$watch('shouldShowCommentButton', newVal => { + if (newVal) { + this.isCommentButtonRendered = true; + this.unwatchShouldShowCommentButton(); + } + }); + }, + beforeDestroy() { + this.unwatchShouldShowCommentButton(); + }, methods: { ...mapActions('diffs', ['showCommentForm', 'setHighlightedRow', 'toggleLineDiscussions']), handleCommentButton() { @@ -151,34 +146,32 @@ export default { 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 bd99fcb71b8..4e228577666 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue @@ -28,10 +28,6 @@ export default { type: String, required: true, }, - contextLinesPath: { - type: String, - required: true, - }, line: { type: Object, required: true, @@ -106,7 +102,6 @@ export default { > 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 83d803f42b1..c2553dc87a6 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue @@ -31,10 +31,6 @@ export default { type: String, required: true, }, - contextLinesPath: { - type: String, - required: true, - }, line: { type: Object, required: true, @@ -144,7 +140,6 @@ export default {