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/commit.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Commit < ActiveRecord::Base
|
2
|
-
|
2
|
+
|
3
3
|
belongs_to :project
|
4
4
|
belongs_to :parent, foreign_key: :parent_sha, primary_key: :sha, class_name: "Commit"
|
5
5
|
has_many :children, foreign_key: :parent_sha, primary_key: :sha, class_name: "Commit"
|
@@ -9,75 +9,70 @@ class Commit < ActiveRecord::Base
|
|
9
9
|
has_and_belongs_to_many :pull_requests, class_name: "Github::PullRequest"
|
10
10
|
has_and_belongs_to_many :tickets
|
11
11
|
has_and_belongs_to_many :tasks
|
12
|
-
|
12
|
+
|
13
13
|
default_scope { order(:created_at) }
|
14
|
-
|
14
|
+
|
15
15
|
after_create :associate_committers_with_self
|
16
16
|
after_create :associate_tickets_with_self
|
17
17
|
after_create :associate_tasks_with_self
|
18
18
|
after_create { Houston.observer.fire "commit:create", self }
|
19
|
-
|
19
|
+
|
20
20
|
validates :project, presence: true
|
21
21
|
validates :sha, presence: true, :uniqueness => {scope: :project_id}
|
22
22
|
validates :message, presence: true
|
23
23
|
validates :authored_at, presence: true
|
24
24
|
validates :committer, presence: true
|
25
25
|
validates :committer_email, presence: true
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
|
27
|
+
|
28
|
+
|
29
29
|
class << self
|
30
30
|
def find_by_sha(sha)
|
31
31
|
with_sha_like(sha).first if sha
|
32
32
|
end
|
33
|
-
|
34
|
-
# def [](sha)
|
35
|
-
# return relation.at(sha) if sha.is_a? Fixnum # <-- normal array accessor syntax
|
36
|
-
# find_by_sha sha
|
37
|
-
# end
|
38
|
-
|
33
|
+
|
39
34
|
def with_sha_like(sha)
|
40
35
|
where(["sha LIKE ?", "#{sha.strip}%"])
|
41
36
|
end
|
42
|
-
|
37
|
+
|
43
38
|
def during(range)
|
44
39
|
where(authored_at: range)
|
45
40
|
end
|
46
|
-
|
41
|
+
|
47
42
|
def reachable
|
48
43
|
where(unreachable: false)
|
49
44
|
end
|
50
|
-
|
45
|
+
|
51
46
|
def latest
|
52
47
|
last
|
53
48
|
end
|
54
|
-
|
49
|
+
|
55
50
|
def earliest
|
56
51
|
first
|
57
52
|
end
|
58
|
-
|
53
|
+
|
59
54
|
def released
|
60
55
|
commits_releases = Arel::Table.new("commits_releases")
|
61
56
|
where(arel_table[:id].in(commits_releases.project(:commit_id)))
|
62
57
|
end
|
63
58
|
end
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
|
60
|
+
|
61
|
+
|
67
62
|
def summary
|
68
63
|
message[/^.*$/]
|
69
64
|
end
|
70
|
-
|
65
|
+
|
71
66
|
def description
|
72
67
|
message.lines[1..-1].join("\n")
|
73
68
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
|
70
|
+
|
71
|
+
|
77
72
|
def self.from_native_commit(native)
|
78
73
|
new attributes_from_native_commit(native)
|
79
74
|
end
|
80
|
-
|
75
|
+
|
81
76
|
def self.attributes_from_native_commit(native)
|
82
77
|
{ :sha => native.sha,
|
83
78
|
:parent_sha => native.parent_sha,
|
@@ -86,156 +81,156 @@ class Commit < ActiveRecord::Base
|
|
86
81
|
:committer => native.author_name,
|
87
82
|
:committer_email => native.author_email.to_s.downcase }
|
88
83
|
end
|
89
|
-
|
84
|
+
|
90
85
|
def native_commit
|
91
86
|
project.repo.native_commit(sha)
|
92
87
|
end
|
93
|
-
|
94
|
-
|
95
|
-
|
88
|
+
|
89
|
+
|
90
|
+
|
96
91
|
def to_str
|
97
92
|
sha
|
98
93
|
end
|
99
|
-
|
94
|
+
|
100
95
|
def to_s
|
101
96
|
sha
|
102
97
|
end
|
103
|
-
|
98
|
+
|
104
99
|
def url
|
105
100
|
@url ||= begin
|
106
101
|
repo = project.repo if project
|
107
102
|
repo.commit_url(sha) if repo.respond_to?(:commit_url)
|
108
103
|
end
|
109
104
|
end
|
110
|
-
|
111
|
-
|
112
|
-
|
105
|
+
|
106
|
+
|
107
|
+
|
113
108
|
def skip?
|
114
109
|
merge? || tags.member?("skip")
|
115
110
|
end
|
116
|
-
|
111
|
+
|
117
112
|
def merge?
|
118
113
|
(message =~ MERGE_COMMIT_PATTERN).present?
|
119
114
|
end
|
120
|
-
|
121
|
-
|
122
|
-
|
115
|
+
|
116
|
+
|
117
|
+
|
123
118
|
def tags
|
124
119
|
parsed_message[:tags]
|
125
120
|
end
|
126
|
-
|
121
|
+
|
127
122
|
def clean_message
|
128
123
|
parsed_message[:clean_message]
|
129
124
|
end
|
130
|
-
|
125
|
+
|
131
126
|
def ticket_numbers
|
132
127
|
parsed_message[:tickets].map { |(number, task)| number }
|
133
128
|
end
|
134
|
-
|
129
|
+
|
135
130
|
def ticket_tasks
|
136
131
|
@ticket_tasks ||= parsed_message[:tickets].each_with_object({}) do |(number, task), tasks_by_ticket|
|
137
132
|
(tasks_by_ticket[number] ||= []).push(task) unless task.blank?
|
138
133
|
end
|
139
134
|
end
|
140
|
-
|
135
|
+
|
141
136
|
def hours_worked
|
142
137
|
parsed_message[:hours_worked]
|
143
138
|
end
|
144
|
-
|
139
|
+
|
145
140
|
def extra_attributes
|
146
141
|
parsed_message[:attributes]
|
147
142
|
end
|
148
|
-
|
143
|
+
|
149
144
|
def antecedents
|
150
145
|
extra_attributes.fetch("err", []).map { |id| TicketAntecedent.new(self, "Errbit", id) }
|
151
146
|
end
|
152
|
-
|
153
|
-
|
154
|
-
|
147
|
+
|
148
|
+
|
149
|
+
|
155
150
|
def committer_hours
|
156
151
|
(hours_worked || 0) * committers.count
|
157
152
|
end
|
158
|
-
|
159
|
-
|
160
|
-
|
153
|
+
|
154
|
+
|
155
|
+
|
161
156
|
def identify_committers
|
162
157
|
emails = Houston.config.identify_committers(self)
|
163
158
|
User.with_email_address(emails).to_a
|
164
159
|
end
|
165
|
-
|
166
|
-
|
167
|
-
|
160
|
+
|
161
|
+
|
162
|
+
|
168
163
|
def self.parse_message(message)
|
169
164
|
tags = []
|
170
165
|
tickets = []
|
171
166
|
attributes = {}
|
172
167
|
hours = 0
|
173
168
|
clean_message = normalize_commit_message(message)
|
174
|
-
|
169
|
+
|
175
170
|
clean_message.gsub!(TICKET_PATTERN) { tickets << [$1.to_i, $2]; "" }
|
176
171
|
clean_message.gsub!(TIME_PATTERN) { hours = $1.to_f; hours /= 60 if $2.starts_with?("m"); "" }
|
177
172
|
clean_message.gsub!(EXTRA_ATTRIBUTE_PATTERN) { (attributes[$1] ||= []).push($2); "" }
|
178
173
|
while clean_message.gsub!(TAG_PATTERN) { tags << $1; "" }; end
|
179
|
-
|
174
|
+
|
180
175
|
{tags: tags, tickets: tickets, hours_worked: hours, attributes: attributes, clean_message: clean_message.strip}
|
181
176
|
end
|
182
|
-
|
177
|
+
|
183
178
|
def self.normalize_commit_message(message)
|
184
179
|
message = message[/^.*(?=\n\n)/] || message # just take the first paragraph of the commit message
|
185
180
|
message = message.gsub(/[\n\s]+/, ' ') # normalize white space within the message
|
186
181
|
end
|
187
|
-
|
188
|
-
|
189
|
-
|
182
|
+
|
183
|
+
|
184
|
+
|
190
185
|
TAG_PATTERN = /^\s*\[([^\]]+)\]\s*/.freeze
|
191
|
-
|
186
|
+
|
192
187
|
TICKET_PATTERN = /\[#(\d+)([a-z]*)\]/.freeze
|
193
|
-
|
188
|
+
|
194
189
|
TIME_PATTERN = /\((\d*\.?\d+) ?(h|hrs?|hours?|m|min|minutes?)\)/.freeze
|
195
|
-
|
190
|
+
|
196
191
|
EXTRA_ATTRIBUTE_PATTERN = /\{\{([^:\}]+):[ \s]*([^\}]+)\}\}/.freeze
|
197
|
-
|
192
|
+
|
198
193
|
MERGE_COMMIT_PATTERN = /^Merge\b/.freeze
|
199
|
-
|
200
|
-
|
201
|
-
|
194
|
+
|
195
|
+
|
196
|
+
|
202
197
|
def associate_tickets_with_self
|
203
198
|
self.tickets = identify_tickets
|
204
199
|
end
|
205
|
-
|
200
|
+
|
206
201
|
def associate_tasks_with_self
|
207
202
|
self.tasks = identify_tasks
|
208
|
-
|
203
|
+
|
209
204
|
tasks.each do |task|
|
210
205
|
task.committed!(self)
|
211
206
|
end
|
212
207
|
end
|
213
|
-
|
208
|
+
|
214
209
|
def associate_committers_with_self
|
215
210
|
self.committers = identify_committers
|
216
211
|
end
|
217
|
-
|
218
|
-
|
219
|
-
|
212
|
+
|
213
|
+
|
214
|
+
|
220
215
|
def create_test_run!
|
221
216
|
super(project: project, sha: sha, commit: self)
|
222
217
|
end
|
223
|
-
|
224
|
-
|
225
|
-
|
218
|
+
|
219
|
+
|
220
|
+
|
226
221
|
private
|
227
|
-
|
222
|
+
|
228
223
|
def parsed_message
|
229
224
|
@parsed_message ||= self.class.parse_message(message)
|
230
225
|
end
|
231
|
-
|
226
|
+
|
232
227
|
def identify_tickets
|
233
228
|
project.find_or_create_tickets_by_number(ticket_numbers)
|
234
229
|
end
|
235
|
-
|
230
|
+
|
236
231
|
def identify_tasks
|
237
232
|
tickets.each_with_object([]) do |ticket, tasks|
|
238
|
-
|
233
|
+
|
239
234
|
# Allow committers who are not using the Tasks feature
|
240
235
|
# to mention a ticket (e.g. [#45]) and record progress
|
241
236
|
# against its only (default) task.
|
@@ -247,9 +242,9 @@ private
|
|
247
242
|
letters = ticket_tasks.fetch(ticket.number) do
|
248
243
|
ticket.tasks.count == 1 ? [ticket.tasks.first.letter] : []
|
249
244
|
end
|
250
|
-
|
245
|
+
|
251
246
|
tasks.concat ticket.tasks.lettered(*letters)
|
252
247
|
end
|
253
248
|
end
|
254
|
-
|
249
|
+
|
255
250
|
end
|
data/app/models/deploy.rb
CHANGED
@@ -1,38 +1,38 @@
|
|
1
1
|
class Deploy < ActiveRecord::Base
|
2
2
|
include BelongsToCommit
|
3
|
-
|
3
|
+
|
4
4
|
belongs_to :project
|
5
5
|
has_one :release
|
6
6
|
belongs_to :user
|
7
|
-
|
7
|
+
|
8
8
|
validates :project_id, :environment_name, presence: true
|
9
|
-
|
9
|
+
|
10
10
|
default_scope { order("completed_at DESC") }
|
11
|
-
|
11
|
+
|
12
12
|
before_save :identify_deployer, if: :deployer
|
13
13
|
after_save :notify_if_completed
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
|
16
16
|
class << self
|
17
17
|
def completed
|
18
18
|
where arel_table[:completed_at].not_eq(nil)
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def to_environment(environment_name)
|
22
22
|
where(environment_name: environment_name)
|
23
23
|
end
|
24
24
|
alias :to :to_environment
|
25
|
-
|
25
|
+
|
26
26
|
def before(time)
|
27
27
|
where arel_table[:completed_at].lt(time)
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def environments
|
31
31
|
reorder(nil).pluck "DISTINCT environment_name"
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
|
34
|
+
|
35
|
+
|
36
36
|
def build_release
|
37
37
|
@release ||= Release.new(
|
38
38
|
project: project,
|
@@ -41,12 +41,12 @@ class Deploy < ActiveRecord::Base
|
|
41
41
|
commit1: sha,
|
42
42
|
deploy: self)
|
43
43
|
end
|
44
|
-
|
45
|
-
|
44
|
+
|
45
|
+
|
46
46
|
def commits
|
47
47
|
@commits ||= find_commits
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def previous_deploy
|
51
51
|
@previous_deploy ||= project.deploys
|
52
52
|
.completed
|
@@ -54,50 +54,54 @@ class Deploy < ActiveRecord::Base
|
|
54
54
|
.before(completed_at || Time.now)
|
55
55
|
.first
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def completed?
|
59
59
|
completed_at.present?
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
def environment
|
63
63
|
environment_name
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
def environment_name=(value)
|
67
67
|
super value.downcase
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def output_stream
|
71
71
|
@output_stream ||= OutputStream.new(self)
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def date
|
75
75
|
completed_at.to_date
|
76
76
|
end
|
77
|
-
|
78
|
-
|
79
|
-
|
77
|
+
|
78
|
+
def url
|
79
|
+
"https://#{Houston.config.host}/projects/#{project.slug}/deploys/#{id}"
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
|
80
84
|
private
|
81
|
-
|
85
|
+
|
82
86
|
def find_commits
|
83
87
|
return [] unless sha
|
84
88
|
return [] unless previous_deploy
|
85
89
|
project.commits.between(previous_deploy.sha, sha)
|
86
90
|
end
|
87
|
-
|
91
|
+
|
88
92
|
def identify_deployer
|
89
93
|
self.user = User.find_by_email_address(deployer)
|
90
94
|
end
|
91
|
-
|
95
|
+
|
92
96
|
def notify_if_completed
|
93
97
|
if just_completed?
|
94
98
|
update_column :duration, completed_at - created_at if duration.nil?
|
95
99
|
Houston.observer.fire "deploy:completed", self
|
96
100
|
end
|
97
101
|
end
|
98
|
-
|
102
|
+
|
99
103
|
def just_completed?
|
100
104
|
completed_at_changed? && completed?
|
101
105
|
end
|
102
|
-
|
106
|
+
|
103
107
|
end
|
data/app/models/environment.rb
CHANGED
@@ -1,39 +1,39 @@
|
|
1
1
|
class Environment
|
2
|
-
|
2
|
+
|
3
3
|
def initialize(project, environment_name)
|
4
4
|
@project = project
|
5
5
|
@environment_name = environment_name
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
attr_reader :project, :environment_name
|
9
|
-
|
9
|
+
|
10
10
|
def last_deploy
|
11
11
|
@last_deploy ||= project.deploys.completed.to(environment_name).first
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def head
|
15
15
|
return (environment_name == "Production" ? "c7c7380" : "98318a3") if Rails.env.development?
|
16
16
|
@head ||= last_deploy.try(:commit)
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def read_file(path)
|
20
20
|
project.read_file(path, commit: head) if head
|
21
21
|
rescue Houston::Adapters::VersionControl::CommitNotFound
|
22
22
|
nil
|
23
23
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
|
25
|
+
|
26
|
+
|
27
27
|
def dependency_version(dependency)
|
28
28
|
lockfile = read_file("Gemfile.lock")
|
29
29
|
return nil unless lockfile
|
30
|
-
|
30
|
+
|
31
31
|
dependency = dependency.to_s
|
32
32
|
locked_gems = Bundler::LockfileParser.new(lockfile)
|
33
33
|
spec = locked_gems.specs.find { |spec| spec.name == dependency }
|
34
34
|
spec.version if spec
|
35
35
|
end
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
|
37
|
+
|
38
|
+
|
39
39
|
end
|
@@ -12,24 +12,24 @@
|
|
12
12
|
#
|
13
13
|
module Github
|
14
14
|
class CommitStatusReport
|
15
|
-
|
15
|
+
|
16
16
|
def self.publish!(test_run)
|
17
17
|
self.new(test_run).publish!
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def initialize(test_run)
|
21
21
|
@access_token = Houston.config.github[:access_token]
|
22
22
|
@project = test_run.project
|
23
23
|
@test_run = test_run
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
attr_reader :access_token, :project, :test_run
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
|
28
|
+
|
29
|
+
|
30
30
|
def publish!
|
31
31
|
return no_access_token unless access_token
|
32
|
-
|
32
|
+
|
33
33
|
Houston.try({max_tries: 5}, Faraday::Error::ConnectionFailed) do
|
34
34
|
Rails.logger.info "[github/commit_status_report:publish!] POST #{state} to #{github_status_url}"
|
35
35
|
response = Faraday.post(github_status_url, payload)
|
@@ -37,37 +37,37 @@ module Github
|
|
37
37
|
response
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def github_status_url
|
42
42
|
project.repo.commit_status_url(test_run.sha) << "?access_token=#{access_token}"
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def state
|
46
46
|
return "pending" unless test_run.completed?
|
47
47
|
{"pass" => "success", "fail" => "failure"}.fetch(test_run.result.to_s, "error")
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def payload
|
51
51
|
MultiJson.dump(
|
52
52
|
state: state,
|
53
53
|
context: "jenkins",
|
54
54
|
description: test_run.short_description,
|
55
|
-
target_url: test_run.
|
55
|
+
target_url: test_run.url)
|
56
56
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
|
58
|
+
|
59
|
+
|
60
60
|
def no_access_token
|
61
61
|
message = "Houston can publish your test results to GitHub"
|
62
62
|
additional_info = "Supply github/access_token in Houston's config.rb"
|
63
63
|
ProjectNotification.ci_configuration_error(test_run, message, additional_info: additional_info).deliver!
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
def bad_response(response)
|
67
67
|
message = "Houston was unable to publish your commit status to GitHub"
|
68
68
|
additional_info = "GitHub returned #{response.status}: #{response.body} (URL: #{github_status_url})"
|
69
69
|
ProjectNotification.ci_configuration_error(test_run, message, additional_info: additional_info).deliver!
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
end
|
73
73
|
end
|