Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 03:12:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 03:12:25 +0300
commit33a1d1835f5fc146acf0cdda402b5a327ae0d52f (patch)
tree670a2d95c957a475866507f87358c55f20359672 /app
parent8c6c2136e8cf8d0a857e587c36448db86965d146 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/pages/issues.scss48
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb2
-rw-r--r--app/services/ci/stuck_builds/drop_scheduled_service.rb26
-rw-r--r--app/services/ci/stuck_builds/drop_service.rb10
-rw-r--r--app/workers/all_queues.yml9
-rw-r--r--app/workers/ci/stuck_builds/drop_scheduled_worker.rb34
-rw-r--r--app/workers/stuck_ci_jobs_worker.rb1
7 files changed, 118 insertions, 12 deletions
diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss
index 25f5c0407f7..880231f5644 100644
--- a/app/assets/stylesheets/pages/issues.scss
+++ b/app/assets/stylesheets/pages/issues.scss
@@ -1,3 +1,51 @@
+.issue-token-link {
+ &[href] {
+ color: $blue-600;
+ }
+
+ &:hover,
+ &:focus {
+ outline: none;
+ text-decoration: none;
+ }
+}
+
+.issue-token-reference {
+ margin-right: 1px;
+ background-color: $gray-lighter;
+ transition: background $general-hover-transition-duration $general-hover-transition-curve, color $general-hover-transition-duration $general-hover-transition-curve;
+
+ .issue-token:hover &,
+ .issue-token-link:focus > & {
+ background-color: $gray-normal;
+ color: $blue-800;
+ text-decoration: none;
+ }
+}
+
+.issue-token-title {
+ background-color: $gray-normal;
+ transition: background $general-hover-transition-duration $general-hover-transition-curve;
+
+ .issue-token:hover &,
+ .issue-token-link:focus > & {
+ background-color: $border-gray-normal;
+ }
+}
+
+.issue-token-remove-button {
+ background-color: $gray-normal;
+ transition: background $general-hover-transition-duration $general-hover-transition-curve;
+
+ &:hover,
+ &:focus,
+ .issue-token:hover &,
+ .issue-token-link:focus + & {
+ background-color: $border-gray-normal;
+ outline: none;
+ }
+}
+
.issue-realtime-pre-pulse {
opacity: 0;
}
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index d1b9485f06d..3e397684ffe 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -231,8 +231,6 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
end
def ensure_verified_primary_email
- return unless Feature.enabled?(:ensure_verified_primary_email_for_2fa, default_enabled: :yaml)
-
unless current_user.two_factor_enabled? || current_user.primary_email_verified?
redirect_to profile_emails_path, notice: s_('You need to verify your primary email first before enabling Two-Factor Authentication.')
end
diff --git a/app/services/ci/stuck_builds/drop_scheduled_service.rb b/app/services/ci/stuck_builds/drop_scheduled_service.rb
new file mode 100644
index 00000000000..bc794f3fcea
--- /dev/null
+++ b/app/services/ci/stuck_builds/drop_scheduled_service.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module Ci
+ module StuckBuilds
+ class DropScheduledService
+ include DropHelpers
+
+ BUILD_SCHEDULED_OUTDATED_TIMEOUT = 1.hour
+
+ def execute
+ Gitlab::AppLogger.info "#{self.class}: Cleaning scheduled, timed-out builds"
+
+ drop(scheduled_timed_out_builds, failure_reason: :stale_schedule)
+ end
+
+ private
+
+ def scheduled_timed_out_builds
+ Ci::Build.where(status: :scheduled).where( # rubocop: disable CodeReuse/ActiveRecord
+ 'ci_builds.scheduled_at IS NOT NULL AND ci_builds.scheduled_at < ?',
+ BUILD_SCHEDULED_OUTDATED_TIMEOUT.ago
+ )
+ end
+ end
+ end
+end
diff --git a/app/services/ci/stuck_builds/drop_service.rb b/app/services/ci/stuck_builds/drop_service.rb
index dbc1860eb2b..0f8375e0cf1 100644
--- a/app/services/ci/stuck_builds/drop_service.rb
+++ b/app/services/ci/stuck_builds/drop_service.rb
@@ -6,7 +6,6 @@ module Ci
include DropHelpers
BUILD_PENDING_OUTDATED_TIMEOUT = 1.day
- BUILD_SCHEDULED_OUTDATED_TIMEOUT = 1.hour
BUILD_PENDING_STUCK_TIMEOUT = 1.hour
BUILD_LOOKBACK = 5.days
@@ -18,8 +17,6 @@ module Ci
failure_reason: :stuck_or_timeout_failure
)
- drop(scheduled_timed_out_builds, failure_reason: :stale_schedule)
-
drop_stuck(
pending_builds(BUILD_PENDING_STUCK_TIMEOUT.ago),
failure_reason: :stuck_or_timeout_failure
@@ -40,13 +37,6 @@ module Ci
end
end
# rubocop: enable CodeReuse/ActiveRecord
-
- def scheduled_timed_out_builds
- Ci::Build.where(status: :scheduled).where( # rubocop: disable CodeReuse/ActiveRecord
- 'ci_builds.scheduled_at IS NOT NULL AND ci_builds.scheduled_at < ?',
- BUILD_SCHEDULED_OUTDATED_TIMEOUT.ago
- )
- end
end
end
end
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 802697b66e1..ebb4e777b44 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -237,6 +237,15 @@
:weight: 1
:idempotent: true
:tags: []
+- :name: cronjob:ci_stuck_builds_drop_scheduled
+ :worker_name: Ci::StuckBuilds::DropScheduledWorker
+ :feature_category: :continuous_integration
+ :has_external_dependencies:
+ :urgency: :low
+ :resource_boundary: :unknown
+ :weight: 1
+ :idempotent: true
+ :tags: []
- :name: cronjob:container_expiration_policy
:worker_name: ContainerExpirationPolicyWorker
:feature_category: :container_registry
diff --git a/app/workers/ci/stuck_builds/drop_scheduled_worker.rb b/app/workers/ci/stuck_builds/drop_scheduled_worker.rb
new file mode 100644
index 00000000000..923841771cf
--- /dev/null
+++ b/app/workers/ci/stuck_builds/drop_scheduled_worker.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+module Ci
+ module StuckBuilds
+ class DropScheduledWorker
+ include ApplicationWorker
+ include ExclusiveLeaseGuard
+
+ idempotent!
+
+ # rubocop:disable Scalability/CronWorkerContext
+ # This is an instance-wide cleanup query, so there's no meaningful
+ # scope to consider this in the context of.
+ include CronjobQueue
+ # rubocop:enable Scalability/CronWorkerContext
+
+ data_consistency :always
+
+ feature_category :continuous_integration
+
+ def perform
+ try_obtain_lease do
+ Ci::StuckBuilds::DropScheduledService.new.execute
+ end
+ end
+
+ private
+
+ def lease_timeout
+ 30.minutes
+ end
+ end
+ end
+end
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb
index d87e866d8a7..6282c9200b1 100644
--- a/app/workers/stuck_ci_jobs_worker.rb
+++ b/app/workers/stuck_ci_jobs_worker.rb
@@ -18,6 +18,7 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
def perform
Ci::StuckBuilds::DropRunningWorker.perform_in(20.minutes)
+ Ci::StuckBuilds::DropScheduledWorker.perform_in(40.minutes)
return unless try_obtain_lease