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
@@ -0,0 +1,53 @@
1
+ require "test_helper"
2
+
3
+ class TriggersTest < ActiveSupport::TestCase
4
+
5
+ def setup
6
+ config.actions.define("test-action") { }
7
+ end
8
+
9
+
10
+ should "raise an error if a trigger has already been registered" do
11
+ triggers.at("5:30pm", "test-action")
12
+ assert_raises Houston::DuplicateTriggerError do
13
+ triggers.at("5:30pm", "test-action")
14
+ end
15
+
16
+ # Triggers with different params count as different
17
+ triggers.at("5:30pm", "test-action", param: 1)
18
+ refute_raises Houston::DuplicateTriggerError do
19
+ triggers.at("5:30pm", "test-action", param: 2)
20
+ end
21
+ end
22
+
23
+
24
+ should "allow you to invoke an action without params" do
25
+ trigger = triggers.at("5:30pm", "test-action")
26
+ mock(config.actions).run("test-action", {}, trigger: trigger.to_s)
27
+ trigger.call
28
+ end
29
+
30
+ should "allow triggers to pass params to an action" do
31
+ trigger = triggers.at("5:30pm", "test-action", trigger_param: 1)
32
+ mock(config.actions).run("test-action", {trigger_param: 1}, {trigger: trigger.to_s})
33
+ trigger.call
34
+ end
35
+
36
+ should "allow callbacks to override triggers' params" do
37
+ trigger = triggers.at("5:30pm", "test-action", trigger_param: 1)
38
+ mock(config.actions).run("test-action", {trigger_param: 2}, {trigger: trigger.to_s})
39
+ trigger.call(trigger_param: 2)
40
+ end
41
+
42
+
43
+ private
44
+
45
+ def triggers
46
+ config.triggers
47
+ end
48
+
49
+ def config
50
+ @config ||= Houston::Configuration.new
51
+ end
52
+
53
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: houston-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta3
4
+ version: 0.7.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-02 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.5.1
19
+ version: 4.2.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.5.1
26
+ version: 4.2.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pg
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -769,7 +769,6 @@ files:
769
769
  - app/assets/javascripts/houston/app/models/release.coffee
770
770
  - app/assets/javascripts/houston/app/models/task.coffee
771
771
  - app/assets/javascripts/houston/app/models/tester.coffee
772
- - app/assets/javascripts/houston/app/models/testing_note.coffee
773
772
  - app/assets/javascripts/houston/app/models/ticket.coffee
774
773
  - app/assets/javascripts/houston/app/models/user.coffee
775
774
  - app/assets/javascripts/houston/app/mousetrap-bind-scoped.js
@@ -779,7 +778,6 @@ files:
779
778
  - app/assets/javascripts/houston/app/views/_show_sprint_view.coffee
780
779
  - app/assets/javascripts/houston/app/views/_tickets_view.coffee
781
780
  - app/assets/javascripts/houston/app/views/all_tickets_view.coffee
782
- - app/assets/javascripts/houston/app/views/commit_view.coffee
783
781
  - app/assets/javascripts/houston/app/views/edit_sprint_view.coffee
784
782
  - app/assets/javascripts/houston/app/views/edit_ticket_view.coffee
785
783
  - app/assets/javascripts/houston/app/views/find_or_create_ticket_view.coffee
@@ -787,9 +785,6 @@ files:
787
785
  - app/assets/javascripts/houston/app/views/new_ticket_modal.coffee
788
786
  - app/assets/javascripts/houston/app/views/new_ticket_view.coffee
789
787
  - app/assets/javascripts/houston/app/views/problems_view.coffee
790
- - app/assets/javascripts/houston/app/views/testing_note_view.coffee
791
- - app/assets/javascripts/houston/app/views/testing_report_view.coffee
792
- - app/assets/javascripts/houston/app/views/testing_ticket_view.coffee
793
788
  - app/assets/javascripts/houston/app/views/ticket_modal_view.coffee
794
789
  - app/assets/javascripts/houston/application.js
795
790
  - app/assets/javascripts/houston/core/app.coffee
@@ -807,6 +802,7 @@ files:
807
802
  - app/assets/javascripts/houston/dashboard/refresher.coffee
808
803
  - app/assets/javascripts/houston/vendor.js
809
804
  - app/assets/stylesheets/houston/application.css
805
+ - app/assets/stylesheets/houston/application/actions.scss
810
806
  - app/assets/stylesheets/houston/application/ansi.scss
811
807
  - app/assets/stylesheets/houston/application/commit.scss
812
808
  - app/assets/stylesheets/houston/application/emoji.scss
@@ -818,8 +814,8 @@ files:
818
814
  - app/assets/stylesheets/houston/application/full_screen.scss
819
815
  - app/assets/stylesheets/houston/application/github_repos.scss
820
816
  - app/assets/stylesheets/houston/application/infinite_scroll.scss
821
- - app/assets/stylesheets/houston/application/jobs.scss
822
817
  - app/assets/stylesheets/houston/application/keyboard_shortcuts.scss
818
+ - app/assets/stylesheets/houston/application/layout.scss
823
819
  - app/assets/stylesheets/houston/application/markdown.scss
824
820
  - app/assets/stylesheets/houston/application/mobile.scss
825
821
  - app/assets/stylesheets/houston/application/modals.scss
@@ -838,7 +834,6 @@ files:
838
834
  - app/assets/stylesheets/houston/application/tables.scss
839
835
  - app/assets/stylesheets/houston/application/test.scss
840
836
  - app/assets/stylesheets/houston/application/test_run.scss
841
- - app/assets/stylesheets/houston/application/testing_report.scss
842
837
  - app/assets/stylesheets/houston/application/ticket.scss
843
838
  - app/assets/stylesheets/houston/application/ticket_modal.scss
844
839
  - app/assets/stylesheets/houston/application/tickets.scss
@@ -864,7 +859,6 @@ files:
864
859
  - app/assets/stylesheets/houston/print.css.scss
865
860
  - app/assets/stylesheets/houston/variables.scss
866
861
  - app/assets/stylesheets/houston/vendor.css
867
- - app/assets/templates/commit.hbs
868
862
  - app/assets/templates/keyboard_shortcuts.hbs
869
863
  - app/assets/templates/new_ticket/form.hbs
870
864
  - app/assets/templates/new_ticket/modal.hbs
@@ -879,12 +873,6 @@ files:
879
873
  - app/assets/templates/sprints/show.hbs
880
874
  - app/assets/templates/sprints/task.hbs
881
875
  - app/assets/templates/sprints/typeahead.hbs
882
- - app/assets/templates/testing_notes/edit.hbs
883
- - app/assets/templates/testing_notes/new.hbs
884
- - app/assets/templates/testing_notes/show.hbs
885
- - app/assets/templates/testing_report/description.hbs
886
- - app/assets/templates/testing_report/ticket.hbs
887
- - app/assets/templates/testing_report/verdict.hbs
888
876
  - app/assets/templates/tickets/find_or_create.hbs
889
877
  - app/assets/templates/tickets/index.hbs
890
878
  - app/assets/templates/tickets/modal.hbs
@@ -902,6 +890,7 @@ files:
902
890
  - app/concerns/retirement.rb
903
891
  - app/concerns/ticket_synchronizer.rb
904
892
  - app/concerns/unique_add.rb
893
+ - app/controllers/actions_controller.rb
905
894
  - app/controllers/api/v1/measurements_controller.rb
906
895
  - app/controllers/api/v1/projects_controller.rb
907
896
  - app/controllers/api/v1/sprint_tasks_controller.rb
@@ -911,10 +900,10 @@ files:
911
900
  - app/controllers/commits_controller.rb
912
901
  - app/controllers/concerns/.keep
913
902
  - app/controllers/deploys_controller.rb
903
+ - app/controllers/errors_controller.rb
914
904
  - app/controllers/github/pulls_controller.rb
915
905
  - app/controllers/home_controller.rb
916
906
  - app/controllers/hooks_controller.rb
917
- - app/controllers/jobs_controller.rb
918
907
  - app/controllers/oauth/providers_controller.rb
919
908
  - app/controllers/omnibar_controller.rb
920
909
  - app/controllers/project_exceptions_controller.rb
@@ -934,14 +923,14 @@ files:
934
923
  - app/controllers/tasks_controller.rb
935
924
  - app/controllers/test_runs_controller.rb
936
925
  - app/controllers/tester_bar_controller.rb
937
- - app/controllers/testing_notes_controller.rb
938
- - app/controllers/testing_report_controller.rb
939
926
  - app/controllers/tickets_controller.rb
927
+ - app/controllers/triggers_controller.rb
940
928
  - app/controllers/uploads_controller.rb
941
929
  - app/controllers/user_credentials_controller.rb
942
930
  - app/controllers/user_options_controller.rb
943
931
  - app/controllers/users_controller.rb
944
932
  - app/controllers/welcome_controller.rb
933
+ - app/helpers/actions_helper.rb
945
934
  - app/helpers/ansi_helper.rb
946
935
  - app/helpers/application_helper.rb
947
936
  - app/helpers/avatar_helper.rb
@@ -983,6 +972,7 @@ files:
983
972
  - app/models/.gitkeep
984
973
  - app/models/.keep
985
974
  - app/models/ability.rb
975
+ - app/models/action.rb
986
976
  - app/models/activity_feed.rb
987
977
  - app/models/antecedent.rb
988
978
  - app/models/authorization.rb
@@ -1002,7 +992,6 @@ files:
1002
992
  - app/models/github/pull_request.rb
1003
993
  - app/models/github/pull_request_event.rb
1004
994
  - app/models/github/unauthorized.rb
1005
- - app/models/job.rb
1006
995
  - app/models/key_dependency.rb
1007
996
  - app/models/maintenance_light.rb
1008
997
  - app/models/measurement.rb
@@ -1011,6 +1000,7 @@ files:
1011
1000
  - app/models/milestone.rb
1012
1001
  - app/models/oauth/provider.rb
1013
1002
  - app/models/output_stream.rb
1003
+ - app/models/persistent_trigger.rb
1014
1004
  - app/models/post_receive_payload.rb
1015
1005
  - app/models/project.rb
1016
1006
  - app/models/project_dependencies.rb
@@ -1036,7 +1026,6 @@ files:
1036
1026
  - app/models/test_result.rb
1037
1027
  - app/models/test_run.rb
1038
1028
  - app/models/test_run_statistics.rb
1039
- - app/models/testing_note.rb
1040
1029
  - app/models/ticket.rb
1041
1030
  - app/models/ticket_antecedent.rb
1042
1031
  - app/models/ticket_comment.rb
@@ -1056,9 +1045,9 @@ files:
1056
1045
  - app/presenters/task_presenter.rb
1057
1046
  - app/presenters/tasks_excel_presenter.rb
1058
1047
  - app/presenters/tester_presenter.rb
1059
- - app/presenters/testing_note_presenter.rb
1060
- - app/presenters/testing_report_ticket_presenter.rb
1061
1048
  - app/presenters/ticket_presenter.rb
1049
+ - app/views/actions/index.html.erb
1050
+ - app/views/actions/show.html.erb
1062
1051
  - app/views/activity/_events.html.erb
1063
1052
  - app/views/authorizations/_form.html.erb
1064
1053
  - app/views/authorizations/edit.html.erb
@@ -1084,10 +1073,10 @@ files:
1084
1073
  - app/views/devise/registrations/new.html.erb
1085
1074
  - app/views/devise/sessions/new.html.erb
1086
1075
  - app/views/devise/unlocks/new.html.erb
1076
+ - app/views/errors/_actions.html.erb
1077
+ - app/views/errors/index.html.erb
1087
1078
  - app/views/github/pulls/index.html.erb
1088
1079
  - app/views/home/index.html.erb
1089
- - app/views/jobs/index.html.erb
1090
- - app/views/jobs/show.html.erb
1091
1080
  - app/views/layouts/_mobile_navigation.html.erb
1092
1081
  - app/views/layouts/_navigation.html.erb
1093
1082
  - app/views/layouts/_tester_bar.html.erb
@@ -1105,7 +1094,6 @@ files:
1105
1094
  - app/views/project_notification/follow_up.html.erb
1106
1095
  - app/views/project_notification/new_release.html.erb
1107
1096
  - app/views/project_notification/test_run.html.erb
1108
- - app/views/project_notification/testing_note.html.erb
1109
1097
  - app/views/project_pretickets/show.html.erb
1110
1098
  - app/views/project_tests/_commits.html.erb
1111
1099
  - app/views/project_tests/index.html.erb
@@ -1146,10 +1134,8 @@ files:
1146
1134
  - app/views/sprints/dashboard.html.erb
1147
1135
  - app/views/sprints/show.html.erb
1148
1136
  - app/views/test_runs/confirm_retry.html.erb
1149
- - app/views/testing_report/_scripts.html.erb
1150
- - app/views/testing_report/index.html.erb
1151
- - app/views/testing_report/show.html.erb
1152
1137
  - app/views/tickets/new.html.erb
1138
+ - app/views/triggers/index.html.erb
1153
1139
  - app/views/users/_form.html.erb
1154
1140
  - app/views/users/_header.html.erb
1155
1141
  - app/views/users/edit.html.erb
@@ -1180,9 +1166,10 @@ files:
1180
1166
  - config/initializers/houston_async.rb
1181
1167
  - config/initializers/houston_benchmark.rb
1182
1168
  - config/initializers/houston_report_exception.rb
1183
- - config/initializers/houston_scheduler.rb
1169
+ - config/initializers/houston_scheduler_daemon.rb
1184
1170
  - config/initializers/houston_try.rb
1185
1171
  - config/initializers/inflections.rb
1172
+ - config/initializers/load_persistent_triggers.rb
1186
1173
  - config/initializers/mime_types.rb
1187
1174
  - config/initializers/profile_gc.rb
1188
1175
  - config/initializers/requirements.rb
@@ -1212,10 +1199,7 @@ files:
1212
1199
  - db/migrate/20120417190504_add_role_to_users.rb
1213
1200
  - db/migrate/20120417195313_create_tickets.rb
1214
1201
  - db/migrate/20120417195433_create_ticket_queues.rb
1215
- - db/migrate/20120424212706_create_testing_notes.rb
1216
1202
  - db/migrate/20120501230243_add_unfuddle_id_to_tickets.rb
1217
- - db/migrate/20120501231817_add_expires_at_to_testing_notes.rb
1218
- - db/migrate/20120501231948_add_unfuddle_id_to_testing_notes.rb
1219
1203
  - db/migrate/20120504143615_link_tickets_and_releases.rb
1220
1204
  - db/migrate/20120525013703_add_health_fields_to_projects.rb
1221
1205
  - db/migrate/20120607124115_add_cached_queries_to_projects.rb
@@ -1224,7 +1208,6 @@ files:
1224
1208
  - db/migrate/20120626151320_link_tickets_and_commits.rb
1225
1209
  - db/migrate/20120626152020_add_committer_email_to_commits.rb
1226
1210
  - db/migrate/20120626152949_replace_committer_info_with_author_info.rb
1227
- - db/migrate/20120715230526_change_testing_notes_comment_to_text.rb
1228
1211
  - db/migrate/20120715230922_create_user_notifications.rb
1229
1212
  - db/migrate/20120716010743_add_user_to_releases.rb
1230
1213
  - db/migrate/20120726212620_add_message_to_release.rb
@@ -1259,7 +1242,6 @@ files:
1259
1242
  - db/migrate/20130119211540_remove_estimated_effort_and_estimated_value_from_tickets.rb
1260
1243
  - db/migrate/20130119212008_rename_tickets_unfuddle_id_to_remote_id.rb
1261
1244
  - db/migrate/20130120182026_create_ticket_prerequisites.rb
1262
- - db/migrate/20130211015046_add_min_passing_verdicts_to_projects.rb
1263
1245
  - db/migrate/20130302205014_change_default_role_for_users.rb
1264
1246
  - db/migrate/20130306023456_add_agent_email_to_test_runs.rb
1265
1247
  - db/migrate/20130306023613_add_branch_to_test_runs.rb
@@ -1267,7 +1249,6 @@ files:
1267
1249
  - db/migrate/20130319003918_add_coverage_to_test_runs.rb
1268
1250
  - db/migrate/20130407195450_create_roles.rb
1269
1251
  - db/migrate/20130407200624_populate_roles.rb
1270
- - db/migrate/20130407220039_add_project_id_to_testing_notes.rb
1271
1252
  - db/migrate/20130407220937_add_project_id_to_commits.rb
1272
1253
  - db/migrate/20130416020627_add_environments_subscribed_to_to_users.rb
1273
1254
  - db/migrate/20130420151334_rename_ticket_tracking_to_ticket_tracker.rb
@@ -1332,7 +1313,6 @@ files:
1332
1313
  - db/migrate/20140429000919_add_feature_states_to_projects.rb
1333
1314
  - db/migrate/20140506032958_add_locked_to_sprints.rb
1334
1315
  - db/migrate/20140506035755_create_value_statements.rb
1335
- - db/migrate/20140511024021_rename_testing_notes_unfuddle_id_to_remote_id.rb
1336
1316
  - db/migrate/20140515174322_create_tasks.rb
1337
1317
  - db/migrate/20140515200824_link_tasks_and_commits.rb
1338
1318
  - db/migrate/20140516005310_link_tasks_and_releases.rb
@@ -1406,6 +1386,9 @@ files:
1406
1386
  - db/migrate/20160625203412_convert_user_view_options_to_props.rb
1407
1387
  - db/migrate/20160625221840_convert_project_extended_attributes_to_props.rb
1408
1388
  - db/migrate/20160625230420_move_users_unfuddle_id_to_props.rb
1389
+ - db/migrate/20160711170921_rename_jobs_to_actions.rb
1390
+ - db/migrate/20160713204605_add_trigger_and_params_to_actions.rb
1391
+ - db/migrate/20160715173039_create_persistent_triggers.rb
1409
1392
  - db/seeds.rb
1410
1393
  - db/structure.sql
1411
1394
  - houston-core.gemspec
@@ -1418,17 +1401,28 @@ files:
1418
1401
  - lib/generators/module_generator.rb
1419
1402
  - lib/houston/application.rb
1420
1403
  - lib/houston/boot.rb
1404
+ - lib/houston/boot/actions.rb
1405
+ - lib/houston/boot/active_record_serializer.rb
1421
1406
  - lib/houston/boot/configuration.rb
1422
1407
  - lib/houston/boot/daemonize.rb
1408
+ - lib/houston/boot/events.rb
1423
1409
  - lib/houston/boot/extensions.rb
1424
1410
  - lib/houston/boot/observer.rb
1411
+ - lib/houston/boot/readonly_hash_serializer.rb
1412
+ - lib/houston/boot/serializer.rb
1425
1413
  - lib/houston/boot/server.rb
1414
+ - lib/houston/boot/ticket_antecedent_serializer.rb
1415
+ - lib/houston/boot/timer.rb
1416
+ - lib/houston/boot/triggers.rb
1426
1417
  - lib/houston/cli.rb
1427
1418
  - lib/houston/version.rb
1428
1419
  - lib/parallel_enumerable.rb
1420
+ - lib/params_serializer.rb
1429
1421
  - lib/rack/oembed.rb
1430
1422
  - lib/tasks/.gitkeep
1431
1423
  - lib/tasks/.keep
1424
+ - lib/tasks/actions.rake
1425
+ - lib/tasks/events.rake
1432
1426
  - lib/tasks/keypair.rake
1433
1427
  - lib/tasks/specific_tests.rake
1434
1428
  - lib/unexpected_response.rb
@@ -1472,6 +1466,16 @@ files:
1472
1466
  - templates/new-instance/config/environments/development.rb
1473
1467
  - templates/new-instance/config/environments/production.rb
1474
1468
  - templates/new-instance/config/environments/test.rb
1469
+ - templates/new-instance/config/events/alerts/slack_when_assigned.rb
1470
+ - templates/new-instance/config/events/alerts/slack_when_opened.rb
1471
+ - templates/new-instance/config/events/daemons/health.rb
1472
+ - templates/new-instance/config/events/deploy/autoresolve_errs.rb
1473
+ - templates/new-instance/config/events/deploy/checkout_mentioned_alerts.rb
1474
+ - templates/new-instance/config/events/deploy/notify_deployer_when_finished.rb
1475
+ - templates/new-instance/config/events/github/publish_comments_on_slack.rb
1476
+ - templates/new-instance/config/events/tests/slack_when_analyzed.rb
1477
+ - templates/new-instance/config/events/tests/slack_when_completed.rb
1478
+ - templates/new-instance/config/events/tickets/mark_tasks_completed_on_commit.rb
1475
1479
  - templates/new-instance/config/initializers/.keep
1476
1480
  - templates/new-instance/config/integrations/engineyard.rb
1477
1481
  - templates/new-instance/config/integrations/errbit.rb
@@ -1479,34 +1483,21 @@ files:
1479
1483
  - templates/new-instance/config/integrations/github.rb
1480
1484
  - templates/new-instance/config/integrations/jenkins.rb
1481
1485
  - templates/new-instance/config/integrations/ldap.rb
1482
- - templates/new-instance/config/jobs/cache_key_dependencies.rb
1483
- - templates/new-instance/config/jobs/email_about_open_alerts.rb
1484
- - templates/new-instance/config/jobs/purge_jobs.rb
1485
- - templates/new-instance/config/jobs/slack_reminders_about_alerts.rb
1486
- - templates/new-instance/config/jobs/sync_commits.rb
1487
- - templates/new-instance/config/jobs/sync_pull_requests.rb
1488
- - templates/new-instance/config/jobs/sync_tickets.rb
1489
1486
  - templates/new-instance/config/keypair.pem
1490
1487
  - templates/new-instance/config/main.rb
1491
1488
  - templates/new-instance/config/routes.rb
1492
- - templates/new-instance/config/triggers/alerts/slack_when_assigned.rb
1493
- - templates/new-instance/config/triggers/alerts/slack_when_opened.rb
1494
- - templates/new-instance/config/triggers/daemons/health.rb
1495
- - templates/new-instance/config/triggers/deploy/autoresolve_errs.rb
1496
- - templates/new-instance/config/triggers/deploy/checkout_mentioned_alerts.rb
1497
- - templates/new-instance/config/triggers/deploy/notify_deployer_when_finished.rb
1498
- - templates/new-instance/config/triggers/github/publish_comments_on_slack.rb
1499
- - templates/new-instance/config/triggers/tests/slack_when_analyzed.rb
1500
- - templates/new-instance/config/triggers/tests/slack_when_completed.rb
1501
- - templates/new-instance/config/triggers/tickets/email_testing_notes.rb
1502
- - templates/new-instance/config/triggers/tickets/mark_tasks_completed_on_commit.rb
1489
+ - templates/new-instance/config/timers/cache_key_dependencies.rb
1490
+ - templates/new-instance/config/timers/email_about_open_alerts.rb
1491
+ - templates/new-instance/config/timers/purge_jobs.rb
1492
+ - templates/new-instance/config/timers/slack_reminders_about_alerts.rb
1493
+ - templates/new-instance/config/timers/sync_commits.rb
1494
+ - templates/new-instance/config/timers/sync_pull_requests.rb
1495
+ - templates/new-instance/config/timers/sync_tickets.rb
1503
1496
  - templates/new-instance/db/structure.sql
1504
1497
  - templates/new-instance/lib/gemnasium-alert.rb
1505
1498
  - templates/new-instance/lib/houston/engine.rb
1506
1499
  - templates/new-instance/lib/slack_helpers.rb
1507
1500
  - templates/new-instance/lib/time_helpers.rb
1508
- - templates/new-instance/log/development.log
1509
- - templates/new-instance/log/test.log
1510
1501
  - templates/new-instance/public/404.html
1511
1502
  - templates/new-instance/public/422.html
1512
1503
  - templates/new-instance/public/500.html
@@ -3254,7 +3245,6 @@ files:
3254
3245
  - templates/new-module/app/views/layouts/houston/%name%/application.html.erb.tt
3255
3246
  - templates/new-module/bin/rails.tt
3256
3247
  - templates/new-module/config/database.yml
3257
- - templates/new-module/config/initializers/add_navigation_renderer.rb
3258
3248
  - templates/new-module/config/routes.rb
3259
3249
  - templates/new-module/gitignore
3260
3250
  - templates/new-module/houston-%name%.gemspec
@@ -3350,22 +3340,27 @@ files:
3350
3340
  - test/unit/controllers/test_runs_controller_test.rb
3351
3341
  - test/unit/controllers/user_options_controller_test.rb
3352
3342
  - test/unit/initializers/sync_commits_on_post_receive_test.rb
3343
+ - test/unit/models/actions_test.rb
3353
3344
  - test/unit/models/code_climate_coverage_report_test.rb
3354
3345
  - test/unit/models/commit_test.rb
3346
+ - test/unit/models/configuration_test.rb
3355
3347
  - test/unit/models/deploy_test.rb
3356
3348
  - test/unit/models/observer_test.rb
3349
+ - test/unit/models/persistent_trigger_test.rb
3357
3350
  - test/unit/models/post_receive_payload_test.rb
3358
3351
  - test/unit/models/project_test.rb
3359
3352
  - test/unit/models/props_test.rb
3360
3353
  - test/unit/models/pull_request_test.rb
3361
3354
  - test/unit/models/release_change_test.rb
3362
3355
  - test/unit/models/release_test.rb
3356
+ - test/unit/models/serializer_test.rb
3363
3357
  - test/unit/models/source_file_coverage_test.rb
3364
3358
  - test/unit/models/sprint_test.rb
3365
3359
  - test/unit/models/task_test.rb
3366
3360
  - test/unit/models/test_run_test.rb
3367
3361
  - test/unit/models/ticket_antecedents_test.rb
3368
3362
  - test/unit/models/ticket_test.rb
3363
+ - test/unit/models/triggers_test.rb
3369
3364
  - test/unit/models/user_test.rb
3370
3365
  - test/unit/presenters/sprint_task_presenter_test.rb
3371
3366
  - test/unit/test_run_comparer_test.rb
@@ -3567,22 +3562,27 @@ test_files:
3567
3562
  - test/unit/controllers/test_runs_controller_test.rb
3568
3563
  - test/unit/controllers/user_options_controller_test.rb
3569
3564
  - test/unit/initializers/sync_commits_on_post_receive_test.rb
3565
+ - test/unit/models/actions_test.rb
3570
3566
  - test/unit/models/code_climate_coverage_report_test.rb
3571
3567
  - test/unit/models/commit_test.rb
3568
+ - test/unit/models/configuration_test.rb
3572
3569
  - test/unit/models/deploy_test.rb
3573
3570
  - test/unit/models/observer_test.rb
3571
+ - test/unit/models/persistent_trigger_test.rb
3574
3572
  - test/unit/models/post_receive_payload_test.rb
3575
3573
  - test/unit/models/project_test.rb
3576
3574
  - test/unit/models/props_test.rb
3577
3575
  - test/unit/models/pull_request_test.rb
3578
3576
  - test/unit/models/release_change_test.rb
3579
3577
  - test/unit/models/release_test.rb
3578
+ - test/unit/models/serializer_test.rb
3580
3579
  - test/unit/models/source_file_coverage_test.rb
3581
3580
  - test/unit/models/sprint_test.rb
3582
3581
  - test/unit/models/task_test.rb
3583
3582
  - test/unit/models/test_run_test.rb
3584
3583
  - test/unit/models/ticket_antecedents_test.rb
3585
3584
  - test/unit/models/ticket_test.rb
3585
+ - test/unit/models/triggers_test.rb
3586
3586
  - test/unit/models/user_test.rb
3587
3587
  - test/unit/presenters/sprint_task_presenter_test.rb
3588
3588
  - test/unit/test_run_comparer_test.rb
@@ -1,18 +0,0 @@
1
- class window.TestingNote extends Backbone.Model
2
- url: ->
3
- if @isNew()
4
- "#{App.relativeRoot()}/tickets/#{@get('ticketId')}/testing_notes"
5
- else
6
- "#{App.relativeRoot()}/tickets/#{@get('ticketId')}/testing_notes/#{@get('id')}"
7
-
8
-
9
- class window.TestingNotes extends Backbone.Collection
10
- model: TestingNote
11
- url: -> "#{App.relativeRoot()}/tickets/#{@ticket.get('id')}/testing_notes"
12
-
13
- initialize: (models, options)->
14
- super(models, options)
15
- @ticket = options.ticket
16
-
17
- since: (date)->
18
- @filter (note)-> note.get('createdAt') > date
@@ -1,13 +0,0 @@
1
- class window.CommitView extends Backbone.View
2
- tagName: 'li'
3
- className: 'commit'
4
-
5
- initialize: ->
6
- @renderer = HandlebarsTemplates['commit']
7
-
8
- render: ->
9
- $el = $(@el)
10
- json = @model.toJSON()
11
- json['message'] = json['message'].replace(/\[#(\d+)\]/g, '') # remove ticket numbers)
12
- $el.html @renderer(json)
13
- @
@@ -1,85 +0,0 @@
1
- class window.TestingNoteView extends Backbone.View
2
- tagName: 'li'
3
- className: 'testing-note'
4
-
5
- events:
6
- 'click .edit-note': 'edit'
7
- 'click .destroy-note': 'destroy'
8
- 'click .btn-cancel': 'cancel'
9
- 'click :radio': 'changeVerdict'
10
-
11
- initialize: ->
12
- @isInEditMode = false
13
- @renderTestingNote = HandlebarsTemplates['testing_notes/show']
14
- @renderEditTestingNote = HandlebarsTemplates['testing_notes/edit']
15
- $(@el).delegate 'form', 'submit', _.bind(@commit, @)
16
-
17
- render: ->
18
- $el = $(@el)
19
- $el.attr('id', "testing_note_#{@model.get('id')}")
20
- renderer = if @isInEditMode then @renderEditTestingNote else @renderTestingNote
21
- $el.html renderer(_.extend(@model.toJSON(), {editable: @isEditable(), tester: (window.user.get('role') == 'Tester')}))
22
- $el.attr('class', "testing-note #{@model.get('verdict')}")
23
- $el.addClass('by-tester') if @model.get('byTester')
24
- @
25
-
26
- isEditable: ->
27
- @model.get('userId') == window.userId or window.user.get('admin')
28
-
29
- edit: (e)->
30
- if e
31
- e.preventDefault()
32
- e.stopImmediatePropagation()
33
- if @isEditable() and !@isInEditMode
34
- @isInEditMode = true
35
- @render()
36
- @trigger('edit:begin', @)
37
- @
38
-
39
- commit: (e)->
40
- if e
41
- e.preventDefault()
42
- e.stopImmediatePropagation()
43
- if @isInEditMode
44
- $form = $(@el).find('form')
45
- $form.disable().find('.btn-primary').html('<i class="fa fa-spinner fa-spin"></i> Saving...')
46
- params = $form.serializeObject()
47
- previousAttributes = @model.previousAttributes()
48
- @model.save params,
49
- success: (model, response)=>
50
- @isInEditMode = false
51
- @render()
52
- @trigger('edit:commit', @, @model)
53
- error: (model, response)=>
54
- $form.enable().find('.btn-primary').html('Save')
55
-
56
- @model.set(previousAttributes, {silent: true})
57
- errors = Errors.fromResponse(response)
58
- if errors.missingCredentials or errors.invalidCredentials
59
- App.promptForCredentialsTo('Unfuddle')
60
- errors.renderToAlert()
61
- @
62
-
63
- changeVerdict: (e)->
64
- verdict = @$el.find(':radio[name="verdict"]:checked').val() || 'none'
65
- @$el.attr('class', "testing-note by-tester #{verdict}")
66
-
67
- cancel: (e)->
68
- if e
69
- e.preventDefault()
70
- e.stopImmediatePropagation()
71
- if @isInEditMode
72
- @$el.attr('class', "testing-note #{@model.get('verdict')}")
73
- @isInEditMode = false
74
- @render()
75
- @trigger('edit:cancel', @)
76
- @
77
-
78
- destroy: (e)->
79
- if e
80
- e.preventDefault()
81
- e.stopImmediatePropagation()
82
- @model.destroy
83
- success: =>
84
- @trigger('destroy', @, @model)
85
- @
@@ -1,29 +0,0 @@
1
- class window.TestingReportView extends Backbone.View
2
-
3
- initialize: ->
4
- @tickets = @options.tickets
5
- @projectsCanCloseTicketsFor = @options.projectsCanCloseTicketsFor
6
- @tickets.bind 'reset', _.bind(@render, @)
7
- @expander = new TableRowExpander()
8
-
9
- # Prevent tablesorter from exhuming buried rows
10
- @tickets.bind 'destroy', (ticket)=>
11
- $('table.testing-report-table').trigger('update')
12
-
13
- @render()
14
-
15
- render: ->
16
- @$el.empty()
17
- views = @tickets.map (ticket)=>
18
- view = new TestingTicketView
19
- ticket: ticket
20
- canClose: _.include(@projectsCanCloseTicketsFor, ticket.get('projectId'))
21
- @$el.appendView view
22
- view
23
-
24
- @expander.setupForViews views
25
-
26
- $("[data-tester-id=#{window.userId}]").addClass('current-tester') if window.userId
27
-
28
- $('table.testing-report-table').tablesorter
29
- headers: {'4': {sorter: 'text'}}