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.
- checksums.yaml +5 -5
- data/app/assets/images/faulty.svg +9 -0
- data/app/assets/images/validating.svg +13 -0
- data/app/assets/stylesheets/_pages/_commits.scss +18 -0
- data/app/controllers/shipit/api/commits_controller.rb +6 -1
- data/app/controllers/shipit/api/deploys_controller.rb +4 -0
- data/app/controllers/shipit/release_statuses_controller.rb +2 -10
- data/app/jobs/shipit/mark_deploy_healty_job.rb +13 -0
- data/app/jobs/shipit/perform_task_job.rb +1 -1
- data/app/models/shipit/check_run.rb +8 -0
- data/app/models/shipit/deploy.rb +39 -16
- data/app/models/shipit/deploy_spec.rb +1 -1
- data/app/models/shipit/deploy_spec/lerna_discovery.rb +10 -7
- data/app/models/shipit/rollback.rb +10 -1
- data/app/models/shipit/stack.rb +7 -5
- data/app/models/shipit/task.rb +20 -6
- data/app/views/layouts/merge_status.html.erb +1 -1
- data/config/routes.rb +1 -1
- data/lib/shipit/version.rb +1 -1
- data/test/controllers/api/commits_controller_test.rb +10 -0
- data/test/controllers/api/deploys_controller_test.rb +11 -0
- data/test/controllers/merge_status_controller_test.rb +6 -1
- data/test/controllers/release_statuses_controller_test.rb +17 -3
- data/test/controllers/stacks_controller_test.rb +5 -0
- data/test/dummy/config/application.rb +1 -13
- data/test/dummy/config/initializers/0_load_development_secrets.rb +2 -2
- data/test/dummy/db/schema.rb +1 -1
- data/test/fixtures/shipit/commits.yml +65 -0
- data/test/fixtures/shipit/release_statuses.yml +4 -4
- data/test/fixtures/shipit/stacks.yml +57 -2
- data/test/fixtures/shipit/statuses.yml +9 -0
- data/test/fixtures/shipit/tasks.yml +48 -0
- data/test/jobs/mark_deploy_healthy_job_test.rb +23 -0
- data/test/jobs/perform_task_job_test.rb +30 -0
- data/test/models/commits_test.rb +1 -1
- data/test/models/deploy_spec_test.rb +2 -2
- data/test/models/deploys_test.rb +40 -14
- data/test/models/pull_request_test.rb +4 -4
- data/test/models/release_statuses_test.rb +2 -2
- data/test/models/stacks_test.rb +58 -0
- metadata +127 -125
- data/app/jobs/shipit/append_delayed_release_status_job.rb +0 -17
- 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
|