diff options
-rw-r--r-- | .gitlab/issue_templates/AI Project Proposal.md (renamed from .gitlab/issue_templates/AI Project Proposal) | 0 | ||||
-rw-r--r-- | .rubocop_todo/layout/argument_alignment.yml | 11 | ||||
-rw-r--r-- | app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/repository_update_remote_mirror_worker.rb | 10 | ||||
-rw-r--r-- | app/workers/run_pipeline_schedule_worker.rb | 16 | ||||
-rw-r--r-- | app/workers/stuck_export_jobs_worker.rb | 3 | ||||
-rw-r--r-- | app/workers/x509_issuer_crl_check_worker.rb | 38 |
8 files changed, 44 insertions, 46 deletions
diff --git a/.gitlab/issue_templates/AI Project Proposal b/.gitlab/issue_templates/AI Project Proposal.md index 97b885b7cbd..97b885b7cbd 100644 --- a/.gitlab/issue_templates/AI Project Proposal +++ b/.gitlab/issue_templates/AI Project Proposal.md diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index bda953a1eb1..e8e9fda05ca 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -651,12 +651,6 @@ Layout/ArgumentAlignment: - 'app/services/webauthn/authenticate_service.rb' - 'app/services/work_items/create_service.rb' - 'app/validators/feature_flag_user_xids_validator.rb' - - 'app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb' - - 'app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb' - - 'app/workers/repository_update_remote_mirror_worker.rb' - - 'app/workers/run_pipeline_schedule_worker.rb' - - 'app/workers/stuck_export_jobs_worker.rb' - - 'app/workers/x509_issuer_crl_check_worker.rb' - 'config/application.rb' - 'config/initializers/hashie_mash_permitted_patch.rb' - 'config/initializers/rack_timeout.rb' @@ -1173,11 +1167,6 @@ Layout/ArgumentAlignment: - 'ee/app/services/vulnerabilities/starboard_vulnerability_resolve_service.rb' - 'ee/app/services/vulnerability_feedback/create_service.rb' - 'ee/app/services/vulnerability_merge_request_links/create_service.rb' - - 'ee/app/workers/audit_events/audit_event_streaming_worker.rb' - - 'ee/app/workers/audit_events/user_impersonation_event_create_worker.rb' - - 'ee/app/workers/concerns/geo/base_registry_sync_worker.rb' - - 'ee/app/workers/elastic/project_transfer_worker.rb' - - 'ee/app/workers/groups/export_memberships_worker.rb' - 'ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb' - 'ee/db/geo/post_migrate/20210217020154_add_unique_index_on_container_repository_registry.rb' - 'ee/db/geo/post_migrate/20210217020156_add_unique_index_on_terraform_state_version_registry.rb' 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 6d6dea10e64..73f4ea580c4 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 @@ -15,9 +15,7 @@ module Gitlab # client - An instance of Gitlab::GithubImport::Client. # project - An instance of Project. def import(client, project) - info(project.id, - message: "starting importer", - importer: 'Importer::ProtectedBranchesImporter') + info(project.id, message: "starting importer", importer: 'Importer::ProtectedBranchesImporter') waiter = Importer::ProtectedBranchesImporter .new(project, client) .execute diff --git a/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb b/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb index 5e675193a8c..a216f3d4ebc 100644 --- a/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb +++ b/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb @@ -8,9 +8,11 @@ module Gitlab private def track_metrics(with_jid_count, without_jid_count) - Gitlab::Metrics.add_event(:stuck_jira_import_jobs, - jira_imports_without_jid_count: with_jid_count, - jira_imports_with_jid_count: without_jid_count) + Gitlab::Metrics.add_event( + :stuck_jira_import_jobs, + jira_imports_without_jid_count: with_jid_count, + jira_imports_with_jid_count: without_jid_count + ) end def enqueued_import_states diff --git a/app/workers/repository_update_remote_mirror_worker.rb b/app/workers/repository_update_remote_mirror_worker.rb index 9265449fdf4..598cf9ce567 100644 --- a/app/workers/repository_update_remote_mirror_worker.rb +++ b/app/workers/repository_update_remote_mirror_worker.rb @@ -25,10 +25,12 @@ class RepositoryUpdateRemoteMirrorWorker # If the update is already running, wait for it to finish before running again # This will wait for a total of 90 seconds in 3 steps - in_lock(remote_mirror_update_lock(remote_mirror.id), - retries: 3, - ttl: remote_mirror.max_runtime, - sleep_sec: LOCK_WAIT_TIME) do + in_lock( + remote_mirror_update_lock(remote_mirror.id), + retries: 3, + ttl: remote_mirror.max_runtime, + sleep_sec: LOCK_WAIT_TIME + ) do update_mirror(remote_mirror, scheduled_time, tries) end rescue Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb index a7037863ef5..4ca366efcad 100644 --- a/app/workers/run_pipeline_schedule_worker.rb +++ b/app/workers/run_pipeline_schedule_worker.rb @@ -63,15 +63,17 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker end def track_error(schedule, error) - Gitlab::ErrorTracking - .track_and_raise_for_dev_exception(error, - issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/41231', - schedule_id: schedule.id) + Gitlab::ErrorTracking.track_and_raise_for_dev_exception( + error, + issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/41231', + schedule_id: schedule.id + ) end def failed_creation_counter - @failed_creation_counter ||= - Gitlab::Metrics.counter(:pipeline_schedule_creation_failed_total, - "Counter of failed attempts of pipeline schedule creation") + @failed_creation_counter ||= Gitlab::Metrics.counter( + :pipeline_schedule_creation_failed_total, + "Counter of failed attempts of pipeline schedule creation" + ) end end diff --git a/app/workers/stuck_export_jobs_worker.rb b/app/workers/stuck_export_jobs_worker.rb index 486d40c443a..ab06ca3107e 100644 --- a/app/workers/stuck_export_jobs_worker.rb +++ b/app/workers/stuck_export_jobs_worker.rb @@ -20,8 +20,7 @@ class StuckExportJobsWorker def perform failed_jobs_count = mark_stuck_jobs_as_failed! - Gitlab::Metrics.add_event(:stuck_export_jobs, - failed_jobs_count: failed_jobs_count) + Gitlab::Metrics.add_event(:stuck_export_jobs, failed_jobs_count: failed_jobs_count) end private diff --git a/app/workers/x509_issuer_crl_check_worker.rb b/app/workers/x509_issuer_crl_check_worker.rb index cb5bae7ca4e..58084405769 100644 --- a/app/workers/x509_issuer_crl_check_worker.rb +++ b/app/workers/x509_issuer_crl_check_worker.rb @@ -40,14 +40,16 @@ class X509IssuerCrlCheckWorker certs = issuer.x509_certificates.where(serial_number: batch, certificate_status: :good) # rubocop: disable CodeReuse/ActiveRecord certs.find_each do |cert| - logger.info(message: "Certificate revoked", - id: cert.id, - email: cert.email, - subject: cert.subject, - serial_number: cert.serial_number, - issuer: cert.x509_issuer.id, - issuer_subject: cert.x509_issuer.subject, - issuer_crl_url: cert.x509_issuer.crl_url) + logger.info( + message: "Certificate revoked", + id: cert.id, + email: cert.email, + subject: cert.subject, + serial_number: cert.serial_number, + issuer: cert.x509_issuer.id, + issuer_subject: cert.x509_issuer.subject, + issuer_crl_url: cert.x509_issuer.crl_url + ) end certs.update_all(certificate_status: :revoked) @@ -60,19 +62,23 @@ class X509IssuerCrlCheckWorker if response&.code == 200 OpenSSL::X509::CRL.new(response.body) else - logger.warn(message: "Failed to download certificate revocation list", - issuer: issuer.id, - issuer_subject: issuer.subject, - issuer_crl_url: issuer.crl_url) + logger.warn( + message: "Failed to download certificate revocation list", + issuer: issuer.id, + issuer_subject: issuer.subject, + issuer_crl_url: issuer.crl_url + ) nil end rescue OpenSSL::X509::CRLError - logger.warn(message: "Failed to parse certificate revocation list", - issuer: issuer.id, - issuer_subject: issuer.subject, - issuer_crl_url: issuer.crl_url) + logger.warn( + message: "Failed to parse certificate revocation list", + issuer: issuer.id, + issuer_subject: issuer.subject, + issuer_crl_url: issuer.crl_url + ) nil end |