shipit-engine 0.28.1 → 0.33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (410) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -2
  3. data/Rakefile +4 -2
  4. data/app/assets/images/archive-solid.svg +1 -0
  5. data/app/assets/images/magic-solid.svg +1 -0
  6. data/app/assets/javascripts/shipit/repositories_search.js.coffee +60 -0
  7. data/app/assets/javascripts/shipit/{search.js.coffee → stack_search.js.coffee} +0 -0
  8. data/app/assets/stylesheets/_pages/_repositories.scss +148 -0
  9. data/app/assets/stylesheets/_pages/_stacks.scss +95 -3
  10. data/app/assets/stylesheets/merge_status.scss +0 -3
  11. data/app/assets/stylesheets/shipit.scss +1 -0
  12. data/app/controllers/concerns/shipit/active_model_serializers_patch.rb +13 -0
  13. data/app/controllers/concerns/shipit/api/cacheable.rb +1 -0
  14. data/app/controllers/concerns/shipit/api/paginable.rb +3 -2
  15. data/app/controllers/concerns/shipit/api/rendering.rb +5 -4
  16. data/app/controllers/concerns/shipit/authentication.rb +3 -2
  17. data/app/controllers/concerns/shipit/pagination.rb +2 -1
  18. data/app/controllers/shipit/api/base_controller.rb +11 -6
  19. data/app/controllers/shipit/api/ccmenu_controller.rb +2 -1
  20. data/app/controllers/shipit/api/commits_controller.rb +2 -1
  21. data/app/controllers/shipit/api/deploys_controller.rb +4 -3
  22. data/app/controllers/shipit/api/hooks_controller.rb +6 -5
  23. data/app/controllers/shipit/api/locks_controller.rb +5 -4
  24. data/app/controllers/shipit/api/merge_requests_controller.rb +37 -0
  25. data/app/controllers/shipit/api/outputs_controller.rb +2 -1
  26. data/app/controllers/shipit/api/release_statuses_controller.rb +3 -2
  27. data/app/controllers/shipit/api/rollbacks_controller.rb +33 -0
  28. data/app/controllers/shipit/api/stacks_controller.rb +50 -5
  29. data/app/controllers/shipit/api/tasks_controller.rb +6 -5
  30. data/app/controllers/shipit/api_clients_controller.rb +50 -0
  31. data/app/controllers/shipit/ccmenu_url_controller.rb +4 -3
  32. data/app/controllers/shipit/commit_checks_controller.rb +2 -1
  33. data/app/controllers/shipit/commits_controller.rb +2 -1
  34. data/app/controllers/shipit/deploys_controller.rb +5 -4
  35. data/app/controllers/shipit/github_authentication_controller.rb +4 -3
  36. data/app/controllers/shipit/merge_requests_controller.rb +31 -0
  37. data/app/controllers/shipit/merge_status_controller.rb +33 -28
  38. data/app/controllers/shipit/release_statuses_controller.rb +3 -2
  39. data/app/controllers/shipit/repositories_controller.rb +74 -0
  40. data/app/controllers/shipit/rollbacks_controller.rb +3 -2
  41. data/app/controllers/shipit/shipit_controller.rb +2 -1
  42. data/app/controllers/shipit/stacks_controller.rb +78 -14
  43. data/app/controllers/shipit/status_controller.rb +2 -1
  44. data/app/controllers/shipit/tasks_controller.rb +9 -8
  45. data/app/controllers/shipit/webhooks_controller.rb +5 -132
  46. data/app/helpers/shipit/chunks_helper.rb +3 -2
  47. data/app/helpers/shipit/deploys_helper.rb +4 -3
  48. data/app/helpers/shipit/github_url_helper.rb +9 -0
  49. data/app/helpers/shipit/merge_status_helper.rb +1 -0
  50. data/app/helpers/shipit/shipit_helper.rb +1 -0
  51. data/app/helpers/shipit/stacks_helper.rb +9 -0
  52. data/app/helpers/shipit/tasks_helper.rb +1 -0
  53. data/app/jobs/shipit/background_job.rb +4 -0
  54. data/app/jobs/shipit/background_job/unique.rb +4 -1
  55. data/app/jobs/shipit/cache_deploy_spec_job.rb +1 -0
  56. data/app/jobs/shipit/chunk_rollup_job.rb +4 -0
  57. data/app/jobs/shipit/clear_git_cache_job.rb +1 -0
  58. data/app/jobs/shipit/continuous_delivery_job.rb +3 -1
  59. data/app/jobs/shipit/create_on_github_job.rb +7 -1
  60. data/app/jobs/shipit/create_release_statuses_job.rb +1 -0
  61. data/app/jobs/shipit/deferred_touch_job.rb +4 -0
  62. data/app/jobs/shipit/deliver_hook_job.rb +1 -0
  63. data/app/jobs/shipit/destroy_job.rb +1 -0
  64. data/app/jobs/shipit/destroy_repository_job.rb +24 -0
  65. data/app/jobs/shipit/destroy_stack_job.rb +5 -4
  66. data/app/jobs/shipit/emit_event_job.rb +2 -1
  67. data/app/jobs/shipit/fetch_commit_stats_job.rb +1 -0
  68. data/app/jobs/shipit/fetch_deployed_revision_job.rb +1 -0
  69. data/app/jobs/shipit/github_sync_job.rb +2 -1
  70. data/app/jobs/shipit/{mark_deploy_healty_job.rb → mark_deploy_healthy_job.rb} +1 -0
  71. data/app/jobs/shipit/perform_commit_checks_job.rb +1 -0
  72. data/app/jobs/shipit/perform_task_job.rb +5 -90
  73. data/app/jobs/shipit/process_merge_requests_job.rb +32 -0
  74. data/app/jobs/shipit/purge_old_deliveries_job.rb +1 -0
  75. data/app/jobs/shipit/reap_dead_tasks_job.rb +21 -0
  76. data/app/jobs/shipit/refresh_check_runs_job.rb +1 -0
  77. data/app/jobs/shipit/refresh_github_user_job.rb +1 -0
  78. data/app/jobs/shipit/refresh_merge_request_job.rb +11 -0
  79. data/app/jobs/shipit/refresh_statuses_job.rb +1 -0
  80. data/app/jobs/shipit/setup_github_hook_job.rb +1 -0
  81. data/app/jobs/shipit/update_estimated_deploy_duration_job.rb +1 -0
  82. data/app/jobs/shipit/update_github_last_deployed_ref_job.rb +4 -3
  83. data/app/models/concerns/shipit/deferred_touch.rb +4 -3
  84. data/app/models/shipit/anonymous_user.rb +9 -0
  85. data/app/models/shipit/api_client.rb +3 -2
  86. data/app/models/shipit/application_record.rb +2 -1
  87. data/app/models/shipit/check_run.rb +5 -4
  88. data/app/models/shipit/command_line_user.rb +5 -0
  89. data/app/models/shipit/commit.rb +41 -22
  90. data/app/models/shipit/commit_checks.rb +2 -0
  91. data/app/models/shipit/commit_deployment.rb +17 -12
  92. data/app/models/shipit/commit_deployment_status.rb +8 -3
  93. data/app/models/shipit/commit_message.rb +1 -0
  94. data/app/models/shipit/delivery.rb +4 -3
  95. data/app/models/shipit/deploy.rb +41 -10
  96. data/app/models/shipit/deploy_spec.rb +38 -7
  97. data/app/models/shipit/deploy_spec/bundler_discovery.rb +2 -1
  98. data/app/models/shipit/deploy_spec/capistrano_discovery.rb +1 -0
  99. data/app/models/shipit/deploy_spec/file_system.rb +20 -7
  100. data/app/models/shipit/deploy_spec/kubernetes_discovery.rb +1 -0
  101. data/app/models/shipit/deploy_spec/lerna_discovery.rb +1 -0
  102. data/app/models/shipit/deploy_spec/npm_discovery.rb +5 -4
  103. data/app/models/shipit/deploy_spec/pypi_discovery.rb +1 -0
  104. data/app/models/shipit/deploy_spec/rubygems_discovery.rb +1 -0
  105. data/app/models/shipit/deploy_stats.rb +58 -0
  106. data/app/models/shipit/duration.rb +3 -2
  107. data/app/models/shipit/ephemeral_commit_checks.rb +1 -0
  108. data/app/models/shipit/github_hook.rb +2 -1
  109. data/app/models/shipit/github_status.rb +2 -1
  110. data/app/models/shipit/hook.rb +8 -5
  111. data/app/models/shipit/membership.rb +3 -2
  112. data/app/models/shipit/merge_request.rb +302 -0
  113. data/app/models/shipit/output_chunk.rb +7 -2
  114. data/app/models/shipit/provisioning_handler.rb +32 -0
  115. data/app/models/shipit/provisioning_handler/base.rb +30 -0
  116. data/app/models/shipit/provisioning_handler/unregistered_provisioning_handler.rb +35 -0
  117. data/app/models/shipit/pull_request.rb +27 -260
  118. data/app/models/shipit/pull_request_assignment.rb +10 -0
  119. data/app/models/shipit/record.rb +18 -0
  120. data/app/models/shipit/release_status.rb +3 -2
  121. data/app/models/shipit/repository.rb +97 -0
  122. data/app/models/shipit/review_stack.rb +116 -0
  123. data/app/models/shipit/review_stack_provisioning_queue.rb +39 -0
  124. data/app/models/shipit/rollback.rb +1 -0
  125. data/app/models/shipit/stack.rb +130 -57
  126. data/app/models/shipit/status.rb +3 -2
  127. data/app/models/shipit/status/common.rb +7 -6
  128. data/app/models/shipit/status/group.rb +1 -0
  129. data/app/models/shipit/status/missing.rb +2 -1
  130. data/app/models/shipit/status/unknown.rb +2 -1
  131. data/app/models/shipit/task.rb +118 -14
  132. data/app/models/shipit/task_definition.rb +1 -0
  133. data/app/models/shipit/task_execution_strategy/base.rb +20 -0
  134. data/app/models/shipit/task_execution_strategy/default.rb +110 -0
  135. data/app/models/shipit/team.rb +2 -1
  136. data/app/models/shipit/undeployed_commit.rb +1 -0
  137. data/app/models/shipit/unlimited_api_client.rb +1 -0
  138. data/app/models/shipit/user.rb +15 -8
  139. data/app/models/shipit/variable_definition.rb +1 -0
  140. data/app/models/shipit/webhooks.rb +43 -0
  141. data/app/models/shipit/webhooks/handlers/check_suite_handler.rb +20 -0
  142. data/app/models/shipit/webhooks/handlers/handler.rb +41 -0
  143. data/app/models/shipit/webhooks/handlers/membership_handler.rb +46 -0
  144. data/app/models/shipit/webhooks/handlers/pull_request/assigned_handler.rb +74 -0
  145. data/app/models/shipit/webhooks/handlers/pull_request/closed_handler.rb +68 -0
  146. data/app/models/shipit/webhooks/handlers/pull_request/edited_handler.rb +74 -0
  147. data/app/models/shipit/webhooks/handlers/pull_request/label_capturing_handler.rb +127 -0
  148. data/app/models/shipit/webhooks/handlers/pull_request/labeled_handler.rb +106 -0
  149. data/app/models/shipit/webhooks/handlers/pull_request/opened_handler.rb +83 -0
  150. data/app/models/shipit/webhooks/handlers/pull_request/reopened_handler.rb +88 -0
  151. data/app/models/shipit/webhooks/handlers/pull_request/review_stack_adapter.rb +103 -0
  152. data/app/models/shipit/webhooks/handlers/pull_request/unlabeled_handler.rb +107 -0
  153. data/app/models/shipit/webhooks/handlers/push_handler.rb +21 -0
  154. data/app/models/shipit/webhooks/handlers/status_handler.rb +27 -0
  155. data/app/serializers/concerns/shipit/conditional_attributes.rb +1 -0
  156. data/app/serializers/shipit/anonymous_user_serializer.rb +1 -0
  157. data/app/serializers/shipit/command_line_user_serializer.rb +1 -0
  158. data/app/serializers/shipit/commit_serializer.rb +1 -0
  159. data/app/serializers/shipit/deploy_serializer.rb +8 -1
  160. data/app/serializers/shipit/hook_serializer.rb +1 -0
  161. data/app/serializers/shipit/merge_request_serializer.rb +21 -0
  162. data/app/serializers/shipit/pull_request_serializer.rb +6 -8
  163. data/app/serializers/shipit/review_stack_serializer.rb +7 -0
  164. data/app/serializers/shipit/rollback_serializer.rb +1 -0
  165. data/app/serializers/shipit/short_commit_serializer.rb +1 -0
  166. data/app/serializers/shipit/stack_serializer.rb +12 -5
  167. data/app/serializers/shipit/tail_task_serializer.rb +11 -2
  168. data/app/serializers/shipit/task_serializer.rb +2 -17
  169. data/app/serializers/shipit/user_serializer.rb +6 -1
  170. data/app/validators/ascii_only_validator.rb +4 -3
  171. data/app/validators/subset_validator.rb +1 -0
  172. data/app/views/layouts/_head.html.erb +0 -0
  173. data/app/views/layouts/shipit.html.erb +5 -3
  174. data/app/views/shipit/_variables.html.erb +1 -1
  175. data/app/views/shipit/api_clients/index.html.erb +36 -0
  176. data/app/views/shipit/api_clients/new.html.erb +33 -0
  177. data/app/views/shipit/api_clients/show.html.erb +35 -0
  178. data/app/views/shipit/ccmenu/project.xml.builder +2 -1
  179. data/app/views/shipit/deploys/show.html.erb +2 -2
  180. data/app/views/shipit/merge_requests/_merge_request.html.erb +29 -0
  181. data/app/views/shipit/{pull_requests → merge_requests}/index.html.erb +2 -2
  182. data/app/views/shipit/merge_requests/merge_requests/_pull_request.html.erb +29 -0
  183. data/app/views/shipit/merge_requests/merge_requests/index.html.erb +20 -0
  184. data/app/views/shipit/merge_status/_merge_queue_button.html.erb +3 -3
  185. data/app/views/shipit/merge_status/backlogged.html.erb +1 -1
  186. data/app/views/shipit/merge_status/failure.html.erb +1 -1
  187. data/app/views/shipit/merge_status/locked.html.erb +1 -1
  188. data/app/views/shipit/merge_status/logged_out.erb +1 -1
  189. data/app/views/shipit/merge_status/success.html.erb +2 -2
  190. data/app/views/shipit/repositories/_header.html.erb +19 -0
  191. data/app/views/shipit/repositories/index.html.erb +31 -0
  192. data/app/views/shipit/repositories/new.html.erb +23 -0
  193. data/app/views/shipit/repositories/settings.html.erb +53 -0
  194. data/app/views/shipit/repositories/show.html.erb +30 -0
  195. data/app/views/shipit/stacks/_banners.html.erb +13 -0
  196. data/app/views/shipit/stacks/_header.html.erb +30 -12
  197. data/app/views/shipit/stacks/_links.html.erb +1 -0
  198. data/app/views/shipit/stacks/_stack.html.erb +8 -0
  199. data/app/views/shipit/stacks/all_tasks.html.erb +28 -0
  200. data/app/views/shipit/stacks/index.html.erb +9 -3
  201. data/app/views/shipit/stacks/settings.html.erb +22 -3
  202. data/app/views/shipit/stacks/show.html.erb +1 -1
  203. data/app/views/shipit/stacks/statistics.html.erb +82 -0
  204. data/app/views/shipit/tasks/_task_output.html.erb +1 -1
  205. data/app/views/shipit/tasks/show.html.erb +1 -1
  206. data/config/initializers/inflections.rb +2 -1
  207. data/config/locales/en.yml +18 -5
  208. data/config/routes.rb +29 -7
  209. data/db/migrate/20191209231045_create_shipit_repositories.rb +12 -0
  210. data/db/migrate/20191209231307_add_repository_reference_to_stacks.rb +15 -0
  211. data/db/migrate/20191216162728_backfill_repository_data.rb +22 -0
  212. data/db/migrate/20191216163010_remove_repository_information_from_stacks.rb +20 -0
  213. data/db/migrate/20191219205202_add_archived_since_to_stacks.rb +6 -0
  214. data/db/migrate/20200102175621_optional_task_commits.rb +6 -0
  215. data/db/migrate/20200109132519_add_sha_to_commit_deployments.rb +5 -0
  216. data/db/migrate/20200226211925_add_index_to_tasks_status.rb +5 -0
  217. data/db/migrate/20200427135152_add_pull_request_head_sha_to_commit.rb +5 -0
  218. data/db/migrate/20200615181558_add_rollback_once_aborted_to.rb +5 -0
  219. data/db/migrate/20200706145406_add_review_stacks.rb +12 -0
  220. data/db/migrate/20200804144639_rename_pull_request_to_merge_request.rb +7 -0
  221. data/db/migrate/20200804161512_rename_commits_pull_request_id_to_merge_request_id.rb +5 -0
  222. data/db/migrate/20200813134712_recreate_shipit_pull_requests.rb +22 -0
  223. data/db/migrate/20200813194056_create_pull_request_assignments.rb +8 -0
  224. data/db/migrate/20201001125502_add_provision_pr_stacks_flag_to_repositories.rb +7 -0
  225. data/db/migrate/20201008145809_add_retry_attempt_to_tasks.rb +5 -0
  226. data/db/migrate/20201008152744_add_max_retries_to_tasks.rb +5 -0
  227. data/lib/shipit.rb +23 -3
  228. data/lib/shipit/cast_value.rb +1 -0
  229. data/lib/shipit/command.rb +14 -18
  230. data/lib/shipit/commands.rb +5 -4
  231. data/lib/shipit/csv_serializer.rb +1 -0
  232. data/lib/shipit/deploy_commands.rb +1 -0
  233. data/lib/shipit/engine.rb +11 -2
  234. data/lib/shipit/environment_variables.rb +11 -1
  235. data/lib/shipit/first_parent_commits_iterator.rb +1 -0
  236. data/lib/shipit/flock.rb +1 -0
  237. data/lib/shipit/github_app.rb +41 -10
  238. data/lib/shipit/github_http_cache_middleware.rb +1 -0
  239. data/lib/shipit/null_serializer.rb +1 -0
  240. data/lib/shipit/octokit_check_runs.rb +3 -2
  241. data/lib/shipit/octokit_iterator.rb +3 -2
  242. data/lib/shipit/paginator.rb +3 -2
  243. data/lib/shipit/review_stack_commands.rb +8 -0
  244. data/lib/shipit/rollback_commands.rb +1 -0
  245. data/lib/shipit/same_site_cookie_middleware.rb +29 -0
  246. data/lib/shipit/simple_message_verifier.rb +1 -0
  247. data/lib/shipit/stack_commands.rb +12 -4
  248. data/lib/shipit/stat.rb +1 -0
  249. data/lib/shipit/task_commands.rb +23 -14
  250. data/lib/shipit/version.rb +2 -1
  251. data/lib/snippets/release-gem +5 -1
  252. data/lib/tasks/cron.rake +13 -2
  253. data/lib/tasks/dev.rake +3 -2
  254. data/lib/tasks/shipit.rake +16 -17
  255. data/lib/tasks/teams.rake +1 -0
  256. data/test/controllers/api/base_controller_test.rb +3 -2
  257. data/test/controllers/api/ccmenu_controller_test.rb +9 -8
  258. data/test/controllers/api/commits_controller_test.rb +3 -2
  259. data/test/controllers/api/deploys_controller_test.rb +15 -14
  260. data/test/controllers/api/hooks_controller_test.rb +8 -7
  261. data/test/controllers/api/locks_controller_test.rb +7 -6
  262. data/test/controllers/api/{pull_requests_controller_test.rb → merge_requests_controller_test.rb} +17 -16
  263. data/test/controllers/api/outputs_controller_test.rb +4 -2
  264. data/test/controllers/api/release_statuses_controller_test.rb +2 -1
  265. data/test/controllers/api/rollback_controller_test.rb +113 -0
  266. data/test/controllers/api/stacks_controller_test.rb +65 -16
  267. data/test/controllers/api/tasks_controller_test.rb +13 -12
  268. data/test/controllers/api_clients_controller_test.rb +104 -0
  269. data/test/controllers/ccmenu_controller_test.rb +4 -3
  270. data/test/controllers/commit_checks_controller_test.rb +4 -3
  271. data/test/controllers/commits_controller_test.rb +3 -2
  272. data/test/controllers/deploys_controller_test.rb +33 -22
  273. data/test/controllers/github_authentication_controller_test.rb +1 -0
  274. data/test/controllers/merge_requests_controller_test.rb +32 -0
  275. data/test/controllers/merge_status_controller_test.rb +27 -9
  276. data/test/controllers/release_statuses_controller_test.rb +3 -2
  277. data/test/controllers/repositories_controller_test.rb +71 -0
  278. data/test/controllers/rollbacks_controller_test.rb +9 -8
  279. data/test/controllers/stacks_controller_test.rb +72 -15
  280. data/test/controllers/status_controller_test.rb +1 -0
  281. data/test/controllers/tasks_controller_test.rb +33 -20
  282. data/test/controllers/webhooks_controller_test.rb +36 -9
  283. data/test/dummy/config/application.rb +7 -2
  284. data/test/dummy/config/environments/development.rb +23 -6
  285. data/test/dummy/config/environments/test.rb +2 -5
  286. data/test/dummy/db/schema.rb +76 -24
  287. data/test/dummy/db/seeds.rb +30 -16
  288. data/test/fixtures/payloads/check_suite_master.json +2 -2
  289. data/test/fixtures/payloads/invalid_pull_request.json +117 -0
  290. data/test/fixtures/payloads/provision_disabled_pull_request.json +454 -0
  291. data/test/fixtures/payloads/pull_request_assigned.json +480 -0
  292. data/test/fixtures/payloads/pull_request_closed.json +454 -0
  293. data/test/fixtures/payloads/pull_request_labeled.json +461 -0
  294. data/test/fixtures/payloads/pull_request_opened.json +454 -0
  295. data/test/fixtures/payloads/pull_request_reopened.json +454 -0
  296. data/test/fixtures/payloads/pull_request_unlabeled.json +454 -0
  297. data/test/fixtures/payloads/pull_request_with_no_repo.json +454 -0
  298. data/test/fixtures/shipit/commit_deployment_statuses.yml +4 -4
  299. data/test/fixtures/shipit/commit_deployments.yml +8 -8
  300. data/test/fixtures/shipit/commits.yml +52 -1
  301. data/test/fixtures/shipit/merge_requests.yml +141 -0
  302. data/test/fixtures/shipit/pull_request_assignments.yml +3 -0
  303. data/test/fixtures/shipit/pull_requests.yml +10 -131
  304. data/test/fixtures/shipit/repositories.yml +28 -0
  305. data/test/fixtures/shipit/stacks.yml +335 -30
  306. data/test/fixtures/shipit/statuses.yml +9 -0
  307. data/test/fixtures/shipit/tasks.yml +69 -3
  308. data/test/fixtures/shipit/users.yml +7 -0
  309. data/test/fixtures/timeout +2 -1
  310. data/test/helpers/api_helper.rb +1 -0
  311. data/test/helpers/fixture_aliases_helper.rb +1 -0
  312. data/test/helpers/hooks_helper.rb +2 -1
  313. data/test/helpers/json_helper.rb +15 -11
  314. data/test/helpers/links_helper.rb +4 -3
  315. data/test/helpers/payloads_helper.rb +5 -0
  316. data/test/helpers/queries_helper.rb +3 -2
  317. data/test/jobs/cache_deploy_spec_job_test.rb +2 -1
  318. data/test/jobs/chunk_rollup_job_test.rb +16 -1
  319. data/test/jobs/deliver_hook_job_test.rb +1 -0
  320. data/test/jobs/destroy_repository_job_test.rb +27 -0
  321. data/test/jobs/destroy_stack_job_test.rb +10 -0
  322. data/test/jobs/emit_event_job_test.rb +2 -1
  323. data/test/jobs/fetch_commit_stats_job_test.rb +1 -0
  324. data/test/jobs/fetch_deployed_revision_job_test.rb +1 -0
  325. data/test/jobs/github_sync_job_test.rb +1 -0
  326. data/test/jobs/mark_deploy_healthy_job_test.rb +1 -0
  327. data/test/jobs/perform_task_job_test.rb +12 -11
  328. data/test/jobs/{merge_pull_requests_job_test.rb → process_merge_requests_job_test.rb} +19 -18
  329. data/test/jobs/purge_old_deliveries_job_test.rb +1 -0
  330. data/test/jobs/reap_dead_tasks_job_test.rb +68 -0
  331. data/test/jobs/refresh_github_user_job_test.rb +1 -0
  332. data/test/jobs/refresh_status_job_test.rb +1 -0
  333. data/test/jobs/unique_job_test.rb +1 -0
  334. data/test/jobs/update_github_last_deployed_ref_job_test.rb +1 -0
  335. data/test/lib/shipit/deploy_commands_test.rb +16 -0
  336. data/test/lib/shipit/task_commands_test.rb +17 -0
  337. data/test/middleware/same_site_cookie_middleware_test.rb +52 -0
  338. data/test/models/api_client_test.rb +1 -0
  339. data/test/models/commit_checks_test.rb +1 -0
  340. data/test/models/commit_deployment_status_test.rb +34 -4
  341. data/test/models/commit_deployment_test.rb +9 -11
  342. data/test/models/commits_test.rb +116 -21
  343. data/test/models/delivery_test.rb +2 -1
  344. data/test/models/deploy_spec_test.rb +103 -65
  345. data/test/models/deploy_stats_test.rb +113 -0
  346. data/test/models/deploys_test.rb +207 -26
  347. data/test/models/duration_test.rb +1 -0
  348. data/test/models/github_hook_test.rb +1 -0
  349. data/test/models/hook_test.rb +20 -16
  350. data/test/models/membership_test.rb +1 -0
  351. data/test/models/{pull_request_test.rb → merge_request_test.rb} +48 -41
  352. data/test/models/pull_request_assignment_test.rb +16 -0
  353. data/test/models/release_statuses_test.rb +1 -0
  354. data/test/models/rollbacks_test.rb +1 -0
  355. data/test/models/shipit/check_run_test.rb +1 -0
  356. data/test/models/shipit/provisioning_handler/base_test.rb +33 -0
  357. data/test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb +49 -0
  358. data/test/models/shipit/provisioning_handler_test.rb +64 -0
  359. data/test/models/shipit/pull_request_test.rb +52 -0
  360. data/test/models/shipit/repository_test.rb +81 -0
  361. data/test/models/shipit/review_stack_provision_status_test.rb +77 -0
  362. data/test/models/shipit/review_stack_provisioning_queue_test.rb +63 -0
  363. data/test/models/shipit/review_stack_test.rb +59 -0
  364. data/test/models/{stacks_test.rb → shipit/stacks_test.rb} +120 -60
  365. data/test/models/shipit/webhooks/handlers/pull_request/assigned_handler_test.rb +45 -0
  366. data/test/models/shipit/webhooks/handlers/pull_request/closed_handler_test.rb +192 -0
  367. data/test/models/shipit/webhooks/handlers/pull_request/edited_handler_test.rb +47 -0
  368. data/test/models/shipit/webhooks/handlers/pull_request/label_capturing_handler_test.rb +209 -0
  369. data/test/models/shipit/webhooks/handlers/pull_request/labeled_handler_test.rb +332 -0
  370. data/test/models/shipit/webhooks/handlers/pull_request/opened_handler_test.rb +238 -0
  371. data/test/models/shipit/webhooks/handlers/pull_request/reopened_handler_test.rb +282 -0
  372. data/test/models/shipit/webhooks/handlers/pull_request/review_stack_adapter_test.rb +83 -0
  373. data/test/models/shipit/webhooks/handlers/pull_request/unlabeled_handler_test.rb +324 -0
  374. data/test/models/shipit/webhooks/handlers_test.rb +27 -0
  375. data/test/models/status/group_test.rb +1 -0
  376. data/test/models/status/missing_test.rb +1 -0
  377. data/test/models/status_test.rb +1 -0
  378. data/test/models/task_definitions_test.rb +9 -8
  379. data/test/models/tasks_test.rb +59 -1
  380. data/test/models/team_test.rb +4 -2
  381. data/test/models/undeployed_commits_test.rb +14 -0
  382. data/test/models/users_test.rb +13 -5
  383. data/test/serializers/shipit/pull_request_serializer_test.rb +29 -0
  384. data/test/test_command_integration.rb +3 -2
  385. data/test/test_helper.rb +37 -32
  386. data/test/unit/anonymous_user_serializer_test.rb +14 -0
  387. data/test/unit/command_test.rb +15 -10
  388. data/test/unit/commands_test.rb +1 -0
  389. data/test/unit/commit_serializer_test.rb +16 -0
  390. data/test/unit/csv_serializer_test.rb +3 -2
  391. data/test/unit/deploy_commands_test.rb +14 -4
  392. data/test/unit/deploy_serializer_test.rb +17 -0
  393. data/test/unit/environment_variables_test.rb +5 -4
  394. data/test/unit/github_app_test.rb +137 -0
  395. data/test/unit/github_url_helper_test.rb +6 -0
  396. data/test/unit/rollback_commands_test.rb +2 -1
  397. data/test/unit/shipit_helper_test.rb +17 -0
  398. data/test/unit/shipit_task_execution_strategy_test.rb +47 -0
  399. data/test/unit/shipit_test.rb +1 -0
  400. data/test/unit/user_serializer_test.rb +14 -0
  401. data/test/unit/variable_definition_test.rb +1 -0
  402. metadata +334 -169
  403. data/app/controllers/shipit/api/pull_requests_controller.rb +0 -36
  404. data/app/controllers/shipit/pull_requests_controller.rb +0 -30
  405. data/app/jobs/shipit/merge_pull_requests_job.rb +0 -31
  406. data/app/jobs/shipit/refresh_pull_request_job.rb +0 -10
  407. data/app/views/shipit/pull_requests/_pull_request.html.erb +0 -29
  408. data/test/controllers/pull_requests_controller_test.rb +0 -31
  409. data/test/fixtures/shipit/output_chunks.yml +0 -47
  410. data/test/models/output_chunk_test.rb +0 -20
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ require 'test_helper'
3
+
4
+ module Shipit
5
+ class CommitSerializerTest < ActiveSupport::TestCase
6
+ test 'commit includes author object' do
7
+ commit = shipit_commits(:first)
8
+
9
+ serializer = ActiveModel::Serializer.serializer_for(commit)
10
+ assert_equal CommitSerializer, serializer
11
+ serialized = serializer.new(commit).to_json
12
+
13
+ assert_json("author.name", commit.author.name, document: serialized)
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -28,7 +29,7 @@ module Shipit
28
29
  def assert_dumped(expected, object)
29
30
  message = "Expected CSVSerializer.dump(#{object.inspect}) to eq #{expected.inspect}"
30
31
  if expected.nil?
31
- assert_nil Shipit::CSVSerializer.dump(object), message
32
+ assert_nil(Shipit::CSVSerializer.dump(object), message)
32
33
  else
33
34
  assert_equal(expected, Shipit::CSVSerializer.dump(object), message)
34
35
  end
@@ -37,7 +38,7 @@ module Shipit
37
38
  def assert_loaded(expected, payload)
38
39
  message = "Expected CSVSerializer.load(#{payload.inspect}) to eq #{expected.inspect}"
39
40
  if expected.nil?
40
- assert_nil Shipit::CSVSerializer.load(payload), message
41
+ assert_nil(Shipit::CSVSerializer.load(payload), message)
41
42
  else
42
43
  assert_equal(expected, Shipit::CSVSerializer.load(payload), message)
43
44
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -10,7 +11,7 @@ module Shipit
10
11
  dependencies_steps!: ['bundle install --some-args'],
11
12
  deploy_steps!: ['bundle exec cap $ENVIRONMENT deploy'],
12
13
  rollback_steps!: ['bundle exec cap $ENVIRONMENT deploy:rollback'],
13
- machine_env: {'GLOBAL' => '1'},
14
+ machine_env: { 'GLOBAL' => '1' },
14
15
  directory: nil,
15
16
  clear_working_directory?: true,
16
17
  )
@@ -62,8 +63,8 @@ module Shipit
62
63
  commands = @commands.clone
63
64
  assert_equal 2, commands.size
64
65
  clone_args = [
65
- 'git', 'clone', '--local',
66
- '--origin', 'cache',
66
+ 'git', 'clone', '--quiet',
67
+ '--local', '--origin', 'cache',
67
68
  @stack.git_path, @deploy.working_directory
68
69
  ]
69
70
  assert_equal clone_args, commands.first.args
@@ -190,7 +191,7 @@ module Shipit
190
191
  end
191
192
 
192
193
  test "the deploy's `env` is merged in ENVIRONMENT" do
193
- @deploy.env = {'FOO' => 'BAR'}
194
+ @deploy.env = { 'FOO' => 'BAR' }
194
195
  command = @commands.install_dependencies.first
195
196
  assert_equal 'BAR', command.env['FOO']
196
197
  end
@@ -212,6 +213,15 @@ module Shipit
212
213
  assert_equal walrus.name, @commands.env['GIT_COMMITTER_NAME']
213
214
  end
214
215
 
216
+ test "GitHub repo details are exposed" do
217
+ assert_equal 'shopify', @commands.env['GITHUB_REPO_OWNER']
218
+ assert_equal 'shipit-engine', @commands.env['GITHUB_REPO_NAME']
219
+ end
220
+
221
+ test "Stack DEPLOY_URL is exposed" do
222
+ assert_equal "https://shipit.shopify.com", @commands.env['DEPLOY_URL']
223
+ end
224
+
215
225
  test "#clear_working_directory rm -rf the working directory" do
216
226
  FileUtils.expects(:rm_rf).with(@deploy.working_directory)
217
227
  @commands.clear_working_directory
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ require 'test_helper'
3
+
4
+ module Shipit
5
+ class DeploySerializerTest < ActiveSupport::TestCase
6
+ test 'deploy commits includes author object' do
7
+ deploy = shipit_deploys(:shipit)
8
+ first_commit_author = deploy.commits.first.author
9
+
10
+ serializer = ActiveModel::Serializer.serializer_for(deploy)
11
+ assert_equal DeploySerializer, serializer
12
+ serialized = serializer.new(deploy).to_json
13
+
14
+ assert_json("commits.0.author.name", first_commit_author.name, document: serialized)
15
+ end
16
+ end
17
+ end
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
4
5
  class EnvironmentVariablesTest < ActiveSupport::TestCase
5
6
  def setup
6
7
  variable_defs = [
7
- {"name" => "FOO", "title" => "Set to 0 to foo", "default" => 1},
8
- {"name" => "BAR", "title" => "Set to 1 to bar", "default" => 0},
8
+ { "name" => "FOO", "title" => "Set to 0 to foo", "default" => 1 },
9
+ { "name" => "BAR", "title" => "Set to 1 to bar", "default" => 0 },
9
10
  ]
10
11
  @variable_definitions = variable_defs.map(&VariableDefinition.method(:new))
11
12
  end
@@ -16,7 +17,7 @@ module Shipit
16
17
  end
17
18
 
18
19
  test 'correctly sanitizes env variables' do
19
- env = {'FOO' => 1, 'BAR' => 1}
20
+ env = { 'FOO' => 1, 'BAR' => 1 }
20
21
  assert_equal env, EnvironmentVariables.with(env).permit(@variable_definitions)
21
22
  end
22
23
 
@@ -27,7 +28,7 @@ module Shipit
27
28
  end
28
29
 
29
30
  test 'throws an exception when a variable is not whitelisted' do
30
- env = {'UNSAFE_VARIABLE' => 1}
31
+ env = { 'UNSAFE_VARIABLE' => 1 }
31
32
  assert_raises(EnvironmentVariables::NotPermitted) do
32
33
  EnvironmentVariables.with(env).permit(@variable_definitions)
33
34
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -5,6 +6,14 @@ module Shipit
5
6
  setup do
6
7
  @github = app
7
8
  @enterprise = app(domain: 'github.example.com')
9
+ @rails_env = Rails.env
10
+ @token_cache_key = 'github:integration:access-token'
11
+ Rails.cache.delete(@token_cache_key)
12
+ end
13
+
14
+ teardown do
15
+ Rails.env = @rails_env
16
+ Rails.cache.delete(@token_cache_key)
8
17
  end
9
18
 
10
19
  test "#initialize doesn't raise if given an empty config" do
@@ -51,6 +60,11 @@ module Shipit
51
60
  assert_equal 'https://github.example.com/foo/bar/baz', @enterprise.url('foo/bar', 'baz')
52
61
  end
53
62
 
63
+ test "#new_client retruns an Octokit::Client configured to use the github installation" do
64
+ assert_equal 'https://github.example.com/', @enterprise.new_client.web_endpoint
65
+ assert_equal 'https://github.example.com/api/v3/', @enterprise.new_client.api_endpoint
66
+ end
67
+
54
68
  test "#oauth_config.last[:client_options] is nil if domain is not overriden" do
55
69
  assert_nil @github.oauth_config.last[:client_options][:site]
56
70
  end
@@ -59,6 +73,129 @@ module Shipit
59
73
  assert_equal 'https://github.example.com/api/v3/', @enterprise.oauth_config.last[:client_options][:site]
60
74
  end
61
75
 
76
+ test "#github token is refreshed after expiration" do
77
+ Rails.env = 'not_test'
78
+ config = {
79
+ app_id: "test_id",
80
+ installation_id: "test_installation_id",
81
+ private_key: "test_private_key",
82
+ }
83
+ initial_token = OpenStruct.new(
84
+ token: "some_initial_github_token",
85
+ expires_at: Time.now.utc + 60.minutes,
86
+ )
87
+ second_token = OpenStruct.new(
88
+ token: "some_new_github_token",
89
+ expires_at: initial_token.expires_at + 60.minutes,
90
+ )
91
+ auth_payload = "test_auth_payload"
92
+
93
+ GitHubApp.any_instance.expects(:authentication_payload).twice.returns(auth_payload)
94
+ valid_app = app(config)
95
+
96
+ freeze_time do
97
+ Octokit::Client
98
+ .any_instance
99
+ .expects(:create_app_installation_access_token).twice.with(config[:installation_id], anything)
100
+ .returns(initial_token, second_token)
101
+
102
+ initial_token = valid_app.token
103
+ initial_cached_token = Rails.cache.fetch(@token_cache_key)
104
+ assert_equal initial_token, initial_cached_token.to_s
105
+
106
+ travel 5.minutes
107
+ assert_equal initial_token, valid_app.token
108
+
109
+ travel_to initial_cached_token.expires_at + 5.minutes
110
+ assert_equal second_token.token, valid_app.token
111
+ end
112
+ end
113
+
114
+ test "#github token is refreshed in refresh window before expiry" do
115
+ Rails.env = 'not_test'
116
+ config = {
117
+ app_id: "test_id",
118
+ installation_id: "test_installation_id",
119
+ private_key: "test_private_key",
120
+ }
121
+ initial_token = OpenStruct.new(
122
+ token: "some_initial_github_token",
123
+ expires_at: Time.now.utc + 60.minutes,
124
+ )
125
+ second_token = OpenStruct.new(
126
+ token: "some_new_github_token",
127
+ expires_at: initial_token.expires_at + 60.minutes,
128
+ )
129
+ auth_payload = "test_auth_payload"
130
+
131
+ GitHubApp.any_instance.expects(:authentication_payload).twice.returns(auth_payload)
132
+ valid_app = app(config)
133
+
134
+ freeze_time do
135
+ Octokit::Client
136
+ .any_instance
137
+ .expects(:create_app_installation_access_token).twice.with(config[:installation_id], anything)
138
+ .returns(initial_token, second_token)
139
+
140
+ initial_token = valid_app.token
141
+ initial_cached_token = Rails.cache.fetch(@token_cache_key)
142
+ assert_equal initial_token, initial_cached_token.to_s
143
+
144
+ # Travel forward, but before the token is refreshed, so the cached value should be the same.
145
+ travel 40.minutes
146
+ assert_equal initial_token, valid_app.token
147
+
148
+ # Travel to when the token should refresh, but is not expired, which should result in our cache.fetch update block.
149
+ travel 15.minutes
150
+ updated_token = valid_app.token
151
+ assert_not_equal initial_token, updated_token
152
+
153
+ cached_token = Rails.cache.fetch(@token_cache_key)
154
+ assert_operator cached_token.expires_at, :>, initial_cached_token.expires_at
155
+ end
156
+ end
157
+
158
+ test "#github token is missing refresh_at field" do
159
+ # $debugging = true
160
+ Rails.env = 'not_test'
161
+ config = {
162
+ app_id: "test_id",
163
+ installation_id: "test_installation_id",
164
+ private_key: "test_private_key",
165
+ }
166
+ initial_cached_token = Shipit::GitHubApp::Token.new("some_initial_github_token", Time.now.utc - 1.minute)
167
+ initial_cached_token.instance_variable_set(:@refresh_at, nil)
168
+
169
+ second_token = OpenStruct.new(
170
+ token: "some_new_github_token",
171
+ expires_at: initial_cached_token.expires_at + 60.minutes,
172
+ )
173
+ auth_payload = "test_auth_payload"
174
+
175
+ GitHubApp.any_instance.expects(:authentication_payload).returns(auth_payload)
176
+ valid_app = app(config)
177
+
178
+ freeze_time do
179
+ valid_app.instance_variable_set(:@token, initial_cached_token)
180
+ Rails.cache.write(@token_cache_key, initial_cached_token, expires_in: 1.minute)
181
+
182
+ Octokit::Client
183
+ .any_instance
184
+ .expects(:create_app_installation_access_token).with(config[:installation_id], anything)
185
+ .returns(second_token)
186
+
187
+ first_token = valid_app.token
188
+
189
+ first_cached_token = Rails.cache.fetch(@token_cache_key)
190
+ assert_equal first_token, first_cached_token.to_s
191
+
192
+ travel_to first_cached_token.expires_at + 5.minutes
193
+ new_token = valid_app.token
194
+
195
+ assert_equal second_token.token, new_token
196
+ end
197
+ end
198
+
62
199
  private
63
200
 
64
201
  def app(extra_config = {})
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -16,5 +17,10 @@ module Shipit
16
17
  expected = 'https://github.com/shopify/shipit-engine/commit/6d9278037b872fd9a6690523e411ecb3aa181355'
17
18
  assert_equal expected, github_commit_url(shipit_commits(:first))
18
19
  end
20
+
21
+ test "#github_pull_request_url returns a PR url" do
22
+ expected = 'https://github.com/shopify/shipit-engine/pull/62'
23
+ assert_equal expected, github_pull_request_url(shipit_merge_requests(:shipit_pending))
24
+ end
19
25
  end
20
26
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -10,7 +11,7 @@ module Shipit
10
11
  dependencies_steps!: ['bundle install --some-args'],
11
12
  deploy_steps!: ['bundle exec cap $ENVIRONMENT deploy'],
12
13
  rollback_steps!: ['bundle exec cap $ENVIRONMENT deploy:rollback'],
13
- machine_env: {'GLOBAL' => '1'},
14
+ machine_env: { 'GLOBAL' => '1' },
14
15
  directory: nil,
15
16
  clear_working_directory?: true,
16
17
  )
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ require 'test_helper'
3
+
4
+ module Shipit
5
+ class ShipitHelperTest < ActionView::TestCase
6
+ include Shipit::ShipitHelper
7
+ include ERB::Util
8
+
9
+ test "#emojify embeds known emojis" do
10
+ assert_includes emojify(':smile:'), '<img'
11
+ end
12
+
13
+ test "#emojify returns unknown emojis" do
14
+ assert_equal ':unknown:', emojify(':unknown:')
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ module Shipit
6
+ class ShipitTaskExecutionStrategyTest < ActiveSupport::TestCase
7
+ setup do
8
+ class FakeExecutionStrategy < Shipit::TaskExecutionStrategy::Base
9
+ def execute; end
10
+ end
11
+ end
12
+
13
+ teardown do
14
+ Shipit.task_execution_strategy = nil
15
+
16
+ Object.send(:remove_const, :FakeExecutionStrategy) if Object.const_defined?(:FakeExecutionStrategy)
17
+ end
18
+
19
+ test "uses the default strategy" do
20
+ Shipit.task_execution_strategy = nil
21
+
22
+ assert_equal Shipit::TaskExecutionStrategy::Default, Shipit.task_execution_strategy
23
+ end
24
+
25
+ test "allows registration of an execution strategy" do
26
+ strategy = FakeExecutionStrategy
27
+
28
+ Shipit.task_execution_strategy = strategy
29
+
30
+ assert_equal(
31
+ strategy,
32
+ Shipit.task_execution_strategy
33
+ )
34
+ end
35
+
36
+ test "the registered execution strategy is invoked during execution of a task" do
37
+ task_type = Shipit::Deploy
38
+ task = task_type.new
39
+ strategy = FakeExecutionStrategy
40
+ strategy.any_instance.expects(:execute)
41
+
42
+ Shipit.task_execution_strategy = strategy
43
+
44
+ Shipit::PerformTaskJob.new.perform(task)
45
+ end
46
+ end
47
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ require 'test_helper'
3
+
4
+ module Shipit
5
+ class UserSerializerTest < ActiveSupport::TestCase
6
+ test 'includes anonymous key' do
7
+ user = User.new
8
+ serializer = ActiveModel::Serializer.serializer_for(user)
9
+ assert_equal UserSerializer, serializer
10
+ serialized = serializer.new(user).to_json
11
+ assert_json("anonymous", false, document: serialized)
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  module Shipit
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.28.1
4
+ version: 0.33.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: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -72,42 +72,42 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '4.2'
75
+ version: '5.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '4.2'
82
+ version: '5.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: explicit-parameters
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.3.0
89
+ version: 0.4.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.3.0
96
+ version: 0.4.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: faraday
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.12.2
103
+ version: '0.15'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.12.2
110
+ version: '0.15'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: faraday-http-cache
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -170,56 +170,56 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 4.12.0
173
+ version: '4.15'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 4.12.0
180
+ version: '4.15'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: omniauth-github
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.3.0
187
+ version: '1.4'
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 1.3.0
194
+ version: '1.4'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: pubsubstub
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.1.2
201
+ version: 0.2.0
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.1.2
208
+ version: 0.2.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: rails
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 5.2.1
215
+ version: 6.0.0
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 5.2.1
222
+ version: 6.0.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: rails-timeago
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -252,58 +252,58 @@ dependencies:
252
252
  name: rake
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - "~>"
255
+ - - ">="
256
256
  - !ruby/object:Gem::Version
257
- version: '10.0'
257
+ version: '0'
258
258
  type: :runtime
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - "~>"
262
+ - - ">="
263
263
  - !ruby/object:Gem::Version
264
- version: '10.0'
264
+ version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: redis-namespace
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
269
  - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: 1.5.2
271
+ version: 1.6.0
272
272
  type: :runtime
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: 1.5.2
278
+ version: 1.6.0
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: redis-objects
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: 1.2.1
285
+ version: 1.4.3
286
286
  type: :runtime
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: 1.2.1
292
+ version: 1.4.3
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: responders
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - "~>"
298
298
  - !ruby/object:Gem::Version
299
- version: 2.4.0
299
+ version: '3.0'
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - "~>"
305
305
  - !ruby/object:Gem::Version
306
- version: 2.4.0
306
+ version: '3.0'
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: safe_yaml
309
309
  requirement: !ruby/object:Gem::Requirement
@@ -366,14 +366,14 @@ dependencies:
366
366
  requirements:
367
367
  - - "~>"
368
368
  - !ruby/object:Gem::Version
369
- version: 0.5.0
369
+ version: 0.6.0
370
370
  type: :runtime
371
371
  prerelease: false
372
372
  version_requirements: !ruby/object:Gem::Requirement
373
373
  requirements:
374
374
  - - "~>"
375
375
  - !ruby/object:Gem::Version
376
- version: 0.5.0
376
+ version: 0.6.0
377
377
  - !ruby/object:Gem::Dependency
378
378
  name: validate_url
379
379
  requirement: !ruby/object:Gem::Requirement
@@ -401,6 +401,7 @@ files:
401
401
  - app/assets/images/aborted.svg
402
402
  - app/assets/images/aborting.svg
403
403
  - app/assets/images/anchor.svg
404
+ - app/assets/images/archive-solid.svg
404
405
  - app/assets/images/caret-down.svg
405
406
  - app/assets/images/default.svg
406
407
  - app/assets/images/deploy_error.jpg
@@ -417,6 +418,7 @@ files:
417
418
  - app/assets/images/flapping.svg
418
419
  - app/assets/images/lock.svg
419
420
  - app/assets/images/logo.svg
421
+ - app/assets/images/magic-solid.svg
420
422
  - app/assets/images/pending-small.svg
421
423
  - app/assets/images/pending.gif
422
424
  - app/assets/images/search-active.svg
@@ -436,7 +438,8 @@ files:
436
438
  - app/assets/javascripts/shipit/deploy.js.coffee
437
439
  - app/assets/javascripts/shipit/flash.js.coffee
438
440
  - app/assets/javascripts/shipit/page_updater.js.coffee
439
- - app/assets/javascripts/shipit/search.js.coffee
441
+ - app/assets/javascripts/shipit/repositories_search.js.coffee
442
+ - app/assets/javascripts/shipit/stack_search.js.coffee
440
443
  - app/assets/javascripts/shipit/stacks.js.coffee
441
444
  - app/assets/javascripts/task.js.coffee
442
445
  - app/assets/javascripts/task/ansi_colors.js.coffee
@@ -458,6 +461,7 @@ files:
458
461
  - app/assets/stylesheets/_base/_utility.scss
459
462
  - app/assets/stylesheets/_pages/_commits.scss
460
463
  - app/assets/stylesheets/_pages/_deploy.scss
464
+ - app/assets/stylesheets/_pages/_repositories.scss
461
465
  - app/assets/stylesheets/_pages/_settings.scss
462
466
  - app/assets/stylesheets/_pages/_stacks.scss
463
467
  - app/assets/stylesheets/_structure/_layout.scss
@@ -469,6 +473,7 @@ files:
469
473
  - app/assets/webfonts/CheckoutSymbols-Regular.svg
470
474
  - app/assets/webfonts/CheckoutSymbols-Regular.ttf
471
475
  - app/assets/webfonts/CheckoutSymbols-Regular.woff
476
+ - app/controllers/concerns/shipit/active_model_serializers_patch.rb
472
477
  - app/controllers/concerns/shipit/api/cacheable.rb
473
478
  - app/controllers/concerns/shipit/api/paginable.rb
474
479
  - app/controllers/concerns/shipit/api/rendering.rb
@@ -480,19 +485,22 @@ files:
480
485
  - app/controllers/shipit/api/deploys_controller.rb
481
486
  - app/controllers/shipit/api/hooks_controller.rb
482
487
  - app/controllers/shipit/api/locks_controller.rb
488
+ - app/controllers/shipit/api/merge_requests_controller.rb
483
489
  - app/controllers/shipit/api/outputs_controller.rb
484
- - app/controllers/shipit/api/pull_requests_controller.rb
485
490
  - app/controllers/shipit/api/release_statuses_controller.rb
491
+ - app/controllers/shipit/api/rollbacks_controller.rb
486
492
  - app/controllers/shipit/api/stacks_controller.rb
487
493
  - app/controllers/shipit/api/tasks_controller.rb
494
+ - app/controllers/shipit/api_clients_controller.rb
488
495
  - app/controllers/shipit/ccmenu_url_controller.rb
489
496
  - app/controllers/shipit/commit_checks_controller.rb
490
497
  - app/controllers/shipit/commits_controller.rb
491
498
  - app/controllers/shipit/deploys_controller.rb
492
499
  - app/controllers/shipit/github_authentication_controller.rb
500
+ - app/controllers/shipit/merge_requests_controller.rb
493
501
  - app/controllers/shipit/merge_status_controller.rb
494
- - app/controllers/shipit/pull_requests_controller.rb
495
502
  - app/controllers/shipit/release_statuses_controller.rb
503
+ - app/controllers/shipit/repositories_controller.rb
496
504
  - app/controllers/shipit/rollbacks_controller.rb
497
505
  - app/controllers/shipit/shipit_controller.rb
498
506
  - app/controllers/shipit/stacks_controller.rb
@@ -517,19 +525,21 @@ files:
517
525
  - app/jobs/shipit/deferred_touch_job.rb
518
526
  - app/jobs/shipit/deliver_hook_job.rb
519
527
  - app/jobs/shipit/destroy_job.rb
528
+ - app/jobs/shipit/destroy_repository_job.rb
520
529
  - app/jobs/shipit/destroy_stack_job.rb
521
530
  - app/jobs/shipit/emit_event_job.rb
522
531
  - app/jobs/shipit/fetch_commit_stats_job.rb
523
532
  - app/jobs/shipit/fetch_deployed_revision_job.rb
524
533
  - app/jobs/shipit/github_sync_job.rb
525
- - app/jobs/shipit/mark_deploy_healty_job.rb
526
- - app/jobs/shipit/merge_pull_requests_job.rb
534
+ - app/jobs/shipit/mark_deploy_healthy_job.rb
527
535
  - app/jobs/shipit/perform_commit_checks_job.rb
528
536
  - app/jobs/shipit/perform_task_job.rb
537
+ - app/jobs/shipit/process_merge_requests_job.rb
529
538
  - app/jobs/shipit/purge_old_deliveries_job.rb
539
+ - app/jobs/shipit/reap_dead_tasks_job.rb
530
540
  - app/jobs/shipit/refresh_check_runs_job.rb
531
541
  - app/jobs/shipit/refresh_github_user_job.rb
532
- - app/jobs/shipit/refresh_pull_request_job.rb
542
+ - app/jobs/shipit/refresh_merge_request_job.rb
533
543
  - app/jobs/shipit/refresh_statuses_job.rb
534
544
  - app/jobs/shipit/setup_github_hook_job.rb
535
545
  - app/jobs/shipit/update_estimated_deploy_duration_job.rb
@@ -556,15 +566,25 @@ files:
556
566
  - app/models/shipit/deploy_spec/npm_discovery.rb
557
567
  - app/models/shipit/deploy_spec/pypi_discovery.rb
558
568
  - app/models/shipit/deploy_spec/rubygems_discovery.rb
569
+ - app/models/shipit/deploy_stats.rb
559
570
  - app/models/shipit/duration.rb
560
571
  - app/models/shipit/ephemeral_commit_checks.rb
561
572
  - app/models/shipit/github_hook.rb
562
573
  - app/models/shipit/github_status.rb
563
574
  - app/models/shipit/hook.rb
564
575
  - app/models/shipit/membership.rb
576
+ - app/models/shipit/merge_request.rb
565
577
  - app/models/shipit/output_chunk.rb
578
+ - app/models/shipit/provisioning_handler.rb
579
+ - app/models/shipit/provisioning_handler/base.rb
580
+ - app/models/shipit/provisioning_handler/unregistered_provisioning_handler.rb
566
581
  - app/models/shipit/pull_request.rb
582
+ - app/models/shipit/pull_request_assignment.rb
583
+ - app/models/shipit/record.rb
567
584
  - app/models/shipit/release_status.rb
585
+ - app/models/shipit/repository.rb
586
+ - app/models/shipit/review_stack.rb
587
+ - app/models/shipit/review_stack_provisioning_queue.rb
568
588
  - app/models/shipit/rollback.rb
569
589
  - app/models/shipit/stack.rb
570
590
  - app/models/shipit/status.rb
@@ -574,18 +594,37 @@ files:
574
594
  - app/models/shipit/status/unknown.rb
575
595
  - app/models/shipit/task.rb
576
596
  - app/models/shipit/task_definition.rb
597
+ - app/models/shipit/task_execution_strategy/base.rb
598
+ - app/models/shipit/task_execution_strategy/default.rb
577
599
  - app/models/shipit/team.rb
578
600
  - app/models/shipit/undeployed_commit.rb
579
601
  - app/models/shipit/unlimited_api_client.rb
580
602
  - app/models/shipit/user.rb
581
603
  - app/models/shipit/variable_definition.rb
604
+ - app/models/shipit/webhooks.rb
605
+ - app/models/shipit/webhooks/handlers/check_suite_handler.rb
606
+ - app/models/shipit/webhooks/handlers/handler.rb
607
+ - app/models/shipit/webhooks/handlers/membership_handler.rb
608
+ - app/models/shipit/webhooks/handlers/pull_request/assigned_handler.rb
609
+ - app/models/shipit/webhooks/handlers/pull_request/closed_handler.rb
610
+ - app/models/shipit/webhooks/handlers/pull_request/edited_handler.rb
611
+ - app/models/shipit/webhooks/handlers/pull_request/label_capturing_handler.rb
612
+ - app/models/shipit/webhooks/handlers/pull_request/labeled_handler.rb
613
+ - app/models/shipit/webhooks/handlers/pull_request/opened_handler.rb
614
+ - app/models/shipit/webhooks/handlers/pull_request/reopened_handler.rb
615
+ - app/models/shipit/webhooks/handlers/pull_request/review_stack_adapter.rb
616
+ - app/models/shipit/webhooks/handlers/pull_request/unlabeled_handler.rb
617
+ - app/models/shipit/webhooks/handlers/push_handler.rb
618
+ - app/models/shipit/webhooks/handlers/status_handler.rb
582
619
  - app/serializers/concerns/shipit/conditional_attributes.rb
583
620
  - app/serializers/shipit/anonymous_user_serializer.rb
584
621
  - app/serializers/shipit/command_line_user_serializer.rb
585
622
  - app/serializers/shipit/commit_serializer.rb
586
623
  - app/serializers/shipit/deploy_serializer.rb
587
624
  - app/serializers/shipit/hook_serializer.rb
625
+ - app/serializers/shipit/merge_request_serializer.rb
588
626
  - app/serializers/shipit/pull_request_serializer.rb
627
+ - app/serializers/shipit/review_stack_serializer.rb
589
628
  - app/serializers/shipit/rollback_serializer.rb
590
629
  - app/serializers/shipit/short_commit_serializer.rb
591
630
  - app/serializers/shipit/stack_serializer.rb
@@ -594,9 +633,13 @@ files:
594
633
  - app/serializers/shipit/user_serializer.rb
595
634
  - app/validators/ascii_only_validator.rb
596
635
  - app/validators/subset_validator.rb
636
+ - app/views/layouts/_head.html.erb
597
637
  - app/views/layouts/merge_status.html.erb
598
638
  - app/views/layouts/shipit.html.erb
599
639
  - app/views/shipit/_variables.html.erb
640
+ - app/views/shipit/api_clients/index.html.erb
641
+ - app/views/shipit/api_clients/new.html.erb
642
+ - app/views/shipit/api_clients/show.html.erb
600
643
  - app/views/shipit/ccmenu/project.xml.builder
601
644
  - app/views/shipit/commit_checks/_checks.html.erb
602
645
  - app/views/shipit/commit_checks/show.html.erb
@@ -610,6 +653,10 @@ files:
610
653
  - app/views/shipit/deploys/rollback.html.erb
611
654
  - app/views/shipit/deploys/show.html.erb
612
655
  - app/views/shipit/github_authentication/failed.html.erb
656
+ - app/views/shipit/merge_requests/_merge_request.html.erb
657
+ - app/views/shipit/merge_requests/index.html.erb
658
+ - app/views/shipit/merge_requests/merge_requests/_pull_request.html.erb
659
+ - app/views/shipit/merge_requests/merge_requests/index.html.erb
613
660
  - app/views/shipit/merge_status/_anchor.html.erb
614
661
  - app/views/shipit/merge_status/_commit_count_warning.html.erb
615
662
  - app/views/shipit/merge_status/_merge_queue_button.html.erb
@@ -620,15 +667,22 @@ files:
620
667
  - app/views/shipit/merge_status/logged_out.erb
621
668
  - app/views/shipit/merge_status/success.html.erb
622
669
  - app/views/shipit/missing_settings.html.erb
623
- - app/views/shipit/pull_requests/_pull_request.html.erb
624
- - app/views/shipit/pull_requests/index.html.erb
670
+ - app/views/shipit/repositories/_header.html.erb
671
+ - app/views/shipit/repositories/index.html.erb
672
+ - app/views/shipit/repositories/new.html.erb
673
+ - app/views/shipit/repositories/settings.html.erb
674
+ - app/views/shipit/repositories/show.html.erb
625
675
  - app/views/shipit/shared/_author.html.erb
626
676
  - app/views/shipit/stacks/_banners.html.erb
627
677
  - app/views/shipit/stacks/_header.html.erb
678
+ - app/views/shipit/stacks/_links.html.erb
679
+ - app/views/shipit/stacks/_stack.html.erb
680
+ - app/views/shipit/stacks/all_tasks.html.erb
628
681
  - app/views/shipit/stacks/index.html.erb
629
682
  - app/views/shipit/stacks/new.html.erb
630
683
  - app/views/shipit/stacks/settings.html.erb
631
684
  - app/views/shipit/stacks/show.html.erb
685
+ - app/views/shipit/stacks/statistics.html.erb
632
686
  - app/views/shipit/statuses/_group.html.erb
633
687
  - app/views/shipit/statuses/_status.html.erb
634
688
  - app/views/shipit/tasks/_task.html.erb
@@ -694,6 +748,24 @@ files:
694
748
  - db/migrate/20180906083930_create_release_statuses.rb
695
749
  - db/migrate/20181010150947_create_shipit_check_runs.rb
696
750
  - db/migrate/20190502020249_add_lock_author_id_to_commits.rb
751
+ - db/migrate/20191209231045_create_shipit_repositories.rb
752
+ - db/migrate/20191209231307_add_repository_reference_to_stacks.rb
753
+ - db/migrate/20191216162728_backfill_repository_data.rb
754
+ - db/migrate/20191216163010_remove_repository_information_from_stacks.rb
755
+ - db/migrate/20191219205202_add_archived_since_to_stacks.rb
756
+ - db/migrate/20200102175621_optional_task_commits.rb
757
+ - db/migrate/20200109132519_add_sha_to_commit_deployments.rb
758
+ - db/migrate/20200226211925_add_index_to_tasks_status.rb
759
+ - db/migrate/20200427135152_add_pull_request_head_sha_to_commit.rb
760
+ - db/migrate/20200615181558_add_rollback_once_aborted_to.rb
761
+ - db/migrate/20200706145406_add_review_stacks.rb
762
+ - db/migrate/20200804144639_rename_pull_request_to_merge_request.rb
763
+ - db/migrate/20200804161512_rename_commits_pull_request_id_to_merge_request_id.rb
764
+ - db/migrate/20200813134712_recreate_shipit_pull_requests.rb
765
+ - db/migrate/20200813194056_create_pull_request_assignments.rb
766
+ - db/migrate/20201001125502_add_provision_pr_stacks_flag_to_repositories.rb
767
+ - db/migrate/20201008145809_add_retry_attempt_to_tasks.rb
768
+ - db/migrate/20201008152744_add_max_retries_to_tasks.rb
697
769
  - lib/shipit-engine.rb
698
770
  - lib/shipit.rb
699
771
  - lib/shipit/cast_value.rb
@@ -712,7 +784,9 @@ files:
712
784
  - lib/shipit/octokit_check_runs.rb
713
785
  - lib/shipit/octokit_iterator.rb
714
786
  - lib/shipit/paginator.rb
787
+ - lib/shipit/review_stack_commands.rb
715
788
  - lib/shipit/rollback_commands.rb
789
+ - lib/shipit/same_site_cookie_middleware.rb
716
790
  - lib/shipit/simple_message_verifier.rb
717
791
  - lib/shipit/stack_commands.rb
718
792
  - lib/shipit/stat.rb
@@ -743,19 +817,22 @@ files:
743
817
  - test/controllers/api/deploys_controller_test.rb
744
818
  - test/controllers/api/hooks_controller_test.rb
745
819
  - test/controllers/api/locks_controller_test.rb
820
+ - test/controllers/api/merge_requests_controller_test.rb
746
821
  - test/controllers/api/outputs_controller_test.rb
747
- - test/controllers/api/pull_requests_controller_test.rb
748
822
  - test/controllers/api/release_statuses_controller_test.rb
823
+ - test/controllers/api/rollback_controller_test.rb
749
824
  - test/controllers/api/stacks_controller_test.rb
750
825
  - test/controllers/api/tasks_controller_test.rb
826
+ - test/controllers/api_clients_controller_test.rb
751
827
  - test/controllers/ccmenu_controller_test.rb
752
828
  - test/controllers/commit_checks_controller_test.rb
753
829
  - test/controllers/commits_controller_test.rb
754
830
  - test/controllers/deploys_controller_test.rb
755
831
  - test/controllers/github_authentication_controller_test.rb
832
+ - test/controllers/merge_requests_controller_test.rb
756
833
  - test/controllers/merge_status_controller_test.rb
757
- - test/controllers/pull_requests_controller_test.rb
758
834
  - test/controllers/release_statuses_controller_test.rb
835
+ - test/controllers/repositories_controller_test.rb
759
836
  - test/controllers/rollbacks_controller_test.rb
760
837
  - test/controllers/stacks_controller_test.rb
761
838
  - test/controllers/status_controller_test.rb
@@ -800,6 +877,15 @@ files:
800
877
  - test/dummy/public/500.html
801
878
  - test/dummy/public/favicon.ico
802
879
  - test/fixtures/payloads/check_suite_master.json
880
+ - test/fixtures/payloads/invalid_pull_request.json
881
+ - test/fixtures/payloads/provision_disabled_pull_request.json
882
+ - test/fixtures/payloads/pull_request_assigned.json
883
+ - test/fixtures/payloads/pull_request_closed.json
884
+ - test/fixtures/payloads/pull_request_labeled.json
885
+ - test/fixtures/payloads/pull_request_opened.json
886
+ - test/fixtures/payloads/pull_request_reopened.json
887
+ - test/fixtures/payloads/pull_request_unlabeled.json
888
+ - test/fixtures/payloads/pull_request_with_no_repo.json
803
889
  - test/fixtures/payloads/push_master.json
804
890
  - test/fixtures/payloads/push_not_master.json
805
891
  - test/fixtures/payloads/status_master.json
@@ -812,9 +898,11 @@ files:
812
898
  - test/fixtures/shipit/github_hooks.yml
813
899
  - test/fixtures/shipit/hooks.yml
814
900
  - test/fixtures/shipit/memberships.yml
815
- - test/fixtures/shipit/output_chunks.yml
901
+ - test/fixtures/shipit/merge_requests.yml
902
+ - test/fixtures/shipit/pull_request_assignments.yml
816
903
  - test/fixtures/shipit/pull_requests.yml
817
904
  - test/fixtures/shipit/release_statuses.yml
905
+ - test/fixtures/shipit/repositories.yml
818
906
  - test/fixtures/shipit/stacks.yml
819
907
  - test/fixtures/shipit/statuses.yml
820
908
  - test/fixtures/shipit/tasks.yml
@@ -831,19 +919,24 @@ files:
831
919
  - test/jobs/cache_deploy_spec_job_test.rb
832
920
  - test/jobs/chunk_rollup_job_test.rb
833
921
  - test/jobs/deliver_hook_job_test.rb
922
+ - test/jobs/destroy_repository_job_test.rb
834
923
  - test/jobs/destroy_stack_job_test.rb
835
924
  - test/jobs/emit_event_job_test.rb
836
925
  - test/jobs/fetch_commit_stats_job_test.rb
837
926
  - test/jobs/fetch_deployed_revision_job_test.rb
838
927
  - test/jobs/github_sync_job_test.rb
839
928
  - test/jobs/mark_deploy_healthy_job_test.rb
840
- - test/jobs/merge_pull_requests_job_test.rb
841
929
  - test/jobs/perform_task_job_test.rb
930
+ - test/jobs/process_merge_requests_job_test.rb
842
931
  - test/jobs/purge_old_deliveries_job_test.rb
932
+ - test/jobs/reap_dead_tasks_job_test.rb
843
933
  - test/jobs/refresh_github_user_job_test.rb
844
934
  - test/jobs/refresh_status_job_test.rb
845
935
  - test/jobs/unique_job_test.rb
846
936
  - test/jobs/update_github_last_deployed_ref_job_test.rb
937
+ - test/lib/shipit/deploy_commands_test.rb
938
+ - test/lib/shipit/task_commands_test.rb
939
+ - test/middleware/same_site_cookie_middleware_test.rb
847
940
  - test/models/api_client_test.rb
848
941
  - test/models/commit_checks_test.rb
849
942
  - test/models/commit_deployment_status_test.rb
@@ -851,17 +944,36 @@ files:
851
944
  - test/models/commits_test.rb
852
945
  - test/models/delivery_test.rb
853
946
  - test/models/deploy_spec_test.rb
947
+ - test/models/deploy_stats_test.rb
854
948
  - test/models/deploys_test.rb
855
949
  - test/models/duration_test.rb
856
950
  - test/models/github_hook_test.rb
857
951
  - test/models/hook_test.rb
858
952
  - test/models/membership_test.rb
859
- - test/models/output_chunk_test.rb
860
- - test/models/pull_request_test.rb
953
+ - test/models/merge_request_test.rb
954
+ - test/models/pull_request_assignment_test.rb
861
955
  - test/models/release_statuses_test.rb
862
956
  - test/models/rollbacks_test.rb
863
957
  - test/models/shipit/check_run_test.rb
864
- - test/models/stacks_test.rb
958
+ - test/models/shipit/provisioning_handler/base_test.rb
959
+ - test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
960
+ - test/models/shipit/provisioning_handler_test.rb
961
+ - test/models/shipit/pull_request_test.rb
962
+ - test/models/shipit/repository_test.rb
963
+ - test/models/shipit/review_stack_provision_status_test.rb
964
+ - test/models/shipit/review_stack_provisioning_queue_test.rb
965
+ - test/models/shipit/review_stack_test.rb
966
+ - test/models/shipit/stacks_test.rb
967
+ - test/models/shipit/webhooks/handlers/pull_request/assigned_handler_test.rb
968
+ - test/models/shipit/webhooks/handlers/pull_request/closed_handler_test.rb
969
+ - test/models/shipit/webhooks/handlers/pull_request/edited_handler_test.rb
970
+ - test/models/shipit/webhooks/handlers/pull_request/label_capturing_handler_test.rb
971
+ - test/models/shipit/webhooks/handlers/pull_request/labeled_handler_test.rb
972
+ - test/models/shipit/webhooks/handlers/pull_request/opened_handler_test.rb
973
+ - test/models/shipit/webhooks/handlers/pull_request/reopened_handler_test.rb
974
+ - test/models/shipit/webhooks/handlers/pull_request/review_stack_adapter_test.rb
975
+ - test/models/shipit/webhooks/handlers/pull_request/unlabeled_handler_test.rb
976
+ - test/models/shipit/webhooks/handlers_test.rb
865
977
  - test/models/status/group_test.rb
866
978
  - test/models/status/missing_test.rb
867
979
  - test/models/status_test.rb
@@ -870,18 +982,25 @@ files:
870
982
  - test/models/team_test.rb
871
983
  - test/models/undeployed_commits_test.rb
872
984
  - test/models/users_test.rb
985
+ - test/serializers/shipit/pull_request_serializer_test.rb
873
986
  - test/test_command_integration.rb
874
987
  - test/test_helper.rb
988
+ - test/unit/anonymous_user_serializer_test.rb
875
989
  - test/unit/command_test.rb
876
990
  - test/unit/commands_test.rb
991
+ - test/unit/commit_serializer_test.rb
877
992
  - test/unit/csv_serializer_test.rb
878
993
  - test/unit/deploy_commands_test.rb
994
+ - test/unit/deploy_serializer_test.rb
879
995
  - test/unit/environment_variables_test.rb
880
996
  - test/unit/github_app_test.rb
881
997
  - test/unit/github_url_helper_test.rb
882
998
  - test/unit/line_buffer_test.rb
883
999
  - test/unit/rollback_commands_test.rb
1000
+ - test/unit/shipit_helper_test.rb
1001
+ - test/unit/shipit_task_execution_strategy_test.rb
884
1002
  - test/unit/shipit_test.rb
1003
+ - test/unit/user_serializer_test.rb
885
1004
  - test/unit/variable_definition_test.rb
886
1005
  - vendor/assets/javascripts/clusterize.js
887
1006
  - vendor/assets/javascripts/jquery-notify.js
@@ -892,7 +1011,8 @@ files:
892
1011
  homepage: https://github.com/shopify/shipit-engine
893
1012
  licenses:
894
1013
  - MIT
895
- metadata: {}
1014
+ metadata:
1015
+ allowed_push_host: https://rubygems.org
896
1016
  post_install_message:
897
1017
  rdoc_options: []
898
1018
  require_paths:
@@ -913,149 +1033,194 @@ signing_key:
913
1033
  specification_version: 4
914
1034
  summary: Application deployment software
915
1035
  test_files:
916
- - test/dummy/public/favicon.ico
917
- - test/dummy/public/500.html
918
- - test/dummy/public/422.html
919
- - test/dummy/public/404.html
920
- - test/dummy/db/seeds.rb
921
- - test/dummy/db/schema.rb
922
- - test/dummy/bin/rake
923
- - test/dummy/bin/bundle
924
- - test/dummy/bin/rails
925
- - test/dummy/bin/setup
926
- - test/dummy/app/views/layouts/application.html.erb
927
- - test/dummy/app/assets/stylesheets/application.css
928
- - test/dummy/app/assets/javascripts/application.js
929
- - test/dummy/app/controllers/application_controller.rb
930
- - test/dummy/app/helpers/application_helper.rb
931
- - test/dummy/config.ru
932
- - test/dummy/Rakefile
933
- - test/dummy/config/application.rb
934
- - test/dummy/config/database.yml
935
- - test/dummy/config/locales/en.yml
936
- - test/dummy/config/secrets.yml
937
- - test/dummy/config/boot.rb
938
- - test/dummy/config/database.mysql.yml
939
- - test/dummy/config/initializers/filter_parameter_logging.rb
940
- - test/dummy/config/initializers/session_store.rb
941
- - test/dummy/config/initializers/backtrace_silencers.rb
942
- - test/dummy/config/initializers/mime_types.rb
943
- - test/dummy/config/initializers/cookies_serializer.rb
944
- - test/dummy/config/initializers/0_load_development_secrets.rb
945
- - test/dummy/config/initializers/assets.rb
946
- - test/dummy/config/initializers/wrap_parameters.rb
947
- - test/dummy/config/initializers/inflections.rb
948
- - test/dummy/config/environment.rb
949
- - test/dummy/config/routes.rb
950
- - test/dummy/config/database.postgresql.yml
951
- - test/dummy/config/environments/test.rb
952
- - test/dummy/config/environments/development.rb
953
- - test/dummy/config/environments/production.rb
954
- - test/controllers/webhooks_controller_test.rb
1036
+ - test/jobs/deliver_hook_job_test.rb
1037
+ - test/jobs/chunk_rollup_job_test.rb
1038
+ - test/jobs/cache_deploy_spec_job_test.rb
1039
+ - test/jobs/mark_deploy_healthy_job_test.rb
1040
+ - test/jobs/fetch_commit_stats_job_test.rb
1041
+ - test/jobs/purge_old_deliveries_job_test.rb
1042
+ - test/jobs/perform_task_job_test.rb
1043
+ - test/jobs/unique_job_test.rb
1044
+ - test/jobs/destroy_repository_job_test.rb
1045
+ - test/jobs/destroy_stack_job_test.rb
1046
+ - test/jobs/update_github_last_deployed_ref_job_test.rb
1047
+ - test/jobs/refresh_status_job_test.rb
1048
+ - test/jobs/github_sync_job_test.rb
1049
+ - test/jobs/reap_dead_tasks_job_test.rb
1050
+ - test/jobs/refresh_github_user_job_test.rb
1051
+ - test/jobs/process_merge_requests_job_test.rb
1052
+ - test/jobs/fetch_deployed_revision_job_test.rb
1053
+ - test/jobs/emit_event_job_test.rb
1054
+ - test/lib/shipit/deploy_commands_test.rb
1055
+ - test/lib/shipit/task_commands_test.rb
1056
+ - test/unit/shipit_helper_test.rb
1057
+ - test/unit/shipit_test.rb
1058
+ - test/unit/github_app_test.rb
1059
+ - test/unit/rollback_commands_test.rb
1060
+ - test/unit/command_test.rb
1061
+ - test/unit/variable_definition_test.rb
1062
+ - test/unit/csv_serializer_test.rb
1063
+ - test/unit/line_buffer_test.rb
1064
+ - test/unit/environment_variables_test.rb
1065
+ - test/unit/user_serializer_test.rb
1066
+ - test/unit/github_url_helper_test.rb
1067
+ - test/unit/commands_test.rb
1068
+ - test/unit/anonymous_user_serializer_test.rb
1069
+ - test/unit/deploy_commands_test.rb
1070
+ - test/unit/shipit_task_execution_strategy_test.rb
1071
+ - test/unit/commit_serializer_test.rb
1072
+ - test/unit/deploy_serializer_test.rb
1073
+ - test/fixtures/payloads/push_not_master.json
1074
+ - test/fixtures/payloads/pull_request_opened.json
1075
+ - test/fixtures/payloads/pull_request_assigned.json
1076
+ - test/fixtures/payloads/pull_request_closed.json
1077
+ - test/fixtures/payloads/pull_request_unlabeled.json
1078
+ - test/fixtures/payloads/pull_request_reopened.json
1079
+ - test/fixtures/payloads/push_master.json
1080
+ - test/fixtures/payloads/provision_disabled_pull_request.json
1081
+ - test/fixtures/payloads/status_master.json
1082
+ - test/fixtures/payloads/check_suite_master.json
1083
+ - test/fixtures/payloads/pull_request_labeled.json
1084
+ - test/fixtures/payloads/pull_request_with_no_repo.json
1085
+ - test/fixtures/payloads/invalid_pull_request.json
1086
+ - test/fixtures/timeout
1087
+ - test/fixtures/shipit/tasks.yml
1088
+ - test/fixtures/shipit/teams.yml
1089
+ - test/fixtures/shipit/release_statuses.yml
1090
+ - test/fixtures/shipit/deliveries.yml
1091
+ - test/fixtures/shipit/commit_deployments.yml
1092
+ - test/fixtures/shipit/commits.yml
1093
+ - test/fixtures/shipit/statuses.yml
1094
+ - test/fixtures/shipit/api_clients.yml
1095
+ - test/fixtures/shipit/memberships.yml
1096
+ - test/fixtures/shipit/repositories.yml
1097
+ - test/fixtures/shipit/stacks.yml
1098
+ - test/fixtures/shipit/commit_deployment_statuses.yml
1099
+ - test/fixtures/shipit/github_hooks.yml
1100
+ - test/fixtures/shipit/check_runs.yml
1101
+ - test/fixtures/shipit/merge_requests.yml
1102
+ - test/fixtures/shipit/pull_request_assignments.yml
1103
+ - test/fixtures/shipit/hooks.yml
1104
+ - test/fixtures/shipit/pull_requests.yml
1105
+ - test/fixtures/shipit/users.yml
955
1106
  - test/controllers/rollbacks_controller_test.rb
956
- - test/controllers/github_authentication_controller_test.rb
957
- - test/controllers/merge_status_controller_test.rb
958
- - test/controllers/commit_checks_controller_test.rb
959
1107
  - test/controllers/ccmenu_controller_test.rb
960
1108
  - test/controllers/stacks_controller_test.rb
961
1109
  - test/controllers/deploys_controller_test.rb
962
- - test/controllers/api/hooks_controller_test.rb
1110
+ - test/controllers/merge_status_controller_test.rb
963
1111
  - test/controllers/api/ccmenu_controller_test.rb
964
1112
  - test/controllers/api/stacks_controller_test.rb
1113
+ - test/controllers/api/rollback_controller_test.rb
965
1114
  - test/controllers/api/base_controller_test.rb
966
- - test/controllers/api/locks_controller_test.rb
967
1115
  - test/controllers/api/deploys_controller_test.rb
968
- - test/controllers/api/commits_controller_test.rb
1116
+ - test/controllers/api/hooks_controller_test.rb
1117
+ - test/controllers/api/locks_controller_test.rb
969
1118
  - test/controllers/api/release_statuses_controller_test.rb
970
- - test/controllers/api/pull_requests_controller_test.rb
971
- - test/controllers/api/tasks_controller_test.rb
1119
+ - test/controllers/api/merge_requests_controller_test.rb
972
1120
  - test/controllers/api/outputs_controller_test.rb
973
- - test/controllers/status_controller_test.rb
974
- - test/controllers/commits_controller_test.rb
1121
+ - test/controllers/api/tasks_controller_test.rb
1122
+ - test/controllers/api/commits_controller_test.rb
975
1123
  - test/controllers/release_statuses_controller_test.rb
976
- - test/controllers/pull_requests_controller_test.rb
1124
+ - test/controllers/status_controller_test.rb
1125
+ - test/controllers/github_authentication_controller_test.rb
1126
+ - test/controllers/merge_requests_controller_test.rb
977
1127
  - test/controllers/tasks_controller_test.rb
978
- - test/unit/command_test.rb
979
- - test/unit/commands_test.rb
980
- - test/unit/line_buffer_test.rb
981
- - test/unit/deploy_commands_test.rb
982
- - test/unit/shipit_test.rb
983
- - test/unit/rollback_commands_test.rb
984
- - test/unit/csv_serializer_test.rb
985
- - test/unit/variable_definition_test.rb
986
- - test/unit/github_url_helper_test.rb
987
- - test/unit/environment_variables_test.rb
988
- - test/unit/github_app_test.rb
989
- - test/models/release_statuses_test.rb
990
- - test/models/deploys_test.rb
991
- - test/models/undeployed_commits_test.rb
1128
+ - test/controllers/commits_controller_test.rb
1129
+ - test/controllers/api_clients_controller_test.rb
1130
+ - test/controllers/repositories_controller_test.rb
1131
+ - test/controllers/commit_checks_controller_test.rb
1132
+ - test/controllers/webhooks_controller_test.rb
1133
+ - test/helpers/payloads_helper.rb
1134
+ - test/helpers/api_helper.rb
1135
+ - test/helpers/hooks_helper.rb
1136
+ - test/helpers/links_helper.rb
1137
+ - test/helpers/queries_helper.rb
1138
+ - test/helpers/fixture_aliases_helper.rb
1139
+ - test/helpers/json_helper.rb
1140
+ - test/middleware/same_site_cookie_middleware_test.rb
992
1141
  - test/models/team_test.rb
1142
+ - test/models/api_client_test.rb
1143
+ - test/models/commits_test.rb
1144
+ - test/models/membership_test.rb
993
1145
  - test/models/rollbacks_test.rb
1146
+ - test/models/deploy_spec_test.rb
1147
+ - test/models/commit_deployment_status_test.rb
994
1148
  - test/models/commit_checks_test.rb
995
- - test/models/github_hook_test.rb
1149
+ - test/models/deploy_stats_test.rb
1150
+ - test/models/pull_request_assignment_test.rb
1151
+ - test/models/hook_test.rb
1152
+ - test/models/merge_request_test.rb
1153
+ - test/models/release_statuses_test.rb
996
1154
  - test/models/task_definitions_test.rb
997
- - test/models/tasks_test.rb
998
- - test/models/output_chunk_test.rb
999
- - test/models/commit_deployment_status_test.rb
1000
- - test/models/delivery_test.rb
1001
- - test/models/users_test.rb
1155
+ - test/models/status_test.rb
1156
+ - test/models/status/group_test.rb
1157
+ - test/models/status/missing_test.rb
1158
+ - test/models/github_hook_test.rb
1002
1159
  - test/models/commit_deployment_test.rb
1160
+ - test/models/delivery_test.rb
1161
+ - test/models/deploys_test.rb
1003
1162
  - test/models/duration_test.rb
1004
- - test/models/api_client_test.rb
1163
+ - test/models/tasks_test.rb
1164
+ - test/models/undeployed_commits_test.rb
1165
+ - test/models/users_test.rb
1005
1166
  - test/models/shipit/check_run_test.rb
1006
- - test/models/commits_test.rb
1007
- - test/models/status/group_test.rb
1008
- - test/models/status/missing_test.rb
1009
- - test/models/deploy_spec_test.rb
1010
- - test/models/stacks_test.rb
1011
- - test/models/hook_test.rb
1012
- - test/models/membership_test.rb
1013
- - test/models/status_test.rb
1014
- - test/models/pull_request_test.rb
1167
+ - test/models/shipit/provisioning_handler_test.rb
1168
+ - test/models/shipit/review_stack_provisioning_queue_test.rb
1169
+ - test/models/shipit/review_stack_test.rb
1170
+ - test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
1171
+ - test/models/shipit/provisioning_handler/base_test.rb
1172
+ - test/models/shipit/stacks_test.rb
1173
+ - test/models/shipit/repository_test.rb
1174
+ - test/models/shipit/review_stack_provision_status_test.rb
1175
+ - test/models/shipit/webhooks/handlers_test.rb
1176
+ - test/models/shipit/webhooks/handlers/pull_request/edited_handler_test.rb
1177
+ - test/models/shipit/webhooks/handlers/pull_request/review_stack_adapter_test.rb
1178
+ - test/models/shipit/webhooks/handlers/pull_request/assigned_handler_test.rb
1179
+ - test/models/shipit/webhooks/handlers/pull_request/unlabeled_handler_test.rb
1180
+ - test/models/shipit/webhooks/handlers/pull_request/label_capturing_handler_test.rb
1181
+ - test/models/shipit/webhooks/handlers/pull_request/labeled_handler_test.rb
1182
+ - test/models/shipit/webhooks/handlers/pull_request/opened_handler_test.rb
1183
+ - test/models/shipit/webhooks/handlers/pull_request/reopened_handler_test.rb
1184
+ - test/models/shipit/webhooks/handlers/pull_request/closed_handler_test.rb
1185
+ - test/models/shipit/pull_request_test.rb
1015
1186
  - test/test_command_integration.rb
1016
- - test/helpers/hooks_helper.rb
1017
- - test/helpers/queries_helper.rb
1018
- - test/helpers/json_helper.rb
1019
- - test/helpers/fixture_aliases_helper.rb
1020
- - test/helpers/payloads_helper.rb
1021
- - test/helpers/links_helper.rb
1022
- - test/helpers/api_helper.rb
1023
- - test/jobs/emit_event_job_test.rb
1024
- - test/jobs/unique_job_test.rb
1025
- - test/jobs/merge_pull_requests_job_test.rb
1026
- - test/jobs/deliver_hook_job_test.rb
1027
- - test/jobs/update_github_last_deployed_ref_job_test.rb
1028
- - test/jobs/refresh_status_job_test.rb
1029
- - test/jobs/fetch_deployed_revision_job_test.rb
1030
- - test/jobs/purge_old_deliveries_job_test.rb
1031
- - test/jobs/refresh_github_user_job_test.rb
1032
- - test/jobs/chunk_rollup_job_test.rb
1033
- - test/jobs/mark_deploy_healthy_job_test.rb
1034
- - test/jobs/fetch_commit_stats_job_test.rb
1035
- - test/jobs/cache_deploy_spec_job_test.rb
1036
- - test/jobs/perform_task_job_test.rb
1037
- - test/jobs/github_sync_job_test.rb
1038
- - test/jobs/destroy_stack_job_test.rb
1039
- - test/fixtures/timeout
1040
- - test/fixtures/shipit/check_runs.yml
1041
- - test/fixtures/shipit/release_statuses.yml
1042
- - test/fixtures/shipit/users.yml
1043
- - test/fixtures/shipit/output_chunks.yml
1044
- - test/fixtures/shipit/deliveries.yml
1045
- - test/fixtures/shipit/hooks.yml
1046
- - test/fixtures/shipit/github_hooks.yml
1047
- - test/fixtures/shipit/statuses.yml
1048
- - test/fixtures/shipit/memberships.yml
1049
- - test/fixtures/shipit/teams.yml
1050
- - test/fixtures/shipit/tasks.yml
1051
- - test/fixtures/shipit/api_clients.yml
1052
- - test/fixtures/shipit/stacks.yml
1053
- - test/fixtures/shipit/commits.yml
1054
- - test/fixtures/shipit/pull_requests.yml
1055
- - test/fixtures/shipit/commit_deployments.yml
1056
- - test/fixtures/shipit/commit_deployment_statuses.yml
1057
- - test/fixtures/payloads/status_master.json
1058
- - test/fixtures/payloads/push_master.json
1059
- - test/fixtures/payloads/push_not_master.json
1060
- - test/fixtures/payloads/check_suite_master.json
1187
+ - test/serializers/shipit/pull_request_serializer_test.rb
1061
1188
  - test/test_helper.rb
1189
+ - test/dummy/db/seeds.rb
1190
+ - test/dummy/db/schema.rb
1191
+ - test/dummy/app/assets/stylesheets/application.css
1192
+ - test/dummy/app/assets/javascripts/application.js
1193
+ - test/dummy/app/controllers/application_controller.rb
1194
+ - test/dummy/app/helpers/application_helper.rb
1195
+ - test/dummy/app/views/layouts/application.html.erb
1196
+ - test/dummy/config/database.postgresql.yml
1197
+ - test/dummy/config/secrets.yml
1198
+ - test/dummy/config/initializers/cookies_serializer.rb
1199
+ - test/dummy/config/initializers/backtrace_silencers.rb
1200
+ - test/dummy/config/initializers/mime_types.rb
1201
+ - test/dummy/config/initializers/filter_parameter_logging.rb
1202
+ - test/dummy/config/initializers/wrap_parameters.rb
1203
+ - test/dummy/config/initializers/inflections.rb
1204
+ - test/dummy/config/initializers/session_store.rb
1205
+ - test/dummy/config/initializers/0_load_development_secrets.rb
1206
+ - test/dummy/config/initializers/assets.rb
1207
+ - test/dummy/config/routes.rb
1208
+ - test/dummy/config/database.yml
1209
+ - test/dummy/config/database.mysql.yml
1210
+ - test/dummy/config/environment.rb
1211
+ - test/dummy/config/locales/en.yml
1212
+ - test/dummy/config/environments/development.rb
1213
+ - test/dummy/config/environments/test.rb
1214
+ - test/dummy/config/environments/production.rb
1215
+ - test/dummy/config/boot.rb
1216
+ - test/dummy/config/application.rb
1217
+ - test/dummy/config.ru
1218
+ - test/dummy/bin/rails
1219
+ - test/dummy/bin/rake
1220
+ - test/dummy/bin/setup
1221
+ - test/dummy/bin/bundle
1222
+ - test/dummy/Rakefile
1223
+ - test/dummy/public/404.html
1224
+ - test/dummy/public/422.html
1225
+ - test/dummy/public/favicon.ico
1226
+ - test/dummy/public/500.html