houston-core 0.5.0.beta1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (368) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +0 -2
  3. data/.gitignore +3 -0
  4. data/Gemfile +1 -0
  5. data/Gemfile.lock +63 -62
  6. data/README.md +13 -121
  7. data/app/adapters/houston/adapters/ci_server/errors.rb +4 -4
  8. data/app/adapters/houston/adapters/ci_server/jenkins_adapter/job.rb +50 -50
  9. data/app/adapters/houston/adapters/ci_server/jenkins_adapter.rb +4 -4
  10. data/app/adapters/houston/adapters/ci_server/none_adapter/job.rb +5 -5
  11. data/app/adapters/houston/adapters/ci_server/none_adapter.rb +4 -4
  12. data/app/adapters/houston/adapters/deployment/engineyard.rb +20 -20
  13. data/app/adapters/houston/adapters/error_tracker/errbit_adapter/app.rb +14 -14
  14. data/app/adapters/houston/adapters/error_tracker/errbit_adapter/connection.rb +41 -41
  15. data/app/adapters/houston/adapters/error_tracker/errbit_adapter/notice.rb +6 -6
  16. data/app/adapters/houston/adapters/error_tracker/errbit_adapter/problem.rb +25 -25
  17. data/app/adapters/houston/adapters/error_tracker/errbit_adapter.rb +20 -20
  18. data/app/adapters/houston/adapters/error_tracker/none_adapter.rb +8 -8
  19. data/app/adapters/houston/adapters/error_tracker/null_app.rb +13 -13
  20. data/app/adapters/houston/adapters/ticket_tracker/errors.rb +5 -5
  21. data/app/adapters/houston/adapters/ticket_tracker/github_adapter/connection.rb +41 -41
  22. data/app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb +22 -22
  23. data/app/adapters/houston/adapters/ticket_tracker/github_adapter.rb +7 -7
  24. data/app/adapters/houston/adapters/ticket_tracker/houston_adapter/connection.rb +13 -13
  25. data/app/adapters/houston/adapters/ticket_tracker/houston_adapter/ticket.rb +15 -15
  26. data/app/adapters/houston/adapters/ticket_tracker/houston_adapter.rb +4 -4
  27. data/app/adapters/houston/adapters/ticket_tracker/none_adapter.rb +4 -4
  28. data/app/adapters/houston/adapters/ticket_tracker/null_connection.rb +13 -13
  29. data/app/adapters/houston/adapters/ticket_tracker/null_ticket.rb +19 -19
  30. data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/connection.rb +54 -54
  31. data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb +10 -10
  32. data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/ticket.rb +59 -59
  33. data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter.rb +9 -9
  34. data/app/adapters/houston/adapters/version_control/commit.rb +4 -4
  35. data/app/adapters/houston/adapters/version_control/errors.rb +9 -9
  36. data/app/adapters/houston/adapters/version_control/git_adapter/github_repo.rb +15 -15
  37. data/app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb +53 -30
  38. data/app/adapters/houston/adapters/version_control/git_adapter/repo.rb +60 -55
  39. data/app/adapters/houston/adapters/version_control/git_adapter.rb +22 -22
  40. data/app/adapters/houston/adapters/version_control/none_adapter.rb +4 -4
  41. data/app/adapters/houston/adapters/version_control/null_commit.rb +4 -4
  42. data/app/adapters/houston/adapters/version_control/null_repo.rb +18 -18
  43. data/app/adapters/houston/adapters.rb +10 -10
  44. data/app/assets/javascripts/app/boot.coffee +5 -5
  45. data/app/assets/javascripts/app/infinite_scroll.coffee +6 -6
  46. data/app/assets/javascripts/app/models/commit.coffee +1 -1
  47. data/app/assets/javascripts/app/models/release.coffee +1 -1
  48. data/app/assets/javascripts/app/models/task.coffee +1 -1
  49. data/app/assets/javascripts/app/models/tester.coffee +1 -1
  50. data/app/assets/javascripts/app/models/testing_note.coffee +2 -2
  51. data/app/assets/javascripts/app/models/ticket.coffee +24 -24
  52. data/app/assets/javascripts/app/models/user.coffee +1 -1
  53. data/app/assets/javascripts/app/releases.coffee +6 -6
  54. data/app/assets/javascripts/app/stacked_area_graph.coffee +22 -22
  55. data/app/assets/javascripts/app/stacked_bar_graph.coffee +20 -20
  56. data/app/assets/javascripts/app/table_row_expander.coffee +10 -10
  57. data/app/assets/javascripts/app/ticket_tracker_refresh.coffee +19 -19
  58. data/app/assets/javascripts/app/views/_show_sprint_view.coffee +14 -14
  59. data/app/assets/javascripts/app/views/_tickets_view.coffee +8 -8
  60. data/app/assets/javascripts/app/views/all_tickets_view.coffee +1 -2
  61. data/app/assets/javascripts/app/views/commit_view.coffee +2 -2
  62. data/app/assets/javascripts/app/views/edit_sprint_view.coffee +36 -36
  63. data/app/assets/javascripts/app/views/find_or_create_ticket_view.coffee +3 -3
  64. data/app/assets/javascripts/app/views/keyboard_shortcuts_modal.coffee +14 -14
  65. data/app/assets/javascripts/app/views/new_ticket_modal.coffee +4 -4
  66. data/app/assets/javascripts/app/views/new_ticket_view.coffee +34 -34
  67. data/app/assets/javascripts/app/views/problems_view.coffee +8 -8
  68. data/app/assets/javascripts/app/views/reports_view.coffee +5 -5
  69. data/app/assets/javascripts/app/views/testing_note_view.coffee +10 -10
  70. data/app/assets/javascripts/app/views/testing_report_view.coffee +7 -7
  71. data/app/assets/javascripts/app/views/testing_ticket_view.coffee +36 -36
  72. data/app/assets/javascripts/app/views/ticket_modal_view.coffee +5 -5
  73. data/app/assets/javascripts/core/app.coffee +22 -22
  74. data/app/assets/javascripts/core/burndown_chart.coffee +21 -21
  75. data/app/assets/javascripts/core/errors.coffee +2 -2
  76. data/app/assets/javascripts/core/handlebars_helpers.coffee +6 -6
  77. data/app/assets/javascripts/core/jquery_extensions.coffee +28 -28
  78. data/app/assets/javascripts/dashboard/refresher.coffee +4 -4
  79. data/app/assets/stylesheets/application/ansi.scss +2 -2
  80. data/app/assets/stylesheets/application/commit.scss +1 -1
  81. data/app/assets/stylesheets/application/exceptions.scss +3 -3
  82. data/app/assets/stylesheets/application/find_or_create_ticket.scss +2 -2
  83. data/app/assets/stylesheets/application/follow_up.scss +2 -2
  84. data/app/assets/stylesheets/application/forms.scss +2 -2
  85. data/app/assets/stylesheets/application/freight_train.css.scss +5 -5
  86. data/app/assets/stylesheets/application/full_screen.scss +2 -2
  87. data/app/assets/stylesheets/application/infinite_scroll.scss +1 -1
  88. data/app/assets/stylesheets/application/keyboard_shortcuts.scss +3 -3
  89. data/app/assets/stylesheets/application/markdown.scss +2 -2
  90. data/app/assets/stylesheets/application/navigation.scss +15 -15
  91. data/app/assets/stylesheets/application/new_ticket_view.scss +16 -16
  92. data/app/assets/stylesheets/application/omnibar.scss +6 -6
  93. data/app/assets/stylesheets/application/project_banner_buttons.scss +6 -6
  94. data/app/assets/stylesheets/application/project_tiles.scss +2 -2
  95. data/app/assets/stylesheets/application/projects.css.scss +3 -3
  96. data/app/assets/stylesheets/application/pull_requests.scss +6 -6
  97. data/app/assets/stylesheets/application/queue.scss +2 -2
  98. data/app/assets/stylesheets/application/release_form.scss +10 -10
  99. data/app/assets/stylesheets/application/releases.scss +32 -39
  100. data/app/assets/stylesheets/application/sortable_table.scss +6 -6
  101. data/app/assets/stylesheets/application/sprint.scss +6 -6
  102. data/app/assets/stylesheets/application/tables.scss +6 -6
  103. data/app/assets/stylesheets/application/test_run.scss +16 -16
  104. data/app/assets/stylesheets/application/ticket.scss +13 -13
  105. data/app/assets/stylesheets/application/ticket_modal.scss +19 -19
  106. data/app/assets/stylesheets/application/tickets.scss +2 -2
  107. data/app/assets/stylesheets/application/timeline.scss +30 -30
  108. data/app/assets/stylesheets/application/tips.scss +1 -1
  109. data/app/assets/stylesheets/application/typeahead.scss +4 -4
  110. data/app/assets/stylesheets/application/uploading.scss +13 -13
  111. data/app/assets/stylesheets/application/welcome.scss +3 -3
  112. data/app/assets/stylesheets/core/burndown_chart.scss +11 -11
  113. data/app/assets/stylesheets/core/misc.scss +8 -8
  114. data/app/assets/stylesheets/core/overrides.scss +2 -2
  115. data/app/assets/stylesheets/core/scores.scss +26 -26
  116. data/app/assets/stylesheets/dashboard/dashboard.scss +16 -16
  117. data/app/assets/stylesheets/print.css.scss +3 -3
  118. data/app/concerns/commit_synchronizer.rb +24 -24
  119. data/app/concerns/feature_state.rb +7 -7
  120. data/app/concerns/feature_support.rb +4 -4
  121. data/app/concerns/historical_weekly_stats.rb +4 -4
  122. data/app/concerns/milestone_synchronizer.rb +14 -14
  123. data/app/concerns/nosync.rb +4 -4
  124. data/app/concerns/project_adapter.rb +22 -22
  125. data/app/concerns/retirement.rb +7 -7
  126. data/app/concerns/ticket_synchronizer.rb +31 -31
  127. data/app/concerns/unique_add.rb +2 -2
  128. data/app/controllers/api/v1/sprint_tasks_controller.rb +19 -19
  129. data/app/controllers/api/v1/ticket_tasks_controller.rb +14 -14
  130. data/app/controllers/application_controller.rb +46 -40
  131. data/app/controllers/commits_controller.rb +10 -10
  132. data/app/controllers/deploys_controller.rb +11 -11
  133. data/app/controllers/home_controller.rb +4 -4
  134. data/app/controllers/jobs_controller.rb +3 -3
  135. data/app/controllers/oauth_consumers_controller.rb +1 -1
  136. data/app/controllers/omnibar_controller.rb +6 -6
  137. data/app/controllers/project_exceptions_controller.rb +11 -11
  138. data/app/controllers/project_hooks_controller.rb +7 -7
  139. data/app/controllers/project_options_controller.rb +8 -8
  140. data/app/controllers/project_pretickets_controller.rb +6 -6
  141. data/app/controllers/project_roles_controller.rb +7 -7
  142. data/app/controllers/project_tickets_controller.rb +28 -28
  143. data/app/controllers/project_tickets_sync_controller.rb +8 -8
  144. data/app/controllers/projects_controller.rb +29 -29
  145. data/app/controllers/releases_controller.rb +25 -25
  146. data/app/controllers/reports_controller.rb +36 -36
  147. data/app/controllers/sessions_controller.rb +2 -2
  148. data/app/controllers/settings_controller.rb +3 -3
  149. data/app/controllers/sprint_task_locks_controller.rb +11 -11
  150. data/app/controllers/sprints_controller.rb +25 -25
  151. data/app/controllers/tasks_controller.rb +10 -10
  152. data/app/controllers/test_runs_controller.rb +8 -8
  153. data/app/controllers/tester_bar_controller.rb +2 -2
  154. data/app/controllers/testing_notes_controller.rb +15 -15
  155. data/app/controllers/testing_report_controller.rb +14 -14
  156. data/app/controllers/tickets_controller.rb +9 -9
  157. data/app/controllers/uploads_controller.rb +9 -9
  158. data/app/controllers/user_credentials_controller.rb +4 -4
  159. data/app/controllers/user_options_controller.rb +6 -6
  160. data/app/controllers/users_controller.rb +34 -34
  161. data/app/controllers/welcome_controller.rb +6 -6
  162. data/app/helpers/ansi_helper.rb +4 -4
  163. data/app/helpers/application_helper.rb +26 -26
  164. data/app/helpers/avatar_helper.rb +12 -12
  165. data/app/helpers/backtrace_helper.rb +2 -2
  166. data/app/helpers/breadcrumbs_helper.rb +9 -9
  167. data/app/helpers/commit_helper.rb +16 -12
  168. data/app/helpers/demo_helper.rb +4 -4
  169. data/app/helpers/email_helper.rb +3 -3
  170. data/app/helpers/emoji_helper.rb +1 -1
  171. data/app/helpers/excel_helpers.rb +2 -2
  172. data/app/helpers/exposure_helper.rb +3 -3
  173. data/app/helpers/flash_message_helper.rb +6 -6
  174. data/app/helpers/maintenance_light_helper.rb +3 -3
  175. data/app/helpers/markdown_helper.rb +3 -3
  176. data/app/helpers/navigation_helper.rb +12 -12
  177. data/app/helpers/project_helper.rb +5 -5
  178. data/app/helpers/release_helper.rb +9 -9
  179. data/app/helpers/score_card_helper.rb +16 -16
  180. data/app/helpers/sprint_helper.rb +2 -2
  181. data/app/helpers/static_chart_helper.rb +2 -2
  182. data/app/helpers/test_run_helper.rb +6 -6
  183. data/app/helpers/ticket_helper.rb +14 -14
  184. data/app/helpers/timeline_helper.rb +5 -5
  185. data/app/helpers/url_helper.rb +26 -26
  186. data/app/helpers/user_helper.rb +6 -6
  187. data/app/helpers/version_helper.rb +4 -4
  188. data/app/interactors/test_run_comparer.rb +9 -9
  189. data/app/interactors/ticket_report.rb +7 -7
  190. data/app/jobs/sync_all_tickets_job.rb +13 -13
  191. data/app/jobs/sync_commits_job.rb +3 -3
  192. data/app/jobs/sync_project_tickets_job.rb +9 -9
  193. data/app/mailers/deploy_notification.rb +9 -9
  194. data/app/mailers/project_notification.rb +29 -29
  195. data/app/mailers/view_mailer.rb +20 -38
  196. data/app/models/ability.rb +21 -21
  197. data/app/models/activity_feed.rb +25 -25
  198. data/app/models/antecedent.rb +3 -3
  199. data/app/models/code_climate/coverage_report.rb +25 -25
  200. data/app/models/commit.rb +77 -82
  201. data/app/models/consumer_token.rb +2 -2
  202. data/app/models/deploy.rb +31 -27
  203. data/app/models/environment.rb +12 -12
  204. data/app/models/github/commit_status_report.rb +16 -16
  205. data/app/models/github/pull_request.rb +35 -12
  206. data/app/models/github/pull_request_event.rb +6 -5
  207. data/app/models/github_token.rb +2 -2
  208. data/app/models/historical_head.rb +2 -2
  209. data/app/models/key_dependency.rb +17 -17
  210. data/app/models/maintenance_light.rb +3 -3
  211. data/app/models/measurement.rb +22 -22
  212. data/app/models/menu_item.rb +5 -5
  213. data/app/models/menu_item_divider.rb +1 -1
  214. data/app/models/milestone.rb +27 -27
  215. data/app/models/output_stream.rb +4 -4
  216. data/app/models/post_receive_payload.rb +7 -7
  217. data/app/models/project.rb +93 -89
  218. data/app/models/project_dependencies.rb +9 -9
  219. data/app/models/project_dependency.rb +33 -33
  220. data/app/models/project_menu_item.rb +3 -3
  221. data/app/models/release.rb +60 -60
  222. data/app/models/release_change.rb +18 -18
  223. data/app/models/role.rb +15 -15
  224. data/app/models/rubygems/gem.rb +21 -21
  225. data/app/models/run_tests_on_post_receive.rb +36 -36
  226. data/app/models/setting.rb +3 -3
  227. data/app/models/settings.rb +8 -8
  228. data/app/models/source_file_coverage.rb +2 -2
  229. data/app/models/sprint.rb +19 -19
  230. data/app/models/sprint_report.rb +7 -7
  231. data/app/models/sprint_task.rb +8 -8
  232. data/app/models/static_chart/area.rb +19 -19
  233. data/app/models/static_chart.rb +35 -35
  234. data/app/models/task.rb +64 -64
  235. data/app/models/test_error.rb +2 -2
  236. data/app/models/test_result.rb +7 -0
  237. data/app/models/test_run.rb +75 -79
  238. data/app/models/test_run_statistics.rb +18 -19
  239. data/app/models/testing_note.rb +19 -19
  240. data/app/models/ticket.rb +104 -104
  241. data/app/models/ticket_antecedent.rb +11 -11
  242. data/app/models/ticket_comment.rb +6 -6
  243. data/app/models/ticket_committer.rb +3 -3
  244. data/app/models/ticket_tag.rb +6 -6
  245. data/app/models/user.rb +44 -44
  246. data/app/models/user_credentials.rb +11 -11
  247. data/app/models/value_statement.rb +3 -3
  248. data/app/presenters/commit_presenter.rb +6 -6
  249. data/app/presenters/one_or_many.rb +4 -4
  250. data/app/presenters/problem_presenter.rb +8 -8
  251. data/app/presenters/release_presenter.rb +4 -4
  252. data/app/presenters/sprint_task_presenter.rb +9 -9
  253. data/app/presenters/task_presenter.rb +8 -8
  254. data/app/presenters/tasks_excel_presenter.rb +6 -6
  255. data/app/presenters/tester_presenter.rb +3 -3
  256. data/app/presenters/testing_note_presenter.rb +4 -4
  257. data/app/presenters/testing_report_ticket_presenter.rb +9 -9
  258. data/app/presenters/ticket_presenter.rb +4 -4
  259. data/app/views/deploys/show.html.erb +8 -0
  260. data/app/views/jobs/show.html.erb +0 -34
  261. data/app/views/layouts/application.html.erb +1 -0
  262. data/app/views/layouts/minimal.html.erb +1 -0
  263. data/app/views/projects/_form.html.erb +0 -7
  264. data/app/views/releases/_form.html.erb +9 -3
  265. data/app/views/releases/index.html.erb +1 -1
  266. data/config/application.rb +1 -2
  267. data/config/database.yml +3 -3
  268. data/config/environments/production.rb +1 -1
  269. data/config/environments/test.rb +1 -1
  270. data/config/initializers/action_view_field_error_proc.rb +3 -3
  271. data/config/initializers/constants.rb +3 -3
  272. data/config/initializers/devise.rb +8 -8
  273. data/config/initializers/hard_coded_knowledge.rb +3 -3
  274. data/config/initializers/houston_async.rb +2 -2
  275. data/config/initializers/houston_report_exception.rb +3 -3
  276. data/config/initializers/houston_try.rb +3 -3
  277. data/config/initializers/sync_commits_on_post_receive.rb +0 -5
  278. data/config/routes.rb +108 -108
  279. data/db/migrate/20120417175450_devise_create_users.rb +2 -2
  280. data/db/migrate/20120501230243_add_unfuddle_id_to_tickets.rb +1 -1
  281. data/db/migrate/20120504143615_link_tickets_and_releases.rb +3 -3
  282. data/db/migrate/20120626150333_add_last_release_at_to_tickets.rb +2 -2
  283. data/db/migrate/20120626151320_link_tickets_and_commits.rb +2 -2
  284. data/db/migrate/20120626152020_add_committer_email_to_commits.rb +2 -2
  285. data/db/migrate/20120715230922_create_user_notifications.rb +3 -3
  286. data/db/migrate/20120716010743_add_user_to_releases.rb +3 -3
  287. data/db/migrate/20120726231754_link_projects_and_maintainers.rb +2 -2
  288. data/db/migrate/20120826022643_add_authentication_token_to_users.rb +2 -2
  289. data/db/migrate/20120920023251_add_administrator_to_users.rb +3 -3
  290. data/db/migrate/20121026014457_split_users_name_into_first_and_last.rb +2 -2
  291. data/db/migrate/20121027160548_create_deploys.rb +1 -1
  292. data/db/migrate/20121222170917_add_version_control_adapter_to_projects.rb +2 -2
  293. data/db/migrate/20121222223635_add_ticket_tracking_adapter_to_projects.rb +2 -2
  294. data/db/migrate/20121224212623_rename_environments.rb +3 -3
  295. data/db/migrate/20121225175106_replace_environment_id_with_environment_name.rb +8 -8
  296. data/db/migrate/20121230174234_create_test_runs.rb +3 -3
  297. data/db/migrate/20130119203853_remove_cached_queries_from_projects.rb +1 -1
  298. data/db/migrate/20130119204608_add_extended_attributes_to_tickets.rb +10 -10
  299. data/db/migrate/20130120182026_create_ticket_prerequisites.rb +2 -2
  300. data/db/migrate/20130312224911_create_errors.rb +1 -1
  301. data/db/migrate/20130407195450_create_roles.rb +2 -2
  302. data/db/migrate/20130407200624_populate_roles.rb +9 -9
  303. data/db/migrate/20130407220039_add_project_id_to_testing_notes.rb +6 -6
  304. data/db/migrate/20130407220937_add_project_id_to_commits.rb +6 -6
  305. data/db/migrate/20130416020627_add_environments_subscribed_to_to_users.rb +3 -3
  306. data/db/migrate/20130420174126_add_error_tracker_name_to_projects.rb +2 -2
  307. data/db/migrate/20130427223925_create_project_quotas.rb +2 -2
  308. data/db/migrate/20130504014802_add_extended_attributes_to_projects.rb +3 -3
  309. data/db/migrate/20130504135741_add_antecedents_to_tickets.rb +6 -6
  310. data/db/migrate/20130505144446_add_tags_to_tickets.rb +1 -1
  311. data/db/migrate/20130505162039_add_type_to_tickets.rb +1 -1
  312. data/db/migrate/20130505212838_add_closed_at_to_tickets.rb +1 -1
  313. data/db/migrate/20130519163615_create_user_credentials.rb +2 -2
  314. data/db/migrate/20130526024851_give_default_values_for_counts_from_test_runs.rb +2 -2
  315. data/db/migrate/20130710233849_add_authored_at_to_commits.rb +10 -10
  316. data/db/migrate/20130711013156_link_commits_and_users.rb +6 -6
  317. data/db/migrate/20130806143651_link_commits_and_releases.rb +2 -2
  318. data/db/migrate/20130921141449_create_milestones.rb +3 -3
  319. data/db/migrate/20131004185618_add_first_release_at_to_tickets.rb +2 -2
  320. data/db/migrate/20131012152403_create_sprints.rb +3 -3
  321. data/db/migrate/20131112010815_delete_duplicate_commits.rb +7 -7
  322. data/db/migrate/20140217160450_add_email_addresses_to_users.rb +3 -3
  323. data/db/migrate/20140327020121_drop_ticket_prerequisites.rb +1 -1
  324. data/db/migrate/20140406183224_remove_new_relic_id_from_projects.rb +1 -1
  325. data/db/migrate/20140406230121_delete_automatically_generated_messages_for_releases.rb +1 -1
  326. data/db/migrate/20140407010111_drop_sprints_project_id.rb +1 -1
  327. data/db/migrate/20140418133005_change_ticket_antecedents_to_text_array.rb +1 -1
  328. data/db/migrate/20140425141946_embed_changes_in_releases.rb +3 -3
  329. data/db/migrate/20140515174322_create_tasks.rb +3 -3
  330. data/db/migrate/20140516012049_create_tasks_for_existing_tickets.rb +1 -1
  331. data/db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb +2 -2
  332. data/db/migrate/20140521014652_allow_task_descriptions_to_be_null.rb +1 -1
  333. data/db/migrate/20140526155845_add_commit_id_to_deploys.rb +5 -5
  334. data/db/migrate/20140526162645_add_commit_before_id_and_commit_after_id_to_releases.rb +4 -4
  335. data/db/migrate/20140526180608_associate_remaining_deploys_and_releases.rb +12 -12
  336. data/db/migrate/20140724231918_create_sprints_tasks.rb +3 -3
  337. data/db/migrate/20140824194031_add_project_id_to_tasks.rb +1 -1
  338. data/db/migrate/20140824194526_add_completed_at_to_tasks.rb +3 -3
  339. data/db/migrate/20140824211249_require_sprints_to_be_unique.rb +1 -1
  340. data/db/migrate/20140907012329_drop_table_changes.rb +1 -1
  341. data/db/migrate/20140907013836_drop_table_errors.rb +1 -1
  342. data/db/migrate/20140921190022_add_checked_out_to_sprints_tasks.rb +2 -2
  343. data/db/migrate/20140921201441_drop_users_name.rb +1 -1
  344. data/db/migrate/20140925021043_rename_deploys_commit_to_sha.rb +1 -1
  345. data/db/migrate/20140929004347_create_historical_heads.rb +4 -4
  346. data/db/migrate/20141027194819_make_users_environments_subscribed_to_an_array.rb +2 -2
  347. data/db/migrate/20141226171730_create_measurements.rb +1 -1
  348. data/db/migrate/20150119154013_drop_unused_fields_from_milestones.rb +1 -1
  349. data/db/migrate/20150222205616_add_features_to_projects.rb +2 -2
  350. data/db/migrate/20150323004452_add_deploys_completed_at.rb +1 -1
  351. data/db/migrate/20150805180939_add_commit_id_to_test_runs.rb +1 -1
  352. data/db/migrate/20150808161805_create_test_results.rb +1 -1
  353. data/db/migrate/20150809132417_rename_test_results_regression_to_difference.rb +1 -1
  354. data/db/migrate/20150927014445_required_pull_requests_to_be_unique_by_project_and_number.rb +13 -0
  355. data/db/structure.sql +9 -0
  356. data/houston.gemspec +23 -26
  357. data/lib/configuration.rb +0 -5
  358. data/lib/core_ext/duration.rb +4 -4
  359. data/lib/core_ext/hash.rb +17 -17
  360. data/lib/houston/version.rb +1 -1
  361. data/lib/houston_server.rb +6 -6
  362. data/lib/parallel_enumerable.rb +16 -16
  363. data/lib/tasks/specific_tests.rake +37 -0
  364. metadata +91 -107
  365. data/app/interactors/push_gemfile_to_gemnasium.rb +0 -88
  366. data/app/models/gemnasium/alert.rb +0 -25
  367. data/app/views/welcome/_tdl.html.erb +0 -31
  368. data/config/initializers/houston_tdl.rb +0 -104
@@ -1,11 +1,11 @@
1
1
  class Release < ActiveRecord::Base
2
-
2
+
3
3
  after_create :load_commits!, :if => :can_read_commits?
4
4
  after_create :release_each_ticket!
5
5
  after_create :release_each_task!
6
6
  after_create :release_each_antecedent!
7
7
  after_create { Houston.observer.fire "release:create", self }
8
-
8
+
9
9
  belongs_to :project
10
10
  belongs_to :user
11
11
  belongs_to :deploy
@@ -14,59 +14,59 @@ class Release < ActiveRecord::Base
14
14
  has_and_belongs_to_many :commits, autosave: false # <-- a bug with autosave causes commit_ids to be saved twice
15
15
  has_and_belongs_to_many :tickets, autosave: false # <-- a bug with autosave causes ticket_ids to be saved twice
16
16
  has_many :tasks, through: :commits
17
-
17
+
18
18
  default_scope { order("created_at DESC") }
19
-
19
+
20
20
  delegate :maintainers, :to => :project
21
-
21
+
22
22
  validates_presence_of :user_id
23
23
  validates_uniqueness_of :deploy_id, :allow_nil => true
24
24
  validates_associated :release_changes
25
-
26
-
27
-
25
+
26
+
27
+
28
28
  class << self
29
29
  def to_environment(environment_name)
30
30
  where(environment_name: environment_name)
31
31
  end
32
32
  alias :to :to_environment
33
-
33
+
34
34
  def for_projects(*projects)
35
35
  ids = projects.flatten.map { |project| project.is_a?(Project) ? project.id : project }
36
36
  where(project_id: ids)
37
37
  end
38
-
38
+
39
39
  def for_deploy(deploy)
40
40
  where(deploy_id: deploy.id)
41
41
  end
42
-
42
+
43
43
  def most_recent_commit
44
44
  release = where(arel_table[:commit1].not_eq("")).first
45
45
  release ? release.commit1 : Houston::NULL_GIT_COMMIT
46
46
  end
47
-
47
+
48
48
  def before(time)
49
49
  return all if time.nil?
50
50
  where(arel_table[:created_at].lt(time))
51
51
  end
52
-
52
+
53
53
  def after(time)
54
54
  return all if time.nil?
55
55
  where(arel_table[:created_at].gt(time))
56
56
  end
57
-
57
+
58
58
  def latest
59
59
  first
60
60
  end
61
-
61
+
62
62
  def earliest
63
63
  last
64
64
  end
65
-
65
+
66
66
  def with_message
67
67
  where arel_table[:message].not_eq("")
68
68
  end
69
-
69
+
70
70
  def most_recent
71
71
  joins <<-SQL
72
72
  INNER JOIN (
@@ -80,111 +80,111 @@ class Release < ActiveRecord::Base
80
80
  SQL
81
81
  end
82
82
  end
83
-
84
-
85
-
83
+
84
+
85
+
86
86
  def commit0
87
87
  super || commit_before.try(:sha)
88
88
  end
89
-
89
+
90
90
  def commit0=(sha)
91
91
  super; self.commit_before = identify_commit(sha)
92
92
  end
93
-
93
+
94
94
  def commit1
95
95
  super || commit_after.try(:sha)
96
96
  end
97
-
97
+
98
98
  def commit1=(sha)
99
99
  super; self.commit_after = identify_commit(sha)
100
100
  end
101
-
101
+
102
102
  def can_read_commits?
103
103
  (commit_before.present? || commit0 == Houston::NULL_GIT_COMMIT) && commit_after.present?
104
104
  end
105
-
105
+
106
106
  def environment_name=(value)
107
107
  super value.downcase
108
108
  end
109
-
110
-
111
-
109
+
110
+
111
+
112
112
  attr_reader :commit_not_found_error_message
113
-
114
-
115
-
113
+
114
+
115
+
116
116
  def released_at
117
117
  deploy ? deploy.completed_at : created_at
118
118
  end
119
-
119
+
120
120
  def release_date
121
121
  released_at.to_date
122
122
  end
123
123
  alias :date :release_date
124
-
125
-
126
-
124
+
125
+
126
+
127
127
  def name
128
128
  release_date.strftime("%A, %b %e, %Y")
129
129
  end
130
-
130
+
131
131
  def message=(value)
132
132
  super value.to_s.strip
133
133
  end
134
-
134
+
135
135
  def release_changes
136
136
  super.lines.map { |s| ReleaseChange.from_s(self, s) }
137
137
  end
138
-
138
+
139
139
  def release_changes=(changes)
140
140
  super changes.map(&:to_s).join("\n")
141
141
  end
142
-
142
+
143
143
  def release_changes_attributes=(params)
144
144
  self.release_changes = params.values
145
145
  .reject { |attrs| attrs["_destroy"] == "1" }
146
146
  .map { |attrs| ReleaseChange.new(self, attrs["tag_slug"], attrs["description"]) }
147
147
  end
148
-
149
-
150
-
148
+
149
+
150
+
151
151
  def build_changes_from_commits
152
152
  self.release_changes = commits
153
153
  .map { |commit| ReleaseChange.from_commit(self, commit) }
154
154
  .reject { |change| change.tag.nil? }
155
155
  end
156
-
156
+
157
157
  def load_commits!
158
158
  self.commits = project.commits.between(commit_before, commit_after)
159
159
  end
160
-
160
+
161
161
  def load_tickets!
162
162
  self.tickets = project.tickets.mentioned_by_commits(commits)
163
163
  end
164
-
165
-
166
-
164
+
165
+
166
+
167
167
  def antecedents
168
168
  @antecedents ||= (tickets.map(&:antecedents) + commits.map(&:antecedents))
169
169
  .flatten
170
170
  .uniq
171
171
  .sort
172
172
  end
173
-
174
-
175
-
173
+
174
+
175
+
176
176
  def ignore?
177
- project.extended_attributes["releases.ignore.#{environment_name.downcase}"] == "1"
177
+ !project.show_release_notes_for?(environment_name)
178
178
  end
179
-
179
+
180
180
  def notification_recipients
181
181
  @notification_recipients ||= project.followers.unretired
182
182
  end
183
-
184
-
185
-
183
+
184
+
185
+
186
186
  private
187
-
187
+
188
188
  def identify_commit(sha)
189
189
  project.find_commit_by_sha(sha)
190
190
  rescue Houston::Adapters::VersionControl::CommitNotFound
@@ -195,23 +195,23 @@ private
195
195
  @commit_not_found_error_message = $!.message
196
196
  nil
197
197
  end
198
-
198
+
199
199
  def release_each_ticket!
200
200
  tickets.each do |ticket|
201
201
  ticket.released!(self)
202
202
  end
203
203
  end
204
-
204
+
205
205
  def release_each_task!
206
206
  tasks.each do |task|
207
207
  task.released!(self)
208
208
  end
209
209
  end
210
-
210
+
211
211
  def release_each_antecedent!
212
212
  antecedents.each do |antecedent|
213
213
  antecedent.released!(self)
214
214
  end
215
215
  end
216
-
216
+
217
217
  end
@@ -1,54 +1,54 @@
1
1
  class ReleaseChange
2
- include ActiveModel::Validations
3
-
2
+ include ActiveModel::Validations
3
+
4
4
  validates :description, :length => 1...255
5
- # validates :tag_slug, :in =>
6
-
5
+ # validates :tag_slug, :in =>
6
+
7
7
  ENCODING_PATTERN = /^\[([^\]]*)\] (.*)$/.freeze
8
-
8
+
9
9
  def initialize(release, tag_slug, description)
10
10
  @release = release
11
11
  @tag_slug = tag_slug
12
12
  @description = description[/^.*$/]
13
13
  end
14
-
14
+
15
15
  attr_reader :release, :tag_slug, :description
16
-
16
+
17
17
  class << self
18
-
18
+
19
19
  def from_s(release, string)
20
20
  new release, *(string.match(ENCODING_PATTERN)[1..2])
21
21
  end
22
-
22
+
23
23
  def from_commit(release, commit)
24
24
  message = commit.clean_message[0..255]
25
25
  message[0] = message[0].upcase if message[0]
26
26
  tag = Houston.config.fetch_tag(commit.tags.first)
27
27
  new release, tag.slug, message
28
28
  end
29
-
29
+
30
30
  end
31
-
31
+
32
32
  def to_s
33
33
  "[#{tag_slug}] #{description}"
34
34
  end
35
-
35
+
36
36
  def tag
37
37
  Houston.config.fetch_tag(tag_slug)
38
38
  end
39
-
40
-
41
-
39
+
40
+
41
+
42
42
  def id
43
43
  hash
44
44
  end
45
-
45
+
46
46
  def marked_for_destruction?
47
47
  false
48
48
  end
49
-
49
+
50
50
  def _destroy
51
51
  marked_for_destruction?
52
52
  end
53
-
53
+
54
54
  end
data/app/models/role.rb CHANGED
@@ -1,55 +1,55 @@
1
1
  class Role < ActiveRecord::Base
2
-
2
+
3
3
  belongs_to :user
4
4
  belongs_to :project
5
-
5
+
6
6
  validates :user_id, presence: true
7
7
  validates :project, presence: true
8
8
  validates :name, presence: true, inclusion: {in: Houston.config.project_roles, message: "\"%{value}\" is unknown. It must be #{Houston.config.project_roles.to_sentence(last_word_connector: ", or ")}"}
9
-
10
-
9
+
10
+
11
11
  Houston.config.project_roles.each do |role|
12
12
  method_name = role.downcase.gsub(' ', '_')
13
13
  class_eval <<-RUBY
14
14
  def #{method_name}?
15
15
  name == "#{role}"
16
16
  end
17
-
17
+
18
18
  def self.#{method_name.pluralize}
19
19
  where(name: "#{role}")
20
20
  end
21
21
  RUBY
22
22
  end
23
-
24
-
23
+
24
+
25
25
  class << self
26
-
26
+
27
27
  def participants
28
28
  where arel_table[:name].not_eq("Follower")
29
29
  end
30
-
30
+
31
31
  def to_users
32
32
  User.where(id: all.select(:user_id))
33
33
  end
34
-
34
+
35
35
  def to_projects
36
36
  Project.where(id: all.select(:project_id))
37
37
  end
38
-
38
+
39
39
  def for_user(user_or_id)
40
40
  user_id = user_or_id.is_a?(User) ? user_or_id.id : user_or_id
41
41
  where user_id: user_id
42
42
  end
43
-
43
+
44
44
  def for_project(project_or_id)
45
45
  project_id = project_or_id.is_a?(Project) ? project_or_id.id : project_or_id
46
46
  where project_id: project_id
47
47
  end
48
-
48
+
49
49
  def any?
50
50
  count > 0
51
51
  end
52
-
52
+
53
53
  end
54
-
54
+
55
55
  end
@@ -1,46 +1,46 @@
1
1
  module Rubygems
2
2
  class Error < RuntimeError; end
3
-
3
+
4
4
  class Gem
5
-
5
+
6
6
  def initialize(name, options={})
7
7
  @name = name
8
8
  @include_prerelease = options.fetch(:prerelease, false)
9
9
  end
10
-
10
+
11
11
  attr_reader :name
12
12
  alias_method :to_s, :name
13
-
13
+
14
14
  delegate :cache_key,
15
15
  :request_releases_of,
16
16
  :to => "self.class"
17
-
18
-
19
-
17
+
18
+
19
+
20
20
  def self.request_releases_of(name)
21
21
  response = Houston.benchmark title: "GET rubygems.org" do
22
22
  Faraday.get("https://rubygems.org/api/v1/versions/#{name}.json")
23
23
  end
24
24
  raise Rubygems::Error, "Unexpected response from rubygems. Status: #{response.status}" unless response.status == 200
25
-
25
+
26
26
  MultiJson.load(response.body)
27
27
  rescue Faraday::Error::ConnectionFailed
28
28
  raise Rubygems::Error, "Unable to connect to rubygems.org: #{$!.message}"
29
29
  end
30
-
30
+
31
31
  def self.cache_key(name, date)
32
32
  "rubygems/#{name}/releases/#{date.strftime('%Y%m%d')}/json"
33
33
  end
34
-
35
-
36
-
34
+
35
+
36
+
37
37
  def releases
38
38
  fetch_releases_from_previous_cache_on_error do
39
39
  key = cache_key(name, Date.today)
40
40
  Rails.cache.fetch(key) { request_releases_of(name) }
41
41
  end
42
42
  end
43
-
43
+
44
44
  def versions
45
45
  @versions ||= begin
46
46
  versions = releases.map { |release| ::Gem::Version.new(release["number"]) }
@@ -48,15 +48,15 @@ module Rubygems
48
48
  versions.sort.reverse
49
49
  end
50
50
  end
51
-
52
-
53
-
51
+
52
+
53
+
54
54
  def fetch_releases_from_previous_cache_on_error
55
55
  yield
56
56
  rescue Rubygems::Error
57
57
  Rails.logger.error "[rubygems] an error occurred fetching releases for '#{name}': #{$!}"
58
58
  Houston.report_exception $!
59
-
59
+
60
60
  # Have we cached releases any time in the last month?
61
61
  (1..30).each do |n|
62
62
  date = n.days.ago
@@ -66,11 +66,11 @@ module Rubygems
66
66
  return Rails.cache.fetch(key)
67
67
  end
68
68
  end
69
-
69
+
70
70
  []
71
71
  end
72
-
73
-
74
-
72
+
73
+
74
+
75
75
  end
76
76
  end
@@ -1,16 +1,16 @@
1
1
  class RunTestsOnPostReceive
2
-
2
+
3
3
  def self.instance
4
4
  @instance
5
5
  end
6
-
6
+
7
7
  def self.begin!
8
8
  @instance = self.new.tap(&:begin!)
9
9
  end
10
-
10
+
11
11
  def begin!
12
12
  Rails.logger.info "\e[34;1mSetting up observers for RunTestsOnPostReceive\e[0m"
13
-
13
+
14
14
  # Here's how this works:
15
15
  #
16
16
  # 1. GitHub receives a `git push` and triggers all Web Hooks:
@@ -24,14 +24,14 @@ class RunTestsOnPostReceive
24
24
  Rails.logger.info "\e[34m[hooks:post_receive] creating a TestRun\e[0m"
25
25
  create_a_test_run(project, params)
26
26
  end
27
-
27
+
28
28
  # 4. Houston notifies GitHub that the test run has started:
29
29
  # POST /repos/houston/houston/statuses/:sha
30
30
  Houston.observer.on "test_run:start" do |test_run|
31
31
  Rails.logger.info "\e[34m[test_run:start] publishing status on GitHub\e[0m"
32
32
  publish_status_to_github(test_run)
33
33
  end
34
-
34
+
35
35
  # 5. Jenkins checks out the project, runs the tests, and
36
36
  # tells Houston that it is finished:
37
37
  # POST /projects/houston/hooks/post_build.
@@ -44,89 +44,89 @@ class RunTestsOnPostReceive
44
44
  Rails.logger.info "\e[34m[hooks:post_build] fetching TestRun results\e[0m"
45
45
  fetch_test_run_results(project, params)
46
46
  end
47
-
47
+
48
48
  # 8. Houston publishes results to GitHub:
49
49
  # POST /repos/houston/houston/statuses/:sha
50
50
  Houston.observer.on "test_run:complete" do |test_run|
51
51
  Rails.logger.info "\e[34m[test_run:complete] publishing status on GitHub\e[0m"
52
52
  publish_status_to_github(test_run)
53
53
  end
54
-
54
+
55
55
  # 9. Houston publishes results to Code Climate.
56
56
  Houston.observer.on "test_run:complete" do |test_run|
57
57
  Rails.logger.info "\e[34m[test_run:complete] publishing status on CodeClimate\e[0m"
58
58
  publish_coverage_to_code_climate(test_run)
59
59
  end
60
60
  end
61
-
62
-
63
-
61
+
62
+
63
+
64
64
  def create_a_test_run(project, params)
65
65
  unless project.has_ci_server?
66
66
  Rails.logger.warn "[hooks:post_receive] the project #{project.name} is not configured to be used with a Continuous Integration server"
67
67
  return
68
68
  end
69
-
69
+
70
70
  payload = PostReceivePayload.new(params)
71
-
71
+
72
72
  unless payload.commit
73
73
  Rails.logger.error "[hooks:post_receive] no commit found in payload"
74
74
  return
75
75
  end
76
-
76
+
77
77
  if payload.commit == Houston::NULL_GIT_COMMIT
78
78
  Rails.logger.error "[hooks:post_receive] branch was deleted; not running tests again"
79
79
  return
80
80
  end
81
-
81
+
82
82
  test_run = project.test_runs.find_by_sha(payload.commit)
83
-
83
+
84
84
  if test_run
85
85
  Rails.logger.warn "[hooks:post_receive] a test run exists for #{test_run.short_commit}; doing nothing"
86
86
  return
87
87
  end
88
-
88
+
89
89
  test_run = TestRun.new(
90
90
  project: project,
91
91
  sha: payload.commit,
92
92
  agent_email: payload.agent_email,
93
93
  branch: payload.branch)
94
-
94
+
95
95
  notify_of_invalid_configuration(test_run) do
96
96
  test_run.start!
97
97
  end
98
-
98
+
99
99
  rescue ActiveRecord::RecordNotUnique
100
100
  Rails.logger.warn "[hooks:post_receive] a test run exists for #{test_run.short_commit}; doing nothing"
101
101
  rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
102
102
  Houston.report_exception $!, parameters: params.merge(project: project.slug)
103
103
  end
104
-
105
-
104
+
105
+
106
106
  def fetch_test_run_results(project, params)
107
107
  commit, results_url = params.values_at(:commit, :results_url)
108
108
  test_run = project.test_runs.find_by_sha(commit)
109
-
109
+
110
110
  unless test_run
111
111
  Rails.logger.warn "[hooks:post_build] no test run found for project '#{project.slug}' and commit '#{commit}'"
112
112
  return
113
113
  end
114
-
114
+
115
115
  if results_url.blank?
116
116
  message = "#{project.ci_server_name} is not appropriately configured to build #{project.name}."
117
117
  additional_info = "#{project.ci_server_name} did not supply 'results_url' when it triggered the post_build hook"
118
118
  ProjectNotification.ci_configuration_error(test_run, message, additional_info: additional_info).deliver!
119
119
  return
120
120
  end
121
-
121
+
122
122
  test_run.completed!(results_url)
123
-
123
+
124
124
  rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
125
125
  Houston.report_exception $!, parameters: params.merge(project: project.slug)
126
126
  end
127
-
128
-
129
-
127
+
128
+
129
+
130
130
  def publish_status_to_github(test_run)
131
131
  return unless test_run.project.repo.respond_to? :commit_status_url
132
132
  Github::CommitStatusReport.publish!(test_run)
@@ -141,9 +141,9 @@ class RunTestsOnPostReceive
141
141
  project: test_run.project.slug,
142
142
  method: "publish_status_to_github" }
143
143
  end
144
-
145
-
146
-
144
+
145
+
146
+
147
147
  def publish_coverage_to_code_climate(test_run)
148
148
  return if test_run.project.code_climate_repo_token.blank?
149
149
  CodeClimate::CoverageReport.publish!(test_run)
@@ -162,11 +162,11 @@ class RunTestsOnPostReceive
162
162
  project: test_run.project.slug,
163
163
  method: "publish_coverage_to_code_climate" }
164
164
  end
165
-
166
-
167
-
165
+
166
+
167
+
168
168
  private
169
-
169
+
170
170
  def notify_of_invalid_configuration(test_run)
171
171
  begin
172
172
  yield
@@ -176,5 +176,5 @@ private
176
176
  ProjectNotification.ci_configuration_error(test_run, message, additional_info: $!.message).deliver!
177
177
  end
178
178
  end
179
-
179
+
180
180
  end
@@ -1,10 +1,10 @@
1
1
  class Setting < ActiveRecord::Base
2
-
2
+
3
3
  validates_presence_of :name, :value
4
-
4
+
5
5
  def self.[](name)
6
6
  setting = where(name: name).first
7
7
  setting && setting.value
8
8
  end
9
-
9
+
10
10
  end