shipit-engine 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/images/faulty.svg +9 -0
  3. data/app/assets/images/validating.svg +13 -0
  4. data/app/assets/stylesheets/_pages/_commits.scss +18 -0
  5. data/app/controllers/shipit/api/commits_controller.rb +6 -1
  6. data/app/controllers/shipit/api/deploys_controller.rb +4 -0
  7. data/app/controllers/shipit/release_statuses_controller.rb +2 -10
  8. data/app/jobs/shipit/mark_deploy_healty_job.rb +13 -0
  9. data/app/jobs/shipit/perform_task_job.rb +1 -1
  10. data/app/models/shipit/check_run.rb +8 -0
  11. data/app/models/shipit/deploy.rb +39 -16
  12. data/app/models/shipit/deploy_spec.rb +1 -1
  13. data/app/models/shipit/deploy_spec/lerna_discovery.rb +10 -7
  14. data/app/models/shipit/rollback.rb +10 -1
  15. data/app/models/shipit/stack.rb +7 -5
  16. data/app/models/shipit/task.rb +20 -6
  17. data/app/views/layouts/merge_status.html.erb +1 -1
  18. data/config/routes.rb +1 -1
  19. data/lib/shipit/version.rb +1 -1
  20. data/test/controllers/api/commits_controller_test.rb +10 -0
  21. data/test/controllers/api/deploys_controller_test.rb +11 -0
  22. data/test/controllers/merge_status_controller_test.rb +6 -1
  23. data/test/controllers/release_statuses_controller_test.rb +17 -3
  24. data/test/controllers/stacks_controller_test.rb +5 -0
  25. data/test/dummy/config/application.rb +1 -13
  26. data/test/dummy/config/initializers/0_load_development_secrets.rb +2 -2
  27. data/test/dummy/db/schema.rb +1 -1
  28. data/test/fixtures/shipit/commits.yml +65 -0
  29. data/test/fixtures/shipit/release_statuses.yml +4 -4
  30. data/test/fixtures/shipit/stacks.yml +57 -2
  31. data/test/fixtures/shipit/statuses.yml +9 -0
  32. data/test/fixtures/shipit/tasks.yml +48 -0
  33. data/test/jobs/mark_deploy_healthy_job_test.rb +23 -0
  34. data/test/jobs/perform_task_job_test.rb +30 -0
  35. data/test/models/commits_test.rb +1 -1
  36. data/test/models/deploy_spec_test.rb +2 -2
  37. data/test/models/deploys_test.rb +40 -14
  38. data/test/models/pull_request_test.rb +4 -4
  39. data/test/models/release_statuses_test.rb +2 -2
  40. data/test/models/stacks_test.rb +58 -0
  41. metadata +127 -125
  42. data/app/jobs/shipit/append_delayed_release_status_job.rb +0 -17
  43. data/test/jobs/append_delayed_release_status_job_test.rb +0 -25
@@ -1,17 +0,0 @@
1
- module Shipit
2
- class AppendDelayedReleaseStatusJob < BackgroundJob
3
- include BackgroundJob::Unique
4
-
5
- queue_as :default
6
-
7
- def lock_key(deploy, *)
8
- super(deploy)
9
- end
10
-
11
- def perform(deploy, cursor:, status:, description:)
12
- return unless cursor == deploy.until_commit.release_statuses.last
13
-
14
- deploy.append_release_status(status, description)
15
- end
16
- end
17
- end
@@ -1,25 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Shipit
4
- class AppendDelayedReleaseStatusJobTest < ActiveSupport::TestCase
5
- setup do
6
- @job = AppendDelayedReleaseStatusJob.new
7
- @deploy = shipit_deploys(:shipit_complete)
8
- end
9
-
10
- test "#perform bails out if another status was appended in the meantime" do
11
- cursor = @deploy.last_release_status
12
- @deploy.append_release_status(cursor.state, 'Something else happened')
13
- assert_no_difference -> { ReleaseStatus.count } do
14
- @job.perform(@deploy, cursor: cursor, status: 'success', description: 'Nothing happened')
15
- end
16
- end
17
-
18
- test "#perform appends the new status if no other status was appended in the meantime" do
19
- cursor = @deploy.last_release_status
20
- assert_difference -> { ReleaseStatus.count }, +1 do
21
- @job.perform(@deploy, cursor: cursor, status: 'success', description: 'Something happened')
22
- end
23
- end
24
- end
25
- end