houston-core 0.6.3 → 0.7.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +53 -63
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter.rb +2 -2
- data/app/adapters/houston/adapters/ticket_tracker/github_adapter.rb +1 -1
- data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter.rb +5 -5
- data/app/adapters/houston/adapters/version_control/git_adapter.rb +4 -4
- data/app/assets/javascripts/{app → houston/app}/boot.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/emoji.coffee.erb +0 -0
- data/app/assets/javascripts/{app → houston/app}/infinite_scroll.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/commit.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/release.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/task.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/tester.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/testing_note.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/ticket.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/models/user.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/mousetrap-bind-scoped.js +0 -0
- data/app/assets/javascripts/{app → houston/app}/releases.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/table_row_expander.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/ticket_tracker_refresh.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/_show_sprint_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/_tickets_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/all_tickets_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/commit_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/edit_sprint_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/edit_ticket_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/find_or_create_ticket_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/keyboard_shortcuts_modal.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/new_ticket_modal.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/new_ticket_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/problems_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/testing_note_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/testing_report_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/testing_ticket_view.coffee +0 -0
- data/app/assets/javascripts/{app → houston/app}/views/ticket_modal_view.coffee +0 -0
- data/app/assets/javascripts/{application.js → houston/application.js} +1 -1
- data/app/assets/javascripts/{core → houston/core}/app.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/burndown_chart.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/core_ext/array.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/core_ext/date.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/core_ext/number.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/errors.coffee +1 -1
- data/app/assets/javascripts/{core → houston/core}/handlebars_helpers.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/helpers.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/jquery_extensions.coffee +5 -3
- data/app/assets/javascripts/{core → houston/core}/stacked_area_graph.coffee +0 -0
- data/app/assets/javascripts/{core → houston/core}/stacked_bar_graph.coffee +0 -0
- data/app/assets/javascripts/{dashboard.js → houston/dashboard.js} +1 -1
- data/app/assets/javascripts/{dashboard → houston/dashboard}/refresher.coffee +0 -0
- data/app/assets/javascripts/{vendor.js → houston/vendor.js} +0 -0
- data/app/assets/stylesheets/{application.css → houston/application.css} +0 -0
- data/app/assets/stylesheets/{application → houston/application}/ansi.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/commit.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/emoji.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/exceptions.scss +1 -1
- data/app/assets/stylesheets/{application → houston/application}/find_or_create_ticket.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/follow_up.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/forms.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/freight_train.css.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/full_screen.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/github_repos.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/infinite_scroll.scss +0 -0
- data/app/assets/stylesheets/houston/application/jobs.scss +5 -0
- data/app/assets/stylesheets/{application → houston/application}/keyboard_shortcuts.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/markdown.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/mobile.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/modals.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/navigation.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/new_ticket_view.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/omnibar.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/project_banner_buttons.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/project_tiles.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/projects.css.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/pull_requests.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/queue.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/release_form.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/releases.scss +1 -1
- data/app/assets/stylesheets/{application → houston/application}/sortable_table.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/sprint.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/tables.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/test.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/test_run.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/testing_report.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/ticket.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/ticket_modal.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/tickets.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/timeline.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/tips.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/typeahead.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/uploading.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/user_wall.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/users.scss +0 -0
- data/app/assets/stylesheets/{application → houston/application}/welcome.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/alerts.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/avatars.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/burndown_chart.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/colors.scss.erb +0 -0
- data/app/assets/stylesheets/{core → houston/core}/misc.scss +3 -0
- data/app/assets/stylesheets/{core → houston/core}/octicons-icons.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/octicons.scss.erb +0 -0
- data/app/assets/stylesheets/{core → houston/core}/overrides.scss +0 -0
- data/app/assets/stylesheets/{core → houston/core}/roboto.scss.erb +0 -0
- data/app/assets/stylesheets/{core → houston/core}/scores.scss +0 -0
- data/app/assets/stylesheets/{dashboard.css → houston/dashboard.css} +0 -0
- data/app/assets/stylesheets/{dashboard → houston/dashboard}/dashboard.scss +0 -0
- data/app/assets/stylesheets/{print.css.scss → houston/print.css.scss} +0 -0
- data/app/assets/stylesheets/{variables.scss → houston/variables.scss} +0 -0
- data/app/assets/stylesheets/{vendor.css → houston/vendor.css} +0 -0
- data/app/concerns/houston/props.rb +96 -0
- data/app/concerns/project_adapter.rb +1 -1
- data/app/controllers/api/v1/measurements_controller.rb +32 -0
- data/app/controllers/application_controller.rb +1 -1
- data/app/controllers/authorizations_controller.rb +61 -0
- data/app/controllers/github/pulls_controller.rb +1 -1
- data/app/controllers/jobs_controller.rb +30 -1
- data/app/controllers/oauth/providers_controller.rb +45 -0
- data/app/controllers/project_options_controller.rb +2 -2
- data/app/controllers/projects_controller.rb +3 -3
- data/app/controllers/releases_controller.rb +3 -3
- data/app/controllers/user_options_controller.rb +2 -2
- data/app/controllers/users_controller.rb +1 -2
- data/app/helpers/application_helper.rb +49 -3
- data/app/helpers/email_helper.rb +19 -1
- data/app/helpers/release_helper.rb +1 -1
- data/app/helpers/ticket_helper.rb +0 -32
- data/app/interactors/cache_key_dependencies.rb +3 -8
- data/app/mailers/view_mailer.rb +8 -8
- data/app/models/authorization.rb +54 -0
- data/app/models/commit.rb +1 -1
- data/app/models/error.rb +14 -0
- data/app/models/github/comment_event.rb +4 -4
- data/app/models/github/pull_request.rb +39 -17
- data/app/models/github/pull_request_event.rb +1 -7
- data/app/models/job.rb +81 -0
- data/app/models/measurement.rb +2 -1
- data/app/models/oauth/provider.rb +35 -0
- data/app/models/project.rb +12 -3
- data/app/models/slackdown.rb +1 -1
- data/app/models/user.rb +28 -35
- data/app/presenters/measurements_presenter.rb +26 -0
- data/app/presenters/project_presenter.rb +1 -1
- data/app/views/authorizations/_form.html.erb +33 -0
- data/app/views/authorizations/edit.html.erb +7 -0
- data/app/views/authorizations/granted.html.erb +7 -0
- data/app/views/authorizations/index.html.erb +47 -0
- data/app/views/authorizations/new.html.erb +7 -0
- data/app/views/configuration_error/_no_ticket_tracker.html.erb +1 -1
- data/app/views/github/pulls/index.html.erb +5 -1
- data/app/views/jobs/index.html.erb +72 -0
- data/app/views/jobs/show.html.erb +25 -32
- data/app/views/layouts/_navigation.html.erb +1 -1
- data/app/views/layouts/application.html.erb +14 -15
- data/app/views/layouts/dashboard.html.erb +9 -10
- data/app/views/layouts/minimal.html.erb +14 -15
- data/app/views/layouts/naked.html.erb +52 -0
- data/app/views/layouts/naked_dashboard.html.erb +9 -10
- data/app/views/oauth/providers/_form.html.erb +54 -0
- data/app/views/oauth/providers/edit.html.erb +7 -0
- data/app/views/oauth/providers/index.html.erb +41 -0
- data/app/views/oauth/providers/new.html.erb +7 -0
- data/app/views/projects/_form.html.erb +8 -9
- data/app/views/projects/index.html.erb +1 -1
- data/app/views/users/_form.html.erb +20 -19
- data/bin/rails +1 -1
- data/config/application.rb +11 -10
- data/config/boot.rb +1 -2
- data/config/environments/development.rb +8 -6
- data/config/environments/production.rb +11 -16
- data/config/environments/test.rb +5 -5
- data/config/initializers/assets.rb +17 -7
- data/config/initializers/cookies_serializer.rb +1 -1
- data/config/initializers/houston_async.rb +22 -4
- data/config/initializers/houston_report_exception.rb +16 -11
- data/config/initializers/houston_scheduler.rb +1 -1
- data/config/initializers/houston_try.rb +12 -0
- data/config/routes.rb +29 -19
- data/db/fixtures/projects.yml +2 -2
- data/db/migrate/20160317140151_remove_limit_from_users_invitation_token.rb +9 -0
- data/db/migrate/20160419230411_create_oauth_providers.rb +14 -0
- data/db/migrate/20160420000616_create_authorizations.rb +16 -0
- data/db/migrate/20160507135209_create_jobs.rb +14 -0
- data/db/migrate/20160507135846_create_errors_2.rb +12 -0
- data/db/migrate/20160510233329_add_closed_at_and_merged_at_to_pull_requests.rb +7 -0
- data/db/migrate/20160625203412_convert_user_view_options_to_props.rb +21 -0
- data/db/migrate/20160625221840_convert_project_extended_attributes_to_props.rb +32 -0
- data/db/migrate/20160625230420_move_users_unfuddle_id_to_props.rb +14 -0
- data/db/structure.sql +247 -4
- data/{houston.gemspec → houston-core.gemspec} +8 -9
- data/lib/configuration.rb +15 -43
- data/lib/houston/version.rb +1 -1
- data/lib/houston_observer.rb +2 -7
- data/lib/parallel_enumerable.rb +2 -8
- data/templates/new-instance/app/assets/javascripts/.keep +0 -0
- data/templates/new-instance/app/assets/javascripts/application.js +13 -0
- data/templates/new-instance/app/assets/stylesheets/.keep +0 -0
- data/templates/new-instance/app/assets/stylesheets/application.css +13 -0
- data/templates/new-instance/app/controllers/.keep +0 -0
- data/templates/new-instance/app/models/.keep +0 -0
- data/templates/new-instance/app/views/.keep +0 -0
- data/templates/new-instance/config/alerts/errs.rb +1 -1
- data/templates/new-instance/config/jobs/purge_jobs.rb +3 -0
- data/templates/new-instance/config/main.rb +1 -0
- data/templates/new-instance/config/routes.rb +5 -0
- data/templates/new-instance/config/triggers/github/publish_comments_on_slack.rb +3 -3
- data/templates/new-instance/lib/houston/engine.rb +25 -0
- data/test/acceptance/creating_a_release_test.rb +1 -1
- data/test/integration/ci_integration_test.rb +2 -2
- data/test/integration/commits_api_test.rb +1 -1
- data/test/unit/controllers/hooks_controller_test.rb +1 -6
- data/test/unit/controllers/project_options_controller_test.rb +11 -11
- data/test/unit/controllers/user_options_controller_test.rb +13 -13
- data/test/unit/models/code_climate_coverage_report_test.rb +1 -1
- data/test/unit/models/commit_test.rb +4 -2
- data/test/unit/models/project_test.rb +5 -5
- data/test/unit/models/props_test.rb +57 -0
- data/test/unit/models/pull_request_test.rb +2 -2
- data/test/unit/models/test_run_test.rb +1 -1
- metadata +166 -151
- data/app/assets/javascripts/app/views/reports_view.coffee +0 -51
- data/app/controllers/oauth_consumers_controller.rb +0 -68
- data/app/controllers/reports_controller.rb +0 -215
- data/app/models/consumer_token.rb +0 -13
- data/app/models/github_token.rb +0 -8
- data/app/views/oauth_consumers/error.html.erb +0 -5
- data/app/views/oauth_consumers/index.html.erb +0 -29
- data/app/views/oauth_consumers/show.html.erb +0 -7
- data/app/views/reports/index.html.erb +0 -9
- data/app/views/reports/sprint.html.erb +0 -21
- data/app/views/reports/velocity.html.erb +0 -104
- data/config/initializers/oauth_consumers.rb +0 -18
- data/lib/patches/sprockets_output_path_for_assets.rb +0 -29
@@ -16,11 +16,13 @@ Rails.application.configure do
|
|
16
16
|
|
17
17
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
18
|
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
-
# For large-scale production use, consider using a caching reverse proxy like
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
20
21
|
# config.action_dispatch.rack_cache = true
|
21
22
|
|
22
|
-
# Disable
|
23
|
-
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
24
26
|
|
25
27
|
# Compress JavaScripts and CSS.
|
26
28
|
config.assets.js_compressor = :uglifier
|
@@ -29,15 +31,15 @@ Rails.application.configure do
|
|
29
31
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
32
|
config.assets.compile = false
|
31
33
|
|
32
|
-
#
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
33
36
|
config.assets.digest = true
|
34
37
|
|
35
|
-
#
|
36
|
-
config.assets.version = '1.0'
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
37
39
|
|
38
40
|
# Specifies the header that your server uses for sending files.
|
39
|
-
# config.action_dispatch.x_sendfile_header =
|
40
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
41
43
|
|
42
44
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
45
|
# config.force_ssl = true
|
@@ -55,11 +57,7 @@ Rails.application.configure do
|
|
55
57
|
# config.cache_store = :mem_cache_store
|
56
58
|
|
57
59
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
-
# config.action_controller.asset_host =
|
59
|
-
|
60
|
-
# Precompile additional assets.
|
61
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
-
# config.assets.precompile += %w( search.js )
|
60
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
63
61
|
|
64
62
|
# Ignore bad email addresses and do not raise email delivery errors.
|
65
63
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
@@ -72,9 +70,6 @@ Rails.application.configure do
|
|
72
70
|
# Send deprecation notices to registered listeners.
|
73
71
|
config.active_support.deprecation = :notify
|
74
72
|
|
75
|
-
# Disable automatic flushing of the log to improve performance.
|
76
|
-
# config.autoflush_log = false
|
77
|
-
|
78
73
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
74
|
config.log_formatter = ::Logger::Formatter.new
|
80
75
|
|
data/config/environments/test.rb
CHANGED
@@ -12,8 +12,8 @@ Rails.application.configure do
|
|
12
12
|
# preloads Rails for running tests, you may have to set it to true.
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
|
-
# Configure static
|
16
|
-
config.serve_static_files
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
17
|
config.static_cache_control = 'public, max-age=3600'
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
@@ -31,6 +31,9 @@ Rails.application.configure do
|
|
31
31
|
# ActionMailer::Base.deliveries array.
|
32
32
|
config.action_mailer.delivery_method = :test
|
33
33
|
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
36
|
+
|
34
37
|
# Print deprecation notices to the stderr.
|
35
38
|
config.active_support.deprecation = :stderr
|
36
39
|
|
@@ -42,7 +45,4 @@ Rails.application.configure do
|
|
42
45
|
|
43
46
|
# Do not dump schema after migrations.
|
44
47
|
config.active_record.dump_schema_after_migration = false
|
45
|
-
|
46
|
-
# Specify test order
|
47
|
-
config.active_support.test_order = :random
|
48
48
|
end
|
@@ -1,9 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
dashboard.js
|
6
|
-
dashboard.css
|
7
|
-
}
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = "1.0"
|
8
5
|
|
6
|
+
# Add additional assets to the asset load path
|
9
7
|
Rails.application.config.assets.paths << Rails.root.join("app", "assets", "fonts")
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
+
Rails.application.config.assets.precompile += %w{
|
12
|
+
houston/application.js
|
13
|
+
houston/application.css
|
14
|
+
houston/print.css
|
15
|
+
houston/vendor.js
|
16
|
+
houston/vendor.css
|
17
|
+
houston/dashboard.js
|
18
|
+
houston/dashboard.css
|
19
|
+
}
|
@@ -1,11 +1,29 @@
|
|
1
1
|
module Houston
|
2
2
|
|
3
|
+
# Rescues exceptions and reports them
|
3
4
|
def self.async
|
4
5
|
Thread.new do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
ActiveRecord::Base.connection_pool.with_connection do
|
7
|
+
begin
|
8
|
+
yield
|
9
|
+
rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
|
10
|
+
Houston.report_exception($!)
|
11
|
+
ensure
|
12
|
+
Rails.logger.flush # http://stackoverflow.com/a/3516003/731300
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Allows exceptions to bubble up
|
19
|
+
def self.async!
|
20
|
+
Thread.new do
|
21
|
+
ActiveRecord::Base.connection_pool.with_connection do
|
22
|
+
begin
|
23
|
+
yield
|
24
|
+
ensure
|
25
|
+
Rails.logger.flush # http://stackoverflow.com/a/3516003/731300
|
26
|
+
end
|
9
27
|
end
|
10
28
|
end
|
11
29
|
end
|
@@ -1,21 +1,26 @@
|
|
1
1
|
module Houston
|
2
2
|
|
3
3
|
def self.report_exception(exception, other_data={})
|
4
|
-
|
4
|
+
if Rails.env.test? || Rails.env.development?
|
5
|
+
Rails.logger.error "\e[31;1m#{exception.class}: #{exception.message}\n#{exception.backtrace.join("\n ")}\e[0m"
|
6
|
+
return
|
7
|
+
end
|
5
8
|
|
6
|
-
|
9
|
+
begin
|
10
|
+
Rails.logger.error "#{exception.class}: #{exception.message}\n#{exception.backtrace.join("\n ")}"
|
7
11
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
if defined?(Airbrake)
|
13
|
+
other_data[:parameters] ||= {}
|
14
|
+
case exception
|
15
|
+
when Faraday::HTTP::Error
|
16
|
+
other_data[:parameters].merge!(_normalize_faraday_env(exception.env))
|
17
|
+
end
|
18
|
+
other_data[:parameters].merge!(exception.additional_information)
|
19
|
+
Airbrake.notify(exception, other_data)
|
13
20
|
end
|
14
|
-
|
15
|
-
|
21
|
+
rescue Exception => e
|
22
|
+
Rails.logger.error "\e[31;1mAn error occurred reporting the exception: \e[0;31m#{e.class}: #{e.message}\n #{e.backtrace.join("\n ")}\e[0m"
|
16
23
|
end
|
17
|
-
rescue Exception => e
|
18
|
-
Rails.logger.error "\e[31;1mAn error occurred reporting the exception: \e[0;31m#{e.class}: #{e.message}\n #{e.backtrace.join("\n ")}\e[0m"
|
19
24
|
end
|
20
25
|
|
21
26
|
def self._normalize_faraday_env(env)
|
@@ -21,4 +21,16 @@ module Houston
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def self.reconnect(options={})
|
25
|
+
max_tries = options.fetch(:max_tries, 2)
|
26
|
+
tries = 1
|
27
|
+
begin
|
28
|
+
yield
|
29
|
+
rescue exceptions_wrapping(PG::ConnectionBad)
|
30
|
+
ActiveRecord::Base.connection.reconnect!
|
31
|
+
retry unless (tries += 1) > 2
|
32
|
+
raise
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
24
36
|
end
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,5 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
2
|
|
3
|
-
resources :oauth_consumers do
|
4
|
-
member do
|
5
|
-
get :callback
|
6
|
-
get :callback2
|
7
|
-
match 'client/*endpoint' => 'oauth_consumers#client', via: [:get, :post, :put, :delete]
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
3
|
devise_for :users, :controllers => { :sessions => "sessions" }
|
12
4
|
|
13
5
|
root to: "welcome#index", via: :get
|
@@ -205,6 +197,8 @@ Rails.application.routes.draw do
|
|
205
197
|
get "sprint/tasks/mine", to: "sprint_tasks#mine"
|
206
198
|
post "sprint/tasks/:project_slug/:shorthand", :to => "sprint_tasks#create"
|
207
199
|
delete "sprint/tasks/:project_slug/:shorthand", :to => "sprint_tasks#destroy"
|
200
|
+
|
201
|
+
get "measurements", to: "measurements#index"
|
208
202
|
end
|
209
203
|
end
|
210
204
|
|
@@ -232,12 +226,29 @@ Rails.application.routes.draw do
|
|
232
226
|
put "credentials", to: "user_credentials#upsert"
|
233
227
|
delete "credentials/:id", to: "user_credentials#destroy"
|
234
228
|
|
229
|
+
get "authorizations" => "authorizations#index", as: :authorizations
|
230
|
+
get "authorizations/new" => "authorizations#new", as: :new_authorization
|
231
|
+
post "authorizations" => "authorizations#create"
|
232
|
+
get "authorizations/:id/edit" => "authorizations#edit", as: :edit_authorization
|
233
|
+
patch "authorizations/:id" => "authorizations#update", as: :authorization
|
234
|
+
|
235
|
+
get "authorizations/:id/grant" => "authorizations#grant", as: :grant_authorization
|
236
|
+
get "authorizations/:id/granted" => "authorizations#granted", as: :authorization_granted
|
237
|
+
get "oauth2/callback" => "authorizations#oauth2_callback", as: :oauth2_callback
|
238
|
+
|
239
|
+
get "oauth/providers" => "oauth/providers#index", as: :oauth_providers
|
240
|
+
get "oauth/providers/new" => "oauth/providers#new", as: :new_oauth_provider
|
241
|
+
post "oauth/providers" => "oauth/providers#create"
|
242
|
+
get "oauth/providers/:id/edit" => "oauth/providers#edit", as: :edit_oauth_provider
|
243
|
+
patch "oauth/providers/:id" => "oauth/providers#update", as: :oauth_provider
|
244
|
+
|
235
245
|
|
236
246
|
|
237
247
|
# Jobs
|
238
248
|
|
239
|
-
get "jobs", to: "jobs#
|
240
|
-
|
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: /[^\/]+/ }
|
241
252
|
|
242
253
|
|
243
254
|
|
@@ -254,15 +265,6 @@ Rails.application.routes.draw do
|
|
254
265
|
# Other
|
255
266
|
|
256
267
|
# Experiments
|
257
|
-
get "reports", to: "reports#index"
|
258
|
-
%w{queue-age cycle-time time-to-first-test time-to-release}.each do |report|
|
259
|
-
get "reports/#{report}", to: "reports##{report.underscore}"
|
260
|
-
end
|
261
|
-
get "reports/velocity", to: "reports#velocity"
|
262
|
-
get "reports/tasks.xlsx", to: "reports#tasks_excel"
|
263
|
-
|
264
|
-
get "sprint/reports", to: "reports#sprint"
|
265
|
-
|
266
268
|
get "pulls", to: "github/pulls#index"
|
267
269
|
|
268
270
|
# Tester Bar
|
@@ -297,4 +299,12 @@ Rails.application.routes.draw do
|
|
297
299
|
mount mod.engine => "/"
|
298
300
|
end
|
299
301
|
|
302
|
+
|
303
|
+
|
304
|
+
# The Instance
|
305
|
+
|
306
|
+
if defined?(Houston::Engine)
|
307
|
+
mount Houston::Engine => "/"
|
308
|
+
end
|
309
|
+
|
300
310
|
end
|
data/db/fixtures/projects.yml
CHANGED
@@ -5,7 +5,7 @@ houston:
|
|
5
5
|
ticket_tracker_name: Github
|
6
6
|
version_control_name: Git
|
7
7
|
error_tracker_name: Errbit
|
8
|
-
|
8
|
+
props: '"github.repo" => "houston/houston", "git.location" => "<%= Rails.root %>", "errbit.appId" => "503638de8348fd1de9000004"'
|
9
9
|
|
10
10
|
tsatsiki:
|
11
11
|
name: Tsatsiki
|
@@ -18,4 +18,4 @@ test:
|
|
18
18
|
color: bark
|
19
19
|
ticket_tracker_name: Unfuddle
|
20
20
|
version_control_name: Git
|
21
|
-
|
21
|
+
props: '"unfuddle.projectId" => "20", "git.location" => "<%= File.expand_path("~/Code/test") %>"'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateOauthProviders < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :oauth_providers do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :site, null: false
|
6
|
+
t.string :authorize_path, null: false
|
7
|
+
t.string :token_path, null: false
|
8
|
+
t.string :client_id, null: false
|
9
|
+
t.string :client_secret, null: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateAuthorizations < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :authorizations do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.integer :provider_id
|
6
|
+
t.string :scope
|
7
|
+
t.string :access_token, length: 1024
|
8
|
+
t.string :refresh_token
|
9
|
+
t.string :secret
|
10
|
+
t.integer :expires_in
|
11
|
+
t.timestamp :expires_at
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateJobs < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :jobs do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.datetime :started_at, null: false
|
6
|
+
|
7
|
+
t.datetime :finished_at
|
8
|
+
t.boolean :succeeded
|
9
|
+
t.integer :error_id
|
10
|
+
|
11
|
+
t.index :name
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class ConvertUserViewOptionsToProps < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :users, :props, :jsonb, default: "{}"
|
4
|
+
|
5
|
+
require "progressbar"
|
6
|
+
users = User.all
|
7
|
+
pbar = ProgressBar.new("users", users.count)
|
8
|
+
users.find_each do |user|
|
9
|
+
props = user.read_attribute(:view_options) || {}
|
10
|
+
props["github.username"] = props.delete("github_username") if props.key?("github_username")
|
11
|
+
props["slack.username"] = props.delete("slack_username") if props.key?("slack_username")
|
12
|
+
user.update_column :props, props
|
13
|
+
pbar.inc
|
14
|
+
end
|
15
|
+
pbar.finish
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
remove_column :users, :props
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class ConvertProjectExtendedAttributesToProps < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :projects, :props, :jsonb, default: "{}"
|
4
|
+
|
5
|
+
require "progressbar"
|
6
|
+
projects = Project.all
|
7
|
+
pbar = ProgressBar.new("projects", projects.count)
|
8
|
+
projects.find_each do |project|
|
9
|
+
props = project.read_attribute(:extended_attributes) || {}
|
10
|
+
props.merge!(project.read_attribute(:view_options) || {})
|
11
|
+
|
12
|
+
props["unfuddle.projectId"] = props.delete("unfuddle_project_id") if props.key?("unfuddle_project_id")
|
13
|
+
props["errbit.appId"] = props.delete("errbit_app_id") if props.key?("errbit_app_id")
|
14
|
+
props["github.repo"] = props.delete("github_repo") if props.key?("github_repo")
|
15
|
+
props["git.location"] = props.delete("git_location") if props.key?("git_location")
|
16
|
+
|
17
|
+
props.keys.each do |old_key|
|
18
|
+
next unless dependency_name = old_key[/^key_dependency\.(.*)$/, 1]
|
19
|
+
new_key = "keyDependency.#{dependency_name}"
|
20
|
+
props[new_key] = props.delete(old_key)
|
21
|
+
end
|
22
|
+
|
23
|
+
project.update_column :props, props
|
24
|
+
pbar.inc
|
25
|
+
end
|
26
|
+
pbar.finish
|
27
|
+
end
|
28
|
+
|
29
|
+
def down
|
30
|
+
remove_column :projects, :props
|
31
|
+
end
|
32
|
+
end
|