diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-18 21:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-18 21:08:43 +0300 |
commit | 055b4c04d5cef7029625c08619df4f3bcdccc6c2 (patch) | |
tree | 4a363915e4878c17f5a6ffef6010a4bf0e3b8b76 /app | |
parent | 85f1126ea6f09296e4e5106d7d8319e93aeedf3c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
9 files changed, 39 insertions, 12 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index e2f301b1911..d5424179ba6 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -263,12 +263,16 @@ export default { 'merged', 'closed', 'merging', - 'autoMergeEnabled', 'shaMismatch', - ].includes(this.mr.state) || ['MERGING', 'AUTO_MERGE'].includes(this.mr.machineValue) + ].includes(this.mr.state) || this.mr.machineValue === 'MERGING' ) ); }, + autoMergeStateVisible() { + if (!window.gon?.features?.mergeBlockedComponent) return false; + + return this.mr.state === 'autoMergeEnabled' || this.mr.machineValue === 'AUTO_MERGE'; + }, }, watch: { 'mr.machineValue': { @@ -577,6 +581,12 @@ export default { </div> <div class="mr-widget-section" data-testid="mr-widget-content"> + <mr-widget-auto-merge-enabled + v-if="autoMergeStateVisible" + :mr="mr" + :service="service" + class="gl-border-b-1 gl-border-b-solid gl-border-gray-100" + /> <merge-checks v-if="mergeBlockedComponentEnabled" :mr="mr" :service="service" /> <component :is="componentName" v-else :mr="mr" :service="service" /> <ready-to-merge diff --git a/app/helpers/registrations_helper.rb b/app/helpers/registrations_helper.rb index 12f7bd41968..4ac14894057 100644 --- a/app/helpers/registrations_helper.rb +++ b/app/helpers/registrations_helper.rb @@ -12,7 +12,7 @@ module RegistrationsHelper end # overridden in EE - def oauth_tracking_label; end + def registration_tracking_label; end # overridden in EE def register_omniauth_params(_local_assigns) diff --git a/app/models/ci/catalog/resources/version.rb b/app/models/ci/catalog/resources/version.rb index 0ea2735b030..47c6612f726 100644 --- a/app/models/ci/catalog/resources/version.rb +++ b/app/models/ci/catalog/resources/version.rb @@ -29,6 +29,7 @@ module Ci delegate :sha, :released_at, :author_id, to: :release + before_create :sync_with_release after_destroy :update_catalog_resource after_save :update_catalog_resource @@ -131,8 +132,19 @@ module Ci project.repository.tree(sha).readme end + def sync_with_release! + sync_with_release + save! + end + private + # This column is denormalized from `releases`. It is first synced when a new version + # is created. Any updates to the column are synced via Release model callback. + def sync_with_release + self.released_at = release.released_at + end + def update_catalog_resource catalog_resource.update_latest_released_at! end diff --git a/app/models/release.rb b/app/models/release.rb index 7bacc69f038..6f32b0e50d5 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -25,8 +25,7 @@ class Release < ApplicationRecord accepts_nested_attributes_for :links, allow_destroy: true before_create :set_released_at - # TODO: Remove this callback after catalog_resource.released_at is denormalized. See https://gitlab.com/gitlab-org/gitlab/-/issues/430117. - after_update :update_catalog_resource, if: -> { project.catalog_resource && saved_change_to_released_at? } + after_update :update_catalog_resource_version, if: -> { catalog_resource_version && saved_change_to_released_at? } after_destroy :update_catalog_resource, if: -> { project.catalog_resource } validates :project, :tag, presence: true @@ -184,6 +183,10 @@ class Release < ApplicationRecord end end + def update_catalog_resource_version + catalog_resource_version.sync_with_release! + end + def update_catalog_resource project.catalog_resource.update_latest_released_at! end diff --git a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json index 9cfb62d4439..fe263a55958 100644 --- a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json +++ b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json @@ -12,7 +12,7 @@ }, { "field": "SAST_EXCLUDED_PATHS", - "label": "Excluded Paths", + "label": "Excluded paths", "type": "string", "default_value": "", "value": "", @@ -32,12 +32,12 @@ }, { "field": "SEARCH_MAX_DEPTH", - "label": "Search Maximum Depth", + "label": "Search maximum depth", "type": "string", "default_value": "", "value": "", "size": "SMALL", - "description": "Specifies the number of directory levels to be included in the repository search phase during SAST analysis. SAST scanner searches through the repository to detect the programming languages used and selects the corresponding analyzers. After that, the entire repository is analyzed." + "description": "Specifies the number of directory levels searched to identify programming languages and frameworks. This determines which analyzers to run against the entire repository." } ], "analyzers": [ diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index ec85c680f7f..c176f96db25 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -14,5 +14,6 @@ = render 'devise/shared/signup_box', url: registration_path(resource_name, registration_path_params), button_text: _('Register'), - show_omniauth_providers: omniauth_enabled? && button_based_providers_enabled? + show_omniauth_providers: omniauth_enabled? && button_based_providers_enabled?, + tracking_label: registration_tracking_label = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 9eb0b773ebb..b875d245fec 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -4,4 +4,5 @@ = render 'devise/shared/signup_box_form', button_text: button_text, url: url, - show_omniauth_providers: omniauth_enabled? && button_based_providers_enabled? + show_omniauth_providers: omniauth_enabled? && button_based_providers_enabled?, + tracking_label: tracking_label diff --git a/app/views/devise/shared/_signup_box_form.html.haml b/app/views/devise/shared/_signup_box_form.html.haml index 2920aeecce0..772b981db4d 100644 --- a/app/views/devise/shared/_signup_box_form.html.haml +++ b/app/views/devise/shared/_signup_box_form.html.haml @@ -73,7 +73,7 @@ - elsif show_recaptcha_sign_up? = recaptcha_tags nonce: content_security_policy_nonce - = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { testid: 'new-user-register-button' }}) do + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { testid: 'new-user-register-button', track_action: 'register', track_label: tracking_label }}) do = button_text = render 'devise/shared/terms_of_service_notice', button_text: button_text diff --git a/app/views/devise/shared/_signup_omniauth_providers.haml b/app/views/devise/shared/_signup_omniauth_providers.haml index 263e11ab341..aa80f0af32d 100644 --- a/app/views/devise/shared/_signup_omniauth_providers.haml +++ b/app/views/devise/shared/_signup_omniauth_providers.haml @@ -1,3 +1,3 @@ = render 'devise/shared/signup_omniauth_provider_list', providers: enabled_button_based_providers, - tracking_label: oauth_tracking_label + tracking_label: registration_tracking_label |