shipit-engine 0.35.1 → 0.37.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -7
  3. data/app/controllers/concerns/shipit/authentication.rb +5 -1
  4. data/app/controllers/shipit/api/base_controller.rb +13 -1
  5. data/app/controllers/shipit/api/rollbacks_controller.rb +1 -1
  6. data/app/controllers/shipit/api/stacks_controller.rb +10 -2
  7. data/app/controllers/shipit/api/tasks_controller.rb +19 -2
  8. data/app/controllers/shipit/rollbacks_controller.rb +5 -1
  9. data/app/helpers/shipit/stacks_helper.rb +11 -0
  10. data/app/models/concerns/shipit/deferred_touch.rb +3 -3
  11. data/app/models/shipit/anonymous_user.rb +4 -0
  12. data/app/models/shipit/api_client.rb +1 -1
  13. data/app/models/shipit/commit_checks.rb +3 -3
  14. data/app/models/shipit/delivery.rb +1 -1
  15. data/app/models/shipit/deploy.rb +1 -0
  16. data/app/models/shipit/deploy_spec/file_system.rb +32 -4
  17. data/app/models/shipit/pull_request.rb +1 -1
  18. data/app/models/shipit/stack.rb +10 -10
  19. data/app/models/shipit/task.rb +31 -4
  20. data/app/models/shipit/user.rb +23 -9
  21. data/app/serializers/shipit/stack_serializer.rb +1 -1
  22. data/app/views/shipit/deploys/_deploy.html.erb +1 -5
  23. data/app/views/shipit/stacks/_banners.html.erb +1 -1
  24. data/app/views/shipit/stacks/_settings_form.erb +55 -0
  25. data/app/views/shipit/stacks/settings.html.erb +1 -55
  26. data/app/views/shipit/stacks/show.html.erb +1 -1
  27. data/config/locales/en.yml +1 -1
  28. data/config/routes.rb +4 -0
  29. data/db/migrate/20211103154121_increase_github_team_slug_size.rb +5 -0
  30. data/lib/shipit/engine.rb +15 -5
  31. data/lib/shipit/stack_commands.rb +9 -2
  32. data/lib/shipit/task_commands.rb +8 -1
  33. data/lib/shipit/version.rb +1 -1
  34. data/lib/shipit.rb +55 -3
  35. data/lib/snippets/fetch-gem-version +1 -1
  36. data/test/controllers/api/hooks_controller_test.rb +1 -1
  37. data/test/controllers/api/rollback_controller_test.rb +1 -0
  38. data/test/controllers/api/stacks_controller_test.rb +34 -0
  39. data/test/controllers/api/tasks_controller_test.rb +56 -0
  40. data/test/controllers/stacks_controller_test.rb +11 -0
  41. data/test/dummy/config/application.rb +1 -2
  42. data/test/dummy/db/schema.rb +2 -2
  43. data/test/fixtures/shipit/check_runs.yml +3 -3
  44. data/test/fixtures/shipit/commits.yml +101 -101
  45. data/test/fixtures/shipit/deliveries.yml +1 -1
  46. data/test/fixtures/shipit/merge_requests.yml +19 -19
  47. data/test/fixtures/shipit/stacks.yml +28 -28
  48. data/test/fixtures/shipit/statuses.yml +16 -16
  49. data/test/fixtures/shipit/tasks.yml +77 -65
  50. data/test/fixtures/shipit/users.yml +2 -5
  51. data/test/models/commits_test.rb +6 -6
  52. data/test/models/deploy_spec_test.rb +0 -23
  53. data/test/models/deploys_test.rb +26 -0
  54. data/test/models/shipit/deploy_spec/file_system_test.rb +81 -0
  55. data/test/models/tasks_test.rb +14 -2
  56. data/test/models/team_test.rb +21 -2
  57. data/test/models/users_test.rb +29 -9
  58. data/test/unit/deploy_commands_test.rb +6 -2
  59. metadata +189 -185
@@ -97,8 +97,8 @@ shipit:
97
97
  ]
98
98
  }
99
99
  }
100
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
101
- updated_at: <%= 8.days.ago.to_s(:db) %>
100
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
101
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
102
102
 
103
103
  shipit_canaries:
104
104
  repository: shipit
@@ -156,8 +156,8 @@ shipit_canaries:
156
156
  "allow_failures": ["ci/ok_to_fail"]
157
157
  }
158
158
  }
159
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
160
- updated_at: <%= 8.days.ago.to_s(:db) %>
159
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
160
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
161
161
 
162
162
  cyclimse:
163
163
  repository: cyclimse
@@ -189,8 +189,8 @@ cyclimse:
189
189
  }
190
190
  }
191
191
  }
192
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
193
- updated_at: <%= 8.days.ago.to_s(:db) %>
192
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
193
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
194
194
 
195
195
  undeployed_stack:
196
196
  repository: foo-bar
@@ -226,7 +226,7 @@ undeployed_stack:
226
226
  "allow_failures": ["ci/ok_to_fail"]
227
227
  }
228
228
  }
229
- updated_at: <%= 8.days.ago.to_s(:db) %>
229
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
230
230
 
231
231
  soc:
232
232
  repository: soc
@@ -260,7 +260,7 @@ soc:
260
260
  "blocking": ["soc/compliance"]
261
261
  }
262
262
  }
263
- updated_at: <%= 8.days.ago.to_s(:db) %>
263
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
264
264
 
265
265
  check_runs:
266
266
  repository: check_runs
@@ -337,8 +337,8 @@ shipit_undeployed:
337
337
  "allow_failures": ["ci/ok_to_fail"]
338
338
  }
339
339
  }
340
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
341
- updated_at: <%= 8.days.ago.to_s(:db) %>
340
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
341
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
342
342
 
343
343
  shipit_single:
344
344
  repository: shipit
@@ -374,8 +374,8 @@ shipit_single:
374
374
  "blocking": ["soc/compliance"]
375
375
  }
376
376
  }
377
- updated_at: <%= 8.days.ago.to_s(:db) %>
378
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
377
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
378
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
379
379
 
380
380
  shipit_stats:
381
381
  repository: shipit
@@ -411,8 +411,8 @@ shipit_stats:
411
411
  "blocking": ["soc/compliance"]
412
412
  }
413
413
  }
414
- updated_at: <%= 8.days.ago.to_s(:db) %>
415
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
414
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
415
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
416
416
 
417
417
  shipit_task_no_commits:
418
418
  repository: shipit
@@ -466,7 +466,7 @@ shipit_task_no_commits:
466
466
  "allow_failures": ["ci/ok_to_fail"]
467
467
  }
468
468
  }
469
- updated_at: <%= 8.days.ago.to_s(:db) %>
469
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
470
470
 
471
471
  check_deploy_spec:
472
472
  repository: check_deploy_spec
@@ -478,8 +478,8 @@ check_deploy_spec:
478
478
  undeployed_commits_count: 1
479
479
  continuous_deployment: true
480
480
  cached_deploy_spec: "{}"
481
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
482
- updated_at: <%= 8.days.ago.to_s(:db) %>
481
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
482
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
483
483
 
484
484
  review_stack:
485
485
  type: Shipit::ReviewStack
@@ -581,8 +581,8 @@ review_stack:
581
581
  ]
582
582
  }
583
583
  }
584
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
585
- updated_at: <%= 8.days.ago.to_s(:db) %>
584
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
585
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
586
586
 
587
587
  archived_25hours_ago:
588
588
  type: Shipit::ReviewStack
@@ -594,9 +594,9 @@ archived_25hours_ago:
594
594
  tasks_count: 8
595
595
  undeployed_commits_count: 2
596
596
  cached_deploy_spec: "{}"
597
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
598
- updated_at: <%= 8.days.ago.to_s(:db) %>
599
- archived_since: <%= 25.hours.ago.to_s(:db) %>
597
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
598
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
599
+ archived_since: <%= 25.hours.ago.to_formatted_s(:db) %>
600
600
 
601
601
  archived_6hours_ago:
602
602
  type: Shipit::ReviewStack
@@ -608,9 +608,9 @@ archived_6hours_ago:
608
608
  tasks_count: 8
609
609
  undeployed_commits_count: 2
610
610
  cached_deploy_spec: "{}"
611
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
612
- updated_at: <%= 8.days.ago.to_s(:db) %>
613
- archived_since: <%= 6.hours.ago.to_s(:db) %>
611
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
612
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
613
+ archived_since: <%= 6.hours.ago.to_formatted_s(:db) %>
614
614
 
615
615
  archived_30minutes_ago:
616
616
  type: Shipit::ReviewStack
@@ -622,6 +622,6 @@ archived_30minutes_ago:
622
622
  tasks_count: 8
623
623
  undeployed_commits_count: 2
624
624
  cached_deploy_spec: "{}"
625
- last_deployed_at: <%= 8.days.ago.to_s(:db) %>
626
- updated_at: <%= 8.days.ago.to_s(:db) %>
627
- archived_since: <%= 30.minutes.ago.to_s(:db) %>
625
+ last_deployed_at: <%= 8.days.ago.to_formatted_s(:db) %>
626
+ updated_at: <%= 8.days.ago.to_formatted_s(:db) %>
627
+ archived_since: <%= 30.minutes.ago.to_formatted_s(:db) %>
@@ -5,7 +5,7 @@ first_pending:
5
5
  commit_id: 1 # first
6
6
  description: lets go
7
7
  context: ci/travis
8
- created_at: <%= 10.days.ago.to_s(:db) %>
8
+ created_at: <%= 10.days.ago.to_formatted_s(:db) %>
9
9
  state: pending
10
10
  target_url: "http://www.example.com"
11
11
 
@@ -14,7 +14,7 @@ second_pending_travis:
14
14
  commit_id: 2 # second
15
15
  description: lets go
16
16
  context: ci/travis
17
- created_at: <%= 10.days.ago.to_s(:db) %>
17
+ created_at: <%= 10.days.ago.to_formatted_s(:db) %>
18
18
  state: pending
19
19
  target_url: "http://www.example.com"
20
20
 
@@ -23,7 +23,7 @@ second_pending_coveralls:
23
23
  commit_id: 2 # second
24
24
  description: lets go
25
25
  context: metrics/coveralls
26
- created_at: <%= 10.days.ago.to_s(:db) %>
26
+ created_at: <%= 10.days.ago.to_formatted_s(:db) %>
27
27
  state: pending
28
28
  target_url: "http://www.example.com"
29
29
 
@@ -32,7 +32,7 @@ second_success_travis:
32
32
  commit_id: 2 # second
33
33
  description: lets go
34
34
  context: ci/travis
35
- created_at: <%= 9.days.ago.to_s(:db) %>
35
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
36
36
  state: success
37
37
  target_url: "http://www.example.com"
38
38
 
@@ -41,7 +41,7 @@ second_failure_coveralls:
41
41
  commit_id: 2 # second
42
42
  description: lets go
43
43
  context: metrics/coveralls
44
- created_at: <%= 9.days.ago.to_s(:db) %>
44
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
45
45
  state: failure
46
46
  target_url: "http://www.example.com"
47
47
 
@@ -50,7 +50,7 @@ third_success_travis:
50
50
  commit_id: 3 # third
51
51
  description: lets go
52
52
  context: ci/travis
53
- created_at: <%= 9.days.ago.to_s(:db) %>
53
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
54
54
  state: success
55
55
  target_url: "http://www.example.com"
56
56
 
@@ -59,7 +59,7 @@ third_success_coveralls:
59
59
  commit_id: 3 # third
60
60
  description: lets go
61
61
  context: metrics/coveralls
62
- created_at: <%= 9.days.ago.to_s(:db) %>
62
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
63
63
  state: success
64
64
  target_url: "http://www.example.com"
65
65
 
@@ -68,7 +68,7 @@ fourth_pending_travis:
68
68
  commit_id: 4 # fourth
69
69
  description: lets go
70
70
  context: ci/travis
71
- created_at: <%= 9.days.ago.to_s(:db) %>
71
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
72
72
  state: pending
73
73
  target_url: "http://www.example.com"
74
74
 
@@ -77,7 +77,7 @@ fourth_success_coveralls:
77
77
  commit_id: 4 # fourth
78
78
  description: lets go
79
79
  context: metrics/coveralls
80
- created_at: <%= 9.days.ago.to_s(:db) %>
80
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
81
81
  state: success
82
82
  target_url: "http://www.example.com"
83
83
 
@@ -86,7 +86,7 @@ cyclimse_success_travis:
86
86
  commit_id: 6 # cyclimse_first
87
87
  description: lets go
88
88
  context: ci/travis
89
- created_at: <%= 9.days.ago.to_s(:db) %>
89
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
90
90
  state: success
91
91
  target_url: "http://www.example.com"
92
92
 
@@ -95,7 +95,7 @@ shipit_pending_pr_success_travis:
95
95
  commit_id: 8 # shipit_pending_pr_head
96
96
  description: Super feature
97
97
  context: ci/travis
98
- created_at: <%= 9.days.ago.to_s(:db) %>
98
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
99
99
  state: success
100
100
  target_url: "http://www.example.com"
101
101
 
@@ -104,7 +104,7 @@ soc_first:
104
104
  commit_id: 101 # soc_first
105
105
  description: Woops
106
106
  context: soc/compliance
107
- created_at: <%= 9.days.ago.to_s(:db) %>
107
+ created_at: <%= 9.days.ago.to_formatted_s(:db) %>
108
108
  state: failure
109
109
  target_url: "http://www.example.com"
110
110
 
@@ -113,7 +113,7 @@ soc_second:
113
113
  commit_id: 102 # soc_second
114
114
  description: All good
115
115
  context: soc/compliance
116
- created_at: <%= 7.days.ago.to_s(:db) %>
116
+ created_at: <%= 7.days.ago.to_formatted_s(:db) %>
117
117
  state: success
118
118
  target_url: "http://www.example.com"
119
119
 
@@ -122,7 +122,7 @@ soc_third:
122
122
  commit_id: 103 # soc_third
123
123
  description: All good
124
124
  context: soc/compliance
125
- created_at: <%= 7.days.ago.to_s(:db) %>
125
+ created_at: <%= 7.days.ago.to_formatted_s(:db) %>
126
126
  state: success
127
127
  target_url: "http://www.example.com"
128
128
 
@@ -131,7 +131,7 @@ canaries_fifth_success:
131
131
  commit_id: 305
132
132
  description: All good
133
133
  context: ci/travis
134
- created_at: <%= 7.days.ago.to_s(:db) %>
134
+ created_at: <%= 7.days.ago.to_formatted_s(:db) %>
135
135
  state: success
136
136
  target_url: "http://www.example.com"
137
137
 
@@ -140,6 +140,6 @@ review_stack_commit_success:
140
140
  commit_id: 801
141
141
  description: lets go
142
142
  context: ci/travis
143
- created_at: <%= 10.days.ago.to_s(:db) %>
143
+ created_at: <%= 10.days.ago.to_formatted_s(:db) %>
144
144
  state: success
145
145
  target_url: "http://www.example.com"
@@ -8,9 +8,9 @@ shipit:
8
8
  status: success
9
9
  additions: 1
10
10
  deletions: 1
11
- created_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
12
- started_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
13
- ended_at: <%= (60 - 6).minutes.ago.to_s(:db) %>
11
+ created_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
12
+ started_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
13
+ ended_at: <%= (60 - 6).minutes.ago.to_formatted_s(:db) %>
14
14
  max_retries: 3
15
15
 
16
16
  shipit2:
@@ -23,9 +23,9 @@ shipit2:
23
23
  status: failed
24
24
  additions: 12
25
25
  deletions: 64
26
- created_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
27
- started_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
28
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
26
+ created_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
27
+ started_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
28
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
29
29
 
30
30
  shipit_restart:
31
31
  id: 3
@@ -46,9 +46,9 @@ shipit_restart:
46
46
  "cap $ENVIRONMENT deploy:restart"
47
47
  ]
48
48
  }
49
- created_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
50
- started_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
51
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
49
+ created_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
50
+ started_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
51
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
52
52
 
53
53
  shipit_pending:
54
54
  id: 4
@@ -59,7 +59,7 @@ shipit_pending:
59
59
  status: pending
60
60
  additions: 432
61
61
  deletions: 406
62
- created_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
62
+ created_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
63
63
  allow_concurrency: true
64
64
  max_retries: 1
65
65
  retry_attempt: 0
@@ -74,8 +74,8 @@ shipit_running:
74
74
  status: running
75
75
  additions: 420
76
76
  deletions: 342
77
- created_at: <%= (60 - 5).minutes.ago.to_s(:db) %>
78
- started_at: <%= (60 - 5).minutes.ago.to_s(:db) %>
77
+ created_at: <%= (60 - 5).minutes.ago.to_formatted_s(:db) %>
78
+ started_at: <%= (60 - 5).minutes.ago.to_formatted_s(:db) %>
79
79
  allow_concurrency: true
80
80
 
81
81
  shipit_complete:
@@ -88,9 +88,9 @@ shipit_complete:
88
88
  status: success
89
89
  additions: 420
90
90
  deletions: 342
91
- created_at: <%= (60 - 6).minutes.ago.to_s(:db) %>
92
- started_at: <%= (60 - 6).minutes.ago.to_s(:db) %>
93
- ended_at: <%= (60 - 8).minutes.ago.to_s(:db) %>
91
+ created_at: <%= (60 - 6).minutes.ago.to_formatted_s(:db) %>
92
+ started_at: <%= (60 - 6).minutes.ago.to_formatted_s(:db) %>
93
+ ended_at: <%= (60 - 8).minutes.ago.to_formatted_s(:db) %>
94
94
 
95
95
  shipit_aborted:
96
96
  id: 7
@@ -103,9 +103,9 @@ shipit_aborted:
103
103
  additions: 420
104
104
  deletions: 342
105
105
  rollback_once_aborted: true
106
- created_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
107
- started_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
108
- ended_at: <%= (60 - 6).minutes.ago.to_s(:db) %>
106
+ created_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
107
+ started_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
108
+ ended_at: <%= (60 - 6).minutes.ago.to_formatted_s(:db) %>
109
109
 
110
110
  shipit_rollback:
111
111
  id: 8
@@ -118,9 +118,9 @@ shipit_rollback:
118
118
  status: aborted
119
119
  additions: 420
120
120
  deletions: 342
121
- created_at: <%= (60 - 8).minutes.ago.to_s(:db) %>
122
- started_at: <%= (60 - 8).minutes.ago.to_s(:db) %>
123
- ended_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
121
+ created_at: <%= (60 - 8).minutes.ago.to_formatted_s(:db) %>
122
+ started_at: <%= (60 - 8).minutes.ago.to_formatted_s(:db) %>
123
+ ended_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
124
124
 
125
125
  soc_deploy:
126
126
  id: 9
@@ -132,9 +132,9 @@ soc_deploy:
132
132
  status: success
133
133
  additions: 1
134
134
  deletions: 1
135
- created_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
136
- started_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
137
- ended_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
135
+ created_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
136
+ started_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
137
+ ended_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
138
138
 
139
139
  shipit_rendered_failover:
140
140
  id: 10
@@ -159,9 +159,9 @@ shipit_rendered_failover:
159
159
  }
160
160
  env:
161
161
  POD_ID: "12"
162
- created_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
163
- started_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
164
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
162
+ created_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
163
+ started_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
164
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
165
165
 
166
166
  canaries_success:
167
167
  id: 101
@@ -171,9 +171,9 @@ canaries_success:
171
171
  until_commit_id: 302
172
172
  type: Shipit::Deploy
173
173
  status: success
174
- created_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
175
- started_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
176
- ended_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
174
+ created_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
175
+ started_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
176
+ ended_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
177
177
 
178
178
  canaries_faulty:
179
179
  id: 102
@@ -183,9 +183,9 @@ canaries_faulty:
183
183
  until_commit_id: 303
184
184
  type: Shipit::Deploy
185
185
  status: faulty
186
- created_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
187
- started_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
188
- ended_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
186
+ created_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
187
+ started_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
188
+ ended_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
189
189
 
190
190
  canaries_validating:
191
191
  id: 103
@@ -195,9 +195,9 @@ canaries_validating:
195
195
  until_commit_id: 304
196
196
  type: Shipit::Deploy
197
197
  status: validating
198
- created_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
199
- started_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
200
- ended_at: <%= (60 - 10).minutes.ago.to_s(:db) %>
198
+ created_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
199
+ started_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
200
+ ended_at: <%= (60 - 10).minutes.ago.to_formatted_s(:db) %>
201
201
 
202
202
  canaries_running:
203
203
  id: 104
@@ -207,9 +207,9 @@ canaries_running:
207
207
  until_commit_id: 305
208
208
  type: Shipit::Deploy
209
209
  status: running
210
- created_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
211
- started_at: <%= (60 - 7).minutes.ago.to_s(:db) %>
212
- ended_at: <%= (60 - 10).minutes.ago.to_s(:db) %>
210
+ created_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
211
+ started_at: <%= (60 - 7).minutes.ago.to_formatted_s(:db) %>
212
+ ended_at: <%= (60 - 10).minutes.ago.to_formatted_s(:db) %>
213
213
 
214
214
  shipit_with_title_parsing_issue:
215
215
  id: 105
@@ -234,9 +234,9 @@ shipit_with_title_parsing_issue:
234
234
  }
235
235
  env:
236
236
  POD_ID: "12"
237
- created_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
238
- started_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
239
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
237
+ created_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
238
+ started_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
239
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
240
240
 
241
241
  shipit_undeployed_1:
242
242
  id: 201
@@ -248,9 +248,9 @@ shipit_undeployed_1:
248
248
  status: success
249
249
  additions: 1
250
250
  deletions: 1
251
- created_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
252
- started_at: <%= (60 - 1).minutes.ago.to_s(:db) %>
253
- ended_at: <%= (60 - 3).minutes.ago.to_s(:db) %>
251
+ created_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
252
+ started_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
253
+ ended_at: <%= (60 - 3).minutes.ago.to_formatted_s(:db) %>
254
254
 
255
255
  shipit_undeployed_2:
256
256
  id: 202
@@ -262,9 +262,9 @@ shipit_undeployed_2:
262
262
  status: running
263
263
  additions: 12
264
264
  deletions: 64
265
- created_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
266
- started_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
267
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
265
+ created_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
266
+ started_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
267
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
268
268
 
269
269
  shipit_single:
270
270
  id: 301
@@ -276,9 +276,9 @@ shipit_single:
276
276
  status: running
277
277
  additions: 12
278
278
  deletions: 64
279
- created_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
280
- started_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
281
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
279
+ created_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
280
+ started_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
281
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
282
282
 
283
283
  shipit_stats:
284
284
  id: 401
@@ -290,9 +290,9 @@ shipit_stats:
290
290
  status: success
291
291
  additions: 12
292
292
  deletions: 64
293
- created_at: <%= 60.minutes.ago.to_s(:db) %>
294
- started_at: <%= 60.minutes.ago.to_s(:db) %>
295
- ended_at: <%= (60 - 4).minutes.ago.to_s(:db) %>
293
+ created_at: <%= 60.minutes.ago.to_formatted_s(:db) %>
294
+ started_at: <%= 60.minutes.ago.to_formatted_s(:db) %>
295
+ ended_at: <%= (60 - 4).minutes.ago.to_formatted_s(:db) %>
296
296
 
297
297
  shipit_stats_2:
298
298
  id: 402
@@ -304,9 +304,9 @@ shipit_stats_2:
304
304
  status: failed
305
305
  additions: 12
306
306
  deletions: 64
307
- created_at: <%= (60 - 5).minutes.ago.to_s(:db) %>
308
- started_at: <%= (60 - 5).minutes.ago.to_s(:db) %>
309
- ended_at: <%= (60 - 11).minutes.ago.to_s(:db) %>
307
+ created_at: <%= (60 - 5).minutes.ago.to_formatted_s(:db) %>
308
+ started_at: <%= (60 - 5).minutes.ago.to_formatted_s(:db) %>
309
+ ended_at: <%= (60 - 11).minutes.ago.to_formatted_s(:db) %>
310
310
 
311
311
  shipit_stats_3:
312
312
  id: 403
@@ -318,9 +318,9 @@ shipit_stats_3:
318
318
  status: success
319
319
  additions: 12
320
320
  deletions: 64
321
- created_at: <%= (60 - 10).minutes.ago.to_s(:db) %>
322
- started_at: <%= (60 - 12).minutes.ago.to_s(:db) %>
323
- ended_at: <%= (60 - 15).minutes.ago.to_s(:db) %>
321
+ created_at: <%= (60 - 10).minutes.ago.to_formatted_s(:db) %>
322
+ started_at: <%= (60 - 12).minutes.ago.to_formatted_s(:db) %>
323
+ ended_at: <%= (60 - 15).minutes.ago.to_formatted_s(:db) %>
324
324
 
325
325
  shipit_stats_4:
326
326
  id: 404
@@ -332,9 +332,9 @@ shipit_stats_4:
332
332
  status: success
333
333
  additions: 12
334
334
  deletions: 64
335
- created_at: <%= (30 - 15).minutes.ago.to_s(:db) %>
336
- started_at: <%= (30 - 15).minutes.ago.to_s(:db) %>
337
- ended_at: <%= (30 - 17).minutes.ago.to_s(:db) %>
335
+ created_at: <%= (30 - 15).minutes.ago.to_formatted_s(:db) %>
336
+ started_at: <%= (30 - 15).minutes.ago.to_formatted_s(:db) %>
337
+ ended_at: <%= (30 - 17).minutes.ago.to_formatted_s(:db) %>
338
338
 
339
339
  shipit_nocommit_task:
340
340
  id: 501
@@ -342,5 +342,17 @@ shipit_nocommit_task:
342
342
  type: Shipit::Task
343
343
  stack: shipit_task_no_commits
344
344
  status: pending
345
- created_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
346
- started_at: <%= (60 - 2).minutes.ago.to_s(:db) %>
345
+ created_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
346
+ started_at: <%= (60 - 2).minutes.ago.to_formatted_s(:db) %>
347
+
348
+ shipit_legacy_yaml_task:
349
+ id: 502
350
+ user: walrus
351
+ type: Shipit::Task
352
+ stack: shipit_task_no_commits
353
+ status: pending
354
+ created_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
355
+ started_at: <%= (60 - 1).minutes.ago.to_formatted_s(:db) %>
356
+ env: |
357
+ --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
358
+ POD_ID: '12'
@@ -2,15 +2,13 @@ walrus:
2
2
  name: Lando Walrussian
3
3
  email: walrus@shopify.com
4
4
  login: walrus
5
- encrypted_github_access_token: "ffHk4diyVKppJGfwfJefMizxF45H\n" # t0k3n
6
- encrypted_github_access_token_iv: "gRSldoTZ+fmrIDoY\n"
5
+ encrypted_github_access_token: '{"p":"Ak5D+/jUFz3e","h":{"iv":"dwwXJyB7F7fWqviI","at":"NQ4U3zu9ijCrZ/iGmZBQtg=="}}' # ghu_t0k3n
7
6
 
8
7
  codertocat:
9
8
  name: Coding Cat
10
9
  email: coding@cat.com
11
10
  login: Codertocat
12
- encrypted_github_access_token: "ffHk4diyVKppJGfwfJefMizxF45H\n" # t0k3n
13
- encrypted_github_access_token_iv: "gRSldoTZ+fmrIDoY\n"
11
+ encrypted_github_access_token: '{"p":"Ak5D+/jUFz3e","h":{"iv":"dwwXJyB7F7fWqviI","at":"NQ4U3zu9ijCrZ/iGmZBQtg=="}}' # ghu_t0k3n
14
12
 
15
13
  bob:
16
14
  name: Bob the Builder
@@ -33,4 +31,3 @@ legacy:
33
31
  email: legacy@shopify.com
34
32
  login: legacy
35
33
  encrypted_github_access_token: FuQv9jpHmMZ8Px64xmqASJtKlefv # t0k3n
36
- encrypted_github_access_token_iv: "QNS4smChXEXtOjxb\n"
@@ -618,7 +618,7 @@ module Shipit
618
618
  unless initial_state == 'unknown'
619
619
  attrs = initial_status_attributes.merge(
620
620
  stack_id: commit.stack_id,
621
- created_at: 10.days.ago.to_s(:db),
621
+ created_at: 10.days.ago.to_formatted_s(:db),
622
622
  )
623
623
  commit.statuses.create!(attrs)
624
624
  end
@@ -626,7 +626,7 @@ module Shipit
626
626
 
627
627
  expected_status_attributes = { state: new_state, description: initial_state, context: 'ci/travis' }
628
628
  add_status = lambda do
629
- attrs = expected_status_attributes.merge(created_at: 1.day.ago.to_s(:db))
629
+ attrs = expected_status_attributes.merge(created_at: 1.day.ago.to_formatted_s(:db))
630
630
  commit.create_status_from_github!(OpenStruct.new(attrs))
631
631
  end
632
632
  expect_hook_emit(commit, :commit_status, expected_status_attributes) do
@@ -651,7 +651,7 @@ module Shipit
651
651
  state: 'failure',
652
652
  description: 'Sad',
653
653
  context: 'ci/hidden',
654
- created_at: 1.day.ago.to_s(:db),
654
+ created_at: 1.day.ago.to_formatted_s(:db),
655
655
  )
656
656
  commit.create_status_from_github!(github_status)
657
657
  end
@@ -668,7 +668,7 @@ module Shipit
668
668
  state: 'failure',
669
669
  description: 'Sad',
670
670
  context: 'ci/ok_to_fail',
671
- created_at: 1.day.ago.to_s(:db),
671
+ created_at: 1.day.ago.to_formatted_s(:db),
672
672
  )
673
673
  commit.create_status_from_github!(github_status)
674
674
  end
@@ -683,7 +683,7 @@ module Shipit
683
683
  state: 'failure',
684
684
  description: 'Sad',
685
685
  context: 'ci/travis',
686
- created_at: 1.day.ago.to_s(:db),
686
+ created_at: 1.day.ago.to_formatted_s(:db),
687
687
  )
688
688
  commit.create_status_from_github!(github_status)
689
689
  end
@@ -695,7 +695,7 @@ module Shipit
695
695
  state: 'success',
696
696
  description: 'Cool',
697
697
  context: 'metrics/coveralls',
698
- created_at: 1.day.ago.to_s(:db),
698
+ created_at: 1.day.ago.to_formatted_s(:db),
699
699
  )
700
700
 
701
701
  assert_equal 'failure', commit.state
@@ -286,29 +286,6 @@ module Shipit
286
286
  assert_equal({ 'GLOBAL' => '1' }, @spec.machine_env)
287
287
  end
288
288
 
289
- test '#load_config can grab the env-specific shipit.yml file' do
290
- config = {}
291
- config.expects(:exist?).returns(true)
292
- config.expects(:read).returns({ 'dependencies' => { 'override' => %w(foo bar baz) } }.to_yaml)
293
- spec = DeploySpec::FileSystem.new('.', 'staging')
294
- spec.expects(:file).with('shipit.staging.yml', root: true).returns(config)
295
- assert_equal %w(foo bar baz), spec.dependencies_steps
296
- end
297
-
298
- test '#load_config grabs the global shipit.yml file if there is no env-specific file' do
299
- not_config = {}
300
- not_config.expects(:exist?).returns(false)
301
-
302
- config = {}
303
- config.expects(:exist?).returns(true)
304
- config.expects(:read).returns({ 'dependencies' => { 'override' => %w(foo bar baz) } }.to_yaml)
305
-
306
- spec = DeploySpec::FileSystem.new('.', 'staging')
307
- spec.expects(:file).with('shipit.staging.yml', root: true).returns(not_config)
308
- spec.expects(:file).with('shipit.yml', root: true).returns(config)
309
- assert_equal %w(foo bar baz), spec.dependencies_steps
310
- end
311
-
312
289
  test '#gemspec gives the path of the repo gemspec if present' do
313
290
  spec = DeploySpec::FileSystem.new('foobar/', 'production')
314
291
  Dir.expects(:[]).with('foobar/*.gemspec').returns(['foobar/foobar.gemspec'])