shipit-engine 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/shipit/hook.rb +1 -1
- data/app/models/shipit/pull_request.rb +1 -1
- data/app/models/shipit/stack.rb +2 -2
- data/lib/shipit/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/models/hook_test.rb +6 -1
- data/test/models/stacks_test.rb +2 -2
- metadata +2 -4
- data/test/dummy/db/test.sqlite3-journal +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d85f27b707a0fd01fd1772e5803af8663d195b
|
4
|
+
data.tar.gz: 3f5df442e05fc1048307226080695c438fce46aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a9dbec229ef543d4e4b884c75539abf59f143d67fd068cee822c609a4fcd5232dae511215d54674064a52a912645036ed7f4bdcfeb2263343a4e57d5559965
|
7
|
+
data.tar.gz: 3a02db736fb43949135fdada6d039c32f1a810204a20152c049c775d9bc17d5de526bf783bee98d9f2f892e753cf6bd329994881282344b40079329b6aaac809
|
data/app/models/shipit/hook.rb
CHANGED
@@ -81,7 +81,7 @@ module Shipit
|
|
81
81
|
|
82
82
|
def purge_old_deliveries!(keep: DELIVERIES_LOG_SIZE)
|
83
83
|
if cut_off_time = deliveries.order(created_at: :desc).limit(1).offset(keep).pluck(:created_at).first
|
84
|
-
deliveries.where('created_at
|
84
|
+
deliveries.where('created_at <= ?', cut_off_time).delete_all
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -102,7 +102,7 @@ module Shipit
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def self.schedule_merges
|
105
|
-
Shipit::Stack.where(
|
105
|
+
Shipit::Stack.where(merge_queue_enabled: true).find_each(&:schedule_merges)
|
106
106
|
end
|
107
107
|
|
108
108
|
def self.extract_number(stack, number_or_url)
|
data/app/models/shipit/stack.rb
CHANGED
@@ -198,14 +198,14 @@ module Shipit
|
|
198
198
|
commits.reachable.first.try!(:sha)
|
199
199
|
end
|
200
200
|
|
201
|
-
def merge_status(backlog_leniency_factor:
|
201
|
+
def merge_status(backlog_leniency_factor: 2.0)
|
202
202
|
return 'locked' if locked?
|
203
203
|
return 'failure' if %w(failure error).freeze.include?(branch_status)
|
204
204
|
return 'backlogged' if backlogged?(backlog_leniency_factor: backlog_leniency_factor)
|
205
205
|
'success'
|
206
206
|
end
|
207
207
|
|
208
|
-
def backlogged?(backlog_leniency_factor:
|
208
|
+
def backlogged?(backlog_leniency_factor: 2.0)
|
209
209
|
maximum_commits_per_deploy && (undeployed_commits_count > maximum_commits_per_deploy * backlog_leniency_factor)
|
210
210
|
end
|
211
211
|
|
data/lib/shipit/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/models/hook_test.rb
CHANGED
@@ -59,9 +59,14 @@ module Shipit
|
|
59
59
|
test "#purge_old_deliveries!" do
|
60
60
|
Hook.deliver(:deploy, @stack, 'foo' => 42)
|
61
61
|
|
62
|
-
|
62
|
+
previous_ids = @hook.deliveries.order(created_at: :desc).pluck(:id)
|
63
|
+
|
64
|
+
assert_difference -> { @hook.deliveries.count }, -1 do
|
63
65
|
@hook.purge_old_deliveries!(keep: 1)
|
64
66
|
end
|
67
|
+
|
68
|
+
after_ids = @hook.deliveries.order(created_at: :desc).pluck(:id)
|
69
|
+
assert_equal previous_ids[0..-2], after_ids
|
65
70
|
end
|
66
71
|
end
|
67
72
|
end
|
data/test/models/stacks_test.rb
CHANGED
@@ -441,14 +441,14 @@ module Shipit
|
|
441
441
|
@stack.deploys_and_rollbacks.destroy_all
|
442
442
|
@stack.update_undeployed_commits_count
|
443
443
|
@stack.reload
|
444
|
-
assert_equal 'backlogged', @stack.merge_status
|
444
|
+
assert_equal 'backlogged', @stack.merge_status(backlog_leniency_factor: 1.5)
|
445
445
|
end
|
446
446
|
|
447
447
|
test "#merge_status returns success with a higher leniency factor" do
|
448
448
|
@stack.deploys_and_rollbacks.destroy_all
|
449
449
|
@stack.update_undeployed_commits_count
|
450
450
|
@stack.reload
|
451
|
-
assert_equal 'success', @stack.merge_status(backlog_leniency_factor:
|
451
|
+
assert_equal 'success', @stack.merge_status(backlog_leniency_factor: 3.0)
|
452
452
|
end
|
453
453
|
|
454
454
|
test "#handle_github_redirections update the stack if the repository was renamed" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shipit-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -782,7 +782,6 @@ files:
|
|
782
782
|
- test/dummy/db/schema.rb
|
783
783
|
- test/dummy/db/seeds.rb
|
784
784
|
- test/dummy/db/test.sqlite3
|
785
|
-
- test/dummy/db/test.sqlite3-journal
|
786
785
|
- test/dummy/public/404.html
|
787
786
|
- test/dummy/public/422.html
|
788
787
|
- test/dummy/public/500.html
|
@@ -963,7 +962,6 @@ test_files:
|
|
963
962
|
- test/dummy/db/schema.rb
|
964
963
|
- test/dummy/db/seeds.rb
|
965
964
|
- test/dummy/db/test.sqlite3
|
966
|
-
- test/dummy/db/test.sqlite3-journal
|
967
965
|
- test/dummy/public/404.html
|
968
966
|
- test/dummy/public/422.html
|
969
967
|
- test/dummy/public/500.html
|
Binary file
|