shipit-engine 0.44.3 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,6 @@ module Shipit
10
10
  end
11
11
  end
12
12
 
13
- PRESENCE_CHECK_TIMEOUT = 30
14
13
  ACTIVE_STATUSES = %w[pending running aborting].freeze
15
14
  COMPLETED_STATUSES = %w[success flapping faulty validating].freeze
16
15
  UNSUCCESSFUL_STATUSES = %w[error failed aborted flapping timedout faulty].freeze
@@ -327,7 +326,7 @@ module Shipit
327
326
  end
328
327
 
329
328
  def ping
330
- Shipit.redis.set(status_key, 'alive', ex: PRESENCE_CHECK_TIMEOUT)
329
+ Shipit.redis.set(status_key, 'alive', ex: Shipit.presence_check_timeout)
331
330
  end
332
331
 
333
332
  def alive?
@@ -335,7 +334,7 @@ module Shipit
335
334
  end
336
335
 
337
336
  def report_dead!
338
- write("ERROR: Background job hasn't reported back in #{PRESENCE_CHECK_TIMEOUT} seconds.")
337
+ write("ERROR: Background job hasn't reported back in #{Shipit.presence_check_timeout} seconds.")
339
338
  error!
340
339
  end
341
340
 
@@ -2,7 +2,6 @@
2
2
  <html>
3
3
  <head>
4
4
  <%= stylesheet_link_tag *(params[:stylesheets] || []).select { |url| url.start_with?('https://assets-cdn.github.com/', 'https://github.githubassets.com/') } %>
5
- <%= stylesheet_link_tag 'merge_status' %>
6
5
  </head>
7
6
  <body data-color-mode="<%= params[:mode] %>">
8
7
  <div class="merge-status-container" data-layout-content><%= yield %></div>
data/lib/shipit/engine.rb CHANGED
@@ -31,7 +31,6 @@ module Shipit
31
31
  shipit.js
32
32
  shipit.css
33
33
  merge_status.js
34
- merge_status.css
35
34
  ]
36
35
  app.config.assets.precompile << proc do |path|
37
36
  path =~ %r{\Aplugins/[-\w]+\.(js|css)\Z}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shipit
4
- VERSION = '0.44.3'
4
+ VERSION = '0.45.1'
5
5
  end
data/lib/shipit.rb CHANGED
@@ -8,7 +8,6 @@ require 'responders'
8
8
  require 'explicit-parameters'
9
9
  require 'paquito'
10
10
 
11
- require 'sass-rails'
12
11
  require 'coffee-rails'
13
12
  require 'jquery-rails'
14
13
  require 'rails-timeago'
@@ -92,6 +91,14 @@ module Shipit
92
91
  ENV['SHIPIT_ENABLE_SAMESITE_NONE'].present?
93
92
  end
94
93
 
94
+ def presence_check_timeout
95
+ raw = ENV.fetch('SHIPIT_PRESENCE_CHECK_TIMEOUT', '30')
96
+ timeout = Integer(raw)
97
+ raise ArgumentError, "SHIPIT_PRESENCE_CHECK_TIMEOUT must be a positive integer, got #{raw.inspect}" if timeout <= 0
98
+
99
+ timeout
100
+ end
101
+
95
102
  def app_name
96
103
  @app_name ||= secrets.app_name || Rails.application.class.name.split(':').first || 'Shipit'
97
104
  end
@@ -30,6 +30,40 @@ module Shipit
30
30
  assert_equal(['shopify/developers'], Shipit.github_teams.map(&:handle))
31
31
  end
32
32
 
33
+ test ".presence_check_timeout defaults to 30" do
34
+ assert_equal 30, Shipit.presence_check_timeout
35
+ end
36
+
37
+ test ".presence_check_timeout returns the configured value from ENV" do
38
+ ENV['SHIPIT_PRESENCE_CHECK_TIMEOUT'] = '120'
39
+ assert_equal 120, Shipit.presence_check_timeout
40
+ ensure
41
+ ENV.delete('SHIPIT_PRESENCE_CHECK_TIMEOUT')
42
+ end
43
+
44
+ test ".presence_check_timeout raises on non-numeric string" do
45
+ ENV['SHIPIT_PRESENCE_CHECK_TIMEOUT'] = 'abc'
46
+ assert_raises(ArgumentError) { Shipit.presence_check_timeout }
47
+ ensure
48
+ ENV.delete('SHIPIT_PRESENCE_CHECK_TIMEOUT')
49
+ end
50
+
51
+ test ".presence_check_timeout raises on zero" do
52
+ ENV['SHIPIT_PRESENCE_CHECK_TIMEOUT'] = '0'
53
+ error = assert_raises(ArgumentError) { Shipit.presence_check_timeout }
54
+ assert_match(/must be a positive integer/, error.message)
55
+ ensure
56
+ ENV.delete('SHIPIT_PRESENCE_CHECK_TIMEOUT')
57
+ end
58
+
59
+ test ".presence_check_timeout raises on negative value" do
60
+ ENV['SHIPIT_PRESENCE_CHECK_TIMEOUT'] = '-5'
61
+ error = assert_raises(ArgumentError) { Shipit.presence_check_timeout }
62
+ assert_match(/must be a positive integer/, error.message)
63
+ ensure
64
+ ENV.delete('SHIPIT_PRESENCE_CHECK_TIMEOUT')
65
+ end
66
+
33
67
  class RedisTest < self
34
68
  setup do
35
69
  @client = mock(:client)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipit-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.3
4
+ version: 0.45.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
@@ -303,20 +303,6 @@ dependencies:
303
303
  - - "~>"
304
304
  - !ruby/object:Gem::Version
305
305
  version: 1.0.4
306
- - !ruby/object:Gem::Dependency
307
- name: sass-rails
308
- requirement: !ruby/object:Gem::Requirement
309
- requirements:
310
- - - ">="
311
- - !ruby/object:Gem::Version
312
- version: '5.0'
313
- type: :runtime
314
- prerelease: false
315
- version_requirements: !ruby/object:Gem::Requirement
316
- requirements:
317
- - - ">="
318
- - !ruby/object:Gem::Version
319
- version: '5.0'
320
306
  - !ruby/object:Gem::Dependency
321
307
  name: securecompare
322
308
  requirement: !ruby/object:Gem::Requirement
@@ -448,26 +434,7 @@ files:
448
434
  - app/assets/javascripts/task/sidebar.js.coffee
449
435
  - app/assets/javascripts/task/stream.js.coffee
450
436
  - app/assets/javascripts/task/tty.js.coffee
451
- - app/assets/stylesheets/_base/_banner.scss
452
- - app/assets/stylesheets/_base/_base.scss
453
- - app/assets/stylesheets/_base/_buttons.scss
454
- - app/assets/stylesheets/_base/_colors.scss
455
- - app/assets/stylesheets/_base/_forms.scss
456
- - app/assets/stylesheets/_base/_icons.scss
457
- - app/assets/stylesheets/_base/_media-queries.scss
458
- - app/assets/stylesheets/_base/_spacing.scss
459
- - app/assets/stylesheets/_base/_status-items.scss
460
- - app/assets/stylesheets/_base/_utility.scss
461
- - app/assets/stylesheets/_pages/_commits.scss
462
- - app/assets/stylesheets/_pages/_deploy.scss
463
- - app/assets/stylesheets/_pages/_repositories.scss
464
- - app/assets/stylesheets/_pages/_settings.scss
465
- - app/assets/stylesheets/_pages/_stacks.scss
466
- - app/assets/stylesheets/_structure/_layout.scss
467
- - app/assets/stylesheets/_structure/_main.scss
468
- - app/assets/stylesheets/_structure/_navigation.scss
469
- - app/assets/stylesheets/merge_status.scss
470
- - app/assets/stylesheets/shipit.scss
437
+ - app/assets/stylesheets/shipit.css.erb
471
438
  - app/assets/webfonts/CheckoutSymbols-Regular.eot
472
439
  - app/assets/webfonts/CheckoutSymbols-Regular.svg
473
440
  - app/assets/webfonts/CheckoutSymbols-Regular.ttf
@@ -1,74 +0,0 @@
1
- // =============================================================================
2
- // BANNERS
3
- // =============================================================================
4
-
5
- .banner {
6
- background: $blue;
7
- padding: 1.75rem 0;
8
- position: relative;
9
-
10
- a {
11
- color: #fff;
12
- }
13
-
14
- .icon {
15
- background-color: #fff;
16
- }
17
- }
18
-
19
- .banner__inner {
20
- display: flex;
21
- align-items: center;
22
- }
23
-
24
- .banner__title {
25
- color: #fff;
26
- margin-bottom: .5rem;
27
- }
28
-
29
- .banner__text {
30
- color: rgba(#000, .6);
31
- line-height: 1.3em;
32
- margin-bottom: 0;
33
- }
34
-
35
- .banner__btn {
36
- margin-top: 1rem;
37
-
38
- .banner__accessory & {
39
- margin-top: 0;
40
- }
41
- }
42
-
43
- .banner__dismiss {
44
- color: rgba(#000, .5);
45
- font-size: 1.25rem;
46
- position: absolute;
47
- right: 0;
48
- top: 0;
49
- padding: .5em .75em;
50
- }
51
-
52
- .banner__content {
53
- flex-grow: 1;
54
- }
55
-
56
- .banner__accessory {
57
- flex-shrink: 0;
58
- }
59
-
60
-
61
- // BANNER COLORS
62
- // -----------------------------------------------------------------------------
63
-
64
- .banner--orange {
65
- background: $orange;
66
- }
67
-
68
- .banner--blue {
69
- background: $banner-blue;
70
- }
71
-
72
- .banner--red {
73
- background: $banner-red;
74
- }
@@ -1,249 +0,0 @@
1
- // =============================================================================
2
- // BASE
3
- // =============================================================================
4
-
5
- $border-radius: 4px;
6
-
7
- @mixin clearfix {
8
- &:after {
9
- content:"";
10
- display:table;
11
- clear:both;
12
- }
13
- }
14
-
15
- @mixin truncate {
16
- text-overflow: ellipsis;
17
- white-space: nowrap;
18
- overflow: hidden;
19
- }
20
-
21
- @mixin disabled {
22
- background: transparent;
23
- border: 1px solid rgba(#ccc,.7);
24
- color: #ccc;
25
- pointer-events: none;
26
- }
27
-
28
- @mixin failure {
29
- color: $red;
30
- border-color: $red;
31
- }
32
-
33
- @mixin flexbox() {
34
- display: -webkit-box;
35
- display: -moz-box;
36
- display: -ms-flexbox;
37
- display: -webkit-flex;
38
- display: flex;
39
- }
40
-
41
- @mixin flex-direction($direction) {
42
- -webkit-flex-direction: $direction;
43
- -ms-flex-direction: $direction;
44
- flex-direction: $direction;
45
- }
46
-
47
- @mixin flex($values) {
48
- -webkit-box-flex: $values;
49
- -moz-box-flex: $values;
50
- -webkit-flex: $values;
51
- -ms-flex: $values;
52
- flex: $values;
53
- }
54
-
55
- @mixin order($val) {
56
- -webkit-box-ordinal-group: $val;
57
- -moz-box-ordinal-group: $val;
58
- -ms-flex-order: $val;
59
- -webkit-order: $val;
60
- order: $val;
61
- }
62
-
63
- @mixin keyframes($name) {
64
- @-webkit-keyframes #{$name} {
65
- @content;
66
- }
67
- @-moz-keyframes #{$name} {
68
- @content;
69
- }
70
- @-ms-keyframes #{$name} {
71
- @content;
72
- }
73
- @keyframes #{$name} {
74
- @content;
75
- }
76
- }
77
-
78
- @-webkit-keyframes rotate {
79
- 0% { -webkit-transform: rotate(0); }
80
- 100% { -webkit-transform: rotate(360deg); }
81
- }
82
-
83
- ::selection {
84
- background: $blue;
85
- color: #fff;
86
- }
87
-
88
- body {
89
- padding: 0; margin: 0;
90
- font-family: "Helvetica Neue", sans-serif;
91
- color: #333;
92
- background-color: #fafafa;
93
- -webkit-font-smoothing: subpixel-antialiased;
94
- }
95
-
96
-
97
- // Paragraphs
98
- p {
99
- margin: 0;
100
- margin-bottom: 1.5em;
101
- }
102
-
103
- // Links
104
-
105
- a {
106
- text-decoration: none;
107
- cursor: pointer;
108
- color: $blue;
109
-
110
- &.disabled {
111
- cursor: default;
112
- }
113
- }
114
-
115
- .more {
116
- &:after {
117
- content: " >";
118
- font-family: "Checkout Symbols";
119
- }
120
- }
121
-
122
- // Headings
123
-
124
- h1 {
125
- font-size: 1.75rem;
126
- font-weight: 400;
127
- margin: 0;
128
- color: #333;
129
- }
130
-
131
- h2 {
132
- font-size: 1.25rem;
133
- font-weight: 400;
134
- margin: 0;
135
- }
136
-
137
- h4 {
138
- color: rgba(#fff, 0.25);
139
- text-transform: uppercase;
140
- font-size: .75rem;
141
- font-weight: 400;
142
- margin: -1rem 0 1.5rem;
143
- }
144
-
145
- h5 {
146
- font-size: 1rem;
147
- margin: 0; margin-bottom: .5rem;
148
- }
149
-
150
- [data-tooltip], [data-tooltip-multiline] { // Add this attribute to the element that needs a tooltip
151
- position: relative;
152
- cursor: pointer;
153
- -webkit-transform: translate3d(0,0,0);
154
-
155
- &:before, &:after { // Hide the tooltip content by default
156
- visibility: hidden;
157
- pointer-events: none;
158
- z-index: 200;
159
- opacity: 0;
160
- -webkit-transform: translate3d(0,0,0);
161
- }
162
-
163
- &:hover:before, &:hover:after { // Show tooltip content on hover
164
- visibility: visible;
165
- opacity: 1;
166
- }
167
-
168
- &:before { // Position tooltip above the element
169
- content: attr(data-tooltip);
170
- box-sizing: border-box;
171
- position: absolute; bottom: 120%; left: 50%;
172
- margin-bottom: 5px; padding: .75em 1em;
173
-
174
- border-radius: 5px;
175
- background: #333; background: rgba(68, 68, 68, 0.9);
176
- font-size: 12px; font-style: normal; font-weight: normal;
177
- line-height: 1.4em;
178
- text-align: center;
179
- color: #fff;
180
- text-indent: 0;
181
-
182
- }
183
-
184
- &:after { // Triangle hack to make tooltip look like a speech bubble
185
- content: " ";
186
- position: absolute; bottom: 120%; left: 50%;
187
- margin-left: -7px;
188
- width: 0;
189
- border-top: 5px solid #333; border-top: 5px solid rgba(68, 68, 68, 0.9);
190
- border-right: 7px solid transparent; border-left: 7px solid transparent;
191
- font-size: 0;
192
- line-height: 0;
193
- }
194
-
195
- }
196
-
197
- [data-tooltip-multiline] {
198
- &:before {
199
- width: 180px;
200
- margin-left: -90px;
201
- white-space: normal;
202
- }
203
- }
204
-
205
- [data-tooltip] {
206
- &:before {
207
- white-space: nowrap;
208
- -webkit-transform: translateX(-50%);
209
- }
210
- }
211
-
212
- a.disabled {
213
- cursor: default;
214
- }
215
-
216
- @font-face {
217
- font-family: 'Checkout Symbols';
218
- font-weight: 400;
219
- src: asset-url('CheckoutSymbols-Regular.eot'); /* IE9 Compat Modes */
220
- src: asset-url('CheckoutSymbols-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
221
- asset-url('CheckoutSymbols-Regular.woff') format('woff'), /* Modern Browsers */
222
- asset-url('CheckoutSymbols-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
223
- asset-url('CheckoutSymbols-Regular.svg#9a6d998e14a2d97b6369d42f64b6816f') format('svg'); /* Legacy iOS */
224
- font-style: normal;
225
- }
226
-
227
- .hidden {
228
- display: none;
229
- }
230
-
231
-
232
- .flash {
233
- transform: translateX(-50%);
234
- left: 50%;
235
- position: fixed;
236
- padding: 1em;
237
- border-radius: 4px;
238
- min-width: 30%;
239
- text-align: center;
240
- z-index: 1;
241
- }
242
-
243
- .flash-success {
244
- background-color: #E2F1FF;
245
- }
246
-
247
- .flash-warning {
248
- background-color: orange;
249
- }
@@ -1,62 +0,0 @@
1
- // =============================================================================
2
- // BUTTONS
3
- // =============================================================================
4
-
5
- .btn {
6
- display: inline-block;
7
- font-family: inherit;
8
- background: #fff;
9
- color: $blue;
10
- padding: .75em 1em;
11
- font-size: 14px;
12
- border-radius: 4px;
13
- cursor: pointer;
14
- border: none;
15
- box-shadow: 0 0 0 1px rgba(#000, 0.15);
16
- }
17
-
18
- .btn--primary {
19
- background-color: $blue;
20
- color: #fff;
21
- box-shadow: none;
22
-
23
- &.btn--disabled {
24
- box-shadow: 0 0 0 1px rgba(#000, 0.15);
25
- }
26
-
27
- &.btn--warning {
28
- background-color: $yellow;
29
- }
30
- }
31
-
32
- .btn--disabled {
33
- color: $grey;
34
- background-color: #fafafa;
35
- cursor: default;
36
- }
37
-
38
- .btn--delete {
39
- color: #fff;
40
- border: none;
41
- background-color: $bright-red;
42
-
43
- &.btn-disabled {
44
- color: $grey;
45
- background-color: $light-red;
46
- }
47
- }
48
-
49
- .btn--alert {
50
- color: #fff;
51
- background-color: $orange;
52
-
53
- &.btn-disabled {
54
- color: $grey;
55
- background-color: $light-orange;
56
- }
57
- }
58
-
59
- .btn--large {
60
- font-size: 1rem;
61
- padding: 1em 1.25em;
62
- }
@@ -1,19 +0,0 @@
1
- // =============================================================================
2
- // COLORS
3
- // =============================================================================
4
-
5
- $banner-blue: #96A9BA;
6
- $banner-red: #EE6A6A;
7
- $blue: #248AF2;
8
- $green: #25C351;
9
- $red: #F39494;
10
- $bright-red: #F73B3B;
11
- $light-red: #ffd9d6;
12
- $yellow: #FFC66C;
13
- $dark-yellow: #CEA61B;
14
- $orange: #FFAD4C;
15
- $light-orange: #ffebcc;
16
- $slate: #2E343A;
17
- $terminal-black: #272C30;
18
- $grey: #999;
19
- $grey-light: #e0e0e0;
@@ -1,48 +0,0 @@
1
- // =============================================================================
2
- // FORMS
3
- // =============================================================================
4
-
5
- form + form {
6
- margin-top: 1rem;
7
- }
8
-
9
- input[type=text], input[type=password], select, textarea {
10
- display: block;
11
- font-size: .875rem;
12
- border-radius: 4px;
13
- border: 1px solid rgba(#000, .15);
14
- padding: .75rem;
15
- width: 100%;
16
- max-width: 600px;
17
-
18
- label + & {
19
- margin-top: .75rem;
20
- }
21
- }
22
-
23
- textarea {
24
- height: 6rem;
25
- }
26
-
27
- .field-wrapper {
28
- margin-bottom: 1.5rem;
29
- input:focus {
30
- border-color: $blue;
31
- }
32
- &.inline {
33
- input {
34
- &.btn {
35
- height: 2.5rem;
36
- }
37
- display: inline;
38
- &:focus {
39
- padding-right: 30px;
40
- }
41
- }
42
- }
43
- }
44
-
45
- .field_with_errors {
46
- border: 1px solid $red;
47
- display: inline-block;
48
- }
@@ -1,26 +0,0 @@
1
- .icon--lock {
2
- display: inline-block;
3
- background-color: #000;
4
- mask: asset-data-url("lock.svg") no-repeat 50% 50%;
5
- // background: asset-data-url("lock.svg") center center no-repeat;
6
- height: 15px;
7
- width: 12px;
8
- }
9
-
10
- .icon--validate {
11
- display: inline-block;
12
- background-color: #000;
13
- mask: asset-data-url("success-small.svg") no-repeat 50% 50%;
14
- // background: asset-data-url("lock.svg") center center no-repeat;
15
- height: 15px;
16
- width: 12px;
17
- }
18
-
19
- .icon--reject {
20
- display: inline-block;
21
- background-color: #000;
22
- mask: asset-data-url("error-small.svg") no-repeat 50% 50%;
23
- // background: asset-data-url("lock.svg") center center no-repeat;
24
- height: 15px;
25
- width: 12px;
26
- }
@@ -1,17 +0,0 @@
1
- $mobile: 600px;
2
- $tablet: 800px;
3
- $desktop: 1000px;
4
-
5
- $media-queries: (
6
- mobile: "(max-width: #{$mobile - 1})",
7
- tablet-down: "(max-width: #{$desktop - 1})",
8
- tablet: "(min-width: #{$mobile} and max-width: #{$tablet - 1})",
9
- tablet-up: "(min-width: #{$tablet})",
10
- desktop: "(min-width: #{$desktop})"
11
- );
12
-
13
- @mixin media($key) {
14
- @media #{map-get($media-queries, $key)} {
15
- @content;
16
- }
17
- }
@@ -1,21 +0,0 @@
1
- $spacing-data: (
2
- tight: 0.75rem,
3
- base: 1rem,
4
- loose: 1.5rem
5
- );
6
-
7
- /// Returns the spacing value for a given variant.
8
- ///
9
- /// @param {String} $variant - The key for the given variant.
10
- /// @return {Number} The spacing for the variant.
11
-
12
- @function spacing($variant: base) {
13
- $fetched-value: map-get($spacing-data, $variant);
14
-
15
- @if type-of($fetched-value) == number {
16
- @return $fetched-value;
17
- } @else {
18
- @error 'Spacing variant `#{$variant}` not found. Available variants: #{available-names($spacing-data)}';
19
- }
20
- }
21
-