Commit 372716ea authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'update-sidekiq-cron' into 'master'

Update sidekiq-cron 0.6.0 -> 1.0

See merge request gitlab-org/gitlab-ce!24235
parents 87f6f6f7 def2d556
...@@ -160,12 +160,12 @@ gem 'acts-as-taggable-on', '~> 5.0' ...@@ -160,12 +160,12 @@ gem 'acts-as-taggable-on', '~> 5.0'
# Background jobs # Background jobs
gem 'sidekiq', '~> 5.2.1' gem 'sidekiq', '~> 5.2.1'
gem 'sidekiq-cron', '~> 0.6.0' gem 'sidekiq-cron', '~> 1.0'
gem 'redis-namespace', '~> 1.6.0' gem 'redis-namespace', '~> 1.6.0'
gem 'gitlab-sidekiq-fetcher', '~> 0.4.0', require: 'sidekiq-reliable-fetch' gem 'gitlab-sidekiq-fetcher', '~> 0.4.0', require: 'sidekiq-reliable-fetch'
# Cron Parser # Cron Parser
gem 'rufus-scheduler', '~> 3.4' gem 'fugit', '~> 1.1'
# HTTP requests # HTTP requests
gem 'httparty', '~> 0.13.3' gem 'httparty', '~> 0.13.3'
......
...@@ -185,7 +185,7 @@ GEM ...@@ -185,7 +185,7 @@ GEM
erubi (1.7.1) erubi (1.7.1)
erubis (2.7.0) erubis (2.7.0)
escape_utils (1.2.1) escape_utils (1.2.1)
et-orbi (1.0.3) et-orbi (1.1.7)
tzinfo tzinfo
eventmachine (1.2.7) eventmachine (1.2.7)
excon (0.62.0) excon (0.62.0)
...@@ -258,6 +258,9 @@ GEM ...@@ -258,6 +258,9 @@ GEM
foreman (0.84.0) foreman (0.84.0)
thor (~> 0.19.1) thor (~> 0.19.1)
formatador (0.2.5) formatador (0.2.5)
fugit (1.1.7)
et-orbi (~> 1.1, >= 1.1.7)
raabro (~> 1.1)
fuubar (2.2.0) fuubar (2.2.0)
rspec-core (~> 3.0) rspec-core (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
...@@ -606,6 +609,7 @@ GEM ...@@ -606,6 +609,7 @@ GEM
get_process_mem (~> 0.2) get_process_mem (~> 0.2)
puma (>= 2.7, < 4) puma (>= 2.7, < 4)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
raabro (1.1.6)
rack (2.0.6) rack (2.0.6)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
...@@ -775,8 +779,6 @@ GEM ...@@ -775,8 +779,6 @@ GEM
rubyntlm (0.6.2) rubyntlm (0.6.2)
rubypants (0.2.0) rubypants (0.2.0)
rubyzip (1.2.2) rubyzip (1.2.2)
rufus-scheduler (3.4.0)
et-orbi (~> 1.0)
rugged (0.27.5) rugged (0.27.5)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sanitize (4.6.6) sanitize (4.6.6)
...@@ -820,8 +822,8 @@ GEM ...@@ -820,8 +822,8 @@ GEM
connection_pool (~> 2.2, >= 2.2.2) connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0) rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5) redis (>= 3.3.5, < 5)
sidekiq-cron (0.6.0) sidekiq-cron (1.0.4)
rufus-scheduler (>= 3.3.0) fugit (~> 1.1)
sidekiq (>= 4.2.1) sidekiq (>= 4.2.1)
signet (0.11.0) signet (0.11.0)
addressable (~> 2.3) addressable (~> 2.3)
...@@ -1003,6 +1005,7 @@ DEPENDENCIES ...@@ -1003,6 +1005,7 @@ DEPENDENCIES
fog-rackspace (~> 0.1.1) fog-rackspace (~> 0.1.1)
font-awesome-rails (~> 4.7) font-awesome-rails (~> 4.7)
foreman (~> 0.84.0) foreman (~> 0.84.0)
fugit (~> 1.1)
fuubar (~> 2.2.0) fuubar (~> 2.2.0)
gemojione (~> 3.3) gemojione (~> 3.3)
gettext (~> 3.2.2) gettext (~> 3.2.2)
...@@ -1127,7 +1130,6 @@ DEPENDENCIES ...@@ -1127,7 +1130,6 @@ DEPENDENCIES
ruby-prof (~> 0.17.0) ruby-prof (~> 0.17.0)
ruby-progressbar ruby-progressbar
ruby_parser (~> 3.8) ruby_parser (~> 3.8)
rufus-scheduler (~> 3.4)
rugged (~> 0.27) rugged (~> 0.27)
sanitize (~> 4.6) sanitize (~> 4.6)
sass (~> 3.5) sass (~> 3.5)
...@@ -1141,7 +1143,7 @@ DEPENDENCIES ...@@ -1141,7 +1143,7 @@ DEPENDENCIES
sham_rack (~> 1.3.6) sham_rack (~> 1.3.6)
shoulda-matchers (~> 3.1.2) shoulda-matchers (~> 3.1.2)
sidekiq (~> 5.2.1) sidekiq (~> 5.2.1)
sidekiq-cron (~> 0.6.0) sidekiq-cron (~> 1.0)
simple_po_parser (~> 1.1.2) simple_po_parser (~> 1.1.2)
simplecov (~> 0.14.0) simplecov (~> 0.14.0)
slack-notifier (~> 1.5.1) slack-notifier (~> 1.5.1)
......
---
title: Update sidekiq-cron to 1.0.4 and use fugit to replace rufus-scheduler to parse
cron syntax
merge_request: 24235
author:
type: other
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
> **Notes**: > **Notes**:
> - This feature was introduced in 9.1 as [Trigger Schedule][ce-10533]. > - This feature was introduced in 9.1 as [Trigger Schedule][ce-10533].
> - In 9.2, the feature was [renamed to Pipeline Schedule][ce-10853]. > - In 9.2, the feature was [renamed to Pipeline Schedule][ce-10853].
> - Cron notation is parsed by [Rufus-Scheduler](https://github.com/jmettraux/rufus-scheduler). > - Cron notation is parsed by [Fugit](https://github.com/floraison/fugit).
Pipeline schedules can be used to run a pipeline at specific intervals, for example every Pipeline schedules can be used to run a pipeline at specific intervals, for example every
month on the 22nd for a certain branch. month on the 22nd for a certain branch.
......
...@@ -35,7 +35,7 @@ module Gitlab ...@@ -35,7 +35,7 @@ module Gitlab
# NOTE: # NOTE:
# cron_timezone can only accept timezones listed in TZInfo::Timezone. # cron_timezone can only accept timezones listed in TZInfo::Timezone.
# Aliases of Timezones from ActiveSupport::TimeZone are NOT accepted, # Aliases of Timezones from ActiveSupport::TimeZone are NOT accepted,
# because Rufus::Scheduler only supports TZInfo::Timezone. # because Fugit::Cron only supports TZInfo::Timezone.
# #
# For example, those codes have the same effect. # For example, those codes have the same effect.
# Time.zone = 'Pacific Time (US & Canada)' (ActiveSupport::TimeZone) # Time.zone = 'Pacific Time (US & Canada)' (ActiveSupport::TimeZone)
...@@ -47,10 +47,7 @@ module Gitlab ...@@ -47,10 +47,7 @@ module Gitlab
# If you want to know more, please take a look # If you want to know more, please take a look
# https://github.com/rails/rails/blob/master/activesupport/lib/active_support/values/time_zone.rb # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/values/time_zone.rb
def try_parse_cron(cron, cron_timezone) def try_parse_cron(cron, cron_timezone)
cron_line = Rufus::Scheduler.parse("#{cron} #{cron_timezone}") Fugit::Cron.parse("#{cron} #{cron_timezone}")
cron_line if cron_line.is_a?(Rufus::Scheduler::CronLine)
rescue
# noop
end end
end end
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Sidekiq::Cron::Job do describe Sidekiq::Cron::Job do
describe 'cron jobs' do describe 'cron jobs' do
context 'when rufus-scheduler depends on ZoTime or EoTime' do context 'when Fugit depends on ZoTime or EoTime' do
before do before do
described_class described_class
.create(name: 'TestCronWorker', .create(name: 'TestCronWorker',
...@@ -10,7 +10,7 @@ describe Sidekiq::Cron::Job do ...@@ -10,7 +10,7 @@ describe Sidekiq::Cron::Job do
class: Settings.cron_jobs[:pipeline_schedule_worker]['job_class']) class: Settings.cron_jobs[:pipeline_schedule_worker]['job_class'])
end end
it 'does not get "Rufus::Scheduler::ZoTime/EtOrbi::EoTime into an exact number"' do it 'does not get any errors' do
expect { described_class.all.first.should_enque?(Time.now) }.not_to raise_error expect { described_class.all.first.should_enque?(Time.now) }.not_to raise_error
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment