shipit-engine 0.20.1 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +43 -6
  3. data/app/assets/stylesheets/_base/_base.scss +4 -0
  4. data/app/assets/stylesheets/_pages/_commits.scss +3 -1
  5. data/app/assets/stylesheets/_pages/_deploy.scss +4 -2
  6. data/app/controllers/concerns/shipit/authentication.rb +1 -1
  7. data/app/controllers/shipit/api/base_controller.rb +6 -1
  8. data/app/controllers/shipit/api/pull_requests_controller.rb +1 -1
  9. data/app/controllers/shipit/commit_checks_controller.rb +1 -1
  10. data/app/controllers/shipit/shipit_controller.rb +1 -5
  11. data/app/controllers/shipit/stacks_controller.rb +2 -0
  12. data/app/controllers/shipit/tasks_controller.rb +1 -1
  13. data/app/controllers/shipit/webhooks_controller.rb +2 -2
  14. data/app/helpers/shipit/deploys_helper.rb +9 -0
  15. data/app/helpers/shipit/shipit_helper.rb +17 -15
  16. data/app/helpers/shipit/stacks_helper.rb +6 -1
  17. data/app/jobs/shipit/destroy_stack_job.rb +4 -2
  18. data/app/jobs/shipit/fetch_deployed_revision_job.rb +1 -1
  19. data/app/jobs/shipit/github_sync_job.rb +1 -1
  20. data/app/jobs/shipit/merge_pull_requests_job.rb +3 -3
  21. data/app/jobs/shipit/perform_task_job.rb +3 -0
  22. data/app/jobs/shipit/purge_old_deliveries_job.rb +1 -0
  23. data/app/models/shipit/api_client.rb +1 -1
  24. data/app/models/shipit/commit.rb +29 -6
  25. data/app/models/shipit/commit_deployment.rb +1 -1
  26. data/app/models/shipit/commit_deployment_status.rb +1 -1
  27. data/app/models/shipit/deploy_spec.rb +19 -2
  28. data/app/models/shipit/deploy_spec/bundler_discovery.rb +1 -10
  29. data/app/models/shipit/deploy_spec/file_system.rb +6 -0
  30. data/app/models/shipit/deploy_spec/kubernetes_discovery.rb +1 -1
  31. data/app/models/shipit/deploy_spec/lerna_discovery.rb +85 -0
  32. data/app/models/shipit/deploy_spec/npm_discovery.rb +103 -5
  33. data/app/models/shipit/deploy_spec/pypi_discovery.rb +4 -2
  34. data/app/models/shipit/deploy_spec/rubygems_discovery.rb +4 -2
  35. data/app/models/shipit/duration.rb +1 -1
  36. data/app/models/shipit/github_status.rb +1 -1
  37. data/app/models/shipit/hook.rb +4 -5
  38. data/app/models/shipit/output_chunk.rb +1 -1
  39. data/app/models/shipit/pull_request.rb +36 -15
  40. data/app/models/shipit/stack.rb +15 -9
  41. data/app/models/shipit/status/common.rb +4 -0
  42. data/app/models/shipit/status/group.rb +4 -0
  43. data/app/models/shipit/task.rb +20 -8
  44. data/app/models/shipit/task_definition.rb +2 -2
  45. data/app/models/shipit/undeployed_commit.rb +13 -2
  46. data/app/models/shipit/user.rb +1 -1
  47. data/app/serializers/shipit/pull_request_serializer.rb +1 -1
  48. data/app/serializers/shipit/tail_task_serializer.rb +1 -1
  49. data/app/views/shipit/ccmenu/project.xml.builder +9 -8
  50. data/app/views/shipit/deploys/_deploy.html.erb +3 -2
  51. data/app/views/shipit/stacks/_banners.html.erb +4 -1
  52. data/app/views/shipit/stacks/settings.html.erb +4 -0
  53. data/app/views/shipit/statuses/_group.html.erb +1 -1
  54. data/app/views/shipit/statuses/_status.html.erb +1 -1
  55. data/app/views/shipit/tasks/_task.html.erb +1 -2
  56. data/config/locales/en.yml +2 -0
  57. data/config/secrets.development.example.yml +0 -4
  58. data/config/secrets.development.shopify.yml +1 -5
  59. data/db/migrate/20170904103242_reindex_deliveries.rb +7 -0
  60. data/db/migrate/20171120161420_add_base_info_to_pull_request.rb +7 -0
  61. data/db/migrate/20180202220850_add_aborted_by_to_tasks.rb +5 -0
  62. data/lib/shipit.rb +15 -23
  63. data/lib/shipit/command.rb +11 -3
  64. data/lib/shipit/engine.rb +0 -4
  65. data/lib/shipit/stack_commands.rb +3 -1
  66. data/lib/shipit/version.rb +1 -1
  67. data/lib/snippets/assert-lerna-fixed-version-tag +21 -0
  68. data/lib/snippets/assert-lerna-independent-version-tags +28 -0
  69. data/lib/snippets/generate-local-npmrc +19 -0
  70. data/lib/snippets/misconfigured-npm-publish-config +8 -0
  71. data/lib/snippets/publish-lerna-independent-packages +39 -0
  72. data/lib/snippets/push-to-heroku +5 -5
  73. data/lib/tasks/cron.rake +1 -1
  74. data/lib/tasks/dev.rake +1 -1
  75. data/test/controllers/api/deploys_controller_test.rb +19 -0
  76. data/test/controllers/api/stacks_controller_test.rb +1 -1
  77. data/test/controllers/github_authentication_controller_test.rb +1 -1
  78. data/test/controllers/stacks_controller_test.rb +10 -0
  79. data/test/controllers/tasks_controller_test.rb +2 -0
  80. data/test/controllers/webhooks_controller_test.rb +0 -7
  81. data/test/dummy/config/secrets.yml +0 -2
  82. data/test/dummy/db/development.sqlite3 +0 -0
  83. data/test/dummy/db/schema.rb +5 -3
  84. data/test/dummy/db/test.sqlite3 +0 -0
  85. data/test/fixtures/shipit/commits.yml +53 -0
  86. data/test/fixtures/shipit/pull_requests.yml +52 -0
  87. data/test/fixtures/shipit/stacks.yml +35 -0
  88. data/test/fixtures/shipit/statuses.yml +27 -0
  89. data/test/fixtures/shipit/tasks.yml +14 -0
  90. data/test/helpers/queries_helper.rb +1 -1
  91. data/test/jobs/merge_pull_requests_job_test.rb +19 -2
  92. data/test/jobs/perform_task_job_test.rb +26 -2
  93. data/test/models/commits_test.rb +55 -6
  94. data/test/models/deploy_spec_test.rb +288 -52
  95. data/test/models/deploys_test.rb +7 -7
  96. data/test/models/hook_test.rb +4 -3
  97. data/test/models/pull_request_test.rb +78 -24
  98. data/test/models/stacks_test.rb +21 -17
  99. data/test/models/status/group_test.rb +6 -0
  100. data/test/models/undeployed_commits_test.rb +9 -0
  101. data/test/models/users_test.rb +2 -2
  102. data/test/test_helper.rb +1 -1
  103. metadata +211 -222
  104. data/app/assets/javascripts/shipit_bs.js.coffee +0 -2
  105. data/app/assets/stylesheets/shipit_bs.scss +0 -22
  106. data/app/views/bootstrap/shipit/missing_settings.html.erb +0 -97
  107. data/app/views/bootstrap/shipit/stacks/new.html.erb +0 -44
  108. data/app/views/layouts/shipit_bootstrap.html.erb +0 -44
  109. data/lib/shipit/template_renderer_extension.rb +0 -16
@@ -8,11 +8,19 @@ module Shipit
8
8
  MAX_READ = 64.kilobytes
9
9
 
10
10
  Error = Class.new(StandardError)
11
- Failed = Class.new(Error)
12
11
  NotFound = Class.new(Error)
13
12
  Denied = Class.new(Error)
14
13
  TimedOut = Class.new(Error)
15
14
 
15
+ class Failed < Error
16
+ attr_reader :exit_code
17
+
18
+ def initialize(message, exit_code)
19
+ super(message)
20
+ @exit_code = exit_code
21
+ end
22
+ end
23
+
16
24
  attr_reader :out, :code, :chdir, :env, :args, :pid, :timeout
17
25
 
18
26
  def initialize(*args, default_timeout: Shipit.default_inactivity_timeout, env: {}, chdir:)
@@ -44,7 +52,7 @@ module Shipit
44
52
  end
45
53
 
46
54
  def success?
47
- code == 0
55
+ !code.nil? && code.zero?
48
56
  end
49
57
 
50
58
  def exit_message
@@ -121,7 +129,7 @@ module Shipit
121
129
 
122
130
  def stream!(&block)
123
131
  stream(&block)
124
- raise Failed.new(exit_message) unless success?
132
+ raise Failed.new(exit_message, code) unless success?
125
133
  self
126
134
  end
127
135
 
data/lib/shipit/engine.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'bootstrap'
2
-
3
1
  module Shipit
4
2
  class Engine < ::Rails::Engine
5
3
  isolate_namespace Shipit
@@ -17,8 +15,6 @@ module Shipit
17
15
  task.js
18
16
  shipit.js
19
17
  shipit.css
20
- shipit_bs.js
21
- shipit_bs.css
22
18
  )
23
19
  app.config.assets.precompile << proc do |path|
24
20
  path =~ %r{\Aplugins/[\-\w]+\.(js|css)\Z}
@@ -26,7 +26,7 @@ module Shipit
26
26
  end
27
27
 
28
28
  def fetch_deployed_revision
29
- with_temporary_working_directory do |dir|
29
+ with_temporary_working_directory(commit: @stack.commits.last) do |dir|
30
30
  spec = DeploySpec::FileSystem.new(dir, @stack.environment)
31
31
  outputs = spec.fetch_deployed_revision_steps!.map do |command_line|
32
32
  Command.new(command_line, env: env, chdir: dir).run
@@ -42,6 +42,8 @@ module Shipit
42
42
  end
43
43
 
44
44
  def with_temporary_working_directory(commit: nil)
45
+ commit ||= @stack.last_deployed_commit.presence || @stack.commits.last
46
+
45
47
  @stack.acquire_git_cache_lock do
46
48
  if !commit || !fetched?(commit).tap(&:run).success?
47
49
  fetch.run!
@@ -1,3 +1,3 @@
1
1
  module Shipit
2
- VERSION = '0.20.1'.freeze
2
+ VERSION = '0.21.0'.freeze
3
3
  end
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+
3
+ VERSION=$(node --eval "console.log(require('./lerna.json').version);")
4
+ echo -e "\033[0;32mTrying to publish version $VERSION\033[0m"
5
+
6
+ git tag | grep "^v$VERSION$" > /dev/null
7
+ if [ $? != '0' ]; then
8
+ echo -e "\033[1;31mYou need to create the \033[0;33mv$VERSION\033[1;31m tag first.\033[0m"
9
+ exit 1
10
+ fi
11
+
12
+ TAG_REV=$(git rev-list -n1 "v$VERSION")
13
+ HEAD_REV=$(git rev-parse HEAD)
14
+
15
+ if [ "$TAG_REV" != "$HEAD_REV" ]; then
16
+ echo -e "\033[1;31mYou're attempting to publish \033[0;33m$HEAD_REV\033[1;31m as \033[0;33mv$VERSION\033[1;31m but it already points to \033[0;33m$TAG_REV\033[1;31m.\033[0m"
17
+ exit 1
18
+ fi
19
+
20
+ echo -e "\033[0;32mAll clear!\033[0m"
21
+ exit 0
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+
3
+ TAGS=$(git tag --points-at HEAD)
4
+
5
+ if [ -z "$TAGS" ]; then
6
+ HEAD_REV=$(git rev-parse HEAD)
7
+ echo -e "\033[1;31mNo tags associated with $HEAD_REV. Did you push your commits and tags?\033[0m"
8
+ exit 1
9
+ fi
10
+
11
+ for TAG in $TAGS
12
+ do
13
+ if [[ "${TAG}" == @* ]]; then
14
+ TAG=$(echo "$TAG" | cut -d \/ -f 2)
15
+ fi
16
+
17
+ PACKAGE_NAME=$(echo "$TAG" | cut -d \@ -f 1)
18
+ TAG_PACKAGE_VERSION=$(echo "$TAG" | cut -d \@ -f 2)
19
+ ACTUAL_PACKAGE_VERSION=$(node -e "console.log(require('./packages/$PACKAGE_NAME/package.json').version)")
20
+
21
+ if [ "$TAG_PACKAGE_VERSION" != "$ACTUAL_PACKAGE_VERSION" ]; then
22
+ echo -e "\033[1;31m$PACKAGE_NAME is tagged as $TAG_PACKAGE_VERSION, but its package.json version is $ACTUAL_PACKAGE_VERSION.\033[0m"
23
+ exit 1
24
+ fi
25
+ done
26
+
27
+ echo -e "\033[0;32mAll clear!\033[0m"
28
+ exit 0
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ const {resolve} = require('path');
3
+ const {existsSync, writeFileSync, readFileSync} = require('fs');
4
+ const npmrc = resolve('.', '.npmrc');
5
+ const npmrcContents = process.argv[2];
6
+
7
+ if (!npmrcContents) {
8
+ console.error('npmrc contents not specified.');
9
+ process.exit(1);
10
+ }
11
+
12
+ if (existsSync(npmrc)) {
13
+ console.log('.npmrc already exists.')
14
+ } else {
15
+ writeFileSync(npmrc, npmrcContents)
16
+
17
+ console.log('\nGenerated .npmrc:');
18
+ console.log(readFileSync(npmrc, {encoding: 'utf8'}))
19
+ }
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+
3
+ echo -e "\033[1;31m Misconfigured package.json, please ensure the following has been met:\n \033[0m"
4
+
5
+ echo -e "\033[1;31m * Please add a publishConfig with an access setting in your package.json. e.g.,\033[0m"
6
+ echo -e "\n\033[1;31m\t\"publishConfig:\" {\n\t \"access\": \"<public|restricted>\" \n\t} \033[0m"
7
+ echo -e "\n\033[1;31m * If your package is private, ensure your the package name is scoped (@organization/package) \033[0m"
8
+ exit 1
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ const {resolve} = require('path');
3
+ const {execSync} = require('child_process')
4
+ const Repository = require(resolve('.', 'node_modules', 'lerna', 'lib', 'Repository'));
5
+ const PackageUtilities = require(resolve('.', 'node_modules', 'lerna', 'lib', 'PackageUtilities'));
6
+
7
+ function npmTag(version) {
8
+ const isNext = ['-beta', '-alpha', '-rc', '-next'].some(distributionType =>
9
+ version.includes(distributionType),
10
+ );
11
+ return isNext ? 'next' : 'latest';
12
+ }
13
+
14
+ const taggedPackages = execSync('git tag --points-at HEAD')
15
+ .toString()
16
+ .trim()
17
+ .split('\n')
18
+ .map(tag => {
19
+ if (tag.startsWith('@')) {
20
+ return `@${tag.split('@')[1]}`;
21
+ }
22
+ return tag.split('@')[0];
23
+ });
24
+
25
+ const repository = new Repository('.');
26
+ const unsortedPackages = PackageUtilities.getPackages({rootPath: '.', packageConfigs: repository.packageConfigs});
27
+ const packages = PackageUtilities.topologicallyBatchPackages(unsortedPackages, true)
28
+ .reduce((acc, packageGroup) => [...acc, ...packageGroup], [])
29
+ .filter(({name}) => taggedPackages.includes(name));
30
+
31
+ packages.forEach(({name, version}) => {
32
+ const command = `node_modules/.bin/lerna publish --yes --npm-client=npm --skip-npm=false --skip-git --force-publish=${name} --repo-version=${version} --scope=${name} --npm-tag=${npmTag(
33
+ version,
34
+ )}`;
35
+
36
+ // eslint-disable-next-line no-console
37
+ console.log(command);
38
+ require('child_process').execSync(command);
39
+ });
@@ -23,17 +23,17 @@ if [[ -z "${HEROKU_APP}" ]]; then
23
23
  exit 1;
24
24
  fi
25
25
 
26
- echo "$HEROKU_RELEASES" | head -n2 | tail -n1 | grep '^\(v[0-9]\+\)' >/dev/null
26
+ echo "$HEROKU_RELEASES" | grep 'Current: \(v[0-9]\+\)' >/dev/null
27
27
 
28
28
  if [[ $? -ne 0 ]]; then
29
29
  red "Error detecting current heroku release. Message from 'heroku releases':"
30
30
  echo "${HEROKU_RELEASES}"
31
31
  red "Please contact a heroku collaborator for ${HEROKU_APP}:"
32
- heroku sharing --app $HEROKU_APP
32
+ heroku access --app $HEROKU_APP
33
33
  exit 1;
34
34
  fi
35
35
 
36
- HEROKU_LAST_GOOD_RELEASE=`echo "$HEROKU_RELEASES" | head -n2 | tail -n1 | sed -e 's/^\(v[0-9]\+\).*/\1/'`
36
+ HEROKU_LAST_GOOD_RELEASE=`echo "$HEROKU_RELEASES" | grep 'Current: \(v[0-9]\+\)' | sed -e 's/.*\(v[0-9]\+\).*/\1/'`
37
37
  green "Current heroku release: ${HEROKU_LAST_GOOD_RELEASE}"
38
38
 
39
39
  green "Pushing to heroku."
@@ -41,7 +41,7 @@ $GIT_COMMAND
41
41
  if [[ $? -ne 0 ]]; then
42
42
  red "Heroku push rejected. See message above."
43
43
  red "Please contact a heroku collaborator for ${HEROKU_APP}:"
44
- heroku sharing --app $HEROKU_APP
44
+ heroku access --app $HEROKU_APP
45
45
  exit 1;
46
46
  fi
47
47
 
@@ -58,7 +58,7 @@ if [[ "${MIGRATION_STATUS}" != "" ]]; then
58
58
  if [[ "${POST_MIGRATION_STATUS}" != "" ]]; then
59
59
  red "Migration failed! This is bad."
60
60
  red "Please contact a heroku collaborator for ${HEROKU_APP}:"
61
- heroku sharing --app $HEROKU_APP
61
+ heroku access --app $HEROKU_APP
62
62
  red "The app ${HEROKU_APP} will now be reverted to its last working version ${HEROKU_LAST_GOOD_RELEASE}."
63
63
  heroku releases:rollback $HEROKU_LAST_GOOD_RELEASE --app $HEROKU_APP
64
64
  red "Abort."
data/lib/tasks/cron.rake CHANGED
@@ -7,7 +7,7 @@ namespace :cron do
7
7
  Shipit::PullRequest.schedule_merges
8
8
  end
9
9
 
10
- task hourly: [:rollup, :refresh_users]
10
+ task hourly: %i(rollup refresh_users)
11
11
 
12
12
  desc "Rolls-up output chunks for completed deploys older than an hour"
13
13
  task rollup: :environment do
data/lib/tasks/dev.rake CHANGED
@@ -15,7 +15,7 @@ namespace :dev do
15
15
 
16
16
  loop do
17
17
  sentence = Faker::Lorem.sentence.split.map do |word|
18
- if rand(4) == 0
18
+ if rand(4).zero?
19
19
  "\e[#{rand(30..37)}m#{word}\e[0m"
20
20
  else
21
21
  word
@@ -40,6 +40,13 @@ module Shipit
40
40
  deploy.user == @user
41
41
  end
42
42
 
43
+ test "#create normalises the claimed user" do
44
+ request.headers['X-Shipit-User'] = @user.login.swapcase
45
+ post :create, params: {stack_id: @stack.to_param, sha: @commit.sha}
46
+ deploy = Deploy.last
47
+ assert_equal deploy.user, @user
48
+ end
49
+
43
50
  test "#create renders a 422 if the sha isn't found" do
44
51
  post :create, params: {stack_id: @stack.to_param, sha: '123443543545'}
45
52
  assert_response :unprocessable_entity
@@ -52,6 +59,18 @@ module Shipit
52
59
  assert_json 'errors', 'sha' => ['is too short (minimum is 6 characters)']
53
60
  end
54
61
 
62
+ test "#create renders a 409 if a concurrent task is already running" do
63
+ assert_difference -> { @stack.deploys.count }, 1 do
64
+ post :create, params: {stack_id: @stack.to_param, sha: @commit.sha}
65
+ end
66
+
67
+ assert_no_difference -> { @stack.deploys.count } do
68
+ post :create, params: {stack_id: @stack.to_param, sha: @commit.sha}
69
+ end
70
+
71
+ assert_response :conflict
72
+ end
73
+
55
74
  test "#create refuses to deploy locked stacks" do
56
75
  @stack.update!(lock_reason: 'Something broken')
57
76
 
@@ -60,7 +60,7 @@ module Shipit
60
60
  assert_response :ok
61
61
  assert_json '0.id', stack.id
62
62
  assert_json do |stacks|
63
- assert_equal 3, stacks.size
63
+ assert_equal Stack.count, stacks.size
64
64
  end
65
65
  end
66
66
 
@@ -24,7 +24,7 @@ module Shipit
24
24
  get :callback
25
25
  end
26
26
 
27
- user = User.find_by_login('shipit-user')
27
+ user = User.find_by(login: 'shipit-user')
28
28
  assert_equal 's3cr3t', user.github_access_token
29
29
  assert_equal 44, user.github_id
30
30
  end
@@ -149,6 +149,11 @@ module Shipit
149
149
  assert_redirected_to stack_settings_path(@stack)
150
150
  end
151
151
 
152
+ test "#sync_webhooks displays a flash message" do
153
+ post :sync_webhooks, params: {id: @stack.to_param}
154
+ assert_equal 'Webhooks syncing scheduled', flash[:success]
155
+ end
156
+
152
157
  test "#clear_git_cache queues a ClearGitCacheJob" do
153
158
  assert_enqueued_with(job: ClearGitCacheJob, args: [@stack]) do
154
159
  post :clear_git_cache, params: {id: @stack.to_param}
@@ -156,6 +161,11 @@ module Shipit
156
161
  assert_redirected_to stack_settings_path(@stack)
157
162
  end
158
163
 
164
+ test "#clear_git_cache displays a flash message" do
165
+ post :clear_git_cache, params: {id: @stack.to_param}
166
+ assert_equal 'Git Cache clearing scheduled', flash[:success]
167
+ end
168
+
159
169
  test "#update redirects to return_to parameter" do
160
170
  patch :update, params: {id: @stack.to_param, stack: {ignore_ci: false}, return_to: stack_path(@stack)}
161
171
  assert_redirected_to stack_path(@stack)
@@ -70,6 +70,7 @@ module Shipit
70
70
  @task.reload
71
71
  assert_response :success
72
72
  assert_equal 'aborting', @task.reload.status
73
+ assert_equal shipit_users(:walrus).id, @task.aborted_by_id
73
74
  assert_equal false, @task.rollback_once_aborted?
74
75
  end
75
76
 
@@ -81,6 +82,7 @@ module Shipit
81
82
  @task.reload
82
83
  assert_response :success
83
84
  assert_equal 'aborting', @task.status
85
+ assert_equal shipit_users(:walrus).id, @task.aborted_by_id
84
86
  assert_equal true, @task.rollback_once_aborted?
85
87
  end
86
88
 
@@ -150,13 +150,6 @@ module Shipit
150
150
  end
151
151
  end
152
152
 
153
- test ":membership can append a user membership for an organization with capitals" do
154
- assert_difference -> { Membership.count }, 1 do
155
- post :membership, params: membership_params.merge(organization: {login: 'Shopify'}, member: {login: 'bob'})
156
- assert_response :ok
157
- end
158
- end
159
-
160
153
  private
161
154
 
162
155
  def membership_params
@@ -15,5 +15,3 @@ test:
15
15
  # -
16
16
  # -
17
17
  redis_url: "redis://127.0.0.1:6379/7"
18
- # features:
19
- # - bootstrap
Binary file
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20170629141736) do
13
+ ActiveRecord::Schema.define(version: 20180202220850) do
14
14
 
15
15
  create_table "api_clients", force: :cascade do |t|
16
16
  t.text "permissions", limit: 65535
@@ -80,9 +80,8 @@ ActiveRecord::Schema.define(version: 20170629141736) do
80
80
  t.datetime "delivered_at"
81
81
  t.datetime "created_at", null: false
82
82
  t.datetime "updated_at", null: false
83
- t.index ["created_at"], name: "index_deliveries_on_created_at"
84
83
  t.index ["hook_id", "event", "status"], name: "index_deliveries_on_hook_id_and_event_and_status"
85
- t.index ["status", "event"], name: "index_deliveries_on_status_and_event"
84
+ t.index ["hook_id", "status"], name: "index_deliveries_on_hook_id_and_status"
86
85
  end
87
86
 
88
87
  create_table "github_hooks", force: :cascade do |t|
@@ -148,6 +147,8 @@ ActiveRecord::Schema.define(version: 20170629141736) do
148
147
  t.string "branch"
149
148
  t.datetime "revalidated_at"
150
149
  t.datetime "merged_at"
150
+ t.string "base_ref", limit: 1024
151
+ t.integer "base_commit_id"
151
152
  t.index ["head_id"], name: "index_pull_requests_on_head_id"
152
153
  t.index ["merge_requested_by_id"], name: "index_pull_requests_on_merge_requested_by_id"
153
154
  t.index ["merge_status"], name: "index_pull_requests_on_merge_status"
@@ -215,6 +216,7 @@ ActiveRecord::Schema.define(version: 20170629141736) do
215
216
  t.datetime "started_at"
216
217
  t.datetime "ended_at"
217
218
  t.boolean "ignored_safeties", default: false, null: false
219
+ t.integer "aborted_by_id"
218
220
  t.index ["rolled_up", "created_at", "status"], name: "index_tasks_on_rolled_up_and_created_at_and_status"
219
221
  t.index ["since_commit_id"], name: "index_tasks_on_since_commit_id"
220
222
  t.index ["stack_id", "allow_concurrency", "status"], name: "index_active_tasks"
Binary file
@@ -102,3 +102,56 @@ shipit_pending_pr_head:
102
102
  deletions: 24
103
103
  updated_at: <%= 8.days.ago.to_s(:db) %>
104
104
  detached: true
105
+
106
+ cyclimse_merged:
107
+ id: 9
108
+ sha: 772b4795871e4a45aa17d53f02aa45d0
109
+ message: "Merge pull request #66 from cyclimse/yoloshipit\n\nyoloshipit!"
110
+ stack: cyclimse
111
+ author: walrus
112
+ committer: walrus
113
+ authored_at: <%= 4.days.ago.to_s(:db) %>
114
+ committed_at: <%= 3.days.ago.to_s(:db) %>
115
+ additions: 420
116
+ deletions: 342
117
+ updated_at: <%= 8.days.ago.to_s(:db) %>
118
+ pull_request_id: 99
119
+
120
+ soc_first:
121
+ id: 101
122
+ sha: 5e9278037b872fd9a6690523e411ecb3aa181355
123
+ message: "lets go"
124
+ stack: soc
125
+ author: walrus
126
+ committer: walrus
127
+ authored_at: <%= 10.days.ago.to_s(:db) %>
128
+ committed_at: <%= 9.days.ago.to_s(:db) %>
129
+ additions: 42
130
+ deletions: 24
131
+ updated_at: <%= 8.days.ago.to_s(:db) %>
132
+
133
+ soc_second:
134
+ id: 102
135
+ sha: e790fd8b5f2be05d1fedb763a3605ee461c39074
136
+ message: "sheep it!"
137
+ stack: soc
138
+ author: walrus
139
+ committer: walrus
140
+ authored_at: <%= 8.days.ago.to_s(:db) %>
141
+ committed_at: <%= 7.days.ago.to_s(:db) %>
142
+ additions: 1
143
+ deletions: 1
144
+ updated_at: <%= 8.days.ago.to_s(:db) %>
145
+
146
+ soc_third:
147
+ id: 103
148
+ sha: 477578b362bf2b4df5903e1c7960929361c39074
149
+ message: "fix it!"
150
+ stack: soc
151
+ author: walrus
152
+ committer: walrus
153
+ authored_at: <%= 6.days.ago.to_s(:db) %>
154
+ committed_at: <%= 5.days.ago.to_s(:db) %>
155
+ additions: 12
156
+ deletions: 64
157
+ updated_at: <%= 8.days.ago.to_s(:db) %>