shipit-engine 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -1
  3. data/app/assets/javascripts/shipit/page_updater.js.coffee +63 -0
  4. data/app/assets/javascripts/shipit/stacks.js.coffee +9 -21
  5. data/app/assets/stylesheets/_base/_base.scss +2 -2
  6. data/app/assets/stylesheets/_base/_colors.scss +0 -1
  7. data/app/assets/stylesheets/_base/_forms.scss +14 -0
  8. data/app/assets/stylesheets/_pages/_commits.scss +16 -6
  9. data/app/assets/stylesheets/_pages/_settings.scss +8 -0
  10. data/app/assets/stylesheets/_pages/_stacks.scss +1 -1
  11. data/app/controllers/shipit/api/base_controller.rb +7 -3
  12. data/app/controllers/shipit/api/ccmenu_controller.rb +33 -0
  13. data/app/controllers/shipit/api/pull_requests_controller.rb +36 -0
  14. data/app/controllers/shipit/api/stacks_controller.rb +1 -0
  15. data/app/controllers/shipit/ccmenu_url_controller.rb +22 -0
  16. data/app/controllers/shipit/pull_requests_controller.rb +30 -0
  17. data/app/controllers/shipit/stacks_controller.rb +7 -2
  18. data/app/controllers/shipit/webhooks_controller.rb +1 -2
  19. data/app/helpers/shipit/github_url_helper.rb +8 -2
  20. data/app/helpers/shipit/shipit_helper.rb +9 -0
  21. data/app/helpers/shipit/stacks_helper.rb +22 -7
  22. data/app/jobs/shipit/background_job/unique.rb +19 -1
  23. data/app/jobs/shipit/cache_deploy_spec_job.rb +1 -1
  24. data/app/jobs/shipit/merge_pull_requests_job.rb +26 -0
  25. data/app/jobs/shipit/perform_task_job.rb +1 -1
  26. data/app/jobs/shipit/refresh_pull_request_job.rb +8 -0
  27. data/app/models/concerns/shipit/deferred_touch.rb +6 -1
  28. data/app/models/shipit/anonymous_user.rb +4 -0
  29. data/app/models/shipit/application_record.rb +5 -0
  30. data/app/models/shipit/commit.rb +51 -49
  31. data/app/models/shipit/commit_message.rb +32 -0
  32. data/app/models/shipit/deploy.rb +5 -0
  33. data/app/models/shipit/deploy_spec.rb +26 -1
  34. data/app/models/shipit/deploy_spec/file_system.rb +6 -1
  35. data/app/models/shipit/deploy_spec/kubernetes_discovery.rb +10 -13
  36. data/app/models/shipit/deploy_spec/npm_discovery.rb +2 -1
  37. data/app/models/shipit/duration.rb +3 -1
  38. data/app/models/shipit/hook.rb +1 -0
  39. data/app/models/shipit/pull_request.rb +252 -0
  40. data/app/models/shipit/stack.rb +33 -17
  41. data/app/models/shipit/status.rb +1 -16
  42. data/app/models/shipit/status/common.rb +45 -0
  43. data/app/models/shipit/status/group.rb +82 -0
  44. data/app/models/shipit/status/missing.rb +30 -0
  45. data/app/models/shipit/status/unknown.rb +33 -0
  46. data/app/models/shipit/unlimited_api_client.rb +10 -0
  47. data/app/serializers/shipit/commit_serializer.rb +1 -1
  48. data/app/serializers/shipit/pull_request_serializer.rb +20 -0
  49. data/app/serializers/shipit/stack_serializer.rb +6 -2
  50. data/app/views/layouts/shipit.html.erb +41 -39
  51. data/app/views/shipit/ccmenu/project.xml.builder +13 -0
  52. data/app/views/shipit/commits/_commit.html.erb +1 -1
  53. data/app/views/shipit/deploys/_deploy.html.erb +1 -1
  54. data/app/views/shipit/pull_requests/_pull_request.html.erb +29 -0
  55. data/app/views/shipit/pull_requests/index.html.erb +20 -0
  56. data/app/views/shipit/shared/_author.html.erb +7 -0
  57. data/app/views/shipit/stacks/_header.html.erb +5 -0
  58. data/app/views/shipit/stacks/settings.html.erb +13 -0
  59. data/app/views/shipit/stacks/show.html.erb +3 -2
  60. data/app/views/shipit/statuses/_group.html.erb +1 -1
  61. data/app/views/shipit/tasks/_task.html.erb +1 -1
  62. data/config/initializers/inflections.rb +3 -0
  63. data/config/locales/en.yml +1 -3
  64. data/config/routes.rb +8 -0
  65. data/db/migrate/20170130113633_create_shipit_pull_requests.rb +25 -0
  66. data/db/migrate/20170208143657_add_pull_request_number_and_title_to_commits.rb +7 -0
  67. data/db/migrate/20170208154609_backfill_merge_commits.rb +13 -0
  68. data/db/migrate/20170209160355_add_branch_to_pull_requests.rb +5 -0
  69. data/db/migrate/20170215123538_add_merge_queue_enabled_to_stacks.rb +5 -0
  70. data/db/migrate/20170220152410_improve_users_indexing.rb +6 -0
  71. data/db/migrate/20170221102128_improve_tasks_indexing.rb +8 -0
  72. data/db/migrate/20170221130336_add_last_revalidated_at_on_pull_requests.rb +10 -0
  73. data/lib/shipit.rb +2 -0
  74. data/lib/shipit/version.rb +1 -1
  75. data/lib/tasks/cron.rake +1 -0
  76. data/test/controllers/api/ccmenu_controller_test.rb +57 -0
  77. data/test/controllers/api/commits_controller_test.rb +1 -1
  78. data/test/controllers/api/pull_requests_controller_test.rb +59 -0
  79. data/test/controllers/ccmenu_controller_test.rb +33 -0
  80. data/test/controllers/pull_requests_controller_test.rb +31 -0
  81. data/test/controllers/webhooks_controller_test.rb +3 -4
  82. data/test/dummy/config/environments/development.rb +3 -1
  83. data/test/dummy/data/stacks/shopify/junk/production/git/README.md +8 -0
  84. data/test/dummy/data/stacks/shopify/junk/production/git/circle.yml +4 -0
  85. data/test/dummy/data/stacks/shopify/junk/production/git/shipit.yml +4 -0
  86. data/test/dummy/db/development.sqlite3 +0 -0
  87. data/test/dummy/db/schema.rb +45 -11
  88. data/test/dummy/db/seeds.rb +33 -10
  89. data/test/dummy/db/test.sqlite3 +0 -0
  90. data/test/fixtures/shipit/commits.yml +14 -0
  91. data/test/fixtures/shipit/pull_requests.yml +56 -0
  92. data/test/fixtures/shipit/stacks.yml +5 -1
  93. data/test/fixtures/shipit/statuses.yml +8 -0
  94. data/test/helpers/json_helper.rb +16 -14
  95. data/test/jobs/merge_pull_requests_job_test.rb +59 -0
  96. data/test/models/commits_test.rb +104 -49
  97. data/test/{unit → models}/deploy_spec_test.rb +138 -12
  98. data/test/models/deploys_test.rb +10 -4
  99. data/test/models/pull_request_test.rb +197 -0
  100. data/test/models/stacks_test.rb +46 -53
  101. data/test/models/status/group_test.rb +44 -0
  102. data/test/models/status/missing_test.rb +23 -0
  103. data/test/models/status_test.rb +3 -6
  104. data/test/unit/csv_serializer_test.rb +10 -2
  105. metadata +57 -12
  106. data/app/models/shipit/missing_status.rb +0 -21
  107. data/app/models/shipit/status_group.rb +0 -35
  108. data/app/models/shipit/unknown_status.rb +0 -48
  109. data/app/views/shipit/commits/_commit_author.html.erb +0 -7
  110. data/test/models/missing_status_test.rb +0 -23
  111. data/test/models/status_group_test.rb +0 -26
@@ -216,7 +216,7 @@ module Shipit
216
216
  end
217
217
 
218
218
  test "#destroy also destroy associated Commits" do
219
- assert_difference -> { Commit.count }, -5 do
219
+ assert_difference -> { Commit.count }, -shipit_stacks(:shipit).commits.count do
220
220
  shipit_stacks(:shipit).destroy
221
221
  end
222
222
  end
@@ -258,19 +258,38 @@ module Shipit
258
258
  end
259
259
  end
260
260
 
261
- test "#deployable? returns true if stack is not locked and is not deploying" do
261
+ test "#deployable? returns true if the stack is not locked and is not deploying" do
262
262
  @stack.deploys.destroy_all
263
- assert @stack.deployable?
263
+ assert_predicate @stack, :deployable?
264
264
  end
265
265
 
266
- test "#deployable? returns false if stack is locked" do
266
+ test "#deployable? returns false if the stack is locked" do
267
267
  @stack.update!(lock_reason: 'Maintenance operation')
268
- refute @stack.deployable?
268
+ refute_predicate @stack, :deployable?
269
269
  end
270
270
 
271
- test "#deployable? returns false if stack is deploying" do
271
+ test "#deployable? returns false if the stack is deploying" do
272
272
  @stack.trigger_deploy(shipit_commits(:third), AnonymousUser.new)
273
- refute @stack.deployable?
273
+ refute_predicate @stack, :deployable?
274
+ end
275
+
276
+ test "#allows_merges? returns true if the stack is not locked and the branch is green" do
277
+ assert_predicate @stack, :allows_merges?
278
+ end
279
+
280
+ test "#allows_merges? returns false if the stack is locked" do
281
+ @stack.update!(lock_reason: 'Maintenance operation')
282
+ refute_predicate @stack, :allows_merges?
283
+ end
284
+
285
+ test "#allows_merges? returns false if the merge queue is disabled" do
286
+ @stack.update!(merge_queue_enabled: false)
287
+ refute_predicate @stack, :allows_merges?
288
+ end
289
+
290
+ test "#allows_merges? returns false if the branch is failing" do
291
+ @stack.undeployed_commits.last.statuses.create!(context: 'ci/travis', state: 'failure', stack: @stack)
292
+ refute_predicate @stack, :allows_merges?
274
293
  end
275
294
 
276
295
  test "#monitoring is empty if cached_deploy_spec is blank" do
@@ -313,6 +332,16 @@ module Shipit
313
332
  end
314
333
  end
315
334
 
335
+ test "unlocking the stack triggers a MergePullRequests job" do
336
+ assert_no_enqueued_jobs(only: MergePullRequestsJob) do
337
+ @stack.update(lock_reason: "Just for fun", lock_author: shipit_users(:walrus))
338
+ end
339
+
340
+ assert_enqueued_with(job: MergePullRequestsJob, args: [@stack]) do
341
+ @stack.update(lock_reason: nil)
342
+ end
343
+ end
344
+
316
345
  test "the git cache lock prevent concurrent access to the git cache" do
317
346
  @stack.acquire_git_cache_lock do
318
347
  assert_raises Redis::Lock::LockTimeout do
@@ -346,26 +375,6 @@ module Shipit
346
375
  end
347
376
  end
348
377
 
349
- test "#filter_visible_statuses removes statuses from hidden contexts" do
350
- stack = shipit_stacks(:cyclimse)
351
- stack.stubs(hidden_statuses: ['ci/hidden'])
352
- commit1 = Status.new(state: 'pending', context: 'ci/valid')
353
- commit2 = Status.new(state: 'pending', context: 'ci/valid')
354
- hidden = Status.new(state: 'pending', context: 'ci/hidden')
355
-
356
- assert_equal [commit1, commit2], stack.filter_visible_statuses([hidden, commit1, commit2])
357
- end
358
-
359
- test "#filter_meaningful_statuses removes statuses from soft-failing contexts" do
360
- stack = shipit_stacks(:cyclimse)
361
- stack.stubs(soft_failing_statuses: ['ci/soft-fail'])
362
- commit1 = Status.new(state: 'pending', context: 'ci/valid')
363
- commit2 = Status.new(state: 'pending', context: 'ci/valid')
364
- soft_fail = Status.new(state: 'pending', context: 'ci/soft-fail')
365
-
366
- assert_equal [commit1, commit2], stack.filter_meaningful_statuses([soft_fail, commit1, commit2])
367
- end
368
-
369
378
  test "updating the stack emit a hook" do
370
379
  expect_hook(:stack, @stack, action: :updated, stack: @stack) do
371
380
  @stack.update(repo_name: 'foo')
@@ -397,42 +406,26 @@ module Shipit
397
406
  assert_equal 'success', @stack.merge_status
398
407
  end
399
408
 
400
- test "#merge_status returns pending if all undeployed commits and last deployed commit are in pending or unknown state" do
409
+ test "#merge_status returns success if all undeployed commits and last deployed commit are in pending or unknown state" do
401
410
  shipit_commits(:fifth).statuses.destroy_all
402
411
  shipit_commits(:fourth).statuses.update_all(state: 'pending')
403
412
  shipit_commits(:third).statuses.update_all(state: 'pending')
404
413
  @stack.deploys_and_rollbacks.last.update!(status: 'success', until_commit: shipit_commits(:third))
405
414
 
406
- assert_equal 'pending', @stack.merge_status
415
+ assert_equal 'success', @stack.merge_status
407
416
  end
408
417
 
409
- test "#merge_status returns pending if there are no undeployed commits and no deployed commits" do
418
+ test "#merge_status returns success if there are no undeployed commits and no deployed commits" do
410
419
  @stack.deploys_and_rollbacks.last.update(status: 'success', until_commit: shipit_commits(:fifth))
411
420
 
412
- assert_equal 'pending', @stack.merge_status
413
- end
414
-
415
- test "#merge_status returns state of last deployed commit if there are no undeployed commits waiting" do
416
- shipit_commits(:fifth).statuses.destroy_all
417
- @stack.deploys_and_rollbacks.last.update!(status: 'success', until_commit: shipit_commits(:fourth))
418
-
419
- shipit_commits(:fourth).statuses.update_all(state: 'success')
420
421
  assert_equal 'success', @stack.merge_status
421
-
422
- shipit_commits(:fourth).statuses.last.update(state: 'failure')
423
- assert_equal 'failure', @stack.merge_status
424
422
  end
425
423
 
426
- test "#merge_status returns state of last deployed commit if all undeployed commits are in pending or unknown state" do
427
- shipit_commits(:fifth).statuses.destroy_all
428
- shipit_commits(:fourth).statuses.update_all(state: 'pending')
429
- @stack.deploys_and_rollbacks.last.update!(status: 'success', until_commit: shipit_commits(:third))
430
-
431
- shipit_commits(:third).statuses.update_all(state: 'success')
432
- assert_equal 'success', @stack.merge_status
433
-
434
- shipit_commits(:third).statuses.last.update(state: 'failure')
435
- assert_equal 'failure', @stack.merge_status
424
+ test "#merge_status returns backlogged if there are too many undeployed commits" do
425
+ @stack.deploys_and_rollbacks.destroy_all
426
+ @stack.update_undeployed_commits_count
427
+ @stack.reload
428
+ assert_equal 'backlogged', @stack.merge_status
436
429
  end
437
430
 
438
431
  test "#handle_github_redirections update the stack if the repository was renamed" do
@@ -547,11 +540,11 @@ module Shipit
547
540
  test "#next_commit_to_deploy respects the deploy.max_commits directive" do
548
541
  @stack.tasks.destroy_all
549
542
 
550
- fifth_commit = shipit_commits(:fifth)
543
+ fifth_commit = shipit_commits(:third)
551
544
  fifth_commit.statuses.create!(stack_id: @stack.id, state: 'success', context: 'ci/travis')
552
545
  assert_predicate fifth_commit, :deployable?
553
546
 
554
- assert_equal shipit_commits(:fifth), @stack.next_commit_to_deploy
547
+ assert_equal shipit_commits(:third), @stack.next_commit_to_deploy
555
548
 
556
549
  @stack.expects(:maximum_commits_per_deploy).returns(3).at_least_once
557
550
  assert_equal shipit_commits(:third), @stack.next_commit_to_deploy
@@ -0,0 +1,44 @@
1
+ require 'test_helper'
2
+
3
+ module Shipit
4
+ class StatusGroupTest < ActiveSupport::TestCase
5
+ setup do
6
+ @commit = shipit_commits(:second)
7
+ @group = Status::Group.new(@commit, @commit.statuses)
8
+ end
9
+
10
+ test "#description is a summary of the statuses" do
11
+ assert_equal '1 / 2 checks OK', @group.description
12
+ end
13
+
14
+ test "#group? returns true" do
15
+ assert_equal true, @group.group?
16
+ end
17
+
18
+ test "#target_url returns nil" do
19
+ assert_nil @group.target_url
20
+ end
21
+
22
+ test "#state is significant's status state" do
23
+ assert_equal %w(success failure), @group.statuses.map(&:state)
24
+ assert_equal 'failure', @group.state
25
+ end
26
+
27
+ test ".compact returns a regular status if there is only one visible status" do
28
+ status = Status::Group.compact(@commit, @commit.statuses.where(context: 'ci/travis'))
29
+ assert_instance_of Status, status
30
+ end
31
+
32
+ test ".compact returns an unknown status if there is no visible status" do
33
+ status = Status::Group.compact(@commit, @commit.statuses.where(context: 'ci/none'))
34
+ assert_instance_of Status::Unknown, status
35
+ end
36
+
37
+ test "missing required status will have MissingRequiredStatus as placeholder" do
38
+ @commit.stubs(:required_statuses).returns(%w(ci/very-important))
39
+ status = Status::Group.compact(@commit, [])
40
+ assert_instance_of Status::Missing, status
41
+ assert_predicate status, :pending?
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,23 @@
1
+ require 'test_helper'
2
+
3
+ module Shipit
4
+ class MissingStatusTest < ActiveSupport::TestCase
5
+ setup do
6
+ @commit = @commit = shipit_commits(:second)
7
+ @status = Status::Missing.new(@commit, 'ci/very-important')
8
+ end
9
+
10
+ test "#state is 'pending'" do
11
+ assert_equal 'pending', @status.state
12
+ end
13
+
14
+ test "#description explains the situation" do
15
+ message = 'ci/very-important is required for deploy but was not sent yet.'
16
+ assert_equal message, @status.description
17
+ end
18
+
19
+ test "#success? is false" do
20
+ refute_predicate @status, :success?
21
+ end
22
+ end
23
+ end
@@ -54,12 +54,9 @@ module Shipit
54
54
  end
55
55
 
56
56
  def expect_event(stack)
57
- Pubsubstub::RedisPubSub.expects(:publish).at_least_once
58
- Pubsubstub::RedisPubSub.expects(:publish).with do |channel, event|
59
- data = JSON.load(event.data)
60
- event.name == 'stack.update' &&
61
- channel == "stack.#{stack.id}" &&
62
- data['url'] == "/#{stack.to_param}"
57
+ Pubsubstub.expects(:publish).at_least_once
58
+ Pubsubstub.expects(:publish).with do |channel, _payload, options = {}|
59
+ options[:name] == 'update' && channel == "stack.#{stack.id}"
63
60
  end
64
61
  end
65
62
  end
@@ -27,12 +27,20 @@ module Shipit
27
27
 
28
28
  def assert_dumped(expected, object)
29
29
  message = "Expected CSVSerializer.dump(#{object.inspect}) to eq #{expected.inspect}"
30
- assert_equal(expected, Shipit::CSVSerializer.dump(object), message)
30
+ if expected.nil?
31
+ assert_nil Shipit::CSVSerializer.dump(object), message
32
+ else
33
+ assert_equal(expected, Shipit::CSVSerializer.dump(object), message)
34
+ end
31
35
  end
32
36
 
33
37
  def assert_loaded(expected, payload)
34
38
  message = "Expected CSVSerializer.load(#{payload.inspect}) to eq #{expected.inspect}"
35
- assert_equal(expected, Shipit::CSVSerializer.load(payload), message)
39
+ if expected.nil?
40
+ assert_nil Shipit::CSVSerializer.load(payload), message
41
+ else
42
+ assert_equal(expected, Shipit::CSVSerializer.load(payload), message)
43
+ end
36
44
  end
37
45
  end
38
46
  end
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.15.0
4
+ version: 0.16.0
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-01-30 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -531,6 +531,7 @@ files:
531
531
  - app/assets/javascripts/shipit/checklist.js.coffee
532
532
  - app/assets/javascripts/shipit/deploy.js.coffee
533
533
  - app/assets/javascripts/shipit/flash.js.coffee
534
+ - app/assets/javascripts/shipit/page_updater.js.coffee
534
535
  - app/assets/javascripts/shipit/search.js.coffee
535
536
  - app/assets/javascripts/shipit/stacks.js.coffee
536
537
  - app/assets/javascripts/shipit_bs.js.coffee
@@ -568,16 +569,20 @@ files:
568
569
  - app/controllers/concerns/shipit/authentication.rb
569
570
  - app/controllers/concerns/shipit/pagination.rb
570
571
  - app/controllers/shipit/api/base_controller.rb
572
+ - app/controllers/shipit/api/ccmenu_controller.rb
571
573
  - app/controllers/shipit/api/commits_controller.rb
572
574
  - app/controllers/shipit/api/deploys_controller.rb
573
575
  - app/controllers/shipit/api/hooks_controller.rb
574
576
  - app/controllers/shipit/api/locks_controller.rb
575
577
  - app/controllers/shipit/api/outputs_controller.rb
578
+ - app/controllers/shipit/api/pull_requests_controller.rb
576
579
  - app/controllers/shipit/api/stacks_controller.rb
577
580
  - app/controllers/shipit/api/tasks_controller.rb
581
+ - app/controllers/shipit/ccmenu_url_controller.rb
578
582
  - app/controllers/shipit/commit_checks_controller.rb
579
583
  - app/controllers/shipit/deploys_controller.rb
580
584
  - app/controllers/shipit/github_authentication_controller.rb
585
+ - app/controllers/shipit/pull_requests_controller.rb
581
586
  - app/controllers/shipit/rollbacks_controller.rb
582
587
  - app/controllers/shipit/shipit_controller.rb
583
588
  - app/controllers/shipit/stacks_controller.rb
@@ -604,19 +609,23 @@ files:
604
609
  - app/jobs/shipit/fetch_commit_stats_job.rb
605
610
  - app/jobs/shipit/fetch_deployed_revision_job.rb
606
611
  - app/jobs/shipit/github_sync_job.rb
612
+ - app/jobs/shipit/merge_pull_requests_job.rb
607
613
  - app/jobs/shipit/perform_commit_checks_job.rb
608
614
  - app/jobs/shipit/perform_task_job.rb
609
615
  - app/jobs/shipit/refresh_github_user_job.rb
616
+ - app/jobs/shipit/refresh_pull_request_job.rb
610
617
  - app/jobs/shipit/refresh_statuses_job.rb
611
618
  - app/jobs/shipit/setup_github_hook_job.rb
612
619
  - app/jobs/shipit/update_estimated_deploy_duration_job.rb
613
620
  - app/models/concerns/shipit/deferred_touch.rb
614
621
  - app/models/shipit/anonymous_user.rb
615
622
  - app/models/shipit/api_client.rb
623
+ - app/models/shipit/application_record.rb
616
624
  - app/models/shipit/commit.rb
617
625
  - app/models/shipit/commit_checks.rb
618
626
  - app/models/shipit/commit_deployment.rb
619
627
  - app/models/shipit/commit_deployment_status.rb
628
+ - app/models/shipit/commit_message.rb
620
629
  - app/models/shipit/delivery.rb
621
630
  - app/models/shipit/deploy.rb
622
631
  - app/models/shipit/deploy_spec.rb
@@ -633,17 +642,20 @@ files:
633
642
  - app/models/shipit/github_status.rb
634
643
  - app/models/shipit/hook.rb
635
644
  - app/models/shipit/membership.rb
636
- - app/models/shipit/missing_status.rb
637
645
  - app/models/shipit/output_chunk.rb
646
+ - app/models/shipit/pull_request.rb
638
647
  - app/models/shipit/rollback.rb
639
648
  - app/models/shipit/stack.rb
640
649
  - app/models/shipit/status.rb
641
- - app/models/shipit/status_group.rb
650
+ - app/models/shipit/status/common.rb
651
+ - app/models/shipit/status/group.rb
652
+ - app/models/shipit/status/missing.rb
653
+ - app/models/shipit/status/unknown.rb
642
654
  - app/models/shipit/task.rb
643
655
  - app/models/shipit/task_definition.rb
644
656
  - app/models/shipit/team.rb
645
657
  - app/models/shipit/undeployed_commit.rb
646
- - app/models/shipit/unknown_status.rb
658
+ - app/models/shipit/unlimited_api_client.rb
647
659
  - app/models/shipit/user.rb
648
660
  - app/models/shipit/variable_definition.rb
649
661
  - app/serializers/concerns/shipit/conditional_attributes.rb
@@ -651,6 +663,7 @@ files:
651
663
  - app/serializers/shipit/commit_serializer.rb
652
664
  - app/serializers/shipit/deploy_serializer.rb
653
665
  - app/serializers/shipit/hook_serializer.rb
666
+ - app/serializers/shipit/pull_request_serializer.rb
654
667
  - app/serializers/shipit/rollback_serializer.rb
655
668
  - app/serializers/shipit/short_commit_serializer.rb
656
669
  - app/serializers/shipit/stack_serializer.rb
@@ -664,10 +677,10 @@ files:
664
677
  - app/views/layouts/shipit.html.erb
665
678
  - app/views/layouts/shipit_bootstrap.html.erb
666
679
  - app/views/shipit/_variables.html.erb
680
+ - app/views/shipit/ccmenu/project.xml.builder
667
681
  - app/views/shipit/commit_checks/_checks.html.erb
668
682
  - app/views/shipit/commit_checks/show.html.erb
669
683
  - app/views/shipit/commits/_commit.html.erb
670
- - app/views/shipit/commits/_commit_author.html.erb
671
684
  - app/views/shipit/deploys/_checklist.html.erb
672
685
  - app/views/shipit/deploys/_concurrent_deploy_warning.html.erb
673
686
  - app/views/shipit/deploys/_deploy.html.erb
@@ -678,6 +691,9 @@ files:
678
691
  - app/views/shipit/deploys/show.html.erb
679
692
  - app/views/shipit/github_authentication/failed.html.erb
680
693
  - app/views/shipit/missing_settings.html.erb
694
+ - app/views/shipit/pull_requests/_pull_request.html.erb
695
+ - app/views/shipit/pull_requests/index.html.erb
696
+ - app/views/shipit/shared/_author.html.erb
681
697
  - app/views/shipit/stacks/_header.html.erb
682
698
  - app/views/shipit/stacks/index.html.erb
683
699
  - app/views/shipit/stacks/new.html.erb
@@ -690,6 +706,7 @@ files:
690
706
  - app/views/shipit/tasks/index.html.erb
691
707
  - app/views/shipit/tasks/new.html.erb
692
708
  - app/views/shipit/tasks/show.html.erb
709
+ - config/initializers/inflections.rb
693
710
  - config/locales/en.yml
694
711
  - config/routes.rb
695
712
  - config/secrets.development.example.yml
@@ -725,6 +742,14 @@ files:
725
742
  - db/migrate/20161206104224_denormalize_stack_id_on_statuses.rb
726
743
  - db/migrate/20161206104817_backfill_stack_id_on_statuses.rb
727
744
  - db/migrate/20161206105318_makes_stack_id_not_null_on_statuses.rb
745
+ - db/migrate/20170130113633_create_shipit_pull_requests.rb
746
+ - db/migrate/20170208143657_add_pull_request_number_and_title_to_commits.rb
747
+ - db/migrate/20170208154609_backfill_merge_commits.rb
748
+ - db/migrate/20170209160355_add_branch_to_pull_requests.rb
749
+ - db/migrate/20170215123538_add_merge_queue_enabled_to_stacks.rb
750
+ - db/migrate/20170220152410_improve_users_indexing.rb
751
+ - db/migrate/20170221102128_improve_tasks_indexing.rb
752
+ - db/migrate/20170221130336_add_last_revalidated_at_on_pull_requests.rb
728
753
  - lib/shipit-engine.rb
729
754
  - lib/shipit.rb
730
755
  - lib/shipit/command.rb
@@ -759,16 +784,20 @@ files:
759
784
  - lib/tasks/teams.rake
760
785
  - lib/tasks/webhook.rake
761
786
  - test/controllers/api/base_controller_test.rb
787
+ - test/controllers/api/ccmenu_controller_test.rb
762
788
  - test/controllers/api/commits_controller_test.rb
763
789
  - test/controllers/api/deploys_controller_test.rb
764
790
  - test/controllers/api/hooks_controller_test.rb
765
791
  - test/controllers/api/locks_controller_test.rb
766
792
  - test/controllers/api/outputs_controller_test.rb
793
+ - test/controllers/api/pull_requests_controller_test.rb
767
794
  - test/controllers/api/stacks_controller_test.rb
768
795
  - test/controllers/api/tasks_controller_test.rb
796
+ - test/controllers/ccmenu_controller_test.rb
769
797
  - test/controllers/commit_checks_controller_test.rb
770
798
  - test/controllers/deploys_controller_test.rb
771
799
  - test/controllers/github_authentication_controller_test.rb
800
+ - test/controllers/pull_requests_controller_test.rb
772
801
  - test/controllers/rollbacks_controller_test.rb
773
802
  - test/controllers/stacks_controller_test.rb
774
803
  - test/controllers/status_controller_test.rb
@@ -819,6 +848,9 @@ files:
819
848
  - test/dummy/data/stacks/byroot/junk/production/git/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
820
849
  - test/dummy/data/stacks/byroot/junk/production/git/shipit.yml
821
850
  - test/dummy/data/stacks/byroot/junk/production/git/toto.txt
851
+ - test/dummy/data/stacks/shopify/junk/production/git/README.md
852
+ - test/dummy/data/stacks/shopify/junk/production/git/circle.yml
853
+ - test/dummy/data/stacks/shopify/junk/production/git/shipit.yml
822
854
  - test/dummy/db/development.sqlite3
823
855
  - test/dummy/db/schema.rb
824
856
  - test/dummy/db/seeds.rb
@@ -839,6 +871,7 @@ files:
839
871
  - test/fixtures/shipit/hooks.yml
840
872
  - test/fixtures/shipit/memberships.yml
841
873
  - test/fixtures/shipit/output_chunks.yml
874
+ - test/fixtures/shipit/pull_requests.yml
842
875
  - test/fixtures/shipit/stacks.yml
843
876
  - test/fixtures/shipit/statuses.yml
844
877
  - test/fixtures/shipit/tasks.yml
@@ -860,6 +893,7 @@ files:
860
893
  - test/jobs/fetch_commit_stats_job_test.rb
861
894
  - test/jobs/fetch_deployed_revision_job_test.rb
862
895
  - test/jobs/github_sync_job_test.rb
896
+ - test/jobs/merge_pull_requests_job_test.rb
863
897
  - test/jobs/perform_task_job_test.rb
864
898
  - test/jobs/refresh_github_user_job_test.rb
865
899
  - test/jobs/refresh_status_job_test.rb
@@ -870,16 +904,18 @@ files:
870
904
  - test/models/commit_deployment_test.rb
871
905
  - test/models/commits_test.rb
872
906
  - test/models/delivery_test.rb
907
+ - test/models/deploy_spec_test.rb
873
908
  - test/models/deploys_test.rb
874
909
  - test/models/duration_test.rb
875
910
  - test/models/github_hook_test.rb
876
911
  - test/models/hook_test.rb
877
912
  - test/models/membership_test.rb
878
- - test/models/missing_status_test.rb
879
913
  - test/models/output_chunk_test.rb
914
+ - test/models/pull_request_test.rb
880
915
  - test/models/rollbacks_test.rb
881
916
  - test/models/stacks_test.rb
882
- - test/models/status_group_test.rb
917
+ - test/models/status/group_test.rb
918
+ - test/models/status/missing_test.rb
883
919
  - test/models/status_test.rb
884
920
  - test/models/task_definitions_test.rb
885
921
  - test/models/team_test.rb
@@ -891,7 +927,6 @@ files:
891
927
  - test/unit/commands_test.rb
892
928
  - test/unit/csv_serializer_test.rb
893
929
  - test/unit/deploy_commands_test.rb
894
- - test/unit/deploy_spec_test.rb
895
930
  - test/unit/environment_variables_test.rb
896
931
  - test/unit/github_url_helper_test.rb
897
932
  - test/unit/shipit_test.rb
@@ -928,16 +963,20 @@ specification_version: 4
928
963
  summary: Application deployment software
929
964
  test_files:
930
965
  - test/controllers/api/base_controller_test.rb
966
+ - test/controllers/api/ccmenu_controller_test.rb
931
967
  - test/controllers/api/commits_controller_test.rb
932
968
  - test/controllers/api/deploys_controller_test.rb
933
969
  - test/controllers/api/hooks_controller_test.rb
934
970
  - test/controllers/api/locks_controller_test.rb
935
971
  - test/controllers/api/outputs_controller_test.rb
972
+ - test/controllers/api/pull_requests_controller_test.rb
936
973
  - test/controllers/api/stacks_controller_test.rb
937
974
  - test/controllers/api/tasks_controller_test.rb
975
+ - test/controllers/ccmenu_controller_test.rb
938
976
  - test/controllers/commit_checks_controller_test.rb
939
977
  - test/controllers/deploys_controller_test.rb
940
978
  - test/controllers/github_authentication_controller_test.rb
979
+ - test/controllers/pull_requests_controller_test.rb
941
980
  - test/controllers/rollbacks_controller_test.rb
942
981
  - test/controllers/stacks_controller_test.rb
943
982
  - test/controllers/status_controller_test.rb
@@ -987,6 +1026,9 @@ test_files:
987
1026
  - test/dummy/data/stacks/byroot/junk/production/git/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
988
1027
  - test/dummy/data/stacks/byroot/junk/production/git/shipit.yml
989
1028
  - test/dummy/data/stacks/byroot/junk/production/git/toto.txt
1029
+ - test/dummy/data/stacks/shopify/junk/production/git/circle.yml
1030
+ - test/dummy/data/stacks/shopify/junk/production/git/README.md
1031
+ - test/dummy/data/stacks/shopify/junk/production/git/shipit.yml
990
1032
  - test/dummy/db/development.sqlite3
991
1033
  - test/dummy/db/schema.rb
992
1034
  - test/dummy/db/seeds.rb
@@ -1008,6 +1050,7 @@ test_files:
1008
1050
  - test/fixtures/shipit/hooks.yml
1009
1051
  - test/fixtures/shipit/memberships.yml
1010
1052
  - test/fixtures/shipit/output_chunks.yml
1053
+ - test/fixtures/shipit/pull_requests.yml
1011
1054
  - test/fixtures/shipit/stacks.yml
1012
1055
  - test/fixtures/shipit/statuses.yml
1013
1056
  - test/fixtures/shipit/tasks.yml
@@ -1029,6 +1072,7 @@ test_files:
1029
1072
  - test/jobs/fetch_commit_stats_job_test.rb
1030
1073
  - test/jobs/fetch_deployed_revision_job_test.rb
1031
1074
  - test/jobs/github_sync_job_test.rb
1075
+ - test/jobs/merge_pull_requests_job_test.rb
1032
1076
  - test/jobs/perform_task_job_test.rb
1033
1077
  - test/jobs/refresh_github_user_job_test.rb
1034
1078
  - test/jobs/refresh_status_job_test.rb
@@ -1039,16 +1083,18 @@ test_files:
1039
1083
  - test/models/commit_deployment_test.rb
1040
1084
  - test/models/commits_test.rb
1041
1085
  - test/models/delivery_test.rb
1086
+ - test/models/deploy_spec_test.rb
1042
1087
  - test/models/deploys_test.rb
1043
1088
  - test/models/duration_test.rb
1044
1089
  - test/models/github_hook_test.rb
1045
1090
  - test/models/hook_test.rb
1046
1091
  - test/models/membership_test.rb
1047
- - test/models/missing_status_test.rb
1048
1092
  - test/models/output_chunk_test.rb
1093
+ - test/models/pull_request_test.rb
1049
1094
  - test/models/rollbacks_test.rb
1050
1095
  - test/models/stacks_test.rb
1051
- - test/models/status_group_test.rb
1096
+ - test/models/status/group_test.rb
1097
+ - test/models/status/missing_test.rb
1052
1098
  - test/models/status_test.rb
1053
1099
  - test/models/task_definitions_test.rb
1054
1100
  - test/models/team_test.rb
@@ -1060,7 +1106,6 @@ test_files:
1060
1106
  - test/unit/commands_test.rb
1061
1107
  - test/unit/csv_serializer_test.rb
1062
1108
  - test/unit/deploy_commands_test.rb
1063
- - test/unit/deploy_spec_test.rb
1064
1109
  - test/unit/environment_variables_test.rb
1065
1110
  - test/unit/github_url_helper_test.rb
1066
1111
  - test/unit/shipit_test.rb