diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 06:21:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 06:21:36 +0300 |
commit | eba7329faa534bc0ea9332e3278f2a74f61a79dc (patch) | |
tree | 39b4d3d4b8d77ebb6766e689d8b9210f0ea643d1 /app | |
parent | f3b2c536778dcd0981134c702d97c6e4047b64d4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
25 files changed, 22 insertions, 28 deletions
diff --git a/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue b/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue index b5042936b1e..cafac061c12 100644 --- a/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue +++ b/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue @@ -159,7 +159,7 @@ export default { search: { deep: true, handler() { - // TODO Implement back button reponse using onpopstate + // TODO Implement back button response using onpopstate // See https://gitlab.com/gitlab-org/gitlab/-/issues/333804 updateHistory({ url: fromSearchToUrl(this.search), diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index e931d95d38a..2f042ea6417 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -279,7 +279,7 @@ module MergeRequestsHelper target_branch = link_to merge_request.target_branch, project_tree_path(merge_request.target_project, merge_request.target_branch), title: merge_request.target_branch, class: 'ref-container gl-display-inline-block gl-text-truncate gl-max-w-26 gl-mx-2' - safe_format('%{author} • %{source_branch} %{copy_button} ➔ %{target_branch} %{created_at}', author: link_to_author, source_branch: merge_request_source_branch(merge_request), copy_button: copy_button, target_branch: target_branch, created_at: time_ago_with_tooltip(merge_request.created_at, html_class: 'gl-display-inline-block')) + _('%{author} requested to merge %{source_branch} %{copy_button} into %{target_branch} %{created_at}').html_safe % { author: link_to_author.html_safe, source_branch: merge_request_source_branch(merge_request).html_safe, copy_button: copy_button.html_safe, target_branch: target_branch.html_safe, created_at: time_ago_with_tooltip(merge_request.created_at, html_class: 'gl-display-inline-block').html_safe } end def sticky_header_data diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index 6bcfd23e69c..4df92235f50 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -618,12 +618,11 @@ class ContainerRepository < ApplicationRecord self.new(project: path.repository_project, name: path.repository_name) end - def self.find_or_create_from_path(path) - repository = safe_find_or_create_by( - project: path.repository_project, + def self.find_or_create_from_path!(path) + ContainerRepository.upsert({ + project_id: path.repository_project.id, name: path.repository_name - ) - return repository if repository.persisted? + }, unique_by: %i[project_id name]) find_by_path!(path) end diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb index 7d473f9ed89..f515fdede29 100644 --- a/app/services/auth/container_registry_authentication_service.rb +++ b/app/services/auth/container_registry_authentication_service.rb @@ -231,7 +231,7 @@ module Auth return if path.has_repository? return unless actions.include?('push') - ContainerRepository.find_or_create_from_path(path) + ContainerRepository.find_or_create_from_path!(path) end # Overridden in EE diff --git a/app/services/import/gitlab_projects/create_project_service.rb b/app/services/import/gitlab_projects/create_project_service.rb index 1613c4dde25..dc0f24df0cb 100644 --- a/app/services/import/gitlab_projects/create_project_service.rb +++ b/app/services/import/gitlab_projects/create_project_service.rb @@ -25,7 +25,7 @@ module Import # Creates a project with the strategy parameters # - # @return [Services::ServiceReponse] + # @return [Services::ServiceResponse] def execute return error(errors.full_messages) unless valid? return error(project.errors.full_messages) unless project.saved? diff --git a/app/views/projects/merge_requests/_code_dropdown.html.haml b/app/views/projects/merge_requests/_code_dropdown.html.haml index 50f4e313bc5..bfa33f26453 100644 --- a/app/views/projects/merge_requests/_code_dropdown.html.haml +++ b/app/views/projects/merge_requests/_code_dropdown.html.haml @@ -1,6 +1,6 @@ .gl-md-ml-3.dropdown.gl-dropdown{ class: "gl-display-none! gl-md-display-flex!" } #js-check-out-modal{ data: how_merge_modal_data(@merge_request) } - = button_tag type: 'button', class: "btn dropdown-toggle btn-confirm-secondary gl-button gl-dropdown-toggle", data: { toggle: 'dropdown', testid: 'mr-code-dropdown' } do + = button_tag type: 'button', class: "btn dropdown-toggle btn-confirm gl-button gl-dropdown-toggle", data: { toggle: 'dropdown', testid: 'mr-code-dropdown' } do %span.gl-dropdown-button-text= _('Code') = sprite_icon "chevron-down", size: 16, css_class: "dropdown-icon gl-icon gl-ml-2 gl-mr-0!" .dropdown-menu.dropdown-menu-right diff --git a/app/workers/concerns/gitlab/github_import/object_importer.rb b/app/workers/concerns/gitlab/github_import/object_importer.rb index 046d9ed49e1..15156e1deef 100644 --- a/app/workers/concerns/gitlab/github_import/object_importer.rb +++ b/app/workers/concerns/gitlab/github_import/object_importer.rb @@ -16,6 +16,7 @@ module Gitlab feature_category :importers worker_has_external_dependencies! + sidekiq_options retry: 5 sidekiq_retries_exhausted do |msg| args = msg['args'] jid = msg['jid'] diff --git a/app/workers/concerns/gitlab/github_import/queue.rb b/app/workers/concerns/gitlab/github_import/queue.rb index 7cc23dd7c0b..5aabc74a3d5 100644 --- a/app/workers/concerns/gitlab/github_import/queue.rb +++ b/app/workers/concerns/gitlab/github_import/queue.rb @@ -14,7 +14,7 @@ module Gitlab # the dead queue. This does mean some resources may not be imported, but # this is better than a project being stuck in the "import" state # forever. - sidekiq_options dead: false, retry: 5 + sidekiq_options dead: false end end end diff --git a/app/workers/concerns/gitlab/github_import/stage_methods.rb b/app/workers/concerns/gitlab/github_import/stage_methods.rb index bc0114e199f..5f6812ab84f 100644 --- a/app/workers/concerns/gitlab/github_import/stage_methods.rb +++ b/app/workers/concerns/gitlab/github_import/stage_methods.rb @@ -9,6 +9,9 @@ module Gitlab included do include ApplicationWorker + include GithubImport::Queue + + sidekiq_options retry: 6 sidekiq_options status_expiration: Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION diff --git a/app/workers/gitlab/github_import/advance_stage_worker.rb b/app/workers/gitlab/github_import/advance_stage_worker.rb index a012241e90c..417b8598547 100644 --- a/app/workers/gitlab/github_import/advance_stage_worker.rb +++ b/app/workers/gitlab/github_import/advance_stage_worker.rb @@ -11,12 +11,15 @@ module Gitlab data_consistency :always - sidekiq_options retry: 3 include ::Gitlab::Import::AdvanceStage - sidekiq_options dead: false - feature_category :importers loggable_arguments 1, 2 + sidekiq_options retry: 6 + + # TODO: Allow this class to include GithubImport::Queue and remove + # the following two lines https://gitlab.com/gitlab-org/gitlab/-/issues/435622 + feature_category :importers + sidekiq_options dead: false # The known importer stages and their corresponding Sidekiq workers. STAGES = { diff --git a/app/workers/gitlab/github_import/refresh_import_jid_worker.rb b/app/workers/gitlab/github_import/refresh_import_jid_worker.rb index fb586ca1ddd..dfc581f201b 100644 --- a/app/workers/gitlab/github_import/refresh_import_jid_worker.rb +++ b/app/workers/gitlab/github_import/refresh_import_jid_worker.rb @@ -9,6 +9,8 @@ module Gitlab include GithubImport::Queue + sidekiq_options retry: 5 + # The interval to schedule new instances of this job at. INTERVAL = 5.minutes.to_i diff --git a/app/workers/gitlab/github_import/stage/finish_import_worker.rb b/app/workers/gitlab/github_import/stage/finish_import_worker.rb index 90445a6d46c..8d5a98136af 100644 --- a/app/workers/gitlab/github_import/stage/finish_import_worker.rb +++ b/app/workers/gitlab/github_import/stage/finish_import_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # project - An instance of Project. diff --git a/app/workers/gitlab/github_import/stage/import_attachments_worker.rb b/app/workers/gitlab/github_import/stage/import_attachments_worker.rb index a5d085a82c0..bbf762133e1 100644 --- a/app/workers/gitlab/github_import/stage/import_attachments_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_attachments_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_base_data_worker.rb b/app/workers/gitlab/github_import/stage/import_base_data_worker.rb index 5bbe14b6528..d965c1ae847 100644 --- a/app/workers/gitlab/github_import/stage/import_base_data_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_base_data_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # These importers are fast enough that we can just run them in the same diff --git a/app/workers/gitlab/github_import/stage/import_collaborators_worker.rb b/app/workers/gitlab/github_import/stage/import_collaborators_worker.rb index 037b529b866..b5b1601e3ed 100644 --- a/app/workers/gitlab/github_import/stage/import_collaborators_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_collaborators_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # client - An instance of Gitlab::GithubImport::Client. diff --git a/app/workers/gitlab/github_import/stage/import_issue_events_worker.rb b/app/workers/gitlab/github_import/stage/import_issue_events_worker.rb index 35779d7bfc5..27d14a1a108 100644 --- a/app/workers/gitlab/github_import/stage/import_issue_events_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_issue_events_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb b/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb index 58e1f637b6a..595f0ca44d4 100644 --- a/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_lfs_objects_worker.rb b/app/workers/gitlab/github_import/stage/import_lfs_objects_worker.rb index 8d7bd98f303..34c31fea726 100644 --- a/app/workers/gitlab/github_import/stage/import_lfs_objects_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_lfs_objects_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # Importer::LfsObjectsImporter can resume work when interrupted as diff --git a/app/workers/gitlab/github_import/stage/import_notes_worker.rb b/app/workers/gitlab/github_import/stage/import_notes_worker.rb index 0459545d8e1..8aea27a94d4 100644 --- a/app/workers/gitlab/github_import/stage/import_notes_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_notes_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb b/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb index e281e965f94..65b9d85f453 100644 --- a/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # client - An instance of Gitlab::GithubImport::Client. diff --git a/app/workers/gitlab/github_import/stage/import_pull_requests_merged_by_worker.rb b/app/workers/gitlab/github_import/stage/import_pull_requests_merged_by_worker.rb index 2f543951bf3..20b2e5ed6af 100644 --- a/app/workers/gitlab/github_import/stage/import_pull_requests_merged_by_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_pull_requests_merged_by_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_pull_requests_review_requests_worker.rb b/app/workers/gitlab/github_import/stage/import_pull_requests_review_requests_worker.rb index db76545ae87..1262fc23c6c 100644 --- a/app/workers/gitlab/github_import/stage/import_pull_requests_review_requests_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_pull_requests_review_requests_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb b/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb index 31b7c57a524..bb4699889da 100644 --- a/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_pull_requests_worker.rb b/app/workers/gitlab/github_import/stage/import_pull_requests_worker.rb index c68b95b5111..bcc39b169af 100644 --- a/app/workers/gitlab/github_import/stage/import_pull_requests_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_pull_requests_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods resumes_work_when_interrupted! diff --git a/app/workers/gitlab/github_import/stage/import_repository_worker.rb b/app/workers/gitlab/github_import/stage/import_repository_worker.rb index e1d67069348..44481b8a75c 100644 --- a/app/workers/gitlab/github_import/stage/import_repository_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_repository_worker.rb @@ -8,7 +8,6 @@ module Gitlab data_consistency :always - include GithubImport::Queue include StageMethods # client - An instance of Gitlab::GithubImport::Client. |