Commit 05e809f3 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'sh-upgrade-gitlab-chronic' into 'master'

Fix cron parsing for Daylight Savings

Closes #37014

See merge request gitlab-org/gitlab!20667
parents 290ad30f 7ba6386e
...@@ -273,8 +273,8 @@ gem 'mimemagic', '~> 0.3.2' ...@@ -273,8 +273,8 @@ gem 'mimemagic', '~> 0.3.2'
gem 'fast_blank' gem 'fast_blank'
# Parse time & duration # Parse time & duration
gem 'chronic', '~> 0.10.2' gem 'gitlab-chronic', '~> 0.10.5'
gem 'gitlab_chronic_duration', '~> 0.10.6.1' gem 'gitlab_chronic_duration', '~> 0.10.6.2'
gem 'webpack-rails', '~> 0.9.10' gem 'webpack-rails', '~> 0.9.10'
gem 'rack-proxy', '~> 0.6.0' gem 'rack-proxy', '~> 0.6.0'
......
...@@ -145,7 +145,6 @@ GEM ...@@ -145,7 +145,6 @@ GEM
charlock_holmes (0.7.6) charlock_holmes (0.7.6)
childprocess (0.9.0) childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11) ffi (~> 1.0, >= 1.0.11)
chronic (0.10.2)
chunky_png (1.3.5) chunky_png (1.3.5)
citrus (3.0.2) citrus (3.0.2)
claide (1.0.3) claide (1.0.3)
...@@ -362,6 +361,8 @@ GEM ...@@ -362,6 +361,8 @@ GEM
gitaly (1.73.0) gitaly (1.73.0)
grpc (~> 1.0) grpc (~> 1.0)
github-markup (1.7.0) github-markup (1.7.0)
gitlab-chronic (0.10.5)
numerizer (~> 0.2)
gitlab-labkit (0.7.0) gitlab-labkit (0.7.0)
actionpack (>= 5.0.0, < 6.1.0) actionpack (>= 5.0.0, < 6.1.0)
activesupport (>= 5.0.0, < 6.1.0) activesupport (>= 5.0.0, < 6.1.0)
...@@ -381,8 +382,8 @@ GEM ...@@ -381,8 +382,8 @@ GEM
rubocop-gitlab-security (~> 0.1.0) rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.1.0) rubocop-performance (~> 1.1.0)
rubocop-rspec (~> 1.19) rubocop-rspec (~> 1.19)
gitlab_chronic_duration (0.10.6.1) gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.1.1) numerizer (~> 0.2)
gitlab_omniauth-ldap (2.1.1) gitlab_omniauth-ldap (2.1.1)
net-ldap (~> 0.16) net-ldap (~> 0.16)
omniauth (~> 1.3) omniauth (~> 1.3)
...@@ -630,7 +631,7 @@ GEM ...@@ -630,7 +631,7 @@ GEM
notiffany (0.1.3) notiffany (0.1.3)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
numerizer (0.1.1) numerizer (0.2.0)
oauth (0.5.4) oauth (0.5.4)
oauth2 (1.4.1) oauth2 (1.4.1)
faraday (>= 0.8, < 0.16.0) faraday (>= 0.8, < 0.16.0)
...@@ -1144,7 +1145,6 @@ DEPENDENCIES ...@@ -1144,7 +1145,6 @@ DEPENDENCIES
capybara-screenshot (~> 1.0.22) capybara-screenshot (~> 1.0.22)
carrierwave (~> 1.3) carrierwave (~> 1.3)
charlock_holmes (~> 0.7.5) charlock_holmes (~> 0.7.5)
chronic (~> 0.10.2)
commonmarker (~> 0.20) commonmarker (~> 0.20)
concurrent-ruby (~> 1.1) concurrent-ruby (~> 1.1)
connection_pool (~> 2.0) connection_pool (~> 2.0)
...@@ -1195,6 +1195,7 @@ DEPENDENCIES ...@@ -1195,6 +1195,7 @@ DEPENDENCIES
gettext_i18n_rails_js (~> 1.3) gettext_i18n_rails_js (~> 1.3)
gitaly (~> 1.73.0) gitaly (~> 1.73.0)
github-markup (~> 1.7.0) github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5)
gitlab-labkit (~> 0.5) gitlab-labkit (~> 0.5)
gitlab-license (~> 1.0) gitlab-license (~> 1.0)
gitlab-markup (~> 1.7.0) gitlab-markup (~> 1.7.0)
...@@ -1202,7 +1203,7 @@ DEPENDENCIES ...@@ -1202,7 +1203,7 @@ DEPENDENCIES
gitlab-peek (~> 0.0.1) gitlab-peek (~> 0.0.1)
gitlab-sidekiq-fetcher (= 0.5.2) gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 2.7) gitlab-styles (~> 2.7)
gitlab_chronic_duration (~> 0.10.6.1) gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1) gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2) gon (~> 6.2)
google-api-client (~> 0.23) google-api-client (~> 0.23)
......
---
title: Fix cron parsing for Daylight Savings
merge_request: 20667
author:
type: fixed
...@@ -152,6 +152,22 @@ describe Gitlab::Ci::CronParser do ...@@ -152,6 +152,22 @@ describe Gitlab::Ci::CronParser do
end end
end end
end end
context 'when time crosses a Daylight Savings boundary' do
let(:cron) { '* 0 1 12 *'}
# Note this previously only failed if the time zone is set
# to a zone that observes Daylight Savings
# (e.g. America/Chicago) at the start of the test. Stubbing
# TZ doesn't appear to be enough.
it 'generates day without TZInfo::AmbiguousTime error' do
Timecop.freeze(Time.utc(2020, 1, 1)) do
expect(subject.year).to eq(2020)
expect(subject.month).to eq(12)
expect(subject.day).to eq(1)
end
end
end
end end
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