houston-core 0.5.0.beta1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +0 -2
- data/.gitignore +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +63 -62
- data/README.md +13 -121
- data/app/adapters/houston/adapters/ci_server/errors.rb +4 -4
- data/app/adapters/houston/adapters/ci_server/jenkins_adapter/job.rb +50 -50
- data/app/adapters/houston/adapters/ci_server/jenkins_adapter.rb +4 -4
- data/app/adapters/houston/adapters/ci_server/none_adapter/job.rb +5 -5
- data/app/adapters/houston/adapters/ci_server/none_adapter.rb +4 -4
- data/app/adapters/houston/adapters/deployment/engineyard.rb +20 -20
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter/app.rb +14 -14
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter/connection.rb +41 -41
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter/notice.rb +6 -6
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter/problem.rb +25 -25
- data/app/adapters/houston/adapters/error_tracker/errbit_adapter.rb +20 -20
- data/app/adapters/houston/adapters/error_tracker/none_adapter.rb +8 -8
- data/app/adapters/houston/adapters/error_tracker/null_app.rb +13 -13
- data/app/adapters/houston/adapters/ticket_tracker/errors.rb +5 -5
- data/app/adapters/houston/adapters/ticket_tracker/github_adapter/connection.rb +41 -41
- data/app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb +22 -22
- data/app/adapters/houston/adapters/ticket_tracker/github_adapter.rb +7 -7
- data/app/adapters/houston/adapters/ticket_tracker/houston_adapter/connection.rb +13 -13
- data/app/adapters/houston/adapters/ticket_tracker/houston_adapter/ticket.rb +15 -15
- data/app/adapters/houston/adapters/ticket_tracker/houston_adapter.rb +4 -4
- data/app/adapters/houston/adapters/ticket_tracker/none_adapter.rb +4 -4
- data/app/adapters/houston/adapters/ticket_tracker/null_connection.rb +13 -13
- data/app/adapters/houston/adapters/ticket_tracker/null_ticket.rb +19 -19
- data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/connection.rb +54 -54
- data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb +10 -10
- data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/ticket.rb +59 -59
- data/app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter.rb +9 -9
- data/app/adapters/houston/adapters/version_control/commit.rb +4 -4
- data/app/adapters/houston/adapters/version_control/errors.rb +9 -9
- data/app/adapters/houston/adapters/version_control/git_adapter/github_repo.rb +15 -15
- data/app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb +53 -30
- data/app/adapters/houston/adapters/version_control/git_adapter/repo.rb +60 -55
- data/app/adapters/houston/adapters/version_control/git_adapter.rb +22 -22
- data/app/adapters/houston/adapters/version_control/none_adapter.rb +4 -4
- data/app/adapters/houston/adapters/version_control/null_commit.rb +4 -4
- data/app/adapters/houston/adapters/version_control/null_repo.rb +18 -18
- data/app/adapters/houston/adapters.rb +10 -10
- data/app/assets/javascripts/app/boot.coffee +5 -5
- data/app/assets/javascripts/app/infinite_scroll.coffee +6 -6
- data/app/assets/javascripts/app/models/commit.coffee +1 -1
- data/app/assets/javascripts/app/models/release.coffee +1 -1
- data/app/assets/javascripts/app/models/task.coffee +1 -1
- data/app/assets/javascripts/app/models/tester.coffee +1 -1
- data/app/assets/javascripts/app/models/testing_note.coffee +2 -2
- data/app/assets/javascripts/app/models/ticket.coffee +24 -24
- data/app/assets/javascripts/app/models/user.coffee +1 -1
- data/app/assets/javascripts/app/releases.coffee +6 -6
- data/app/assets/javascripts/app/stacked_area_graph.coffee +22 -22
- data/app/assets/javascripts/app/stacked_bar_graph.coffee +20 -20
- data/app/assets/javascripts/app/table_row_expander.coffee +10 -10
- data/app/assets/javascripts/app/ticket_tracker_refresh.coffee +19 -19
- data/app/assets/javascripts/app/views/_show_sprint_view.coffee +14 -14
- data/app/assets/javascripts/app/views/_tickets_view.coffee +8 -8
- data/app/assets/javascripts/app/views/all_tickets_view.coffee +1 -2
- data/app/assets/javascripts/app/views/commit_view.coffee +2 -2
- data/app/assets/javascripts/app/views/edit_sprint_view.coffee +36 -36
- data/app/assets/javascripts/app/views/find_or_create_ticket_view.coffee +3 -3
- data/app/assets/javascripts/app/views/keyboard_shortcuts_modal.coffee +14 -14
- data/app/assets/javascripts/app/views/new_ticket_modal.coffee +4 -4
- data/app/assets/javascripts/app/views/new_ticket_view.coffee +34 -34
- data/app/assets/javascripts/app/views/problems_view.coffee +8 -8
- data/app/assets/javascripts/app/views/reports_view.coffee +5 -5
- data/app/assets/javascripts/app/views/testing_note_view.coffee +10 -10
- data/app/assets/javascripts/app/views/testing_report_view.coffee +7 -7
- data/app/assets/javascripts/app/views/testing_ticket_view.coffee +36 -36
- data/app/assets/javascripts/app/views/ticket_modal_view.coffee +5 -5
- data/app/assets/javascripts/core/app.coffee +22 -22
- data/app/assets/javascripts/core/burndown_chart.coffee +21 -21
- data/app/assets/javascripts/core/errors.coffee +2 -2
- data/app/assets/javascripts/core/handlebars_helpers.coffee +6 -6
- data/app/assets/javascripts/core/jquery_extensions.coffee +28 -28
- data/app/assets/javascripts/dashboard/refresher.coffee +4 -4
- data/app/assets/stylesheets/application/ansi.scss +2 -2
- data/app/assets/stylesheets/application/commit.scss +1 -1
- data/app/assets/stylesheets/application/exceptions.scss +3 -3
- data/app/assets/stylesheets/application/find_or_create_ticket.scss +2 -2
- data/app/assets/stylesheets/application/follow_up.scss +2 -2
- data/app/assets/stylesheets/application/forms.scss +2 -2
- data/app/assets/stylesheets/application/freight_train.css.scss +5 -5
- data/app/assets/stylesheets/application/full_screen.scss +2 -2
- data/app/assets/stylesheets/application/infinite_scroll.scss +1 -1
- data/app/assets/stylesheets/application/keyboard_shortcuts.scss +3 -3
- data/app/assets/stylesheets/application/markdown.scss +2 -2
- data/app/assets/stylesheets/application/navigation.scss +15 -15
- data/app/assets/stylesheets/application/new_ticket_view.scss +16 -16
- data/app/assets/stylesheets/application/omnibar.scss +6 -6
- data/app/assets/stylesheets/application/project_banner_buttons.scss +6 -6
- data/app/assets/stylesheets/application/project_tiles.scss +2 -2
- data/app/assets/stylesheets/application/projects.css.scss +3 -3
- data/app/assets/stylesheets/application/pull_requests.scss +6 -6
- data/app/assets/stylesheets/application/queue.scss +2 -2
- data/app/assets/stylesheets/application/release_form.scss +10 -10
- data/app/assets/stylesheets/application/releases.scss +32 -39
- data/app/assets/stylesheets/application/sortable_table.scss +6 -6
- data/app/assets/stylesheets/application/sprint.scss +6 -6
- data/app/assets/stylesheets/application/tables.scss +6 -6
- data/app/assets/stylesheets/application/test_run.scss +16 -16
- data/app/assets/stylesheets/application/ticket.scss +13 -13
- data/app/assets/stylesheets/application/ticket_modal.scss +19 -19
- data/app/assets/stylesheets/application/tickets.scss +2 -2
- data/app/assets/stylesheets/application/timeline.scss +30 -30
- data/app/assets/stylesheets/application/tips.scss +1 -1
- data/app/assets/stylesheets/application/typeahead.scss +4 -4
- data/app/assets/stylesheets/application/uploading.scss +13 -13
- data/app/assets/stylesheets/application/welcome.scss +3 -3
- data/app/assets/stylesheets/core/burndown_chart.scss +11 -11
- data/app/assets/stylesheets/core/misc.scss +8 -8
- data/app/assets/stylesheets/core/overrides.scss +2 -2
- data/app/assets/stylesheets/core/scores.scss +26 -26
- data/app/assets/stylesheets/dashboard/dashboard.scss +16 -16
- data/app/assets/stylesheets/print.css.scss +3 -3
- data/app/concerns/commit_synchronizer.rb +24 -24
- data/app/concerns/feature_state.rb +7 -7
- data/app/concerns/feature_support.rb +4 -4
- data/app/concerns/historical_weekly_stats.rb +4 -4
- data/app/concerns/milestone_synchronizer.rb +14 -14
- data/app/concerns/nosync.rb +4 -4
- data/app/concerns/project_adapter.rb +22 -22
- data/app/concerns/retirement.rb +7 -7
- data/app/concerns/ticket_synchronizer.rb +31 -31
- data/app/concerns/unique_add.rb +2 -2
- data/app/controllers/api/v1/sprint_tasks_controller.rb +19 -19
- data/app/controllers/api/v1/ticket_tasks_controller.rb +14 -14
- data/app/controllers/application_controller.rb +46 -40
- data/app/controllers/commits_controller.rb +10 -10
- data/app/controllers/deploys_controller.rb +11 -11
- data/app/controllers/home_controller.rb +4 -4
- data/app/controllers/jobs_controller.rb +3 -3
- data/app/controllers/oauth_consumers_controller.rb +1 -1
- data/app/controllers/omnibar_controller.rb +6 -6
- data/app/controllers/project_exceptions_controller.rb +11 -11
- data/app/controllers/project_hooks_controller.rb +7 -7
- data/app/controllers/project_options_controller.rb +8 -8
- data/app/controllers/project_pretickets_controller.rb +6 -6
- data/app/controllers/project_roles_controller.rb +7 -7
- data/app/controllers/project_tickets_controller.rb +28 -28
- data/app/controllers/project_tickets_sync_controller.rb +8 -8
- data/app/controllers/projects_controller.rb +29 -29
- data/app/controllers/releases_controller.rb +25 -25
- data/app/controllers/reports_controller.rb +36 -36
- data/app/controllers/sessions_controller.rb +2 -2
- data/app/controllers/settings_controller.rb +3 -3
- data/app/controllers/sprint_task_locks_controller.rb +11 -11
- data/app/controllers/sprints_controller.rb +25 -25
- data/app/controllers/tasks_controller.rb +10 -10
- data/app/controllers/test_runs_controller.rb +8 -8
- data/app/controllers/tester_bar_controller.rb +2 -2
- data/app/controllers/testing_notes_controller.rb +15 -15
- data/app/controllers/testing_report_controller.rb +14 -14
- data/app/controllers/tickets_controller.rb +9 -9
- data/app/controllers/uploads_controller.rb +9 -9
- data/app/controllers/user_credentials_controller.rb +4 -4
- data/app/controllers/user_options_controller.rb +6 -6
- data/app/controllers/users_controller.rb +34 -34
- data/app/controllers/welcome_controller.rb +6 -6
- data/app/helpers/ansi_helper.rb +4 -4
- data/app/helpers/application_helper.rb +26 -26
- data/app/helpers/avatar_helper.rb +12 -12
- data/app/helpers/backtrace_helper.rb +2 -2
- data/app/helpers/breadcrumbs_helper.rb +9 -9
- data/app/helpers/commit_helper.rb +16 -12
- data/app/helpers/demo_helper.rb +4 -4
- data/app/helpers/email_helper.rb +3 -3
- data/app/helpers/emoji_helper.rb +1 -1
- data/app/helpers/excel_helpers.rb +2 -2
- data/app/helpers/exposure_helper.rb +3 -3
- data/app/helpers/flash_message_helper.rb +6 -6
- data/app/helpers/maintenance_light_helper.rb +3 -3
- data/app/helpers/markdown_helper.rb +3 -3
- data/app/helpers/navigation_helper.rb +12 -12
- data/app/helpers/project_helper.rb +5 -5
- data/app/helpers/release_helper.rb +9 -9
- data/app/helpers/score_card_helper.rb +16 -16
- data/app/helpers/sprint_helper.rb +2 -2
- data/app/helpers/static_chart_helper.rb +2 -2
- data/app/helpers/test_run_helper.rb +6 -6
- data/app/helpers/ticket_helper.rb +14 -14
- data/app/helpers/timeline_helper.rb +5 -5
- data/app/helpers/url_helper.rb +26 -26
- data/app/helpers/user_helper.rb +6 -6
- data/app/helpers/version_helper.rb +4 -4
- data/app/interactors/test_run_comparer.rb +9 -9
- data/app/interactors/ticket_report.rb +7 -7
- data/app/jobs/sync_all_tickets_job.rb +13 -13
- data/app/jobs/sync_commits_job.rb +3 -3
- data/app/jobs/sync_project_tickets_job.rb +9 -9
- data/app/mailers/deploy_notification.rb +9 -9
- data/app/mailers/project_notification.rb +29 -29
- data/app/mailers/view_mailer.rb +20 -38
- data/app/models/ability.rb +21 -21
- data/app/models/activity_feed.rb +25 -25
- data/app/models/antecedent.rb +3 -3
- data/app/models/code_climate/coverage_report.rb +25 -25
- data/app/models/commit.rb +77 -82
- data/app/models/consumer_token.rb +2 -2
- data/app/models/deploy.rb +31 -27
- data/app/models/environment.rb +12 -12
- data/app/models/github/commit_status_report.rb +16 -16
- data/app/models/github/pull_request.rb +35 -12
- data/app/models/github/pull_request_event.rb +6 -5
- data/app/models/github_token.rb +2 -2
- data/app/models/historical_head.rb +2 -2
- data/app/models/key_dependency.rb +17 -17
- data/app/models/maintenance_light.rb +3 -3
- data/app/models/measurement.rb +22 -22
- data/app/models/menu_item.rb +5 -5
- data/app/models/menu_item_divider.rb +1 -1
- data/app/models/milestone.rb +27 -27
- data/app/models/output_stream.rb +4 -4
- data/app/models/post_receive_payload.rb +7 -7
- data/app/models/project.rb +93 -89
- data/app/models/project_dependencies.rb +9 -9
- data/app/models/project_dependency.rb +33 -33
- data/app/models/project_menu_item.rb +3 -3
- data/app/models/release.rb +60 -60
- data/app/models/release_change.rb +18 -18
- data/app/models/role.rb +15 -15
- data/app/models/rubygems/gem.rb +21 -21
- data/app/models/run_tests_on_post_receive.rb +36 -36
- data/app/models/setting.rb +3 -3
- data/app/models/settings.rb +8 -8
- data/app/models/source_file_coverage.rb +2 -2
- data/app/models/sprint.rb +19 -19
- data/app/models/sprint_report.rb +7 -7
- data/app/models/sprint_task.rb +8 -8
- data/app/models/static_chart/area.rb +19 -19
- data/app/models/static_chart.rb +35 -35
- data/app/models/task.rb +64 -64
- data/app/models/test_error.rb +2 -2
- data/app/models/test_result.rb +7 -0
- data/app/models/test_run.rb +75 -79
- data/app/models/test_run_statistics.rb +18 -19
- data/app/models/testing_note.rb +19 -19
- data/app/models/ticket.rb +104 -104
- data/app/models/ticket_antecedent.rb +11 -11
- data/app/models/ticket_comment.rb +6 -6
- data/app/models/ticket_committer.rb +3 -3
- data/app/models/ticket_tag.rb +6 -6
- data/app/models/user.rb +44 -44
- data/app/models/user_credentials.rb +11 -11
- data/app/models/value_statement.rb +3 -3
- data/app/presenters/commit_presenter.rb +6 -6
- data/app/presenters/one_or_many.rb +4 -4
- data/app/presenters/problem_presenter.rb +8 -8
- data/app/presenters/release_presenter.rb +4 -4
- data/app/presenters/sprint_task_presenter.rb +9 -9
- data/app/presenters/task_presenter.rb +8 -8
- data/app/presenters/tasks_excel_presenter.rb +6 -6
- data/app/presenters/tester_presenter.rb +3 -3
- data/app/presenters/testing_note_presenter.rb +4 -4
- data/app/presenters/testing_report_ticket_presenter.rb +9 -9
- data/app/presenters/ticket_presenter.rb +4 -4
- data/app/views/deploys/show.html.erb +8 -0
- data/app/views/jobs/show.html.erb +0 -34
- data/app/views/layouts/application.html.erb +1 -0
- data/app/views/layouts/minimal.html.erb +1 -0
- data/app/views/projects/_form.html.erb +0 -7
- data/app/views/releases/_form.html.erb +9 -3
- data/app/views/releases/index.html.erb +1 -1
- data/config/application.rb +1 -2
- data/config/database.yml +3 -3
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -1
- data/config/initializers/action_view_field_error_proc.rb +3 -3
- data/config/initializers/constants.rb +3 -3
- data/config/initializers/devise.rb +8 -8
- data/config/initializers/hard_coded_knowledge.rb +3 -3
- data/config/initializers/houston_async.rb +2 -2
- data/config/initializers/houston_report_exception.rb +3 -3
- data/config/initializers/houston_try.rb +3 -3
- data/config/initializers/sync_commits_on_post_receive.rb +0 -5
- data/config/routes.rb +108 -108
- data/db/migrate/20120417175450_devise_create_users.rb +2 -2
- data/db/migrate/20120501230243_add_unfuddle_id_to_tickets.rb +1 -1
- data/db/migrate/20120504143615_link_tickets_and_releases.rb +3 -3
- data/db/migrate/20120626150333_add_last_release_at_to_tickets.rb +2 -2
- data/db/migrate/20120626151320_link_tickets_and_commits.rb +2 -2
- data/db/migrate/20120626152020_add_committer_email_to_commits.rb +2 -2
- data/db/migrate/20120715230922_create_user_notifications.rb +3 -3
- data/db/migrate/20120716010743_add_user_to_releases.rb +3 -3
- data/db/migrate/20120726231754_link_projects_and_maintainers.rb +2 -2
- data/db/migrate/20120826022643_add_authentication_token_to_users.rb +2 -2
- data/db/migrate/20120920023251_add_administrator_to_users.rb +3 -3
- data/db/migrate/20121026014457_split_users_name_into_first_and_last.rb +2 -2
- data/db/migrate/20121027160548_create_deploys.rb +1 -1
- data/db/migrate/20121222170917_add_version_control_adapter_to_projects.rb +2 -2
- data/db/migrate/20121222223635_add_ticket_tracking_adapter_to_projects.rb +2 -2
- data/db/migrate/20121224212623_rename_environments.rb +3 -3
- data/db/migrate/20121225175106_replace_environment_id_with_environment_name.rb +8 -8
- data/db/migrate/20121230174234_create_test_runs.rb +3 -3
- data/db/migrate/20130119203853_remove_cached_queries_from_projects.rb +1 -1
- data/db/migrate/20130119204608_add_extended_attributes_to_tickets.rb +10 -10
- data/db/migrate/20130120182026_create_ticket_prerequisites.rb +2 -2
- data/db/migrate/20130312224911_create_errors.rb +1 -1
- data/db/migrate/20130407195450_create_roles.rb +2 -2
- data/db/migrate/20130407200624_populate_roles.rb +9 -9
- data/db/migrate/20130407220039_add_project_id_to_testing_notes.rb +6 -6
- data/db/migrate/20130407220937_add_project_id_to_commits.rb +6 -6
- data/db/migrate/20130416020627_add_environments_subscribed_to_to_users.rb +3 -3
- data/db/migrate/20130420174126_add_error_tracker_name_to_projects.rb +2 -2
- data/db/migrate/20130427223925_create_project_quotas.rb +2 -2
- data/db/migrate/20130504014802_add_extended_attributes_to_projects.rb +3 -3
- data/db/migrate/20130504135741_add_antecedents_to_tickets.rb +6 -6
- data/db/migrate/20130505144446_add_tags_to_tickets.rb +1 -1
- data/db/migrate/20130505162039_add_type_to_tickets.rb +1 -1
- data/db/migrate/20130505212838_add_closed_at_to_tickets.rb +1 -1
- data/db/migrate/20130519163615_create_user_credentials.rb +2 -2
- data/db/migrate/20130526024851_give_default_values_for_counts_from_test_runs.rb +2 -2
- data/db/migrate/20130710233849_add_authored_at_to_commits.rb +10 -10
- data/db/migrate/20130711013156_link_commits_and_users.rb +6 -6
- data/db/migrate/20130806143651_link_commits_and_releases.rb +2 -2
- data/db/migrate/20130921141449_create_milestones.rb +3 -3
- data/db/migrate/20131004185618_add_first_release_at_to_tickets.rb +2 -2
- data/db/migrate/20131012152403_create_sprints.rb +3 -3
- data/db/migrate/20131112010815_delete_duplicate_commits.rb +7 -7
- data/db/migrate/20140217160450_add_email_addresses_to_users.rb +3 -3
- data/db/migrate/20140327020121_drop_ticket_prerequisites.rb +1 -1
- data/db/migrate/20140406183224_remove_new_relic_id_from_projects.rb +1 -1
- data/db/migrate/20140406230121_delete_automatically_generated_messages_for_releases.rb +1 -1
- data/db/migrate/20140407010111_drop_sprints_project_id.rb +1 -1
- data/db/migrate/20140418133005_change_ticket_antecedents_to_text_array.rb +1 -1
- data/db/migrate/20140425141946_embed_changes_in_releases.rb +3 -3
- data/db/migrate/20140515174322_create_tasks.rb +3 -3
- data/db/migrate/20140516012049_create_tasks_for_existing_tickets.rb +1 -1
- data/db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb +2 -2
- data/db/migrate/20140521014652_allow_task_descriptions_to_be_null.rb +1 -1
- data/db/migrate/20140526155845_add_commit_id_to_deploys.rb +5 -5
- data/db/migrate/20140526162645_add_commit_before_id_and_commit_after_id_to_releases.rb +4 -4
- data/db/migrate/20140526180608_associate_remaining_deploys_and_releases.rb +12 -12
- data/db/migrate/20140724231918_create_sprints_tasks.rb +3 -3
- data/db/migrate/20140824194031_add_project_id_to_tasks.rb +1 -1
- data/db/migrate/20140824194526_add_completed_at_to_tasks.rb +3 -3
- data/db/migrate/20140824211249_require_sprints_to_be_unique.rb +1 -1
- data/db/migrate/20140907012329_drop_table_changes.rb +1 -1
- data/db/migrate/20140907013836_drop_table_errors.rb +1 -1
- data/db/migrate/20140921190022_add_checked_out_to_sprints_tasks.rb +2 -2
- data/db/migrate/20140921201441_drop_users_name.rb +1 -1
- data/db/migrate/20140925021043_rename_deploys_commit_to_sha.rb +1 -1
- data/db/migrate/20140929004347_create_historical_heads.rb +4 -4
- data/db/migrate/20141027194819_make_users_environments_subscribed_to_an_array.rb +2 -2
- data/db/migrate/20141226171730_create_measurements.rb +1 -1
- data/db/migrate/20150119154013_drop_unused_fields_from_milestones.rb +1 -1
- data/db/migrate/20150222205616_add_features_to_projects.rb +2 -2
- data/db/migrate/20150323004452_add_deploys_completed_at.rb +1 -1
- data/db/migrate/20150805180939_add_commit_id_to_test_runs.rb +1 -1
- data/db/migrate/20150808161805_create_test_results.rb +1 -1
- data/db/migrate/20150809132417_rename_test_results_regression_to_difference.rb +1 -1
- data/db/migrate/20150927014445_required_pull_requests_to_be_unique_by_project_and_number.rb +13 -0
- data/db/structure.sql +9 -0
- data/houston.gemspec +23 -26
- data/lib/configuration.rb +0 -5
- data/lib/core_ext/duration.rb +4 -4
- data/lib/core_ext/hash.rb +17 -17
- data/lib/houston/version.rb +1 -1
- data/lib/houston_server.rb +6 -6
- data/lib/parallel_enumerable.rb +16 -16
- data/lib/tasks/specific_tests.rake +37 -0
- metadata +91 -107
- data/app/interactors/push_gemfile_to_gemnasium.rb +0 -88
- data/app/models/gemnasium/alert.rb +0 -25
- data/app/views/welcome/_tdl.html.erb +0 -31
- data/config/initializers/houston_tdl.rb +0 -104
data/app/models/task.rb
CHANGED
@@ -1,96 +1,96 @@
|
|
1
1
|
class Task < ActiveRecord::Base
|
2
|
-
|
2
|
+
|
3
3
|
versioned initial_version: true, only: [:description, :effort]
|
4
|
-
|
4
|
+
|
5
5
|
belongs_to :ticket
|
6
6
|
belongs_to :project
|
7
7
|
has_and_belongs_to_many :sprints, extend: UniqueAdd
|
8
8
|
has_and_belongs_to_many :releases
|
9
9
|
has_and_belongs_to_many :commits
|
10
|
-
|
10
|
+
|
11
11
|
validates :project_id, :ticket_id, :number, presence: true
|
12
12
|
validate :description_must_be_present, :unless => :default_task?
|
13
|
-
|
13
|
+
|
14
14
|
before_validation :set_project_id, on: :create
|
15
15
|
before_validation :assign_number, on: :create
|
16
16
|
before_destroy :prevent_destroying_a_tickets_last_task
|
17
|
-
|
17
|
+
|
18
18
|
attr_readonly :number
|
19
|
-
|
19
|
+
|
20
20
|
default_scope { order(:number) }
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
|
22
|
+
|
23
|
+
|
24
24
|
class << self
|
25
25
|
def open
|
26
26
|
where completed_at: nil
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def numbered(*numbers)
|
30
30
|
where number: numbers.flatten
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def lettered(*letters)
|
34
34
|
numbered letters.flatten.map { |letter| to_number(letter) }
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def default
|
38
38
|
where description: nil
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def uncommitted
|
42
42
|
where first_commit_at: nil
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def committed
|
46
46
|
where(arel_table[:first_commit_at].not_eq(nil))
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def unreleased
|
50
50
|
where first_release_at: nil
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
def released
|
54
54
|
where(arel_table[:first_release_at].not_eq(nil))
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def completed
|
58
58
|
where(arel_table[:completed_at].not_eq(nil))
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
def completed_during(sprint)
|
62
62
|
where(arel_table[:completed_at].in(sprint.range).or(arel_table[:first_commit_at].in(sprint.range)))
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def in_current_sprint
|
66
66
|
joins(:sprint).where("sprints.end_date >= current_date")
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def checked_out_by(user)
|
70
70
|
where(checked_out_by_id: user.id)
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def find_by_project_and_shorthand(project_slug, shorthand)
|
74
74
|
with_shorthand(shorthand)
|
75
75
|
.merge(Ticket.joins(:project)
|
76
76
|
.where(Project.arel_table[:slug].eq(project_slug)))
|
77
77
|
.first
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
def with_shorthand(shorthand)
|
81
81
|
_, ticket_number, letter = shorthand.split /(\d+)([a-z]+)/
|
82
82
|
joins(:ticket)
|
83
83
|
.where(Ticket.arel_table[:number].eq(ticket_number))
|
84
84
|
.lettered(letter)
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
def versions
|
88
88
|
VestalVersions::Version.where(versioned_type: "Task", versioned_id: pluck(:id))
|
89
89
|
end
|
90
90
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
|
92
|
+
|
93
|
+
|
94
94
|
def letter
|
95
95
|
bytes = []
|
96
96
|
remaining = number
|
@@ -100,118 +100,118 @@ class Task < ActiveRecord::Base
|
|
100
100
|
end
|
101
101
|
bytes.pack "c*"
|
102
102
|
end
|
103
|
-
|
103
|
+
|
104
104
|
def description
|
105
105
|
super || ticket.summary
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
108
|
def shorthand
|
109
109
|
"#{ticket.number}#{letter}"
|
110
110
|
end
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
|
112
|
+
|
113
|
+
|
114
114
|
def released!(release)
|
115
115
|
self.releases << release unless releases.exists?(release.id)
|
116
116
|
update_column :first_release_at, release.created_at unless released?
|
117
117
|
Houston.observer.fire "task:released", self
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
def released?
|
121
121
|
first_release_at.present?
|
122
122
|
end
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
|
124
|
+
|
125
|
+
|
126
126
|
def committed!(commit)
|
127
127
|
update_column :first_commit_at, commit.authored_at unless committed?
|
128
128
|
Houston.observer.fire "task:committed", self
|
129
129
|
end
|
130
|
-
|
130
|
+
|
131
131
|
def committed?
|
132
132
|
first_commit_at.present?
|
133
133
|
end
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
|
135
|
+
|
136
|
+
|
137
137
|
def completed!
|
138
138
|
return if completed?
|
139
139
|
touch :completed_at
|
140
140
|
Houston.observer.fire "task:completed", self
|
141
141
|
end
|
142
142
|
alias :complete! :completed!
|
143
|
-
|
143
|
+
|
144
144
|
def completed?
|
145
145
|
completed_at.present?
|
146
146
|
end
|
147
|
-
|
147
|
+
|
148
148
|
def manually_completed?
|
149
149
|
completed? && !committed? && !released?
|
150
150
|
end
|
151
|
-
|
151
|
+
|
152
152
|
def completed_during?(sprint)
|
153
153
|
return false unless completed?
|
154
154
|
completed_at < sprint.ends_at
|
155
155
|
end
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
|
157
|
+
|
158
|
+
|
159
159
|
def reopen!
|
160
160
|
return unless manually_completed?
|
161
161
|
update_column :completed_at, nil
|
162
162
|
Houston.observer.fire "task:reopened", self
|
163
163
|
end
|
164
|
-
|
164
|
+
|
165
165
|
def open?
|
166
166
|
!completed?
|
167
167
|
end
|
168
|
-
|
169
|
-
|
170
|
-
|
168
|
+
|
169
|
+
|
170
|
+
|
171
171
|
def checked_out?(sprint)
|
172
172
|
SprintTask.where(sprint_id: sprint.id, task_id: id).checked_out.exists?
|
173
173
|
end
|
174
|
-
|
174
|
+
|
175
175
|
def checked_out_by_me?(sprint, user)
|
176
176
|
SprintTask.where(sprint_id: sprint.id, task_id: id).checked_out_by(user).exists?
|
177
177
|
end
|
178
|
-
|
178
|
+
|
179
179
|
def check_out!(sprint, user)
|
180
180
|
SprintTask.where(sprint_id: sprint.id, task_id: id).check_out!(user)
|
181
181
|
end
|
182
|
-
|
182
|
+
|
183
183
|
def check_in!(sprint)
|
184
184
|
SprintTask.where(sprint_id: sprint.id, task_id: id).check_in!
|
185
185
|
end
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
|
187
|
+
|
188
|
+
|
189
189
|
def default_task?
|
190
190
|
number == 1 && read_attribute(:description).nil?
|
191
191
|
end
|
192
|
-
|
193
|
-
|
194
|
-
|
192
|
+
|
193
|
+
|
194
|
+
|
195
195
|
private
|
196
|
-
|
196
|
+
|
197
197
|
def set_project_id
|
198
198
|
self.project_id = ticket.project_id if ticket
|
199
199
|
end
|
200
|
-
|
200
|
+
|
201
201
|
def assign_number
|
202
202
|
self.number = (Task.where(ticket_id: ticket_id).maximum(:number) || 0) + 1
|
203
203
|
end
|
204
|
-
|
204
|
+
|
205
205
|
def description_must_be_present
|
206
206
|
errors.add :description, "can't be blank" if read_attribute(:description).blank?
|
207
207
|
end
|
208
|
-
|
208
|
+
|
209
209
|
def prevent_destroying_a_tickets_last_task
|
210
210
|
return false if ticket.tasks.pluck(:id) == [id]
|
211
211
|
end
|
212
|
-
|
212
|
+
|
213
213
|
def self.to_number(letter)
|
214
214
|
letter.bytes.reverse.each_with_index.map { |byte, i| (byte - 96) * (26 ** i) }.sum
|
215
215
|
end
|
216
|
-
|
216
|
+
|
217
217
|
end
|
data/app/models/test_error.rb
CHANGED
data/app/models/test_result.rb
CHANGED
@@ -7,4 +7,11 @@ class TestResult < ActiveRecord::Base
|
|
7
7
|
validates :test_id, :test_run_id, presence: true
|
8
8
|
validates :status, inclusion: {in: %w{fail skip pass}}
|
9
9
|
|
10
|
+
def self.insert_many(attributes)
|
11
|
+
return if attributes.none?
|
12
|
+
columns = attributes.first.keys
|
13
|
+
values = attributes.map(&:values)
|
14
|
+
import columns, values
|
15
|
+
end
|
16
|
+
|
10
17
|
end
|
data/app/models/test_run.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class TestRun < ActiveRecord::Base
|
2
2
|
include BelongsToCommit
|
3
|
-
|
3
|
+
|
4
4
|
belongs_to :project
|
5
5
|
belongs_to :user
|
6
6
|
has_many :test_results do
|
@@ -9,53 +9,49 @@ class TestRun < ActiveRecord::Base
|
|
9
9
|
joins(:test).where("tests.suite" => suite, "tests.name" => name).first
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
validates_presence_of :project_id, :sha
|
14
14
|
validates :results_url, :presence => true, :if => :completed?
|
15
15
|
validates :result, inclusion: {in: %w{aborted pass fail error}, allow_nil: true, message: "\"%{value}\" is unknown. It must be pass, fail, error, or aborted"}
|
16
16
|
validates_associated :test_results
|
17
|
-
|
17
|
+
|
18
18
|
default_scope { order("completed_at DESC") }
|
19
|
-
|
19
|
+
|
20
20
|
after_save :save_tests_and_results, if: :tests_changed?
|
21
21
|
before_save :identify_user
|
22
|
-
|
22
|
+
|
23
23
|
serialize :tests
|
24
24
|
serialize :coverage
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
|
26
|
+
|
27
|
+
|
28
28
|
class << self
|
29
29
|
def find_by_sha(sha)
|
30
30
|
return nil if sha.blank?
|
31
31
|
where(["sha LIKE ?", "#{sha}%"]).limit(1).first
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def excluding(*test_runs_or_ids)
|
35
35
|
ids = test_runs_or_ids.flatten.map { |test_run_or_id| test_run_or_id.respond_to?(:id) ? test_run_or_id.id : test_run_or_id }
|
36
36
|
where arel_table[:id].not_in(ids)
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def completed
|
40
40
|
where arel_table[:completed_at].not_eq(nil)
|
41
41
|
end
|
42
|
-
|
43
|
-
def pending
|
44
|
-
where(completed_at: nil)
|
45
|
-
end
|
46
|
-
|
42
|
+
|
47
43
|
def passed
|
48
44
|
where(result: "pass")
|
49
45
|
end
|
50
|
-
|
46
|
+
|
51
47
|
def failed
|
52
48
|
where(result: "fail")
|
53
49
|
end
|
54
|
-
|
50
|
+
|
55
51
|
def errored
|
56
52
|
where(result: "error")
|
57
53
|
end
|
58
|
-
|
54
|
+
|
59
55
|
def most_recent
|
60
56
|
joins <<-SQL
|
61
57
|
INNER JOIN (
|
@@ -68,47 +64,47 @@ class TestRun < ActiveRecord::Base
|
|
68
64
|
SQL
|
69
65
|
end
|
70
66
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
|
68
|
+
|
69
|
+
|
74
70
|
def failed?
|
75
71
|
result.to_s == "fail"
|
76
72
|
end
|
77
|
-
|
73
|
+
|
78
74
|
def failed_or_errored?
|
79
75
|
%w{fail error}.member?(result.to_s)
|
80
76
|
end
|
81
|
-
|
77
|
+
|
82
78
|
def passed?
|
83
79
|
result.to_s == "pass"
|
84
80
|
end
|
85
|
-
|
81
|
+
|
86
82
|
def aborted?
|
87
83
|
result.to_s == "aborted"
|
88
84
|
end
|
89
|
-
|
85
|
+
|
90
86
|
def completed_without_running_tests?
|
91
87
|
%w{aborted error}.member?(result.to_s)
|
92
88
|
end
|
93
|
-
|
89
|
+
|
94
90
|
def broken?
|
95
91
|
return false unless failed_or_errored?
|
96
|
-
|
92
|
+
|
97
93
|
last_tested_ancestor = commits_since_last_test_run.last
|
98
94
|
return false if last_tested_ancestor.nil?
|
99
|
-
|
95
|
+
|
100
96
|
project.test_runs.find_by_sha(last_tested_ancestor.sha).passed?
|
101
97
|
end
|
102
|
-
|
98
|
+
|
103
99
|
def fixed?
|
104
100
|
return false unless passed?
|
105
|
-
|
101
|
+
|
106
102
|
last_tested_ancestor = commits_since_last_test_run.last
|
107
103
|
return false if last_tested_ancestor.nil?
|
108
|
-
|
104
|
+
|
109
105
|
project.test_runs.find_by_sha(last_tested_ancestor.sha).failed_or_errored?
|
110
106
|
end
|
111
|
-
|
107
|
+
|
112
108
|
def short_description(with_duration: false)
|
113
109
|
passes = "#{pass_count} #{pass_count == 1 ? "test" : "tests"} passed"
|
114
110
|
fails = "#{fail_count} #{fail_count == 1 ? "test" : "tests"} failed"
|
@@ -126,24 +122,24 @@ class TestRun < ActiveRecord::Base
|
|
126
122
|
"#{project.ci_server_name} was not able to run the tests"
|
127
123
|
end
|
128
124
|
end
|
129
|
-
|
130
|
-
|
131
|
-
|
125
|
+
|
126
|
+
|
127
|
+
|
132
128
|
def url
|
133
129
|
"https://#{Houston.config.host}/projects/#{project.slug}/test_runs/#{sha}"
|
134
130
|
end
|
135
|
-
|
136
|
-
|
137
|
-
|
131
|
+
|
132
|
+
|
133
|
+
|
138
134
|
def coverage_detail
|
139
135
|
@coverage_detail ||= (Array(coverage).map do |file|
|
140
136
|
file = file.with_indifferent_access
|
141
137
|
SourceFileCoverage.new(project, sha, file[:filename], file[:coverage])
|
142
138
|
end).select { |file| file.src.any? }
|
143
139
|
end
|
144
|
-
|
145
|
-
|
146
|
-
|
140
|
+
|
141
|
+
|
142
|
+
|
147
143
|
def commits_since_last_test_run
|
148
144
|
shas_of_tested_commits = project.test_runs.excluding(self).pluck(:sha)
|
149
145
|
project.repo.ancestors_until(sha, including_self: true) { |ancestor|
|
@@ -151,7 +147,7 @@ class TestRun < ActiveRecord::Base
|
|
151
147
|
rescue Houston::Adapters::VersionControl::CommitNotFound
|
152
148
|
[]
|
153
149
|
end
|
154
|
-
|
150
|
+
|
155
151
|
def commits_since_last_passing_test_run
|
156
152
|
shas_of_passing_commits = project.test_runs.passed.pluck(:sha)
|
157
153
|
project.repo.ancestors_until(sha, including_self: true) { |ancestor|
|
@@ -160,13 +156,13 @@ class TestRun < ActiveRecord::Base
|
|
160
156
|
[]
|
161
157
|
end
|
162
158
|
alias :blamable_commits :commits_since_last_passing_test_run
|
163
|
-
|
164
|
-
|
165
|
-
|
159
|
+
|
160
|
+
|
161
|
+
|
166
162
|
def retry!
|
167
163
|
trigger_build!
|
168
164
|
end
|
169
|
-
|
165
|
+
|
170
166
|
def start!
|
171
167
|
# Let's _not_ trigger the build if this Test Run is not going
|
172
168
|
# to be saved. Let's also run BelongsToCommit#identify_commit
|
@@ -176,54 +172,54 @@ class TestRun < ActiveRecord::Base
|
|
176
172
|
trigger_build!
|
177
173
|
save!
|
178
174
|
end
|
179
|
-
|
175
|
+
|
180
176
|
def short_commit
|
181
177
|
sha[0...7]
|
182
178
|
end
|
183
|
-
|
179
|
+
|
184
180
|
def completed?
|
185
181
|
completed_at.present?
|
186
182
|
end
|
187
|
-
|
183
|
+
|
188
184
|
def has_results?
|
189
185
|
result.present? and !aborted?
|
190
186
|
end
|
191
|
-
|
187
|
+
|
192
188
|
def trigger_build!
|
193
189
|
project.ci_server.build!(sha)
|
194
190
|
Houston.observer.fire "test_run:start", self
|
195
191
|
end
|
196
|
-
|
192
|
+
|
197
193
|
def completed!(results_url)
|
198
194
|
self.completed_at = Time.now unless completed?
|
199
195
|
self.results_url = results_url
|
200
196
|
save!
|
201
197
|
fetch_results!
|
202
|
-
|
198
|
+
|
203
199
|
if has_results?
|
204
200
|
compare_results!
|
205
201
|
fire_complete!
|
206
202
|
end
|
207
203
|
end
|
208
|
-
|
204
|
+
|
209
205
|
def fetch_results!
|
210
206
|
update_attributes! project.ci_server.fetch_results!(results_url)
|
211
207
|
rescue Houston::Adapters::CIServer::Error
|
212
208
|
update_column :result, "error"
|
213
209
|
Rails.logger.error "#{$!.message}\n #{$!.backtrace.join("\n ")}"
|
214
210
|
end
|
215
|
-
|
211
|
+
|
216
212
|
def fire_complete!
|
217
213
|
Houston.observer.fire "test_run:complete", self
|
218
214
|
end
|
219
|
-
|
220
|
-
|
221
|
-
|
215
|
+
|
216
|
+
|
217
|
+
|
222
218
|
def tests=(value)
|
223
219
|
@tests = nil
|
224
220
|
write_attribute :tests, value
|
225
221
|
end
|
226
|
-
|
222
|
+
|
227
223
|
def tests
|
228
224
|
@tests ||= test_results.includes(:error).joins(:test).select("test_results.*", "tests.suite", "tests.name").map do |test_result|
|
229
225
|
message, backtrace = test_result.error.output.split("\n\n") if test_result.error
|
@@ -232,31 +228,31 @@ class TestRun < ActiveRecord::Base
|
|
232
228
|
status: test_result.status,
|
233
229
|
duration: test_result.duration,
|
234
230
|
error_message: message,
|
235
|
-
error_backtrace: backtrace.to_s.split("\n") }
|
231
|
+
error_backtrace: backtrace.to_s.split("\n") }
|
236
232
|
end
|
237
233
|
end
|
238
|
-
|
239
|
-
|
240
|
-
|
234
|
+
|
235
|
+
|
236
|
+
|
241
237
|
def real_fail_count
|
242
238
|
fail_count + regression_count
|
243
239
|
end
|
244
|
-
|
245
|
-
|
246
|
-
|
240
|
+
|
241
|
+
|
242
|
+
|
247
243
|
def identify_user
|
248
244
|
email = Mail::Address.new(agent_email)
|
249
245
|
self.user = User.find_by_email_address(email.address)
|
250
246
|
end
|
251
|
-
|
247
|
+
|
252
248
|
def save_tests_and_results
|
253
249
|
create_tests_and_results read_attribute(:tests)
|
254
250
|
end
|
255
|
-
|
251
|
+
|
256
252
|
def create_tests_and_results(tests)
|
257
253
|
tests = Array(tests)
|
258
254
|
return if tests.empty?
|
259
|
-
|
255
|
+
|
260
256
|
tests_map = Hash.new do |hash, (suite, name)|
|
261
257
|
begin
|
262
258
|
test = Test.create!(suite: suite, name: name, project_id: project_id)
|
@@ -265,13 +261,13 @@ class TestRun < ActiveRecord::Base
|
|
265
261
|
end
|
266
262
|
hash[[suite, name]] = test.id
|
267
263
|
end
|
268
|
-
|
264
|
+
|
269
265
|
Test.where(project_id: project_id).pluck(:suite, :name, :id).each do |suite, name, id|
|
270
266
|
tests_map[[suite, name]] = id
|
271
267
|
end
|
272
|
-
|
268
|
+
|
273
269
|
errors_map = Hash[TestError.pluck(:sha, :id)]
|
274
|
-
|
270
|
+
|
275
271
|
test_results = Houston.benchmark("Processing #{tests.count} test results") do
|
276
272
|
tests.map do |test_attributes|
|
277
273
|
suite = test_attributes.fetch :suite
|
@@ -308,16 +304,16 @@ class TestRun < ActiveRecord::Base
|
|
308
304
|
TestResult.insert_many(test_results)
|
309
305
|
end
|
310
306
|
end
|
311
|
-
|
312
|
-
|
313
|
-
|
307
|
+
|
308
|
+
|
309
|
+
|
314
310
|
def compare_results!
|
315
311
|
return if completed_without_running_tests?
|
316
312
|
return unless commit
|
317
313
|
compare_to_parent!
|
318
314
|
compare_to_children!
|
319
315
|
end
|
320
|
-
|
316
|
+
|
321
317
|
def compare_to_parent!
|
322
318
|
return if compared?
|
323
319
|
return unless parent = commit.parent
|
@@ -349,18 +345,18 @@ class TestRun < ActiveRecord::Base
|
|
349
345
|
end
|
350
346
|
end
|
351
347
|
end
|
352
|
-
|
348
|
+
|
353
349
|
def compare_to_children!
|
354
350
|
commit.children.each do |commit|
|
355
351
|
commit.test_run.compare_results! if commit.test_run
|
356
352
|
end
|
357
353
|
end
|
358
|
-
|
354
|
+
|
359
355
|
private
|
360
|
-
|
356
|
+
|
361
357
|
# This is defined in Rails 4.2 but absent in previous versions
|
362
358
|
def validate!
|
363
359
|
raise ActiveRecord::RecordInvalid.new(self) unless valid?
|
364
360
|
end
|
365
|
-
|
361
|
+
|
366
362
|
end
|