diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-18 03:10:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-18 03:10:43 +0300 |
commit | da4f753e76a4fd162d35c0c79d1241583e88b685 (patch) | |
tree | 3e9a8ebb90efeceaebe9a85cef6cb8410e850c9b /app | |
parent | 20082d14c8a188514703824d59f1a1a524477b68 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/ci/catalog/components/list/ci_resources_list_item.vue | 34 | ||||
-rw-r--r-- | app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue | 2 | ||||
-rw-r--r-- | app/models/ci/build_metadata.rb | 6 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 20 | ||||
-rw-r--r-- | app/models/commit_status.rb | 5 | ||||
-rw-r--r-- | app/models/vulnerability.rb | 4 |
6 files changed, 40 insertions, 31 deletions
diff --git a/app/assets/javascripts/ci/catalog/components/list/ci_resources_list_item.vue b/app/assets/javascripts/ci/catalog/components/list/ci_resources_list_item.vue index 9540e1ed3ea..5bbf11e541f 100644 --- a/app/assets/javascripts/ci/catalog/components/list/ci_resources_list_item.vue +++ b/app/assets/javascripts/ci/catalog/components/list/ci_resources_list_item.vue @@ -1,13 +1,5 @@ <script> -import { - GlAvatar, - GlBadge, - GlButton, - GlIcon, - GlLink, - GlSprintf, - GlTooltipDirective, -} from '@gitlab/ui'; +import { GlAvatar, GlBadge, GlIcon, GlLink, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; import { s__ } from '~/locale'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { formatDate, getTimeago } from '~/lib/utils/datetime_utility'; @@ -21,7 +13,6 @@ export default { components: { GlAvatar, GlBadge, - GlButton, GlIcon, GlLink, GlSprintf, @@ -42,6 +33,12 @@ export default { authorProfileUrl() { return this.latestVersion.author.webUrl; }, + detailsPageHref() { + return this.$router.resolve({ + name: CI_RESOURCE_DETAILS_PAGE_NAME, + params: { id: this.entityId }, + }).href; + }, entityId() { return getIdFromGraphQLId(this.resource.id); }, @@ -68,7 +65,16 @@ export default { }, }, methods: { - navigateToDetailsPage() { + navigateToDetailsPage(e) { + // Open link in a new tab if any of these modifier key is held down. + if (e?.ctrlKey || e?.metaKey) { + return; + } + + // Override the <a> tag if no modifier key is held down to use Vue router and not + // open a new tab. + e.preventDefault(); + this.$router.push({ name: CI_RESOURCE_DETAILS_PAGE_NAME, params: { id: this.entityId }, @@ -93,14 +99,14 @@ export default { /> <div class="gl-display-flex gl-flex-direction-column gl-flex-grow-1"> <div class="gl-display-flex gl-flex-wrap gl-gap-2 gl-mb-2"> - <gl-button - variant="link" + <gl-link class="gl-text-gray-900! gl-mr-1" + :href="detailsPageHref" data-testid="ci-resource-link" @click="navigateToDetailsPage" > {{ resourcePath }} <b> {{ resource.name }}</b> - </gl-button> + </gl-link> <div class="gl-display-flex gl-flex-grow-1 gl-md-justify-content-space-between"> <gl-badge size="sm">{{ tagName }}</gl-badge> <span class="gl-display-flex gl-align-items-center gl-ml-5"> diff --git a/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue b/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue index c345f8f07fc..db5f5b02d72 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue @@ -136,7 +136,7 @@ export default { return REVIEW_STATE_ICONS[user.mergeRequestInteraction.reviewState]; }, showRequestReviewButton(user) { - if (this.glFeatures.mrRequestChanges) { + if (this.glFeatures.mrRequestChanges && !user.mergeRequestInteraction.approved) { return user.mergeRequestInteraction.reviewState !== 'UNREVIEWED'; } diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb index 4194be7c0af..1fe6af8c595 100644 --- a/app/models/ci/build_metadata.rb +++ b/app/models/ci/build_metadata.rb @@ -36,7 +36,11 @@ module Ci chronic_duration_attr_reader :timeout_human_readable, :timeout - scope :scoped_build, -> { where("#{quoted_table_name}.build_id = #{Ci::Build.quoted_table_name}.id") } + scope :scoped_build, -> do + where(arel_table[:build_id].eq(Ci::Build.arel_table[:id])) + .where(arel_table[:partition_id].eq(Ci::Build.arel_table[:partition_id])) + end + scope :with_interruptible, -> { where(interruptible: true) } scope :with_exposed_artifacts, -> { where(has_exposed_artifacts: true) } diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 7ee96d6796e..b9823bd4a07 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -459,20 +459,12 @@ module Ci end scope :with_reports, -> (reports_scope) do - where('EXISTS (?)', - ::Ci::Build - .latest - .with_artifacts(reports_scope) - .where("#{quoted_table_name}.id = #{Ci::Build.quoted_table_name}.commit_id") - .select(1) - ) + where_exists(Ci::Build.latest.scoped_pipeline.with_artifacts(reports_scope)) end scope :with_only_interruptible_builds, -> do - where('NOT EXISTS (?)', - Ci::Build.where("#{Ci::Build.quoted_table_name}.commit_id = #{quoted_table_name}.id") - .with_status(STARTED_STATUSES) - .not_interruptible + where_not_exists( + Ci::Build.scoped_pipeline.with_status(STARTED_STATUSES).not_interruptible ) end @@ -999,15 +991,15 @@ module Ci end def builds_in_self_and_project_descendants - Ci::Build.latest.where(pipeline: self_and_project_descendants) + Ci::Build.in_partition(self).latest.where(pipeline: self_and_project_descendants) end def bridges_in_self_and_project_descendants - Ci::Bridge.latest.where(pipeline: self_and_project_descendants) + Ci::Bridge.in_partition(self).latest.where(pipeline: self_and_project_descendants) end def jobs_in_self_and_project_descendants - Ci::Processable.latest.where(pipeline: self_and_project_descendants) + Ci::Processable.in_partition(self).latest.where(pipeline: self_and_project_descendants) end def environments_in_self_and_project_descendants(deployment_status: nil) diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index a8e2615b327..21980a5e1b7 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -99,6 +99,11 @@ class CommitStatus < Ci::ApplicationRecord preload(project: :namespace) end + scope :scoped_pipeline, -> do + where(arel_table[:commit_id].eq(Ci::Pipeline.arel_table[:id])) + .where(arel_table[:partition_id].eq(Ci::Pipeline.arel_table[:partition_id])) + end + scope :match_id_and_lock_version, -> (items) do # it expects that items are an array of attributes to match # each hash needs to have `id` and `lock_version` diff --git a/app/models/vulnerability.rb b/app/models/vulnerability.rb index a9e1b2dbc5b..702e7fce567 100644 --- a/app/models/vulnerability.rb +++ b/app/models/vulnerability.rb @@ -5,7 +5,9 @@ class Vulnerability < ApplicationRecord include EachBatch include IgnorableColumns - ignore_column %i[epic_id milestone_id last_edited_at], remove_with: '16.9', remove_after: '2023-01-13' + ignore_column %i[epic_id milestone_id last_edited_at start_date], + remove_with: '16.9', + remove_after: '2024-01-13' alias_attribute :vulnerability_id, :id |