houston-core 0.6.3 → 0.7.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile.lock +53 -63
  4. data/app/adapters/houston/adapters/error_tracker/errbit_adapter.rb +2 -2
  5. data/app/adapters/houston/adapters/ticket_tracker/github_adapter.rb +1 -1
  6. data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter.rb +5 -5
  7. data/app/adapters/houston/adapters/version_control/git_adapter.rb +4 -4
  8. data/app/assets/javascripts/{app → houston/app}/boot.coffee +0 -0
  9. data/app/assets/javascripts/{app → houston/app}/emoji.coffee.erb +0 -0
  10. data/app/assets/javascripts/{app → houston/app}/infinite_scroll.coffee +0 -0
  11. data/app/assets/javascripts/{app → houston/app}/models/commit.coffee +0 -0
  12. data/app/assets/javascripts/{app → houston/app}/models/release.coffee +0 -0
  13. data/app/assets/javascripts/{app → houston/app}/models/task.coffee +0 -0
  14. data/app/assets/javascripts/{app → houston/app}/models/tester.coffee +0 -0
  15. data/app/assets/javascripts/{app → houston/app}/models/testing_note.coffee +0 -0
  16. data/app/assets/javascripts/{app → houston/app}/models/ticket.coffee +0 -0
  17. data/app/assets/javascripts/{app → houston/app}/models/user.coffee +0 -0
  18. data/app/assets/javascripts/{app → houston/app}/mousetrap-bind-scoped.js +0 -0
  19. data/app/assets/javascripts/{app → houston/app}/releases.coffee +0 -0
  20. data/app/assets/javascripts/{app → houston/app}/table_row_expander.coffee +0 -0
  21. data/app/assets/javascripts/{app → houston/app}/ticket_tracker_refresh.coffee +0 -0
  22. data/app/assets/javascripts/{app → houston/app}/views/_show_sprint_view.coffee +0 -0
  23. data/app/assets/javascripts/{app → houston/app}/views/_tickets_view.coffee +0 -0
  24. data/app/assets/javascripts/{app → houston/app}/views/all_tickets_view.coffee +0 -0
  25. data/app/assets/javascripts/{app → houston/app}/views/commit_view.coffee +0 -0
  26. data/app/assets/javascripts/{app → houston/app}/views/edit_sprint_view.coffee +0 -0
  27. data/app/assets/javascripts/{app → houston/app}/views/edit_ticket_view.coffee +0 -0
  28. data/app/assets/javascripts/{app → houston/app}/views/find_or_create_ticket_view.coffee +0 -0
  29. data/app/assets/javascripts/{app → houston/app}/views/keyboard_shortcuts_modal.coffee +0 -0
  30. data/app/assets/javascripts/{app → houston/app}/views/new_ticket_modal.coffee +0 -0
  31. data/app/assets/javascripts/{app → houston/app}/views/new_ticket_view.coffee +0 -0
  32. data/app/assets/javascripts/{app → houston/app}/views/problems_view.coffee +0 -0
  33. data/app/assets/javascripts/{app → houston/app}/views/testing_note_view.coffee +0 -0
  34. data/app/assets/javascripts/{app → houston/app}/views/testing_report_view.coffee +0 -0
  35. data/app/assets/javascripts/{app → houston/app}/views/testing_ticket_view.coffee +0 -0
  36. data/app/assets/javascripts/{app → houston/app}/views/ticket_modal_view.coffee +0 -0
  37. data/app/assets/javascripts/{application.js → houston/application.js} +1 -1
  38. data/app/assets/javascripts/{core → houston/core}/app.coffee +0 -0
  39. data/app/assets/javascripts/{core → houston/core}/burndown_chart.coffee +0 -0
  40. data/app/assets/javascripts/{core → houston/core}/core_ext/array.coffee +0 -0
  41. data/app/assets/javascripts/{core → houston/core}/core_ext/date.coffee +0 -0
  42. data/app/assets/javascripts/{core → houston/core}/core_ext/number.coffee +0 -0
  43. data/app/assets/javascripts/{core → houston/core}/errors.coffee +1 -1
  44. data/app/assets/javascripts/{core → houston/core}/handlebars_helpers.coffee +0 -0
  45. data/app/assets/javascripts/{core → houston/core}/helpers.coffee +0 -0
  46. data/app/assets/javascripts/{core → houston/core}/jquery_extensions.coffee +5 -3
  47. data/app/assets/javascripts/{core → houston/core}/stacked_area_graph.coffee +0 -0
  48. data/app/assets/javascripts/{core → houston/core}/stacked_bar_graph.coffee +0 -0
  49. data/app/assets/javascripts/{dashboard.js → houston/dashboard.js} +1 -1
  50. data/app/assets/javascripts/{dashboard → houston/dashboard}/refresher.coffee +0 -0
  51. data/app/assets/javascripts/{vendor.js → houston/vendor.js} +0 -0
  52. data/app/assets/stylesheets/{application.css → houston/application.css} +0 -0
  53. data/app/assets/stylesheets/{application → houston/application}/ansi.scss +0 -0
  54. data/app/assets/stylesheets/{application → houston/application}/commit.scss +0 -0
  55. data/app/assets/stylesheets/{application → houston/application}/emoji.scss +0 -0
  56. data/app/assets/stylesheets/{application → houston/application}/exceptions.scss +1 -1
  57. data/app/assets/stylesheets/{application → houston/application}/find_or_create_ticket.scss +0 -0
  58. data/app/assets/stylesheets/{application → houston/application}/follow_up.scss +0 -0
  59. data/app/assets/stylesheets/{application → houston/application}/forms.scss +0 -0
  60. data/app/assets/stylesheets/{application → houston/application}/freight_train.css.scss +0 -0
  61. data/app/assets/stylesheets/{application → houston/application}/full_screen.scss +0 -0
  62. data/app/assets/stylesheets/{application → houston/application}/github_repos.scss +0 -0
  63. data/app/assets/stylesheets/{application → houston/application}/infinite_scroll.scss +0 -0
  64. data/app/assets/stylesheets/houston/application/jobs.scss +5 -0
  65. data/app/assets/stylesheets/{application → houston/application}/keyboard_shortcuts.scss +0 -0
  66. data/app/assets/stylesheets/{application → houston/application}/markdown.scss +0 -0
  67. data/app/assets/stylesheets/{application → houston/application}/mobile.scss +0 -0
  68. data/app/assets/stylesheets/{application → houston/application}/modals.scss +0 -0
  69. data/app/assets/stylesheets/{application → houston/application}/navigation.scss +0 -0
  70. data/app/assets/stylesheets/{application → houston/application}/new_ticket_view.scss +0 -0
  71. data/app/assets/stylesheets/{application → houston/application}/omnibar.scss +0 -0
  72. data/app/assets/stylesheets/{application → houston/application}/project_banner_buttons.scss +0 -0
  73. data/app/assets/stylesheets/{application → houston/application}/project_tiles.scss +0 -0
  74. data/app/assets/stylesheets/{application → houston/application}/projects.css.scss +0 -0
  75. data/app/assets/stylesheets/{application → houston/application}/pull_requests.scss +0 -0
  76. data/app/assets/stylesheets/{application → houston/application}/queue.scss +0 -0
  77. data/app/assets/stylesheets/{application → houston/application}/release_form.scss +0 -0
  78. data/app/assets/stylesheets/{application → houston/application}/releases.scss +1 -1
  79. data/app/assets/stylesheets/{application → houston/application}/sortable_table.scss +0 -0
  80. data/app/assets/stylesheets/{application → houston/application}/sprint.scss +0 -0
  81. data/app/assets/stylesheets/{application → houston/application}/tables.scss +0 -0
  82. data/app/assets/stylesheets/{application → houston/application}/test.scss +0 -0
  83. data/app/assets/stylesheets/{application → houston/application}/test_run.scss +0 -0
  84. data/app/assets/stylesheets/{application → houston/application}/testing_report.scss +0 -0
  85. data/app/assets/stylesheets/{application → houston/application}/ticket.scss +0 -0
  86. data/app/assets/stylesheets/{application → houston/application}/ticket_modal.scss +0 -0
  87. data/app/assets/stylesheets/{application → houston/application}/tickets.scss +0 -0
  88. data/app/assets/stylesheets/{application → houston/application}/timeline.scss +0 -0
  89. data/app/assets/stylesheets/{application → houston/application}/tips.scss +0 -0
  90. data/app/assets/stylesheets/{application → houston/application}/typeahead.scss +0 -0
  91. data/app/assets/stylesheets/{application → houston/application}/uploading.scss +0 -0
  92. data/app/assets/stylesheets/{application → houston/application}/user_wall.scss +0 -0
  93. data/app/assets/stylesheets/{application → houston/application}/users.scss +0 -0
  94. data/app/assets/stylesheets/{application → houston/application}/welcome.scss +0 -0
  95. data/app/assets/stylesheets/{core → houston/core}/alerts.scss +0 -0
  96. data/app/assets/stylesheets/{core → houston/core}/avatars.scss +0 -0
  97. data/app/assets/stylesheets/{core → houston/core}/burndown_chart.scss +0 -0
  98. data/app/assets/stylesheets/{core → houston/core}/colors.scss.erb +0 -0
  99. data/app/assets/stylesheets/{core → houston/core}/misc.scss +3 -0
  100. data/app/assets/stylesheets/{core → houston/core}/octicons-icons.scss +0 -0
  101. data/app/assets/stylesheets/{core → houston/core}/octicons.scss.erb +0 -0
  102. data/app/assets/stylesheets/{core → houston/core}/overrides.scss +0 -0
  103. data/app/assets/stylesheets/{core → houston/core}/roboto.scss.erb +0 -0
  104. data/app/assets/stylesheets/{core → houston/core}/scores.scss +0 -0
  105. data/app/assets/stylesheets/{dashboard.css → houston/dashboard.css} +0 -0
  106. data/app/assets/stylesheets/{dashboard → houston/dashboard}/dashboard.scss +0 -0
  107. data/app/assets/stylesheets/{print.css.scss → houston/print.css.scss} +0 -0
  108. data/app/assets/stylesheets/{variables.scss → houston/variables.scss} +0 -0
  109. data/app/assets/stylesheets/{vendor.css → houston/vendor.css} +0 -0
  110. data/app/concerns/houston/props.rb +96 -0
  111. data/app/concerns/project_adapter.rb +1 -1
  112. data/app/controllers/api/v1/measurements_controller.rb +32 -0
  113. data/app/controllers/application_controller.rb +1 -1
  114. data/app/controllers/authorizations_controller.rb +61 -0
  115. data/app/controllers/github/pulls_controller.rb +1 -1
  116. data/app/controllers/jobs_controller.rb +30 -1
  117. data/app/controllers/oauth/providers_controller.rb +45 -0
  118. data/app/controllers/project_options_controller.rb +2 -2
  119. data/app/controllers/projects_controller.rb +3 -3
  120. data/app/controllers/releases_controller.rb +3 -3
  121. data/app/controllers/user_options_controller.rb +2 -2
  122. data/app/controllers/users_controller.rb +1 -2
  123. data/app/helpers/application_helper.rb +49 -3
  124. data/app/helpers/email_helper.rb +19 -1
  125. data/app/helpers/release_helper.rb +1 -1
  126. data/app/helpers/ticket_helper.rb +0 -32
  127. data/app/interactors/cache_key_dependencies.rb +3 -8
  128. data/app/mailers/view_mailer.rb +8 -8
  129. data/app/models/authorization.rb +54 -0
  130. data/app/models/commit.rb +1 -1
  131. data/app/models/error.rb +14 -0
  132. data/app/models/github/comment_event.rb +4 -4
  133. data/app/models/github/pull_request.rb +39 -17
  134. data/app/models/github/pull_request_event.rb +1 -7
  135. data/app/models/job.rb +81 -0
  136. data/app/models/measurement.rb +2 -1
  137. data/app/models/oauth/provider.rb +35 -0
  138. data/app/models/project.rb +12 -3
  139. data/app/models/slackdown.rb +1 -1
  140. data/app/models/user.rb +28 -35
  141. data/app/presenters/measurements_presenter.rb +26 -0
  142. data/app/presenters/project_presenter.rb +1 -1
  143. data/app/views/authorizations/_form.html.erb +33 -0
  144. data/app/views/authorizations/edit.html.erb +7 -0
  145. data/app/views/authorizations/granted.html.erb +7 -0
  146. data/app/views/authorizations/index.html.erb +47 -0
  147. data/app/views/authorizations/new.html.erb +7 -0
  148. data/app/views/configuration_error/_no_ticket_tracker.html.erb +1 -1
  149. data/app/views/github/pulls/index.html.erb +5 -1
  150. data/app/views/jobs/index.html.erb +72 -0
  151. data/app/views/jobs/show.html.erb +25 -32
  152. data/app/views/layouts/_navigation.html.erb +1 -1
  153. data/app/views/layouts/application.html.erb +14 -15
  154. data/app/views/layouts/dashboard.html.erb +9 -10
  155. data/app/views/layouts/minimal.html.erb +14 -15
  156. data/app/views/layouts/naked.html.erb +52 -0
  157. data/app/views/layouts/naked_dashboard.html.erb +9 -10
  158. data/app/views/oauth/providers/_form.html.erb +54 -0
  159. data/app/views/oauth/providers/edit.html.erb +7 -0
  160. data/app/views/oauth/providers/index.html.erb +41 -0
  161. data/app/views/oauth/providers/new.html.erb +7 -0
  162. data/app/views/projects/_form.html.erb +8 -9
  163. data/app/views/projects/index.html.erb +1 -1
  164. data/app/views/users/_form.html.erb +20 -19
  165. data/bin/rails +1 -1
  166. data/config/application.rb +11 -10
  167. data/config/boot.rb +1 -2
  168. data/config/environments/development.rb +8 -6
  169. data/config/environments/production.rb +11 -16
  170. data/config/environments/test.rb +5 -5
  171. data/config/initializers/assets.rb +17 -7
  172. data/config/initializers/cookies_serializer.rb +1 -1
  173. data/config/initializers/houston_async.rb +22 -4
  174. data/config/initializers/houston_report_exception.rb +16 -11
  175. data/config/initializers/houston_scheduler.rb +1 -1
  176. data/config/initializers/houston_try.rb +12 -0
  177. data/config/routes.rb +29 -19
  178. data/db/fixtures/projects.yml +2 -2
  179. data/db/migrate/20160317140151_remove_limit_from_users_invitation_token.rb +9 -0
  180. data/db/migrate/20160419230411_create_oauth_providers.rb +14 -0
  181. data/db/migrate/20160420000616_create_authorizations.rb +16 -0
  182. data/db/migrate/20160507135209_create_jobs.rb +14 -0
  183. data/db/migrate/20160507135846_create_errors_2.rb +12 -0
  184. data/db/migrate/20160510233329_add_closed_at_and_merged_at_to_pull_requests.rb +7 -0
  185. data/db/migrate/20160625203412_convert_user_view_options_to_props.rb +21 -0
  186. data/db/migrate/20160625221840_convert_project_extended_attributes_to_props.rb +32 -0
  187. data/db/migrate/20160625230420_move_users_unfuddle_id_to_props.rb +14 -0
  188. data/db/structure.sql +247 -4
  189. data/{houston.gemspec → houston-core.gemspec} +8 -9
  190. data/lib/configuration.rb +15 -43
  191. data/lib/houston/version.rb +1 -1
  192. data/lib/houston_observer.rb +2 -7
  193. data/lib/parallel_enumerable.rb +2 -8
  194. data/templates/new-instance/app/assets/javascripts/.keep +0 -0
  195. data/templates/new-instance/app/assets/javascripts/application.js +13 -0
  196. data/templates/new-instance/app/assets/stylesheets/.keep +0 -0
  197. data/templates/new-instance/app/assets/stylesheets/application.css +13 -0
  198. data/templates/new-instance/app/controllers/.keep +0 -0
  199. data/templates/new-instance/app/models/.keep +0 -0
  200. data/templates/new-instance/app/views/.keep +0 -0
  201. data/templates/new-instance/config/alerts/errs.rb +1 -1
  202. data/templates/new-instance/config/jobs/purge_jobs.rb +3 -0
  203. data/templates/new-instance/config/main.rb +1 -0
  204. data/templates/new-instance/config/routes.rb +5 -0
  205. data/templates/new-instance/config/triggers/github/publish_comments_on_slack.rb +3 -3
  206. data/templates/new-instance/lib/houston/engine.rb +25 -0
  207. data/test/acceptance/creating_a_release_test.rb +1 -1
  208. data/test/integration/ci_integration_test.rb +2 -2
  209. data/test/integration/commits_api_test.rb +1 -1
  210. data/test/unit/controllers/hooks_controller_test.rb +1 -6
  211. data/test/unit/controllers/project_options_controller_test.rb +11 -11
  212. data/test/unit/controllers/user_options_controller_test.rb +13 -13
  213. data/test/unit/models/code_climate_coverage_report_test.rb +1 -1
  214. data/test/unit/models/commit_test.rb +4 -2
  215. data/test/unit/models/project_test.rb +5 -5
  216. data/test/unit/models/props_test.rb +57 -0
  217. data/test/unit/models/pull_request_test.rb +2 -2
  218. data/test/unit/models/test_run_test.rb +1 -1
  219. metadata +166 -151
  220. data/app/assets/javascripts/app/views/reports_view.coffee +0 -51
  221. data/app/controllers/oauth_consumers_controller.rb +0 -68
  222. data/app/controllers/reports_controller.rb +0 -215
  223. data/app/models/consumer_token.rb +0 -13
  224. data/app/models/github_token.rb +0 -8
  225. data/app/views/oauth_consumers/error.html.erb +0 -5
  226. data/app/views/oauth_consumers/index.html.erb +0 -29
  227. data/app/views/oauth_consumers/show.html.erb +0 -7
  228. data/app/views/reports/index.html.erb +0 -9
  229. data/app/views/reports/sprint.html.erb +0 -21
  230. data/app/views/reports/velocity.html.erb +0 -104
  231. data/config/initializers/oauth_consumers.rb +0 -18
  232. data/lib/patches/sprockets_output_path_for_assets.rb +0 -29
@@ -0,0 +1,14 @@
1
+ class MoveUsersUnfuddleIdToProps < ActiveRecord::Migration
2
+ def up
3
+ require "progressbar"
4
+ users = User.all
5
+ pbar = ProgressBar.new("users", users.count)
6
+ users.find_each do |user|
7
+ if unfuddle_id = user.read_attribute(:unfuddle_id)
8
+ user.update_prop! "unfuddle.id", unfuddle_id
9
+ end
10
+ pbar.inc
11
+ end
12
+ pbar.finish
13
+ end
14
+ end
data/db/structure.sql CHANGED
@@ -54,6 +54,44 @@ SET default_tablespace = '';
54
54
 
55
55
  SET default_with_oids = false;
56
56
 
57
+ --
58
+ -- Name: authorizations; Type: TABLE; Schema: public; Owner: -; Tablespace:
59
+ --
60
+
61
+ CREATE TABLE authorizations (
62
+ id integer NOT NULL,
63
+ name character varying NOT NULL,
64
+ provider_id integer,
65
+ scope character varying,
66
+ access_token character varying,
67
+ refresh_token character varying,
68
+ secret character varying,
69
+ expires_in integer,
70
+ expires_at timestamp without time zone,
71
+ created_at timestamp without time zone,
72
+ updated_at timestamp without time zone
73
+ );
74
+
75
+
76
+ --
77
+ -- Name: authorizations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
78
+ --
79
+
80
+ CREATE SEQUENCE authorizations_id_seq
81
+ START WITH 1
82
+ INCREMENT BY 1
83
+ NO MINVALUE
84
+ NO MAXVALUE
85
+ CACHE 1;
86
+
87
+
88
+ --
89
+ -- Name: authorizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
90
+ --
91
+
92
+ ALTER SEQUENCE authorizations_id_seq OWNED BY authorizations.id;
93
+
94
+
57
95
  --
58
96
  -- Name: commits; Type: TABLE; Schema: public; Owner: -; Tablespace:
59
97
  --
@@ -222,6 +260,72 @@ CREATE SEQUENCE deploys_id_seq
222
260
  ALTER SEQUENCE deploys_id_seq OWNED BY deploys.id;
223
261
 
224
262
 
263
+ --
264
+ -- Name: errors; Type: TABLE; Schema: public; Owner: -; Tablespace:
265
+ --
266
+
267
+ CREATE TABLE errors (
268
+ id integer NOT NULL,
269
+ sha character varying NOT NULL,
270
+ message text NOT NULL,
271
+ backtrace text NOT NULL,
272
+ created_at timestamp without time zone,
273
+ updated_at timestamp without time zone
274
+ );
275
+
276
+
277
+ --
278
+ -- Name: errors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
279
+ --
280
+
281
+ CREATE SEQUENCE errors_id_seq
282
+ START WITH 1
283
+ INCREMENT BY 1
284
+ NO MINVALUE
285
+ NO MAXVALUE
286
+ CACHE 1;
287
+
288
+
289
+ --
290
+ -- Name: errors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
291
+ --
292
+
293
+ ALTER SEQUENCE errors_id_seq OWNED BY errors.id;
294
+
295
+
296
+ --
297
+ -- Name: jobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
298
+ --
299
+
300
+ CREATE TABLE jobs (
301
+ id integer NOT NULL,
302
+ name character varying NOT NULL,
303
+ started_at timestamp without time zone NOT NULL,
304
+ finished_at timestamp without time zone,
305
+ succeeded boolean,
306
+ error_id integer
307
+ );
308
+
309
+
310
+ --
311
+ -- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
312
+ --
313
+
314
+ CREATE SEQUENCE jobs_id_seq
315
+ START WITH 1
316
+ INCREMENT BY 1
317
+ NO MINVALUE
318
+ NO MAXVALUE
319
+ CACHE 1;
320
+
321
+
322
+ --
323
+ -- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
324
+ --
325
+
326
+ ALTER SEQUENCE jobs_id_seq OWNED BY jobs.id;
327
+
328
+
225
329
  --
226
330
  -- Name: measurements; Type: TABLE; Schema: public; Owner: -; Tablespace:
227
331
  --
@@ -294,6 +398,42 @@ CREATE SEQUENCE milestones_id_seq
294
398
  ALTER SEQUENCE milestones_id_seq OWNED BY milestones.id;
295
399
 
296
400
 
401
+ --
402
+ -- Name: oauth_providers; Type: TABLE; Schema: public; Owner: -; Tablespace:
403
+ --
404
+
405
+ CREATE TABLE oauth_providers (
406
+ id integer NOT NULL,
407
+ name character varying NOT NULL,
408
+ site character varying NOT NULL,
409
+ authorize_path character varying NOT NULL,
410
+ token_path character varying NOT NULL,
411
+ client_id character varying NOT NULL,
412
+ client_secret character varying NOT NULL,
413
+ created_at timestamp without time zone,
414
+ updated_at timestamp without time zone
415
+ );
416
+
417
+
418
+ --
419
+ -- Name: oauth_providers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
420
+ --
421
+
422
+ CREATE SEQUENCE oauth_providers_id_seq
423
+ START WITH 1
424
+ INCREMENT BY 1
425
+ NO MINVALUE
426
+ NO MAXVALUE
427
+ CACHE 1;
428
+
429
+
430
+ --
431
+ -- Name: oauth_providers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
432
+ --
433
+
434
+ ALTER SEQUENCE oauth_providers_id_seq OWNED BY oauth_providers.id;
435
+
436
+
297
437
  --
298
438
  -- Name: project_quotas; Type: TABLE; Schema: public; Owner: -; Tablespace:
299
439
  --
@@ -352,7 +492,8 @@ CREATE TABLE projects (
352
492
  view_options hstore DEFAULT ''::hstore NOT NULL,
353
493
  feature_states hstore DEFAULT ''::hstore NOT NULL,
354
494
  selected_features text[],
355
- head_sha character varying(255)
495
+ head_sha character varying(255),
496
+ props jsonb DEFAULT '{}'::jsonb
356
497
  );
357
498
 
358
499
 
@@ -397,7 +538,9 @@ CREATE TABLE pull_requests (
397
538
  avatar_url character varying(255),
398
539
  json_labels jsonb DEFAULT '[]'::jsonb,
399
540
  created_at timestamp without time zone,
400
- updated_at timestamp without time zone
541
+ updated_at timestamp without time zone,
542
+ closed_at timestamp without time zone,
543
+ merged_at timestamp without time zone
401
544
  );
402
545
 
403
546
 
@@ -959,7 +1102,7 @@ CREATE TABLE users (
959
1102
  last_sign_in_ip character varying(255),
960
1103
  created_at timestamp without time zone,
961
1104
  updated_at timestamp without time zone,
962
- invitation_token character varying(60),
1105
+ invitation_token character varying,
963
1106
  invitation_sent_at timestamp without time zone,
964
1107
  invitation_accepted_at timestamp without time zone,
965
1108
  invitation_limit integer,
@@ -978,7 +1121,8 @@ CREATE TABLE users (
978
1121
  current_project_id integer,
979
1122
  nickname character varying(255),
980
1123
  username character varying(255),
981
- environments_subscribed_to text[] DEFAULT '{}'::text[] NOT NULL
1124
+ environments_subscribed_to text[] DEFAULT '{}'::text[] NOT NULL,
1125
+ props jsonb DEFAULT '{}'::jsonb
982
1126
  );
983
1127
 
984
1128
 
@@ -1071,6 +1215,13 @@ CREATE SEQUENCE versions_id_seq
1071
1215
  ALTER SEQUENCE versions_id_seq OWNED BY versions.id;
1072
1216
 
1073
1217
 
1218
+ --
1219
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1220
+ --
1221
+
1222
+ ALTER TABLE ONLY authorizations ALTER COLUMN id SET DEFAULT nextval('authorizations_id_seq'::regclass);
1223
+
1224
+
1074
1225
  --
1075
1226
  -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1076
1227
  --
@@ -1092,6 +1243,20 @@ ALTER TABLE ONLY consumer_tokens ALTER COLUMN id SET DEFAULT nextval('consumer_t
1092
1243
  ALTER TABLE ONLY deploys ALTER COLUMN id SET DEFAULT nextval('deploys_id_seq'::regclass);
1093
1244
 
1094
1245
 
1246
+ --
1247
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1248
+ --
1249
+
1250
+ ALTER TABLE ONLY errors ALTER COLUMN id SET DEFAULT nextval('errors_id_seq'::regclass);
1251
+
1252
+
1253
+ --
1254
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1255
+ --
1256
+
1257
+ ALTER TABLE ONLY jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass);
1258
+
1259
+
1095
1260
  --
1096
1261
  -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1097
1262
  --
@@ -1106,6 +1271,13 @@ ALTER TABLE ONLY measurements ALTER COLUMN id SET DEFAULT nextval('measurements_
1106
1271
  ALTER TABLE ONLY milestones ALTER COLUMN id SET DEFAULT nextval('milestones_id_seq'::regclass);
1107
1272
 
1108
1273
 
1274
+ --
1275
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1276
+ --
1277
+
1278
+ ALTER TABLE ONLY oauth_providers ALTER COLUMN id SET DEFAULT nextval('oauth_providers_id_seq'::regclass);
1279
+
1280
+
1109
1281
  --
1110
1282
  -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1111
1283
  --
@@ -1239,6 +1411,14 @@ ALTER TABLE ONLY value_statements ALTER COLUMN id SET DEFAULT nextval('value_sta
1239
1411
  ALTER TABLE ONLY versions ALTER COLUMN id SET DEFAULT nextval('versions_id_seq'::regclass);
1240
1412
 
1241
1413
 
1414
+ --
1415
+ -- Name: authorizations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1416
+ --
1417
+
1418
+ ALTER TABLE ONLY authorizations
1419
+ ADD CONSTRAINT authorizations_pkey PRIMARY KEY (id);
1420
+
1421
+
1242
1422
  --
1243
1423
  -- Name: commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1244
1424
  --
@@ -1263,6 +1443,22 @@ ALTER TABLE ONLY deploys
1263
1443
  ADD CONSTRAINT deploys_pkey PRIMARY KEY (id);
1264
1444
 
1265
1445
 
1446
+ --
1447
+ -- Name: errors_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1448
+ --
1449
+
1450
+ ALTER TABLE ONLY errors
1451
+ ADD CONSTRAINT errors_pkey PRIMARY KEY (id);
1452
+
1453
+
1454
+ --
1455
+ -- Name: jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1456
+ --
1457
+
1458
+ ALTER TABLE ONLY jobs
1459
+ ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
1460
+
1461
+
1266
1462
  --
1267
1463
  -- Name: measurements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1268
1464
  --
@@ -1279,6 +1475,14 @@ ALTER TABLE ONLY milestones
1279
1475
  ADD CONSTRAINT milestones_pkey PRIMARY KEY (id);
1280
1476
 
1281
1477
 
1478
+ --
1479
+ -- Name: oauth_providers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1480
+ --
1481
+
1482
+ ALTER TABLE ONLY oauth_providers
1483
+ ADD CONSTRAINT oauth_providers_pkey PRIMARY KEY (id);
1484
+
1485
+
1282
1486
  --
1283
1487
  -- Name: project_quotas_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1284
1488
  --
@@ -1524,6 +1728,20 @@ CREATE INDEX index_deploys_on_environment_name ON deploys USING btree (environme
1524
1728
  CREATE INDEX index_deploys_on_project_id_and_environment_name ON deploys USING btree (project_id, environment_name);
1525
1729
 
1526
1730
 
1731
+ --
1732
+ -- Name: index_errors_on_sha; Type: INDEX; Schema: public; Owner: -; Tablespace:
1733
+ --
1734
+
1735
+ CREATE UNIQUE INDEX index_errors_on_sha ON errors USING btree (sha);
1736
+
1737
+
1738
+ --
1739
+ -- Name: index_jobs_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
1740
+ --
1741
+
1742
+ CREATE INDEX index_jobs_on_name ON jobs USING btree (name);
1743
+
1744
+
1527
1745
  --
1528
1746
  -- Name: index_measurements_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
1529
1747
  --
@@ -1587,6 +1805,13 @@ CREATE INDEX index_project_quotas_on_week ON project_quotas USING btree (week);
1587
1805
  CREATE UNIQUE INDEX index_projects_on_slug ON projects USING btree (slug);
1588
1806
 
1589
1807
 
1808
+ --
1809
+ -- Name: index_pull_requests_on_closed_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
1810
+ --
1811
+
1812
+ CREATE INDEX index_pull_requests_on_closed_at ON pull_requests USING btree (closed_at);
1813
+
1814
+
1590
1815
  --
1591
1816
  -- Name: index_pull_requests_on_project_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1592
1817
  --
@@ -2267,3 +2492,21 @@ INSERT INTO schema_migrations (version) VALUES ('20151228183704');
2267
2492
 
2268
2493
  INSERT INTO schema_migrations (version) VALUES ('20160120145757');
2269
2494
 
2495
+ INSERT INTO schema_migrations (version) VALUES ('20160317140151');
2496
+
2497
+ INSERT INTO schema_migrations (version) VALUES ('20160419230411');
2498
+
2499
+ INSERT INTO schema_migrations (version) VALUES ('20160420000616');
2500
+
2501
+ INSERT INTO schema_migrations (version) VALUES ('20160507135209');
2502
+
2503
+ INSERT INTO schema_migrations (version) VALUES ('20160507135846');
2504
+
2505
+ INSERT INTO schema_migrations (version) VALUES ('20160510233329');
2506
+
2507
+ INSERT INTO schema_migrations (version) VALUES ('20160625203412');
2508
+
2509
+ INSERT INTO schema_migrations (version) VALUES ('20160625221840');
2510
+
2511
+ INSERT INTO schema_migrations (version) VALUES ('20160625230420');
2512
+
@@ -21,13 +21,12 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  # For Houston as a Web Application
23
23
  spec.add_dependency "rails", "~> 4.2.5.1"
24
- spec.add_dependency "sprockets", "~> 2.8" # update this when updating Rails
25
24
  spec.add_dependency "pg", "~> 0.18.3"
26
25
  # --------------------------------
27
26
  spec.add_dependency "activerecord-import"
28
27
  spec.add_dependency "activerecord-pluck_in_batches"
29
- spec.add_dependency "addressable"
30
- spec.add_dependency "browser"
28
+ spec.add_dependency "addressable", "~> 2.3.8"
29
+ spec.add_dependency "browser", "~> 1.1.0"
31
30
  spec.add_dependency "cancan", "~> 1.6.10"
32
31
  spec.add_dependency "default_value_for", "3.0.1"
33
32
  spec.add_dependency "devise", "~> 3.5.0"
@@ -37,11 +36,11 @@ Gem::Specification.new do |spec|
37
36
  spec.add_dependency "faraday-http-cache", "~> 1.2.2"
38
37
  spec.add_dependency "faraday-raise-errors", "~> 0.2.0"
39
38
  spec.add_dependency "gemoji", "~> 2.1.0"
40
- spec.add_dependency "handlebars_assets", "~> 0.21.0"
39
+ spec.add_dependency "handlebars_assets", "~> 0.23.0"
41
40
  spec.add_dependency "hpricot", "~> 0.8.6"
42
41
  spec.add_dependency "neat-rails"
43
42
  spec.add_dependency "nokogiri"
44
- spec.add_dependency "houston-oauth-plugin"
43
+ spec.add_dependency "oauth2"
45
44
  spec.add_dependency "oj", "~> 2.13"
46
45
  spec.add_dependency "openxml-xlsx", ">= 0.2.0"
47
46
  spec.add_dependency "pg_search", "~> 1.0.5"
@@ -60,7 +59,7 @@ Gem::Specification.new do |spec|
60
59
  spec.add_dependency "coffee-rails", "~> 4.1.0"
61
60
 
62
61
  # Houston's background jobs daemon
63
- spec.add_dependency "rufus-scheduler", "~> 3.1.7"
62
+ spec.add_dependency "rufus-scheduler", "~> 3.2.0"
64
63
  spec.add_dependency "whenever", "0.9.2" # Houston uses just the DSL for writing cron jobs
65
64
 
66
65
  # Used to create image charts for embedding in email
@@ -83,12 +82,12 @@ Gem::Specification.new do |spec|
83
82
  spec.add_dependency "simplecov", "~> 0.9.1"
84
83
 
85
84
  # Implements Houston's VersionControl::GitAdapter
86
- spec.add_dependency "rugged", "~> 0.23.3" # for speaking to Git
85
+ spec.add_dependency "rugged", "~> 0.24.0" # for speaking to Git
87
86
 
88
87
  # For integration with GitHub
89
- spec.add_dependency "octokit", "~> 4.1.0"
88
+ spec.add_dependency "octokit", "~> 4.3.0"
90
89
 
91
- # Implements Houston's TicketTracker::UnfuddleAdapter
90
+ # Implements Houston's TicketTracker::UnfuddleAdapter (TODO: extract)
92
91
  spec.add_dependency "boblail-unfuddle"
93
92
 
94
93
  # For deploying to EngineYard
data/lib/configuration.rb CHANGED
@@ -46,18 +46,6 @@ module Houston
46
46
  Houston::Application.paths["log"] = root.join("log/#{Rails.env}.log")
47
47
  Houston::Application.paths["tmp"] = root.join("tmp")
48
48
  Houston::Application.paths["config/environments"] << root.join("config/environments")
49
-
50
- # TODO: finish this
51
- Rails.application.assets = Sprockets::Environment.new(root) do |env|
52
- env.version = Rails.env
53
-
54
- path = "#{Houston.root}/tmp/cache/assets/#{Rails.env}"
55
- env.cache = Sprockets::Cache::FileStore.new(path)
56
-
57
- env.context_class.class_eval do
58
- include ::Sprockets::Rails::Helper
59
- end
60
- end
61
49
  end
62
50
 
63
51
  def title(*args)
@@ -625,46 +613,30 @@ module Houston
625
613
 
626
614
  class Jobs
627
615
 
628
- def run_async(slug)
629
- block = find_timer_block!(slug)
630
- Thread.new do
631
- run! "#{slug}/manual", block
616
+ def run(job)
617
+ trigger = "manual"
618
+ job, trigger = [job.tags.first, job.original] if job.is_a? Rufus::Scheduler::Job
619
+ block = find_timer_block!(job)
620
+ Houston.async do
621
+ run! job, trigger, block
632
622
  end
633
623
  end
634
624
 
635
- def run_job(job)
636
- slug = job.tags.first
637
- block = find_timer_block!(slug)
638
- run! "#{slug}/#{job.original}", block
639
- end
640
-
641
625
  private
642
626
 
643
- def find_timer_block!(slug)
644
- timer = Houston.config.timers.detect { |(_, _, name, _, _)| name == slug }
645
- raise ArgumentError, "#{slug} is not a job" unless timer
627
+ def find_timer_block!(job_name)
628
+ timer = Houston.config.timers.detect { |(_, _, name, _, _)| name == job_name }
629
+ raise ArgumentError, "#{job_name} is not a job" unless timer
646
630
  timer.last
647
631
  end
648
632
 
649
- def run!(tag, block)
650
- Rails.logger.info "\e[34m[#{tag}] Running job\e[0m"
651
- block.call
652
-
653
- rescue SocketError,
654
- Errno::ECONNREFUSED,
655
- Errno::ETIMEDOUT,
656
- Faraday::Error::ConnectionFailed,
657
- Faraday::HTTP::ServerError,
658
- Rugged::NetworkError,
659
- Unfuddle::ConnectionError,
660
- Octokit::BadGateway,
661
- exceptions_wrapping(PG::ConnectionBad)
662
- Rails.logger.error "\e[31m[#{tag}] #{$!.class}: #{$!.message} [ignored]\e[0m"
633
+ def run!(job_name, trigger, block)
634
+ Job.record job_name do
635
+ Rails.logger.info "\e[34m[#{job_name}/#{trigger}] Running job\e[0m"
636
+ block.call
637
+ end
663
638
  rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
664
- Rails.logger.error "\e[31m[#{tag}] \e[1m#{$!.message}\e[0m"
665
- Houston.report_exception($!, parameters: {job_name: tag}) # <-- no job id!
666
- ensure
667
- ActiveRecord::Base.clear_active_connections!
639
+ Houston.report_exception($!, parameters: {job_name: job_name})
668
640
  end
669
641
 
670
642
  end