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
@@ -3,6 +3,7 @@ module Github
|
|
3
3
|
self.table_name = "pull_requests"
|
4
4
|
|
5
5
|
attr_readonly :project_id, :user_id, :repo, :number, :username, :base_ref, :base_sha, :url
|
6
|
+
attr_accessor :actor
|
6
7
|
|
7
8
|
belongs_to :project
|
8
9
|
belongs_to :user
|
@@ -10,7 +11,7 @@ module Github
|
|
10
11
|
|
11
12
|
before_validation :associate_project_with_self, if: :repo_changed?
|
12
13
|
before_save :associate_user_with_self, if: :username_changed?
|
13
|
-
after_commit :associate_commits_with_self,
|
14
|
+
after_commit :associate_commits_with_self, autosave: false
|
14
15
|
|
15
16
|
after_destroy { Houston.observer.fire "github:pull:closed", self }
|
16
17
|
after_create { Houston.observer.fire "github:pull:opened", self }
|
@@ -18,6 +19,7 @@ module Github
|
|
18
19
|
|
19
20
|
validates :project_id, :title, :number, :repo, :url, :base_ref, :base_sha, :head_ref, :head_sha,
|
20
21
|
presence: true
|
22
|
+
validates :number, uniqueness: { scope: :project_id }
|
21
23
|
|
22
24
|
class << self
|
23
25
|
def fetch!
|
@@ -49,7 +51,7 @@ module Github
|
|
49
51
|
|
50
52
|
# Create or Update existing pulls
|
51
53
|
expected_pulls.map do |expected_pr|
|
52
|
-
existing_pr = existing_pulls.detect { |existing_pr|
|
54
|
+
existing_pr = existing_pulls.detect { |existing_pr|
|
53
55
|
expected_pr["base"]["repo"]["name"] == existing_pr.repo &&
|
54
56
|
expected_pr["number"] == existing_pr.number }
|
55
57
|
|
@@ -61,19 +63,34 @@ module Github
|
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
64
|
-
def close!(github_pr)
|
66
|
+
def close!(github_pr, options={})
|
65
67
|
pr = find_by(
|
66
68
|
repo: github_pr["base"]["repo"]["name"],
|
67
69
|
number: github_pr["number"])
|
68
|
-
|
70
|
+
return unless pr
|
71
|
+
|
72
|
+
pr.actor = options[:as]
|
73
|
+
pr.destroy
|
69
74
|
end
|
70
75
|
|
71
|
-
def upsert!(github_pr)
|
76
|
+
def upsert!(github_pr, options={})
|
77
|
+
retry_count ||= 0
|
78
|
+
upsert(github_pr).tap do |pr|
|
79
|
+
if pr.valid?
|
80
|
+
pr.actor = options[:as]
|
81
|
+
pr.save
|
82
|
+
end
|
83
|
+
end
|
84
|
+
rescue ActiveRecord::RecordNotUnique
|
85
|
+
retry unless (retry_count += 1) > 1
|
86
|
+
raise
|
87
|
+
end
|
88
|
+
|
89
|
+
def upsert(github_pr)
|
72
90
|
Github::PullRequest.find_or_initialize_by(
|
73
91
|
repo: github_pr["base"]["repo"]["name"],
|
74
92
|
number: github_pr["number"])
|
75
93
|
.merge_attributes(github_pr)
|
76
|
-
.tap { |pr| pr.save if pr.valid? }
|
77
94
|
end
|
78
95
|
end
|
79
96
|
|
@@ -87,12 +104,18 @@ module Github
|
|
87
104
|
super Array(value).uniq.join("\n")
|
88
105
|
end
|
89
106
|
|
90
|
-
def add_label!(label)
|
91
|
-
|
107
|
+
def add_label!(label, options={})
|
108
|
+
transaction do
|
109
|
+
pr = self.class.lock.find id
|
110
|
+
pr.update_attributes! labels: pr.labels + [label], actor: options[:as]
|
111
|
+
end
|
92
112
|
end
|
93
113
|
|
94
|
-
def remove_label!(label)
|
95
|
-
|
114
|
+
def remove_label!(label, options={})
|
115
|
+
transaction do
|
116
|
+
pr = self.class.lock.find id
|
117
|
+
pr.update_attributes! labels: pr.labels - [label], actor: options[:as]
|
118
|
+
end
|
96
119
|
end
|
97
120
|
|
98
121
|
|
@@ -100,7 +123,7 @@ module Github
|
|
100
123
|
def merge_attributes(pr)
|
101
124
|
if new_record?
|
102
125
|
self.repo = pr["base"]["repo"]["name"]
|
103
|
-
self.number = pr["number"]
|
126
|
+
self.number = pr["number"]
|
104
127
|
self.username = pr["user"]["login"]
|
105
128
|
self.url = pr["html_url"]
|
106
129
|
self.base_sha = pr["base"]["sha"]
|
@@ -126,7 +149,7 @@ module Github
|
|
126
149
|
end
|
127
150
|
|
128
151
|
def associate_commits_with_self
|
129
|
-
self.commits = project.commits.between(base_sha, head_sha)
|
152
|
+
self.commits = project.commits.between(base_sha, head_sha)
|
130
153
|
end
|
131
154
|
|
132
155
|
end
|
@@ -2,13 +2,14 @@ require "github/event"
|
|
2
2
|
|
3
3
|
module Github
|
4
4
|
class PullRequestEvent < Event
|
5
|
-
attr_reader :action, :pull_request
|
5
|
+
attr_reader :action, :pull_request, :actor
|
6
6
|
|
7
7
|
# https://developer.github.com/v3/activity/events/types/#pullrequestevent
|
8
8
|
def initialize(payload)
|
9
9
|
super
|
10
10
|
@action = payload.fetch "action"
|
11
11
|
@pull_request = payload.fetch "pull_request"
|
12
|
+
@actor = payload.fetch("sender", {})["login"]
|
12
13
|
end
|
13
14
|
|
14
15
|
def process!
|
@@ -21,21 +22,21 @@ module Github
|
|
21
22
|
|
22
23
|
# Delete pull requests when they are closed
|
23
24
|
if action == "closed"
|
24
|
-
PullRequest.close! pull_request
|
25
|
+
PullRequest.close! pull_request, as: actor
|
25
26
|
return
|
26
27
|
end
|
27
28
|
|
28
29
|
# Ensure that we have a record of this open pull request
|
29
30
|
# action: labeled, unlabeled, opened, reopened, or synchronized
|
30
|
-
pr = PullRequest.upsert! pull_request
|
31
|
+
pr = PullRequest.upsert! pull_request, as: actor
|
31
32
|
|
32
33
|
# The Pull Request may be invalid if it isn't for a
|
33
34
|
# project that exists in Houston.
|
34
35
|
return unless pr && pr.persisted?
|
35
36
|
|
36
37
|
case action
|
37
|
-
when "labeled" then pr.add_label! payload["label"]["name"]
|
38
|
-
when "unlabeled" then pr.remove_label! payload["label"]["name"]
|
38
|
+
when "labeled" then pr.add_label! payload["label"]["name"], as: actor
|
39
|
+
when "unlabeled" then pr.remove_label! payload["label"]["name"], as: actor
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
data/app/models/github_token.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
class KeyDependency
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
|
4
4
|
def initialize(attributes={})
|
5
5
|
@slug = attributes[:slug]
|
6
6
|
@name = attributes.fetch(:as, @slug.titleize)
|
7
7
|
@target_versions = attributes.fetch(:target_versions, []).map(&Gem::Version.method(:new))
|
8
8
|
end
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
|
10
|
+
|
11
|
+
|
12
12
|
attr_reader :slug, :name, :target_versions
|
13
|
-
|
13
|
+
|
14
14
|
def versions
|
15
15
|
@versions ||= KeyDependency.versions_for(self)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def latest_version
|
19
19
|
versions.first
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def to_s
|
23
23
|
slug
|
24
24
|
end
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
|
26
|
+
|
27
|
+
|
28
28
|
def self.all
|
29
29
|
@dependency_versions ||= Houston.config.key_dependencies.map do |dependency|
|
30
30
|
KeyDependency.new(dependency)
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
|
34
|
+
|
35
|
+
|
36
36
|
def self.versions_for(dependency)
|
37
|
-
|
37
|
+
|
38
38
|
# Right now the only supported dependencies are Ruby Gems
|
39
39
|
# In the future, as other kinds of dependencies are supported,
|
40
40
|
# we'll support different adapters to fetch their version info
|
41
41
|
Rubygems::Gem.new(dependency.slug).versions
|
42
42
|
end
|
43
|
-
|
44
|
-
|
43
|
+
|
44
|
+
|
45
45
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class MaintenanceLight
|
2
|
-
|
2
|
+
|
3
3
|
def initialize(dependency, color, message)
|
4
4
|
@version = dependency.version
|
5
5
|
@dependency_name = dependency.name
|
6
6
|
@color = color
|
7
7
|
@message = message
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
attr_reader :version, :dependency_name, :color, :message
|
11
|
-
|
11
|
+
|
12
12
|
end
|
data/app/models/measurement.rb
CHANGED
@@ -1,61 +1,61 @@
|
|
1
1
|
class Measurement < ActiveRecord::Base
|
2
|
-
|
2
|
+
|
3
3
|
belongs_to :subject, polymorphic: true
|
4
|
-
|
4
|
+
|
5
5
|
validates :name, :value, :taken_at, presence: true
|
6
6
|
validates :name, length: { maximum: 50 }
|
7
|
-
|
7
|
+
|
8
8
|
default_scope -> { order(arel_table[:taken_at].desc) }
|
9
|
-
|
9
|
+
|
10
10
|
class << self
|
11
11
|
def take!(attributes)
|
12
12
|
required_keys = [:subject_type, :subject_id, :taken_at, :name].freeze
|
13
|
-
|
13
|
+
|
14
14
|
identifying_attributes = attributes.pick(required_keys)
|
15
15
|
subject = attributes[:subject]
|
16
16
|
identifying_attributes.merge!(subject_type: subject.class.name, subject_id: subject.id) if subject
|
17
17
|
identifying_attributes.reverse_merge!(subject_type: nil, subject_id: nil)
|
18
|
-
|
18
|
+
|
19
19
|
required_keys.each do |key|
|
20
20
|
raise ArgumentError, "#{key.inspect} is required to take a measurement" unless identifying_attributes.key?(key)
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
find_or_initialize_by(identifying_attributes).tap do |measurement|
|
24
24
|
measurement.value = attributes[:value]
|
25
25
|
measurement.save!
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def taken_at(time)
|
30
30
|
where(taken_at: time)
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def taken_on(date)
|
34
34
|
where(taken_on: date)
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def taken_before(date)
|
38
38
|
where(arel_table[:taken_on].lteq(date))
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def taken_after(date)
|
42
42
|
where(arel_table[:taken_on].gteq(date))
|
43
43
|
end
|
44
44
|
alias :taken_since :taken_after
|
45
|
-
|
45
|
+
|
46
46
|
def taken_between(date0, date1)
|
47
47
|
taken_after(date0).taken_before(date1)
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def for(subject)
|
51
51
|
return where(subject_type: nil, subject_id: nil) if subject.nil?
|
52
52
|
where(subject_type: subject.class.name, subject_id: subject.id)
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def global
|
56
56
|
self.for(nil)
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
# Valid identifies for names
|
60
60
|
# - weekly.hours.charged
|
61
61
|
# - weekly.hours.charged.*
|
@@ -69,21 +69,21 @@ class Measurement < ActiveRecord::Base
|
|
69
69
|
.gsub(/\*$/, "%") }
|
70
70
|
where(["name SIMILAR TO ?", "(#{name_patterns.join("|")})"])
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def total
|
74
74
|
pluck(:value).inject(0) { |sum, value| sum + value.to_d }
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
def value
|
78
78
|
limit(1).pluck(:value)[0]
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def mean
|
82
82
|
denominator = count
|
83
83
|
return nil if denominator.zero?
|
84
84
|
total.to_f / denominator
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
def debug(colored: true)
|
88
88
|
format_subject = ->(s) { s.is_a?(User) ? s.first_name : s.is_a?(Project) ? s.slug : "" }
|
89
89
|
includes(:subject).reorder("taken_at ASC, subject_type ASC, subject_id ASC, name ASC").map { |m|
|
@@ -97,14 +97,14 @@ class Measurement < ActiveRecord::Base
|
|
97
97
|
line }.join("\n")
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
def taken_at=(value)
|
102
102
|
super
|
103
103
|
self.taken_on = value && value.to_date
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
def taken_on?(date)
|
107
107
|
taken_on == date
|
108
108
|
end
|
109
|
-
|
109
|
+
|
110
110
|
end
|
data/app/models/menu_item.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
class MenuItem
|
2
2
|
include ERB::Util
|
3
|
-
|
3
|
+
|
4
4
|
def initialize(name, href)
|
5
5
|
@name = name
|
6
6
|
@href = href
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
attr_reader :href
|
10
|
-
|
10
|
+
|
11
11
|
def display
|
12
12
|
h @name
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def to_html
|
16
16
|
"<li><a href=\"#{href}\">#{display}</a></li>".html_safe
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
end
|
data/app/models/milestone.rb
CHANGED
@@ -1,106 +1,106 @@
|
|
1
1
|
class Milestone < ActiveRecord::Base
|
2
2
|
extend Nosync
|
3
|
-
|
3
|
+
|
4
4
|
belongs_to :project
|
5
5
|
has_many :tickets, -> { reorder("NULLIF(tickets.extended_attributes->'milestoneSequence', '')::int") }
|
6
|
-
|
6
|
+
|
7
7
|
versioned only: [:name, :start_date, :end_date, :band, :lanes], class_name: "MilestoneVersion", initial_version: true
|
8
|
-
|
8
|
+
|
9
9
|
default_scope { where(destroyed_at: nil).order(:start_date) }
|
10
|
-
|
10
|
+
|
11
11
|
validates :project_id, presence: true
|
12
12
|
validates :name, presence: true, uniqueness: {scope: :project_id}
|
13
|
-
|
13
|
+
|
14
14
|
after_save :propagate_name_change, if: :name_changed?
|
15
|
-
|
15
|
+
|
16
16
|
delegate :ticket_tracker, to: :project
|
17
17
|
delegate :nosync?, to: "self.class"
|
18
|
-
|
18
|
+
|
19
19
|
class << self
|
20
20
|
def empty
|
21
21
|
where(tickets_count: 0)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def populated
|
25
25
|
where(arel_table[:tickets_count].gt(0))
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def completed
|
29
29
|
where(
|
30
30
|
arel_table[:tickets_count].gt(0).and(
|
31
31
|
arel_table[:closed_tickets_count].eq(arel_table[:tickets_count])))
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def uncompleted
|
35
35
|
where(
|
36
36
|
arel_table[:tickets_count].eq(0).or(
|
37
37
|
arel_table[:closed_tickets_count].lt(arel_table[:tickets_count])))
|
38
38
|
end
|
39
39
|
alias :open :uncompleted
|
40
|
-
|
40
|
+
|
41
41
|
def visible
|
42
42
|
where(arel_table[:start_date].not_eq(nil)).
|
43
43
|
where(arel_table[:end_date].not_eq(nil))
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def current
|
47
47
|
during(Date.today..Date.today)
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def during(range)
|
51
51
|
visible
|
52
52
|
.where(arel_table[:start_date].lteq(range.end))
|
53
53
|
.where(arel_table[:end_date].gteq(range.begin))
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
def without(milestones)
|
57
57
|
without_remote_ids(milestones.map(&:remote_id))
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def without_remote_ids(*ids)
|
61
61
|
where(arel_table[:remote_id].not_in(ids.flatten.map(&:to_i)))
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def remote_id_map
|
65
65
|
query = select("remote_id, id").to_sql
|
66
66
|
connection.select_rows(query).each_with_object({}) { |(remote_id, id), map| map[remote_id.to_i] = id.to_i }
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def id_for_remote_id(remote_id)
|
70
70
|
return nil if remote_id.nil? or remote_id == 0
|
71
71
|
where(remote_id: remote_id).pluck(:id).first
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
|
75
|
+
|
76
|
+
|
77
77
|
def completed?
|
78
78
|
tickets_count > 0 && closed_tickets_count == tickets_count
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def uncompleted?
|
82
82
|
!completed?
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
def close!
|
86
86
|
project.ticket_tracker.close_milestone!(self) if project.ticket_tracker.respond_to?(:close_milestone!)
|
87
87
|
touch :completed_at
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
def remote_milestone
|
91
91
|
@remote_milestone ||= ticket_tracker.find_milestone(remote_id) if ticket_tracker.respond_to?(:find_milestone)
|
92
92
|
end
|
93
93
|
alias :remote :remote_milestone
|
94
|
-
|
94
|
+
|
95
95
|
def update_closed_tickets_count!
|
96
96
|
update_column :closed_tickets_count, tickets.closed.count
|
97
97
|
end
|
98
|
-
|
98
|
+
|
99
99
|
private
|
100
|
-
|
100
|
+
|
101
101
|
def propagate_name_change
|
102
102
|
return if nosync?
|
103
103
|
remote_milestone.update_name!(name) if remote_milestone.respond_to?(:update_name!)
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
end
|
data/app/models/output_stream.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require "thread_safe"
|
2
2
|
|
3
3
|
class OutputStream
|
4
|
-
|
4
|
+
|
5
5
|
def initialize(deploy)
|
6
6
|
@deploy = deploy
|
7
7
|
@lines = ThreadSafe::Array.new
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def <<(value)
|
11
11
|
@lines.push(value)
|
12
12
|
begin
|
@@ -18,9 +18,9 @@ class OutputStream
|
|
18
18
|
end
|
19
19
|
self
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def to_s
|
23
23
|
@lines.join
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
class PostReceivePayload
|
2
|
-
|
2
|
+
|
3
3
|
def initialize(params)
|
4
4
|
parse_params(params)
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
attr_accessor :agent_email, :commit, :branch
|
8
|
-
|
8
|
+
|
9
9
|
def parsed?
|
10
10
|
commit.present?
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def parse_params(params)
|
14
14
|
(params = MultiJson.load(params["payload"])) if params.key?("payload")
|
15
15
|
parse_github_style_params(params) if params
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def parse_github_style_params(params)
|
19
19
|
self.commit = params["after"]
|
20
20
|
self.agent_email = parse_github_style_agent(params["pusher"])
|
21
21
|
self.branch = params["ref"].split("/").last if params.key?("ref")
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def parse_github_style_agent(pusher)
|
25
25
|
return nil unless pusher && pusher.key?("email")
|
26
26
|
return pusher["email"] unless pusher.key?("name")
|
27
27
|
"#{pusher["name"].inspect} <#{pusher["email"]}>"
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
end
|