houston-core 0.7.0.beta3 → 0.7.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +56 -56
  3. data/app/assets/javascripts/houston/app/infinite_scroll.coffee +6 -2
  4. data/app/assets/javascripts/houston/app/models/ticket.coffee +0 -42
  5. data/app/assets/javascripts/houston/app/ticket_tracker_refresh.coffee +0 -2
  6. data/app/assets/javascripts/houston/app/views/keyboard_shortcuts_modal.coffee +0 -6
  7. data/app/assets/javascripts/houston/core/handlebars_helpers.coffee +0 -5
  8. data/app/assets/stylesheets/houston/application/actions.scss +15 -0
  9. data/app/assets/stylesheets/houston/application/layout.scss +3 -0
  10. data/app/assets/stylesheets/houston/application/markdown.scss +1 -1
  11. data/app/assets/stylesheets/houston/application/navigation.scss +3 -1
  12. data/app/assets/stylesheets/houston/application/project_banner_buttons.scss +2 -0
  13. data/app/assets/stylesheets/houston/application/tables.scss +0 -1
  14. data/app/assets/stylesheets/houston/application/timeline.scss +1 -1
  15. data/app/assets/stylesheets/houston/core/overrides.scss +2 -1
  16. data/app/concerns/houston/props.rb +11 -4
  17. data/app/concerns/project_adapter.rb +1 -1
  18. data/app/concerns/unique_add.rb +1 -1
  19. data/app/controllers/actions_controller.rb +39 -0
  20. data/app/controllers/commits_controller.rb +1 -1
  21. data/app/controllers/errors_controller.rb +10 -0
  22. data/app/controllers/hooks_controller.rb +1 -1
  23. data/app/controllers/omnibar_controller.rb +1 -11
  24. data/app/controllers/project_hooks_controller.rb +2 -2
  25. data/app/controllers/projects_controller.rb +2 -0
  26. data/app/controllers/test_runs_controller.rb +14 -3
  27. data/app/controllers/triggers_controller.rb +8 -0
  28. data/app/helpers/actions_helper.rb +7 -0
  29. data/app/helpers/application_helper.rb +1 -1
  30. data/app/interactors/cache_key_dependencies.rb +1 -1
  31. data/app/interactors/test_run_comparer.rb +1 -1
  32. data/app/mailers/project_notification.rb +0 -31
  33. data/app/models/ability.rb +0 -11
  34. data/app/models/{job.rb → action.rb} +19 -7
  35. data/app/models/commit.rb +2 -2
  36. data/app/models/deploy.rb +3 -3
  37. data/app/models/github/comment_event.rb +9 -3
  38. data/app/models/github/post_receive_event.rb +1 -1
  39. data/app/models/github/pull_request.rb +5 -5
  40. data/app/models/persistent_trigger.rb +46 -0
  41. data/app/models/project.rb +0 -1
  42. data/app/models/release.rb +1 -1
  43. data/app/models/run_tests_on_post_receive.rb +17 -17
  44. data/app/models/task.rb +4 -4
  45. data/app/models/test_run.rb +18 -5
  46. data/app/models/ticket.rb +2 -21
  47. data/app/models/ticket_antecedent.rb +3 -3
  48. data/app/models/user.rb +0 -1
  49. data/app/views/actions/index.html.erb +69 -0
  50. data/app/views/actions/show.html.erb +45 -0
  51. data/app/views/commits/show.html.erb +7 -8
  52. data/app/views/errors/_actions.html.erb +11 -0
  53. data/app/views/errors/index.html.erb +39 -0
  54. data/app/views/layouts/_mobile_navigation.html.erb +1 -9
  55. data/app/views/layouts/_navigation.html.erb +14 -8
  56. data/app/views/layouts/application.html.erb +1 -3
  57. data/app/views/project_notification/test_run.html.erb +13 -3
  58. data/app/views/projects/_form.html.erb +13 -7
  59. data/app/views/triggers/index.html.erb +39 -0
  60. data/config/initializers/add_navigation_renderers.rb +0 -6
  61. data/config/initializers/houston_async.rb +4 -2
  62. data/config/initializers/houston_scheduler_daemon.rb +6 -0
  63. data/config/initializers/load_persistent_triggers.rb +7 -0
  64. data/config/initializers/requirements.rb +2 -1
  65. data/config/initializers/sync_commits_on_post_receive.rb +2 -2
  66. data/config/routes.rb +17 -15
  67. data/db/migrate/20160711170921_rename_jobs_to_actions.rb +5 -0
  68. data/db/migrate/20160713204605_add_trigger_and_params_to_actions.rb +6 -0
  69. data/db/migrate/20160715173039_create_persistent_triggers.rb +10 -0
  70. data/db/structure.sql +197 -221
  71. data/houston-core.gemspec +1 -1
  72. data/lib/houston/boot/actions.rb +105 -0
  73. data/lib/houston/boot/active_record_serializer.rb +24 -0
  74. data/lib/houston/boot/configuration.rb +118 -49
  75. data/lib/houston/boot/events.rb +46 -0
  76. data/lib/houston/boot/extensions.rb +118 -14
  77. data/lib/houston/boot/observer.rb +122 -24
  78. data/lib/houston/boot/readonly_hash_serializer.rb +15 -0
  79. data/lib/houston/boot/serializer.rb +83 -0
  80. data/lib/houston/boot/ticket_antecedent_serializer.rb +21 -0
  81. data/lib/houston/boot/timer.rb +45 -0
  82. data/lib/houston/boot/triggers.rb +75 -0
  83. data/lib/houston/boot.rb +5 -0
  84. data/lib/houston/version.rb +1 -1
  85. data/lib/params_serializer.rb +18 -0
  86. data/lib/tasks/actions.rake +12 -0
  87. data/lib/tasks/events.rake +11 -0
  88. data/templates/new-instance/config/abilities.rb +0 -8
  89. data/templates/new-instance/config/{triggers → events}/alerts/slack_when_assigned.rb +1 -1
  90. data/templates/new-instance/config/{triggers → events}/alerts/slack_when_opened.rb +1 -1
  91. data/templates/new-instance/config/{triggers → events}/daemons/health.rb +6 -6
  92. data/templates/new-instance/config/{triggers → events}/deploy/autoresolve_errs.rb +1 -1
  93. data/templates/new-instance/config/{triggers → events}/deploy/checkout_mentioned_alerts.rb +1 -1
  94. data/templates/new-instance/config/{triggers → events}/deploy/notify_deployer_when_finished.rb +2 -2
  95. data/templates/new-instance/config/{triggers → events}/github/publish_comments_on_slack.rb +9 -9
  96. data/templates/new-instance/config/{triggers → events}/tests/slack_when_analyzed.rb +1 -1
  97. data/templates/new-instance/config/{triggers → events}/tests/slack_when_completed.rb +1 -1
  98. data/templates/new-instance/config/{triggers → events}/tickets/mark_tasks_completed_on_commit.rb +1 -1
  99. data/templates/new-instance/config/main.rb +8 -35
  100. data/templates/new-instance/config/{jobs → timers}/cache_key_dependencies.rb +0 -0
  101. data/templates/new-instance/config/{jobs → timers}/email_about_open_alerts.rb +0 -0
  102. data/templates/new-instance/config/{jobs → timers}/purge_jobs.rb +0 -0
  103. data/templates/new-instance/config/{jobs → timers}/slack_reminders_about_alerts.rb +0 -0
  104. data/templates/new-instance/config/{jobs → timers}/sync_commits.rb +0 -0
  105. data/templates/new-instance/config/{jobs → timers}/sync_pull_requests.rb +0 -0
  106. data/templates/new-instance/config/{jobs → timers}/sync_tickets.rb +0 -0
  107. data/templates/new-module/lib/houston/%name%.rb +13 -0
  108. data/test/integration/ci_integration_test.rb +5 -5
  109. data/test/integration/web_hook_test.rb +1 -1
  110. data/test/test_helper.rb +14 -0
  111. data/test/unit/controllers/hooks_controller_test.rb +2 -2
  112. data/test/unit/initializers/sync_commits_on_post_receive_test.rb +1 -1
  113. data/test/unit/models/actions_test.rb +107 -0
  114. data/test/unit/models/configuration_test.rb +108 -0
  115. data/test/unit/models/observer_test.rb +87 -3
  116. data/test/unit/models/persistent_trigger_test.rb +94 -0
  117. data/test/unit/models/serializer_test.rb +80 -0
  118. data/test/unit/models/triggers_test.rb +53 -0
  119. metadata +60 -60
  120. data/app/assets/javascripts/houston/app/models/testing_note.coffee +0 -18
  121. data/app/assets/javascripts/houston/app/views/commit_view.coffee +0 -13
  122. data/app/assets/javascripts/houston/app/views/testing_note_view.coffee +0 -85
  123. data/app/assets/javascripts/houston/app/views/testing_report_view.coffee +0 -29
  124. data/app/assets/javascripts/houston/app/views/testing_ticket_view.coffee +0 -203
  125. data/app/assets/stylesheets/houston/application/jobs.scss +0 -5
  126. data/app/assets/stylesheets/houston/application/testing_report.scss +0 -279
  127. data/app/assets/templates/commit.hbs +0 -9
  128. data/app/assets/templates/testing_notes/edit.hbs +0 -20
  129. data/app/assets/templates/testing_notes/new.hbs +0 -27
  130. data/app/assets/templates/testing_notes/show.hbs +0 -11
  131. data/app/assets/templates/testing_report/description.hbs +0 -12
  132. data/app/assets/templates/testing_report/ticket.hbs +0 -21
  133. data/app/assets/templates/testing_report/verdict.hbs +0 -4
  134. data/app/controllers/jobs_controller.rb +0 -42
  135. data/app/controllers/testing_notes_controller.rb +0 -50
  136. data/app/controllers/testing_report_controller.rb +0 -38
  137. data/app/models/testing_note.rb +0 -64
  138. data/app/presenters/testing_note_presenter.rb +0 -27
  139. data/app/presenters/testing_report_ticket_presenter.rb +0 -71
  140. data/app/views/jobs/index.html.erb +0 -72
  141. data/app/views/jobs/show.html.erb +0 -41
  142. data/app/views/project_notification/testing_note.html.erb +0 -9
  143. data/app/views/testing_report/_scripts.html.erb +0 -12
  144. data/app/views/testing_report/index.html.erb +0 -31
  145. data/app/views/testing_report/show.html.erb +0 -29
  146. data/config/initializers/houston_scheduler.rb +0 -23
  147. data/db/migrate/20120424212706_create_testing_notes.rb +0 -14
  148. data/db/migrate/20120501231817_add_expires_at_to_testing_notes.rb +0 -5
  149. data/db/migrate/20120501231948_add_unfuddle_id_to_testing_notes.rb +0 -5
  150. data/db/migrate/20120715230526_change_testing_notes_comment_to_text.rb +0 -9
  151. data/db/migrate/20130211015046_add_min_passing_verdicts_to_projects.rb +0 -5
  152. data/db/migrate/20130407220039_add_project_id_to_testing_notes.rb +0 -26
  153. data/db/migrate/20140511024021_rename_testing_notes_unfuddle_id_to_remote_id.rb +0 -5
  154. data/templates/new-instance/config/triggers/tickets/email_testing_notes.rb +0 -7
  155. data/templates/new-instance/log/development.log +0 -41253
  156. data/templates/new-instance/log/test.log +0 -545
  157. data/templates/new-module/config/initializers/add_navigation_renderer.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 081a232807d05f2d41fe46f30a026da4724aae42
4
- data.tar.gz: dd2e049ba04b12782241352113fd0badaaf34ff6
3
+ metadata.gz: f6c7d2f0537e31c913013579570a403c3ed71e62
4
+ data.tar.gz: bae46e8b42c70baaeebef413cfe6b38fdc72aab1
5
5
  SHA512:
6
- metadata.gz: 340fb1900ec277a8d88cddbdf2b15878fc6614d52854976e3ed60863189d6491b560cbe3197fbccfd09fb23c105cfd98fcbbc6e90a87744682c8f8fa3bbccc45
7
- data.tar.gz: ec50b40d5a53fa0dec6b337791c627ba3c6a92ffea95e0f6eef64e1ff66c122e1817787daf6ce8d806a8b0e77bcffd9713744fb39f83a496c07fcc5e6cacc648
6
+ metadata.gz: 01c289fcc4cd1aaff9496d2273b3703d87184f9ec4d1742f518fdf0d3861215cae4ef92889ba952fa3e7a6b3fe09ed3d8c2278cd30b61aee1601900e24b055fd
7
+ data.tar.gz: b2f67d2a12797f57aa6e246889c051b6a68ac5733eb743c433e75f21f12b3beb00def052249166e4c258c9af992abed167248d31b115e389bfd29cc274438e02
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- houston-core (0.7.0.beta3)
4
+ houston-core (0.7.0.beta4)
5
5
  activerecord-import
6
6
  activerecord-pluck_in_batches
7
7
  addressable (~> 2.3.8)
@@ -36,7 +36,7 @@ PATH
36
36
  premailer (~> 1.8.6)
37
37
  progressbar
38
38
  rack-utf8_sanitizer (~> 1.3.1)
39
- rails (~> 4.2.5.1)
39
+ rails (~> 4.2.5)
40
40
  redcarpet (~> 3.3.2)
41
41
  rufus-scheduler (~> 3.2.0)
42
42
  rugged (~> 0.24.0)
@@ -51,40 +51,40 @@ PATH
51
51
  GEM
52
52
  remote: https://rubygems.org/
53
53
  specs:
54
- actionmailer (4.2.5.2)
55
- actionpack (= 4.2.5.2)
56
- actionview (= 4.2.5.2)
57
- activejob (= 4.2.5.2)
54
+ actionmailer (4.2.7)
55
+ actionpack (= 4.2.7)
56
+ actionview (= 4.2.7)
57
+ activejob (= 4.2.7)
58
58
  mail (~> 2.5, >= 2.5.4)
59
59
  rails-dom-testing (~> 1.0, >= 1.0.5)
60
- actionpack (4.2.5.2)
61
- actionview (= 4.2.5.2)
62
- activesupport (= 4.2.5.2)
60
+ actionpack (4.2.7)
61
+ actionview (= 4.2.7)
62
+ activesupport (= 4.2.7)
63
63
  rack (~> 1.6)
64
64
  rack-test (~> 0.6.2)
65
65
  rails-dom-testing (~> 1.0, >= 1.0.5)
66
66
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
67
- actionview (4.2.5.2)
68
- activesupport (= 4.2.5.2)
67
+ actionview (4.2.7)
68
+ activesupport (= 4.2.7)
69
69
  builder (~> 3.1)
70
70
  erubis (~> 2.7.0)
71
71
  rails-dom-testing (~> 1.0, >= 1.0.5)
72
72
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
73
- activejob (4.2.5.2)
74
- activesupport (= 4.2.5.2)
73
+ activejob (4.2.7)
74
+ activesupport (= 4.2.7)
75
75
  globalid (>= 0.3.0)
76
- activemodel (4.2.5.2)
77
- activesupport (= 4.2.5.2)
76
+ activemodel (4.2.7)
77
+ activesupport (= 4.2.7)
78
78
  builder (~> 3.1)
79
- activerecord (4.2.5.2)
80
- activemodel (= 4.2.5.2)
81
- activesupport (= 4.2.5.2)
79
+ activerecord (4.2.7)
80
+ activemodel (= 4.2.7)
81
+ activesupport (= 4.2.7)
82
82
  arel (~> 6.0)
83
- activerecord-import (0.13.0)
84
- activerecord (>= 3.0)
83
+ activerecord-import (0.15.0)
84
+ activerecord (>= 3.2)
85
85
  activerecord-pluck_in_batches (0.1.1)
86
86
  activerecord
87
- activesupport (4.2.5.2)
87
+ activesupport (4.2.7)
88
88
  i18n (~> 0.7)
89
89
  json (~> 1.7, >= 1.7.7)
90
90
  minitest (~> 5.1)
@@ -119,14 +119,14 @@ GEM
119
119
  coffee-script-source
120
120
  execjs
121
121
  coffee-script-source (1.10.0)
122
- concurrent-ruby (1.0.1)
122
+ concurrent-ruby (1.0.2)
123
123
  crack (0.4.3)
124
124
  safe_yaml (~> 1.0.0)
125
- css_parser (1.4.1)
125
+ css_parser (1.4.5)
126
126
  addressable
127
127
  default_value_for (3.0.1)
128
128
  activerecord (>= 3.2.0, < 5.0)
129
- devise (3.5.7)
129
+ devise (3.5.10)
130
130
  bcrypt (~> 3.0)
131
131
  orm_adapter (~> 0.1)
132
132
  railties (>= 3.2.6, < 5)
@@ -137,7 +137,7 @@ GEM
137
137
  actionmailer (>= 3.2.6, < 5)
138
138
  devise (>= 3.2.0)
139
139
  docile (1.1.5)
140
- domain_name (0.5.20160310)
140
+ domain_name (0.5.20160615)
141
141
  unf (>= 0.0.5, < 1.0.0)
142
142
  engineyard (3.2.1)
143
143
  engineyard-cloud-client (~> 2.1)
@@ -154,7 +154,7 @@ GEM
154
154
  multi_json (~> 1.6)
155
155
  erubis (2.7.0)
156
156
  escape (0.0.4)
157
- execjs (2.6.0)
157
+ execjs (2.7.0)
158
158
  factory_girl (4.7.0)
159
159
  activesupport (>= 3.0.0)
160
160
  factory_girl_rails (4.7.0)
@@ -189,7 +189,7 @@ GEM
189
189
  domain_name (~> 0.5)
190
190
  i18n (0.7.0)
191
191
  json (1.8.3)
192
- jwt (1.5.1)
192
+ jwt (1.5.4)
193
193
  launchy (2.4.3)
194
194
  addressable (~> 2.3)
195
195
  libv8 (3.16.14.13)
@@ -198,9 +198,9 @@ GEM
198
198
  mail (2.6.4)
199
199
  mime-types (>= 1.16, < 4)
200
200
  method_source (0.8.2)
201
- mime-types (2.99.1)
201
+ mime-types (2.99.2)
202
202
  mini_portile2 (2.1.0)
203
- minitest (5.8.4)
203
+ minitest (5.9.0)
204
204
  minitest-reporters (1.1.8)
205
205
  ansi
206
206
  builder
@@ -219,15 +219,15 @@ GEM
219
219
  nokogiri (1.6.8)
220
220
  mini_portile2 (~> 2.1.0)
221
221
  pkg-config (~> 1.1.7)
222
- oauth2 (1.1.0)
222
+ oauth2 (1.2.0)
223
223
  faraday (>= 0.8, < 0.10)
224
- jwt (~> 1.0, < 1.5.2)
224
+ jwt (~> 1.0)
225
225
  multi_json (~> 1.3)
226
226
  multi_xml (~> 0.5)
227
227
  rack (>= 1.2, < 3)
228
228
  octokit (4.3.0)
229
229
  sawyer (~> 0.7.0, >= 0.5.3)
230
- oj (2.15.0)
230
+ oj (2.17.1)
231
231
  openxml-package (0.2.4)
232
232
  nokogiri
233
233
  ox
@@ -236,15 +236,15 @@ GEM
236
236
  nokogiri
237
237
  openxml-package (>= 0.2.0)
238
238
  orm_adapter (0.5.0)
239
- ox (2.4.0)
239
+ ox (2.4.3)
240
240
  pg (0.18.4)
241
- pg_search (1.0.5)
241
+ pg_search (1.0.6)
242
242
  activerecord (>= 3.1)
243
243
  activesupport (>= 3.1)
244
244
  arel
245
245
  pkg-config (1.1.7)
246
- premailer (1.8.6)
247
- css_parser (>= 1.3.6)
246
+ premailer (1.8.7)
247
+ css_parser (>= 1.4.5)
248
248
  htmlentities (>= 4.0.0)
249
249
  progressbar (0.21.0)
250
250
  pry (0.10.3)
@@ -256,16 +256,16 @@ GEM
256
256
  rack (>= 1.0)
257
257
  rack-utf8_sanitizer (1.3.2)
258
258
  rack (>= 1.0, < 3.0)
259
- rails (4.2.5.2)
260
- actionmailer (= 4.2.5.2)
261
- actionpack (= 4.2.5.2)
262
- actionview (= 4.2.5.2)
263
- activejob (= 4.2.5.2)
264
- activemodel (= 4.2.5.2)
265
- activerecord (= 4.2.5.2)
266
- activesupport (= 4.2.5.2)
259
+ rails (4.2.7)
260
+ actionmailer (= 4.2.7)
261
+ actionpack (= 4.2.7)
262
+ actionview (= 4.2.7)
263
+ activejob (= 4.2.7)
264
+ activemodel (= 4.2.7)
265
+ activerecord (= 4.2.7)
266
+ activesupport (= 4.2.7)
267
267
  bundler (>= 1.3.0, < 2.0)
268
- railties (= 4.2.5.2)
268
+ railties (= 4.2.7)
269
269
  sprockets-rails
270
270
  rails-deprecated_sanitizer (1.0.3)
271
271
  activesupport (>= 4.2.0.alpha)
@@ -275,15 +275,15 @@ GEM
275
275
  rails-deprecated_sanitizer (>= 1.0.1)
276
276
  rails-html-sanitizer (1.0.3)
277
277
  loofah (~> 2.0)
278
- railties (4.2.5.2)
279
- actionpack (= 4.2.5.2)
280
- activesupport (= 4.2.5.2)
278
+ railties (4.2.7)
279
+ actionpack (= 4.2.7)
280
+ activesupport (= 4.2.7)
281
281
  rake (>= 0.8.7)
282
282
  thor (>= 0.18.1, < 2.0)
283
- rake (11.1.2)
283
+ rake (11.2.2)
284
284
  redcarpet (3.3.4)
285
285
  ref (2.0.0)
286
- responders (2.1.2)
286
+ responders (2.2.0)
287
287
  railties (>= 4.2.0, < 5.1)
288
288
  rest-client (1.8.0)
289
289
  http-cookie (>= 1.0.2, < 2.0)
@@ -292,12 +292,12 @@ GEM
292
292
  rr (1.1.2)
293
293
  ruby-progressbar (1.7.5)
294
294
  rubyzip (1.1.7)
295
- rufus-scheduler (3.2.0)
295
+ rufus-scheduler (3.2.1)
296
296
  rugged (0.24.0)
297
297
  safe_yaml (1.0.4)
298
298
  sass (3.4.22)
299
- sass-rails (5.0.4)
300
- railties (>= 4.0.0, < 5.0)
299
+ sass-rails (5.0.5)
300
+ railties (>= 4.0.0, < 6)
301
301
  sass (~> 3.1)
302
302
  sprockets (>= 2.8, < 4.0)
303
303
  sprockets-rails (>= 2.0, < 4.0)
@@ -315,10 +315,10 @@ GEM
315
315
  json
316
316
  simplecov
317
317
  slop (3.6.0)
318
- sprockets (3.6.0)
318
+ sprockets (3.6.3)
319
319
  concurrent-ruby (~> 1.0)
320
320
  rack (> 1, < 3)
321
- sprockets-rails (3.0.4)
321
+ sprockets-rails (3.1.1)
322
322
  actionpack (>= 4.0)
323
323
  activesupport (>= 4.0)
324
324
  sprockets (>= 3.0.0)
@@ -331,7 +331,7 @@ GEM
331
331
  ref
332
332
  thor (0.19.1)
333
333
  thread_safe (0.3.5)
334
- tilt (2.0.2)
334
+ tilt (2.0.5)
335
335
  timecop (0.8.1)
336
336
  tzinfo (1.2.2)
337
337
  thread_safe (~> 0.1)
@@ -7,8 +7,12 @@ class @InfiniteScroll
7
7
  @success = options.success
8
8
  @error = options.error
9
9
 
10
- @$window = $(window)
11
- @$document = $(document)
10
+ @$window = @$el.closest('.scrollable')
11
+ @$document = @$el.closest('.scrollable-document')
12
+
13
+ if @$window.length is 0 or @$document.length is 0
14
+ @$window = $(window)
15
+ @$document = $(document)
12
16
  @$window.scroll _.bind(@onScroll, @)
13
17
 
14
18
  onScroll: ->
@@ -21,17 +21,12 @@ class window.Ticket extends Backbone.Model
21
21
  return false unless seriousness && likelihood && clumsiness
22
22
  (0.6 * seriousness + 0.3 * likelihood + 0.1 * clumsiness).toFixed(1)
23
23
 
24
- testingNotes: ->
25
- @testingNotesCollection ||= new TestingNotes(@get('testingNotes'), ticket: @)
26
-
27
24
  releases: ->
28
25
  @releasesCollection ||= new Releases(@get('releases'), ticket: @)
29
26
 
30
27
  commits: ->
31
28
  @commitsCollection ||= new Commits(@get('commits'), ticket: @)
32
29
 
33
- activityStream: ->
34
- _.sortBy @testingNotes().models.concat(@commits().models), (item)-> item.get('createdAt')
35
30
 
36
31
 
37
32
  parse: (ticket)->
@@ -41,43 +36,6 @@ class window.Ticket extends Backbone.Model
41
36
  ticket
42
37
 
43
38
 
44
- testerVerdicts: ->
45
- verdictsByTester = @verdictsByTester(@testingNotesSinceLastRelease())
46
- window.testers.map (tester)->
47
- testerId: tester.id
48
- email: tester.get('email')
49
- verdict: verdictsByTester[tester.get('id')] ? 'pending'
50
-
51
- verdict: ->
52
- verdicts = _.values(@verdictsByTester(@testingNotesSinceLastRelease()))
53
- return 'Failing' if _.include verdicts, 'failing'
54
- return 'Pending' if window.testers.length == 0
55
-
56
- minPassingVerdicts = @get('minPassingVerdicts') ? window.testers.length
57
- passingVerdicts = _.filter(verdicts, (verdict)=> verdict == 'passing').length
58
- return 'Passing' if passingVerdicts >= minPassingVerdicts
59
-
60
- 'Pending'
61
-
62
- verdictsByTester: (notes)->
63
- verdictsByTester = {}
64
- notes.each (note)->
65
- testerId = note.get('userId')
66
- verdict = note.get('verdict')
67
- if verdict == 'fails'
68
- verdictsByTester[testerId] = 'failing'
69
- else if verdict == 'works'
70
- verdictsByTester[testerId] ?= 'passing'
71
- else if verdict == 'badticket'
72
- verdictsByTester[testerId] ?= 'badticket'
73
- else if verdict == 'none'
74
- verdictsByTester[testerId] ?= 'comment'
75
- verdictsByTester
76
-
77
- testingNotesSinceLastRelease: ->
78
- date = @get('lastReleaseAt')
79
- if date then @testingNotes().since(date) else @testingNotes()
80
-
81
39
 
82
40
  close: ->
83
41
  url = "/projects/#{@get 'projectSlug'}/tickets/by_number/#{@get 'number'}/close"
@@ -61,8 +61,6 @@ $ ->
61
61
  $('#omnibar').on 'keyup', (e)-> $modal.modal('hide') if e.keyCode is 27
62
62
 
63
63
  Mousetrap.bind 'g p', -> window.location = '/projects'
64
- Mousetrap.bind 'g i', -> window.location = '/itsm/issues'
65
- Mousetrap.bind 'g t r', -> window.location = '/testing_report'
66
64
  Mousetrap.bind 'g n t', -> window.location = '/tickets/new'
67
65
  Mousetrap.bind 'g u', -> window.location = '/users'
68
66
 
@@ -19,12 +19,6 @@ class @KeyboardShortcutsModal
19
19
  ,
20
20
  keys: ['g', 'q']
21
21
  name: 'Go to Pull Requests'
22
- ,
23
- keys: ['g', 'i']
24
- name: 'Go to ITSMs'
25
- ,
26
- keys: ['g', 't', 'r']
27
- name: 'Go to Testing Report'
28
22
  ,
29
23
  keys: ['g', 'n', 't']
30
24
  name: 'Go to New Ticket'
@@ -72,11 +72,6 @@ Handlebars.registerHelper 'linkToCommit', (commit)->
72
72
  else
73
73
  sha
74
74
 
75
- Handlebars.registerHelper 'testerAvatar', (email, size, title)->
76
- tester = window.testers.findByEmail(email)
77
- gravatarUrl = "https://www.gravatar.com/avatar/#{MD5(email.toLowerCase().trim())}?r=g&d=retro&s=#{size * 2}"
78
- "<img src=\"#{gravatarUrl}\" width=\"#{size}\" height=\"#{size}\" rel=\"tooltip\" title=\"#{tester.get('name')}\" />"
79
-
80
75
  Handlebars.registerHelper 'userAvatar', (size)->
81
76
  user = window.user
82
77
  gravatarUrl = "https://www.gravatar.com/avatar/#{MD5(user.get('email').toLowerCase().trim())}?r=g&d=retro&s=#{size * 2}"
@@ -0,0 +1,15 @@
1
+ .action-last,
2
+ .action-duration,
3
+ .action-reliability {
4
+ white-space: nowrap;
5
+ }
6
+
7
+ td.action-reliability {
8
+ padding-right: 16px !important;
9
+ }
10
+
11
+ .action-success-rate {
12
+ font-size: 0.75em;
13
+ line-height: 20px;
14
+ float: right;
15
+ }
@@ -0,0 +1,3 @@
1
+ .nomargin {
2
+ margin: 0 -20px;
3
+ }
@@ -1,4 +1,4 @@
1
- .markdown, .commit, .testing-note, .ticket-description {
1
+ .markdown, .commit, .ticket-description {
2
2
  // formatting for markdown, etc within comments, ticket description
3
3
  h1 { font-size: 1.5em; font-weight: 200; margin: 0.66em 0 0.33em 0; line-height: 1.18em; }
4
4
  h2 { font-size: 1.33em; margin: 0.66em 0 0.33em 0; line-height: 1.42857142857143em; }
@@ -182,8 +182,10 @@ $current-project-active-bg: #222;
182
182
  }
183
183
 
184
184
 
185
- .navbar .nav > li.current-user {
185
+ .navbar .nav.pull-right {
186
186
  z-index: 5;
187
+
188
+ .fa-cog { font-size: 20px; }
187
189
  }
188
190
 
189
191
  .navbar .nav > li.current-user > a {
@@ -22,6 +22,8 @@
22
22
  position: relative;
23
23
  top: -4px;
24
24
 
25
+ &:focus { text-decoration: none; }
26
+
25
27
  label {
26
28
  display: inline-block;
27
29
  font-weight: inherit;
@@ -20,7 +20,6 @@ th.vertical {
20
20
 
21
21
  > span {
22
22
  display: block;
23
- writing-mode: tb-rl;
24
23
  filter: flipv fliph;
25
24
  transform: rotate(-90deg);
26
25
  -ms-transform: rotate(-90deg); /* IE 9 */
@@ -137,7 +137,7 @@ $lightGray: #eee;
137
137
  font-size: 1.10em;
138
138
 
139
139
  a { font-weight: 400;
140
- b { font-weight: 800; }
140
+ b { font-weight: 700; }
141
141
  }
142
142
 
143
143
  .bubble {
@@ -1,6 +1,7 @@
1
1
  body {
2
2
  padding-bottom: 60px;
3
- font-family: "Helvetica Neue", roboto, Helvetica, Arial, sans-serif
3
+ // a la GitHub
4
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
4
5
  }
5
6
 
6
7
  li { line-height: 1.5em; }
@@ -5,15 +5,19 @@ module Houston
5
5
  VALID_PROP_NAME = /\A[a-z0-9]+(?:\.[a-z0-9_\-]+)+\Z/i.freeze
6
6
 
7
7
  def self.valid_prop_name!(prop_name)
8
- return if prop_name =~ VALID_PROP_NAME
8
+ return if valid_prop_name?(prop_name)
9
9
  raise ArgumentError, "#{prop_name.inspect} can only contain word-characters, hyphens, and must contain at least one period"
10
10
  end
11
11
 
12
+ def self.valid_prop_name?(prop_name)
13
+ prop_name =~ VALID_PROP_NAME
14
+ end
15
+
12
16
 
13
17
  module ClassMethods
14
18
  def with_prop(prop_name, value)
15
19
  Houston::Props.valid_prop_name!(prop_name)
16
- where(["props->>? = ?", prop_name, value])
20
+ where(["props->>? = ?", prop_name, value.to_s])
17
21
  end
18
22
 
19
23
  def find_by_prop(prop_name, value)
@@ -85,13 +89,16 @@ module Houston
85
89
  end
86
90
 
87
91
  def respond_to_missing?(method_name, *args)
88
- return true if key?(method_name.to_s)
92
+ prop_name = method_name.to_s.gsub(/_before_type_cast$/, "")
93
+ return true if key?(prop_name)
94
+ return true if Houston::Props.valid_prop_name?(prop_name)
89
95
  super
90
96
  end
91
97
 
92
98
  def method_missing(method_name, *args, &block)
93
- prop_name = method_name.to_s
99
+ prop_name = method_name.to_s.gsub(/_before_type_cast$/, "")
94
100
  return self[prop_name] if key?(prop_name)
101
+ return nil if Houston::Props.valid_prop_name?(prop_name)
95
102
  super
96
103
  end
97
104
  end
@@ -55,7 +55,7 @@ module ProjectAdapter
55
55
  end
56
56
 
57
57
  def define_methods!
58
- model.module_eval <<-RUBY
58
+ model.module_eval <<-RUBY, __FILE__ , __LINE__ + 1
59
59
  def self.with_#{attribute_name}
60
60
  where arel_table[:#{attribute_name}_name].not_eq("None")
61
61
  end
@@ -1,7 +1,7 @@
1
1
  module UniqueAdd
2
2
 
3
3
  def add(relation)
4
- self << relation unless exists?(relation)
4
+ self << relation unless exists?(relation.id)
5
5
  end
6
6
 
7
7
  end
@@ -0,0 +1,39 @@
1
+ class ActionsController < ApplicationController
2
+
3
+ def index
4
+ authorize! :show, :actions
5
+
6
+ actions_by_name = Houston.actions.names.each_with_object({}) { |name, map| map[name] = { name: name } }
7
+ actions = Action.where(name: actions_by_name.keys)
8
+
9
+ most_recent_actions = actions.joins(<<-SQL)
10
+ inner join (select name, max(started_at) "started_at" from actions group by name) "most_recent"
11
+ on actions.name=most_recent.name and actions.started_at=most_recent.started_at
12
+ SQL
13
+ most_recent_actions.each do |action|
14
+ actions_by_name[action.name][:last] = action
15
+ end
16
+
17
+ actions.group(:name).unscope(:order).pluck(:name, "COUNT(id)", "COUNT(CASE WHEN succeeded THEN 1 ELSE NULL END)", "AVG(EXTRACT(epoch from finished_at - started_at))").each do |name, runs, successful_runs, avg_duration|
18
+ actions_by_name[name].merge!(
19
+ runs: runs,
20
+ successful_runs: successful_runs,
21
+ avg_duration: avg_duration )
22
+ end
23
+
24
+ @actions = actions_by_name.values
25
+ end
26
+
27
+ def show
28
+ authorize! :show, :actions
29
+ @action_name = params[:slug]
30
+ @actions = Action.where(name: @action_name).preload(:error)
31
+ end
32
+
33
+ def run
34
+ authorize! :run, :actions
35
+ Houston.actions.run params[:slug]
36
+ redirect_to "/actions", notice: "#{params[:slug]} is running"
37
+ end
38
+
39
+ end
@@ -1,5 +1,5 @@
1
1
  class CommitsController < ApplicationController
2
- before_filter :api_authenticate!
2
+ before_filter :api_authenticate!, only: [:index, :self]
3
3
 
4
4
  def index
5
5
  commits = Commit.includes(:releases).includes(:committers).includes(:project)
@@ -0,0 +1,10 @@
1
+ class ErrorsController < ApplicationController
2
+
3
+ def index
4
+ authorize! :show, Error
5
+ @actions = Action.reorder(finished_at: :desc).where.not(error_id: nil).includes(:error).limit(50)
6
+ @actions = @actions.where(Action.arel_table[:finished_at].lt(params[:before])) if params[:before]
7
+ render partial: "errors/actions" if request.xhr?
8
+ end
9
+
10
+ end
@@ -42,7 +42,7 @@ class HooksController < ApplicationController
42
42
  }
43
43
  })
44
44
 
45
- Houston.observer.fire event, payload
45
+ Houston.observer.fire event, params: payload
46
46
  head 200
47
47
  end
48
48
 
@@ -41,21 +41,11 @@ class OmnibarController < ApplicationController
41
41
  projectColor: project.color,
42
42
  title: "Scheduler",
43
43
  url: "/scheduler/by_project/#{project.slug}" },
44
- { type: "project",
45
- projectTitle: project.name,
46
- projectColor: project.color,
47
- title: "Testing Report",
48
- url: "/testing_report/#{project.slug}" },
49
44
  { type: "project",
50
45
  projectTitle: project.name,
51
46
  projectColor: project.color,
52
47
  title: "Releases",
53
- url: "/projects/#{project.slug}/releases" },
54
- { type: "project",
55
- projectTitle: project.name,
56
- projectColor: project.color,
57
- title: "Pretickets",
58
- url: "/pretickets/by_project/#{project.slug}" }]
48
+ url: "/projects/#{project.slug}/releases" }]
59
49
  end if filter.member? :project
60
50
 
61
51
  render json: results
@@ -9,7 +9,7 @@ class ProjectHooksController < ApplicationController
9
9
  return
10
10
  end
11
11
 
12
- event = "hooks:#{params[:hook]}"
12
+ event = "hooks:project:#{params[:hook]}"
13
13
  unless Houston.observer.observed?(event)
14
14
  render text: "A hook with the slug '#{params[:hook]}' is not defined", status: 404
15
15
  return
@@ -22,7 +22,7 @@ class ProjectHooksController < ApplicationController
22
22
  }
23
23
  })
24
24
 
25
- Houston.observer.fire event, project, payload
25
+ Houston.observer.fire event, project: project, params: payload
26
26
  head 200
27
27
  end
28
28
 
@@ -96,6 +96,8 @@ class ProjectsController < ApplicationController
96
96
  def update
97
97
  @project = Project.find_by_slug!(params[:id])
98
98
 
99
+ @project.props.merge! project_attributes.delete(:props) if project_attributes.key?(:props)
100
+
99
101
  if @project.update_attributes(project_attributes)
100
102
  redirect_to projects_path, notice: 'Project was successfully updated.'
101
103
  else