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,69 @@
1
+ <% content_for :title do %>
2
+ <h1 class="project-banner space-below">
3
+ Actions
4
+ </h1>
5
+ <% end %>
6
+
7
+ <% if $scheduler %>
8
+ <p><b>Status:</b> <%= $scheduler.up? ? "Up (Started #{format_time $scheduler.started_at})".html_safe : "Down" %></p>
9
+ <% else %>
10
+ <p><b>Status:</b> Unavailable</p>
11
+ <% end %>
12
+
13
+ <div class="nomargin">
14
+ <table id="actions" class="table table-sortable table-striped">
15
+ <thead>
16
+ <tr>
17
+ <td class="table-margin"></td>
18
+ <th class="action-name">Name</th>
19
+ <th class="action-last">Last Run</th>
20
+ <th class="action-reliability">Reliability</th>
21
+ <th class="action-duration">Duration</th>
22
+ <!--<td class="action-run-now"></td>-->
23
+ <td class="table-margin"></td>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <% @actions.each do |action| %>
28
+ <tr class="action">
29
+ <td class="table-margin"></td>
30
+ <td class="action-name"><%= link_to action[:name], action_path(slug: action[:name]) %></td>
31
+ <% if action[:last] %>
32
+ <td class="action-last" data-timestamp="<%= action[:last].started_at.iso8601 %>">
33
+ <%= format_time action[:last].started_at, today: false %>
34
+ <%= format_action_state action[:last] %>
35
+ </td>
36
+ <td class="action-reliability">
37
+ <%= number_to_percentage 100.0 * action[:successful_runs].to_f / action[:runs], precision: 1 %>
38
+ <span class="action-success-rate">/<%= action[:runs] %></span>
39
+ </td>
40
+ <td class="action-duration" data-position="<%= action[:avg_duration] %>"><%= format_duration action[:avg_duration] %></td>
41
+ <% else %>
42
+ <td class="action-last">&mdash;</td>
43
+ <td class="action-reliability">&mdash;</td>
44
+ <td class="action-duration">&mdash;</td>
45
+ <% end %>
46
+ <!--<td class="action-run-now">
47
+ <%= button_to "Run now", run_action_path(slug: action[:name]), :class => "btn btn-default" %>
48
+ </td>-->
49
+ <td class="table-margin"></td>
50
+ </tr>
51
+ <% end %>
52
+ </tbody>
53
+ </table>
54
+ </div>
55
+
56
+
57
+ <% content_for :javascripts do %>
58
+ <script type="text/javascript">
59
+ $(function() {
60
+ $('#actions').tablesorter({
61
+ headers: {
62
+ 2: { sorter: 'timestamp' },
63
+ 3: { sorter: 'percent' },
64
+ 4: { sorter: 'property' }
65
+ }
66
+ });
67
+ });
68
+ </script>
69
+ <% end %>
@@ -0,0 +1,45 @@
1
+ <% content_for :title do %>
2
+ <h1 class="project-banner space-below">
3
+ <%= link_to "Actions", actions_path %>
4
+ <small><%= @action_name %></small>
5
+ </h1>
6
+ <% end %>
7
+
8
+ <div class="nomargin">
9
+ <table id="actions" class="table table-sortable table-striped">
10
+ <thead>
11
+ <tr>
12
+ <td class="table-margin"></td>
13
+ <th class="action-time">Time</th>
14
+ <th class="action-duration">Duration</th>
15
+ <th class="action-trigger">Trigger</th>
16
+ <th class="action-params">Params</th>
17
+ <th class="action-succeded">Succeeded</th>
18
+ <th class="action-exception">Exception</th>
19
+ <td class="table-margin"></td>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <% @actions.each do |action| %>
24
+ <tr class="action">
25
+ <td class="table-margin"></td>
26
+ <td class="action-time"><%= format_time action.started_at %></td>
27
+ <td class="action-duration"><%= format_duration action.duration %></td>
28
+ <td class="action-trigger"><%= action.trigger %></td>
29
+ <td class="action-params"><%= format_action_params action.params %></td>
30
+ <td class="action-succeded"><%= format_action_state action %></td>
31
+ <td class="action-exception"><%= action.error.message if action.error %><td>
32
+ <td class="table-margin"></td>
33
+ </tr>
34
+ <% end %>
35
+ </tbody>
36
+ </table>
37
+ </div>
38
+
39
+ <% content_for :javascripts do %>
40
+ <script type="text/javascript">
41
+ $(function() {
42
+ $('#actions').tablesorter();
43
+ });
44
+ </script>
45
+ <% end %>
@@ -12,25 +12,25 @@
12
12
  <%= gravatar_image @commit.committer_email, size: 96 %>
13
13
  <h2><%= @commit.summary %></h2>
14
14
  <h4><%= @commit.description %></h4>
15
-
15
+
16
16
  <div class="-houston-changelog">
17
17
  <% if @commit.releases.any? %>
18
18
  <% @commit.releases.each do |release| %>
19
-
19
+
20
20
  <div class="-houston-changelog-day">
21
21
  <h4><%= format_release_date(date = release.date) %></h4>
22
22
  </div>
23
-
23
+
24
24
  <%= div_for(release) do %>
25
25
  <p class="release-header">
26
26
  <%= release.released_at.strftime("%l:%M %p") %>&nbsp;&nbsp;
27
27
  <%= link_to "details &rarr;".html_safe, release_url(release) %>
28
-
28
+
29
29
  <% if can?(:read, @project.commits.build) %>
30
30
  <span class="commit-range"><%= link_to_release_commit_range(release) %></span>
31
31
  <% end %>
32
32
  </p>
33
-
33
+
34
34
  <% if release.release_changes.any? %>
35
35
  <div class="release-changes">
36
36
  <% ordered_by_tag(release.release_changes).each do |change| %>
@@ -46,12 +46,11 @@
46
46
  <div class="release-no-changes">No changes</div>
47
47
  <% end %>
48
48
  <% end %>
49
-
49
+
50
50
  <% end %>
51
51
  <% else %>
52
52
  <p>This commit has not been released</p>
53
53
  <% end %>
54
54
  </div>
55
-
56
- </div>
57
55
 
56
+ </div>
@@ -0,0 +1,11 @@
1
+ <% @actions.each do |action| %>
2
+ <tr class="action-error" data-timestamp="<%= action.finished_at.iso8601 %>">
3
+ <td class="table-margin"></td>
4
+ <td class="action-time"><%= format_time action.finished_at %></td>
5
+ <td class="action-name"><%= link_to action[:name], action_path(slug: action[:name]) %></td>
6
+ <td class="action-trigger"><%= action.trigger %></td>
7
+ <td class="action-params"><%# format_action_params action.params %></td>
8
+ <td class="action-error-message"><%= action.error.message %></td>
9
+ <td class="table-margin"></td>
10
+ </tr>
11
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <% content_for :title do %>
2
+ <h1 class="project-banner space-below">
3
+ Errors
4
+ </h1>
5
+ <% end %>
6
+
7
+ <div class="nomargin">
8
+ <table id="errors" class="table table-sortable table-striped">
9
+ <thead>
10
+ <tr>
11
+ <td class="table-margin"></td>
12
+ <th class="action-time">Time</th>
13
+ <th class="action-name">Action</th>
14
+ <th class="action-trigger">Trigger</th>
15
+ <th class="action-params">Params</th>
16
+ <th class="action-error-message">Message</th>
17
+ <td class="table-margin"></td>
18
+ </tr>
19
+ </thead>
20
+ <tbody class="infinite-scroll">
21
+ <%= render "errors/actions" %>
22
+ </tbody>
23
+ </table>
24
+ </div>
25
+
26
+
27
+ <% content_for :javascripts do %>
28
+ <script type="text/javascript">
29
+ $(function() {
30
+ $('#triggers').tablesorter();
31
+ });
32
+ new InfiniteScroll({
33
+ load: function($tbody) {
34
+ var timestamp = $tbody.find('.action-error:last').attr('data-timestamp');
35
+ return $.get(window.location.pathname, {before: timestamp});
36
+ }
37
+ });
38
+ </script>
39
+ <% end %>
@@ -29,14 +29,6 @@
29
29
  <%= render_nav_link "Projects", main_app.projects_path, icon: "fa-database" %>
30
30
  <% end -%>
31
31
 
32
- <% if can?(:read, User) -%>
33
- <%= render_nav_link "Team", main_app.users_path, icon: "fa-user" %>
34
- <% end -%>
35
-
36
- <% if can?(:read, :job) -%>
37
- <%= render_nav_link "Jobs", main_app.jobs_path, icon: "fa-user" %>
38
- <% end -%>
39
-
40
32
  </ul>
41
33
  </div>
42
34
 
@@ -59,7 +51,7 @@
59
51
  <% path = if !current_feature
60
52
  # we're not on a project page,
61
53
  # just refresh the page and set the project
62
- "?project=#{project.slug}"
54
+ "?project=#{project.slug}"
63
55
  elsif !project.features.include?(current_feature)
64
56
  # we're using a feature that this project
65
57
  # doesn't support. Navigate to the root URL
@@ -4,6 +4,20 @@
4
4
 
5
5
  <ul class="nav pull-right">
6
6
  <% if current_user -%>
7
+
8
+ <% if current_user.administrator? %>
9
+ <li class="dropdown">
10
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> <b class="caret"></b></a>
11
+ <ul class="dropdown-menu">
12
+ <li><%= link_to "Users", main_app.users_path %></li>
13
+ <li><%= link_to "Actions", main_app.actions_path %></li>
14
+ <li><%= link_to "Triggers", main_app.triggers_path %></li>
15
+ <li><%= link_to "Errors", main_app.errors_path %></li>
16
+ </ul>
17
+ </li>
18
+ <% end %>
19
+
20
+
7
21
  <li class="current-user dropdown">
8
22
  <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= avatar_for(current_user, size: 30) %> <b class="caret"></b></a>
9
23
  <ul class="dropdown-menu">
@@ -25,14 +39,6 @@
25
39
  <%= render_nav_link "Projects", main_app.projects_path, icon: "fa-archive" %>
26
40
  <% end -%>
27
41
 
28
- <% if can?(:read, User) -%>
29
- <%= render_nav_link "Team", main_app.users_path, icon: "fa-user" %>
30
- <% end -%>
31
-
32
- <% if can?(:read, :job) -%>
33
- <%= render_nav_link "Jobs", main_app.jobs_path, icon: "fa-gear" %>
34
- <% end -%>
35
-
36
42
  </ul>
37
43
  </div>
38
44
  </div>
@@ -64,9 +64,7 @@
64
64
  <%= javascript_include_tag "houston/vendor" %>
65
65
  <%= javascript_include_tag "houston/application" %>
66
66
  <script type="text/javascript">
67
- $(function(){
68
- window.testers = new Testers(<%= raw TesterPresenter.new(User.testers.unretired).to_json %>);
69
-
67
+ $(function() {
70
68
  <% if flash[:alert] %>
71
69
  alertify.log(<%=raw flash[:alert].to_json %>);
72
70
  <% end %>
@@ -1,3 +1,13 @@
1
+ <% content_for :meta do %>
2
+ <%= link_to_oembed test_run_url(slug: @test_run.project.slug, commit: @test_run.sha) %>
3
+ <%= tag "meta", property: "og:type", content: "website" %>
4
+ <%= tag "meta", property: "og:site_name", content: "Houston" %>
5
+ <%= tag "meta", property: "og:title", content: @test_run.summary %>
6
+ <%= tag "meta", property: "og:description", content: @test_run.short_description(with_duration: true) %>
7
+ <%= tag "meta", property: "og:url", content: test_run_url(slug: @test_run.project.slug, commit: @test_run.sha) %>
8
+ <% end %>
9
+
10
+
1
11
  <h1 class="project-banner <%= @project.color %>" style="margin-bottom: 12px;">
2
12
  <small>Test Results for</small> <%= @project.name %>
3
13
  </h1>
@@ -13,12 +23,12 @@
13
23
  <span class="score-count"><%= (@test_run.duration / 1000.0).round(2) %><span class="unit">s</span></span>
14
24
  <span class="score-label">Duration</span>
15
25
  </p>
16
-
26
+
17
27
  <p class="test-coverage">
18
28
  <span class="score-count"><%= (@test_run.covered_percent * 100.0).round(1) %><span class="unit">%</span></span>
19
29
  <span class="score-label">Coverage</span>
20
30
  </p>
21
-
31
+
22
32
  <% if @test_run.real_fail_count.zero? %>
23
33
  <p class="test-coverage">
24
34
  <span class="score-count"><%= @test_run.total_count %></span>
@@ -40,7 +50,7 @@
40
50
  <td class="test-result-graph">
41
51
  <% stats = TestRunStatistics.new(@project) %>
42
52
  <% runs, width, height = 15, 188, 75 %>
43
-
53
+
44
54
  <%= area_graph(
45
55
  data: stats.tests(runs),
46
56
  colors: ["FFFFFF", "AA0000", "E24E32", "5DB64C"],
@@ -91,6 +91,19 @@
91
91
  </div>
92
92
  </div>
93
93
 
94
+ <%= f.fields_for :props do |f| %>
95
+ <% Houston.project_options.each do |form| %>
96
+ <hr />
97
+
98
+ <div class="control-group">
99
+ <label class="control-label"><%= form.name %></label>
100
+ <div class="controls">
101
+ <%= form.render(self, f) %>
102
+ </div>
103
+ </div>
104
+ <% end %>
105
+ <% end %>
106
+
94
107
  <hr />
95
108
 
96
109
  <div class="control-group">
@@ -103,13 +116,6 @@
103
116
  </div>
104
117
  </div>
105
118
 
106
- <div class="control-group">
107
- <%= f.label :min_passing_verdicts, "Min. Passing Verdicts", :class => "control-label" %>
108
- <div class="controls">
109
- <%= f.text_field :min_passing_verdicts, :class => "text_field" %>
110
- </div>
111
- </div>
112
-
113
119
  <div class="form-actions">
114
120
  <%= f.submit nil, :class => "btn btn-primary" %>
115
121
  <%= link_to "Cancel", projects_path, :class => "btn" %>
@@ -0,0 +1,39 @@
1
+ <% content_for :title do %>
2
+ <h1 class="project-banner space-below">
3
+ Triggers
4
+ </h1>
5
+ <% end %>
6
+
7
+ <div class="nomargin">
8
+ <table id="triggers" class="table table-sortable table-striped">
9
+ <thead>
10
+ <tr>
11
+ <td class="table-margin"></td>
12
+ <th class="trigger-type">Type</th>
13
+ <th class="trigger-value">Value</th>
14
+ <th class="trigger-action">Action</th>
15
+ <td class="table-margin"></td>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% @triggers.each do |trigger| %>
20
+ <tr class="trigger">
21
+ <td class="table-margin"></td>
22
+ <td class="trigger-type"><%= trigger.method_name %></td>
23
+ <td class="trigger-value"><%= trigger.value %></td>
24
+ <td class="trigger-action"><%= link_to trigger.action, action_path(slug: trigger.action) %></td>
25
+ <td class="table-margin"></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
30
+ </div>
31
+
32
+
33
+ <% content_for :javascripts do %>
34
+ <script type="text/javascript">
35
+ $(function() {
36
+ $('#triggers').tablesorter();
37
+ });
38
+ </script>
39
+ <% end %>
@@ -26,12 +26,6 @@ Houston.add_project_feature :bugs do
26
26
  ability { |ability, project| ability.can?(:read, project.tickets.build) }
27
27
  end
28
28
 
29
- Houston.add_project_feature :testing do
30
- name "Testing"
31
- icon "fa-comments"
32
- path { |project| Houston::Application.routes.url_helpers.project_testing_report_path(project) }
33
- end
34
-
35
29
  Houston.add_project_feature :releases do
36
30
  name "Releases"
37
31
  icon "fa-paper-plane"
@@ -1,7 +1,8 @@
1
1
  module Houston
2
2
 
3
3
  # Rescues exceptions and reports them
4
- def self.async
4
+ def self.async(do_async=true)
5
+ return yield unless do_async
5
6
  Thread.new do
6
7
  ActiveRecord::Base.connection_pool.with_connection do
7
8
  begin
@@ -16,7 +17,8 @@ module Houston
16
17
  end
17
18
 
18
19
  # Allows exceptions to bubble up
19
- def self.async!
20
+ def self.async!(do_async=true)
21
+ return yield unless do_async
20
22
  Thread.new do
21
23
  ActiveRecord::Base.connection_pool.with_connection do
22
24
  begin
@@ -0,0 +1,6 @@
1
+ require "rufus/scheduler"
2
+
3
+ Houston.daemonize "scheduler" do
4
+ $scheduler = Rufus::Scheduler.new
5
+ $scheduler.join
6
+ end
@@ -0,0 +1,7 @@
1
+ Rails.configuration.after_initialize do
2
+ if ActiveRecord::Base.connection.table_exists? "persistent_triggers"
3
+ PersistentTrigger.load_all
4
+ else
5
+ Rails.logger.info "\e[94mSkipping PersistentTrigger.load_all since the table doesn't exist\e[0m"
6
+ end
7
+ end
@@ -1,5 +1,6 @@
1
1
  require "core_ext/duration"
2
2
  require "core_ext/array"
3
3
  require "parallel_enumerable"
4
- require "unexpected_response"
4
+ require "params_serializer"
5
5
  require "pg_search"
6
+ require "unexpected_response"
@@ -1,3 +1,3 @@
1
- Houston.observer.on "hooks:post_receive" do |project, params|
2
- project.commits.sync!
1
+ Houston.observer.on "hooks:project:post_receive" do |e|
2
+ e.project.commits.sync!
3
3
  end
data/config/routes.rb CHANGED
@@ -13,19 +13,9 @@ Rails.application.routes.draw do
13
13
 
14
14
 
15
15
 
16
- # Testing Report
17
-
18
- get "testing_report" => "testing_report#index", :as => :testing_report
19
- get "testing_report/:slug" => "testing_report#show", :as => :project_testing_report
20
-
21
- scope "tickets/:ticket_id" do
22
- resources :testing_notes
23
- end
24
-
25
-
26
-
27
16
  # Test Runs
28
17
 
18
+ get "test_runs/:commit", to: "test_runs#show"
29
19
  get "projects/:slug/test_runs/:commit", to: "test_runs#show", :as => :test_run
30
20
  get "projects/:slug/test_runs/:commit/retry", to: "test_runs#confirm_retry", :as => :retry_test_run
31
21
  post "projects/:slug/test_runs/:commit/retry", to: "test_runs#retry"
@@ -244,11 +234,23 @@ Rails.application.routes.draw do
244
234
 
245
235
 
246
236
 
247
- # Jobs
237
+ # Actions
238
+
239
+ get "actions", to: "actions#index", as: :actions
240
+ get "actions/:slug", to: "actions#show", as: :action, constraints: { slug: /[^\/]+/ }
241
+ post "actions/:slug", to: "actions#run", as: :run_action, constraints: { slug: /[^\/]+/ }
242
+
243
+
244
+
245
+ # Triggers
246
+
247
+ get "triggers", to: "triggers#index", as: :triggers
248
+
249
+
250
+
251
+ # Errors
248
252
 
249
- get "jobs", to: "jobs#index", as: :jobs
250
- get "jobs/:slug", to: "jobs#show", as: :job, constraints: { slug: /[^\/]+/ }
251
- post "jobs/:slug", to: "jobs#run", as: :run_job, constraints: { slug: /[^\/]+/ }
253
+ get "errors", to: "errors#index", as: :errors
252
254
 
253
255
 
254
256
 
@@ -0,0 +1,5 @@
1
+ class RenameJobsToActions < ActiveRecord::Migration
2
+ def change
3
+ rename_table :jobs, :actions
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddTriggerAndParamsToActions < ActiveRecord::Migration
2
+ def change
3
+ add_column :actions, :trigger, :string
4
+ add_column :actions, :params, :text
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePersistentTriggers < ActiveRecord::Migration
2
+ def change
3
+ create_table :persistent_triggers do |t|
4
+ t.string :type, null: false
5
+ t.text :value, null: false
6
+ t.text :params, null: false, default: "{}"
7
+ t.string :action, null: false
8
+ end
9
+ end
10
+ end