summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml5
-rw-r--r--.rubocop.yml6
-rw-r--r--Dangerfile1
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock18
-rw-r--r--Gemfile.rails5.lock12
-rw-r--r--app/assets/javascripts/issue_show/components/edited.vue2
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js20
-rw-r--r--app/assets/javascripts/notes/components/note_edited_text.vue2
-rw-r--r--app/assets/javascripts/notes/index.js2
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/assignees.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/participants/participants.vue2
-rw-r--r--app/assets/javascripts/users_select.js4
-rw-r--r--app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue3
-rw-r--r--app/assets/stylesheets/framework/avatar.scss4
-rw-r--r--app/assets/stylesheets/framework/common.scss2
-rw-r--r--app/assets/stylesheets/framework/forms.scss2
-rw-r--r--app/assets/stylesheets/framework/highlight.scss8
-rw-r--r--app/assets/stylesheets/framework/jquery.scss2
-rw-r--r--app/assets/stylesheets/framework/lists.scss4
-rw-r--r--app/assets/stylesheets/framework/mixins.scss4
-rw-r--r--app/assets/stylesheets/framework/sidebar.scss12
-rw-r--r--app/assets/stylesheets/framework/stacked_progress_bar.scss2
-rw-r--r--app/assets/stylesheets/framework/typography.scss8
-rw-r--r--app/assets/stylesheets/framework/variables.scss20
-rw-r--r--app/assets/stylesheets/mailers/highlighted_diff_email.scss4
-rw-r--r--app/assets/stylesheets/pages/boards.scss2
-rw-r--r--app/assets/stylesheets/pages/commits.scss2
-rw-r--r--app/assets/stylesheets/pages/cycle_analytics.scss2
-rw-r--r--app/assets/stylesheets/pages/detail_page.scss2
-rw-r--r--app/assets/stylesheets/pages/diff.scss6
-rw-r--r--app/assets/stylesheets/pages/editor.scss2
-rw-r--r--app/assets/stylesheets/pages/environments.scss2
-rw-r--r--app/assets/stylesheets/pages/issuable.scss16
-rw-r--r--app/assets/stylesheets/pages/issues.scss2
-rw-r--r--app/assets/stylesheets/pages/merge_conflicts.scss210
-rw-r--r--app/assets/stylesheets/pages/merge_requests.scss2
-rw-r--r--app/assets/stylesheets/pages/note_form.scss2
-rw-r--r--app/assets/stylesheets/pages/notes.scss4
-rw-r--r--app/assets/stylesheets/pages/repo.scss2
-rw-r--r--app/assets/stylesheets/snippets.scss16
-rw-r--r--app/controllers/profiles_controller.rb3
-rw-r--r--app/controllers/projects/wikis_controller.rb6
-rw-r--r--app/controllers/users_controller.rb6
-rw-r--r--app/finders/personal_projects_finder.rb4
-rw-r--r--app/finders/user_recent_events_finder.rb3
-rw-r--r--app/helpers/projects_helper.rb4
-rw-r--r--app/helpers/users_helper.rb8
-rw-r--r--app/models/concerns/reactive_caching.rb10
-rw-r--r--app/models/email.rb4
-rw-r--r--app/models/project.rb5
-rw-r--r--app/models/project_feature.rb26
-rw-r--r--app/models/project_wiki.rb2
-rw-r--r--app/models/site_statistic.rb74
-rw-r--r--app/policies/application_setting/term_policy.rb2
-rw-r--r--app/policies/base_policy.rb2
-rw-r--r--app/policies/ci/build_policy.rb2
-rw-r--r--app/policies/ci/pipeline_policy.rb2
-rw-r--r--app/policies/ci/pipeline_schedule_policy.rb2
-rw-r--r--app/policies/ci/runner_policy.rb2
-rw-r--r--app/policies/ci/trigger_policy.rb2
-rw-r--r--app/policies/clusters/cluster_policy.rb2
-rw-r--r--app/policies/commit_status_policy.rb2
-rw-r--r--app/policies/deploy_key_policy.rb2
-rw-r--r--app/policies/deploy_token_policy.rb2
-rw-r--r--app/policies/deployment_policy.rb2
-rw-r--r--app/policies/environment_policy.rb2
-rw-r--r--app/policies/external_issue_policy.rb2
-rw-r--r--app/policies/global_policy.rb2
-rw-r--r--app/policies/group_label_policy.rb2
-rw-r--r--app/policies/group_member_policy.rb2
-rw-r--r--app/policies/group_policy.rb2
-rw-r--r--app/policies/issuable_policy.rb2
-rw-r--r--app/policies/issue_policy.rb2
-rw-r--r--app/policies/merge_request_policy.rb2
-rw-r--r--app/policies/namespace_policy.rb2
-rw-r--r--app/policies/nil_policy.rb2
-rw-r--r--app/policies/note_policy.rb2
-rw-r--r--app/policies/personal_snippet_policy.rb2
-rw-r--r--app/policies/project_label_policy.rb2
-rw-r--r--app/policies/project_member_policy.rb2
-rw-r--r--app/policies/project_policy.rb2
-rw-r--r--app/policies/project_policy/class_methods.rb2
-rw-r--r--app/policies/project_snippet_policy.rb2
-rw-r--r--app/policies/protected_branch_policy.rb2
-rw-r--r--app/policies/user_policy.rb8
-rw-r--r--app/presenters/ci/build_metadata_presenter.rb2
-rw-r--r--app/presenters/ci/build_presenter.rb2
-rw-r--r--app/presenters/ci/group_variable_presenter.rb2
-rw-r--r--app/presenters/ci/pipeline_presenter.rb2
-rw-r--r--app/presenters/ci/variable_presenter.rb2
-rw-r--r--app/presenters/clusters/cluster_presenter.rb2
-rw-r--r--app/presenters/commit_status_presenter.rb2
-rw-r--r--app/presenters/conversational_development_index/metric_presenter.rb2
-rw-r--r--app/presenters/generic_commit_status_presenter.rb2
-rw-r--r--app/presenters/group_member_presenter.rb2
-rw-r--r--app/presenters/member_presenter.rb2
-rw-r--r--app/presenters/members_presenter.rb2
-rw-r--r--app/presenters/merge_request_presenter.rb2
-rw-r--r--app/presenters/project_member_presenter.rb2
-rw-r--r--app/presenters/project_presenter.rb2
-rw-r--r--app/presenters/projects/settings/deploy_keys_presenter.rb2
-rw-r--r--app/serializers/analytics_build_entity.rb2
-rw-r--r--app/serializers/analytics_build_serializer.rb2
-rw-r--r--app/serializers/analytics_commit_entity.rb2
-rw-r--r--app/serializers/analytics_commit_serializer.rb2
-rw-r--r--app/serializers/analytics_generic_serializer.rb2
-rw-r--r--app/serializers/analytics_issue_entity.rb2
-rw-r--r--app/serializers/analytics_issue_serializer.rb2
-rw-r--r--app/serializers/analytics_merge_request_entity.rb2
-rw-r--r--app/serializers/analytics_merge_request_serializer.rb2
-rw-r--r--app/serializers/analytics_stage_entity.rb2
-rw-r--r--app/serializers/analytics_stage_serializer.rb2
-rw-r--r--app/serializers/analytics_summary_entity.rb2
-rw-r--r--app/serializers/analytics_summary_serializer.rb2
-rw-r--r--app/serializers/award_emoji_entity.rb2
-rw-r--r--app/serializers/base_serializer.rb2
-rw-r--r--app/serializers/blob_entity.rb2
-rw-r--r--app/serializers/build_action_entity.rb2
-rw-r--r--app/serializers/build_artifact_entity.rb2
-rw-r--r--app/serializers/build_details_entity.rb2
-rw-r--r--app/serializers/build_metadata_entity.rb2
-rw-r--r--app/serializers/build_serializer.rb2
-rw-r--r--app/serializers/cluster_application_entity.rb2
-rw-r--r--app/serializers/cluster_entity.rb2
-rw-r--r--app/serializers/cluster_serializer.rb2
-rw-r--r--app/serializers/cohort_activity_month_entity.rb2
-rw-r--r--app/serializers/cohort_entity.rb2
-rw-r--r--app/serializers/cohorts_entity.rb2
-rw-r--r--app/serializers/cohorts_serializer.rb2
-rw-r--r--app/serializers/commit_entity.rb2
-rw-r--r--app/serializers/concerns/with_pagination.rb2
-rw-r--r--app/serializers/container_repositories_serializer.rb2
-rw-r--r--app/serializers/container_repository_entity.rb2
-rw-r--r--app/serializers/container_tag_entity.rb2
-rw-r--r--app/serializers/container_tags_serializer.rb2
-rw-r--r--app/serializers/deploy_key_entity.rb2
-rw-r--r--app/serializers/deploy_key_serializer.rb2
-rw-r--r--app/serializers/deploy_keys_project_entity.rb2
-rw-r--r--app/serializers/deployment_entity.rb2
-rw-r--r--app/serializers/deployment_serializer.rb2
-rw-r--r--app/serializers/diff_file_entity.rb2
-rw-r--r--app/serializers/diffs_entity.rb2
-rw-r--r--app/serializers/diffs_serializer.rb2
-rw-r--r--app/serializers/discussion_entity.rb2
-rw-r--r--app/serializers/discussion_serializer.rb2
-rw-r--r--app/serializers/entity_date_helper.rb23
-rw-r--r--app/serializers/entity_request.rb2
-rw-r--r--app/serializers/environment_entity.rb2
-rw-r--r--app/serializers/environment_serializer.rb2
-rw-r--r--app/serializers/group_child_entity.rb2
-rw-r--r--app/serializers/group_child_serializer.rb2
-rw-r--r--app/serializers/group_entity.rb2
-rw-r--r--app/serializers/group_serializer.rb2
-rw-r--r--app/serializers/group_variable_entity.rb2
-rw-r--r--app/serializers/group_variable_serializer.rb2
-rw-r--r--app/serializers/issuable_entity.rb2
-rw-r--r--app/serializers/issuable_sidebar_entity.rb2
-rw-r--r--app/serializers/issue_entity.rb2
-rw-r--r--app/serializers/issue_serializer.rb2
-rw-r--r--app/serializers/issue_sidebar_entity.rb2
-rw-r--r--app/serializers/job_entity.rb2
-rw-r--r--app/serializers/job_group_entity.rb2
-rw-r--r--app/serializers/label_entity.rb2
-rw-r--r--app/serializers/label_serializer.rb2
-rw-r--r--app/serializers/lfs_file_lock_entity.rb2
-rw-r--r--app/serializers/lfs_file_lock_serializer.rb2
-rw-r--r--app/serializers/merge_request_basic_entity.rb2
-rw-r--r--app/serializers/merge_request_basic_serializer.rb2
-rw-r--r--app/serializers/merge_request_create_entity.rb2
-rw-r--r--app/serializers/merge_request_create_serializer.rb2
-rw-r--r--app/serializers/merge_request_diff_entity.rb2
-rw-r--r--app/serializers/merge_request_metrics_entity.rb2
-rw-r--r--app/serializers/merge_request_serializer.rb2
-rw-r--r--app/serializers/merge_request_user_entity.rb2
-rw-r--r--app/serializers/merge_request_widget_entity.rb2
-rw-r--r--app/serializers/note_attachment_entity.rb2
-rw-r--r--app/serializers/note_entity.rb2
-rw-r--r--app/serializers/note_user_entity.rb2
-rw-r--r--app/serializers/pipeline_details_entity.rb2
-rw-r--r--app/serializers/pipeline_entity.rb2
-rw-r--r--app/serializers/pipeline_serializer.rb2
-rw-r--r--app/serializers/project_entity.rb2
-rw-r--r--app/serializers/project_mirror_entity.rb2
-rw-r--r--app/serializers/project_note_entity.rb2
-rw-r--r--app/serializers/project_note_serializer.rb2
-rw-r--r--app/serializers/project_serializer.rb2
-rw-r--r--app/serializers/request_aware_entity.rb2
-rw-r--r--app/serializers/runner_entity.rb2
-rw-r--r--app/serializers/stage_entity.rb2
-rw-r--r--app/serializers/stage_serializer.rb2
-rw-r--r--app/serializers/status_entity.rb2
-rw-r--r--app/serializers/submodule_entity.rb2
-rw-r--r--app/serializers/time_trackable_entity.rb2
-rw-r--r--app/serializers/tree_entity.rb2
-rw-r--r--app/serializers/tree_root_entity.rb2
-rw-r--r--app/serializers/tree_serializer.rb2
-rw-r--r--app/serializers/user_entity.rb2
-rw-r--r--app/serializers/user_serializer.rb2
-rw-r--r--app/serializers/variable_entity.rb2
-rw-r--r--app/serializers/variable_serializer.rb2
-rw-r--r--app/services/users/build_service.rb3
-rw-r--r--app/views/layouts/_recaptcha_verification.html.haml4
-rw-r--r--app/views/layouts/_search.html.haml10
-rw-r--r--app/views/layouts/admin.html.haml4
-rw-r--r--app/views/layouts/dashboard.html.haml4
-rw-r--r--app/views/layouts/devise.html.haml13
-rw-r--r--app/views/layouts/devise_empty.html.haml6
-rw-r--r--app/views/layouts/explore.html.haml4
-rw-r--r--app/views/layouts/group_settings.html.haml2
-rw-r--r--app/views/layouts/header/_default.html.haml16
-rw-r--r--app/views/layouts/header/_new_dropdown.haml24
-rw-r--r--app/views/layouts/help.html.haml6
-rw-r--r--app/views/layouts/koding.html.haml6
-rw-r--r--app/views/layouts/mailer.text.erb2
-rw-r--r--app/views/layouts/mailer/devise.html.haml12
-rw-r--r--app/views/layouts/nav/_breadcrumbs.html.haml2
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml42
-rw-r--r--app/views/layouts/nav/_explore.html.haml14
-rw-r--r--app/views/layouts/nav/sidebar/_admin.html.haml107
-rw-r--r--app/views/layouts/nav/sidebar/_group.html.haml52
-rw-r--r--app/views/layouts/nav/sidebar/_profile.html.haml54
-rw-r--r--app/views/layouts/nav/sidebar/_project.html.haml54
-rw-r--r--app/views/layouts/notify.html.haml7
-rw-r--r--app/views/layouts/profile.html.haml4
-rw-r--r--app/views/layouts/project_settings.html.haml2
-rw-r--r--app/views/layouts/search.html.haml4
-rw-r--r--app/views/layouts/snippets.html.haml2
-rw-r--r--app/views/profiles/show.html.haml6
-rw-r--r--app/views/shared/notes/_notes_with_form.html.haml2
-rw-r--r--app/views/users/show.html.haml74
-rw-r--r--changelogs/unreleased/38604-add-private-profile.yml5
-rw-r--r--changelogs/unreleased/40973-disable-rack-attack-by-default.yml5
-rw-r--r--changelogs/unreleased/43011-typecast-markdownversion-prop-notesapp.yml5
-rw-r--r--changelogs/unreleased/49025-docs-kubernetes-tiller.yml5
-rw-r--r--changelogs/unreleased/ce-6064-geo-sql-query-for-counting-projects-with-wikis-is-very-slow.yml5
-rw-r--r--changelogs/unreleased/fix-email-confirmation-addtional-email.yml5
-rw-r--r--changelogs/unreleased/frozen-string-danger.yml5
-rw-r--r--changelogs/unreleased/frozen-string-enable-app-presenters-policies.yml5
-rw-r--r--changelogs/unreleased/frozen-string-enable-app-serializers.yml5
-rw-r--r--changelogs/unreleased/kp-stacked-progress-bar-decimal-places.yml5
-rw-r--r--changelogs/unreleased/replace-all-snake-case-in-scss-variables.yml5
-rw-r--r--changelogs/unreleased/replace-snake-case-css-classes.yml5
-rw-r--r--changelogs/unreleased/sh-bump-sanitize-4-6-6.yml5
-rw-r--r--changelogs/unreleased/sh-include-rbtrace.yml5
-rw-r--r--changelogs/unreleased/sh-revert-markdown-changes.yml5
-rw-r--r--changelogs/unreleased/sh-use-wiki-limit-parameter-gitaly.yml5
-rw-r--r--changelogs/unreleased/zj-backup-timeout.yml5
-rw-r--r--config/initializers/1_settings.rb29
-rw-r--r--config/initializers/rbtrace.rb3
-rw-r--r--config/object_store_settings.rb15
-rw-r--r--danger/frozen_string/Dangerfile27
-rw-r--r--db/migrate/20140313092127_init_schema.rb9
-rw-r--r--db/migrate/20140407135544_fix_namespaces.rb1
-rw-r--r--db/migrate/20140415124820_limits_to_mysql.rb1
-rw-r--r--db/migrate/20140729145339_migrate_project_tags.rb1
-rw-r--r--db/migrate/20141121133009_add_timestamps_to_members.rb1
-rw-r--r--db/migrate/20141223135007_add_import_data_to_project_table.rb1
-rw-r--r--db/migrate/20150116234544_add_home_page_url_for_application_settings.rb1
-rw-r--r--db/migrate/20150116234545_add_gitlab_access_token_to_user.rb1
-rw-r--r--db/migrate/20150206222854_add_notification_email_to_user.rb1
-rw-r--r--db/migrate/20150211174341_allow_null_in_services_project_id.rb1
-rw-r--r--db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb1
-rw-r--r--db/migrate/20150223022001_set_missing_last_activity_at.rb1
-rw-r--r--db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb1
-rw-r--r--db/migrate/20150320234437_add_location_to_user.rb1
-rw-r--r--db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb1
-rw-r--r--db/migrate/20150327150017_add_import_data_to_project.rb1
-rw-r--r--db/migrate/20150327223628_add_devise_two_factor_to_users.rb1
-rw-r--r--db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb1
-rw-r--r--db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb1
-rw-r--r--db/migrate/20150411000035_fix_identities.rb1
-rw-r--r--db/migrate/20150411180045_rename_buildbox_service.rb1
-rw-r--r--db/migrate/20150417121913_create_project_import_data.rb1
-rw-r--r--db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb1
-rw-r--r--db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb1
-rw-r--r--db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb1
-rw-r--r--db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb1
-rw-r--r--db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb1
-rw-r--r--db/migrate/20150429002313_remove_abandoned_group_members_records.rb1
-rw-r--r--db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb1
-rw-r--r--db/migrate/20150509180749_convert_legacy_reference_notes.rb1
-rw-r--r--db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb1
-rw-r--r--db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb1
-rw-r--r--db/migrate/20150620233230_add_default_otp_required_for_login_value.rb1
-rw-r--r--db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb1
-rw-r--r--db/migrate/20150818213832_add_sent_notifications.rb1
-rw-r--r--db/migrate/20150915001905_enable_ssl_verification_by_default.rb1
-rw-r--r--db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb1
-rw-r--r--db/migrate/20150916114643_add_help_page_text_to_application_settings.rb1
-rw-r--r--db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb1
-rw-r--r--db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb1
-rw-r--r--db/migrate/20150920010715_add_consumed_timestep_to_users.rb1
-rw-r--r--db/migrate/20150920161119_add_line_code_to_sent_notification.rb1
-rw-r--r--db/migrate/20150924125150_add_project_id_to_ci_commit.rb1
-rw-r--r--db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb1
-rw-r--r--db/migrate/20150930001110_merge_request_error_field.rb1
-rw-r--r--db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb1
-rw-r--r--db/migrate/20151002112914_add_stage_idx_to_builds.rb1
-rw-r--r--db/migrate/20151002122929_add_ref_and_tag_to_builds.rb1
-rw-r--r--db/migrate/20151005075649_add_user_id_to_build.rb1
-rw-r--r--db/migrate/20151008143519_add_admin_notification_email_setting.rb1
-rw-r--r--db/migrate/20151013092124_add_artifacts_file_to_builds.rb1
-rw-r--r--db/migrate/20151019111551_fix_build_tags.rb1
-rw-r--r--db/migrate/20151019111703_fail_build_without_names.rb1
-rw-r--r--db/migrate/20151020173516_ci_limits_to_mysql.rb1
-rw-r--r--db/migrate/20151023112551_fail_build_with_empty_name.rb1
-rw-r--r--db/migrate/20151023144219_remove_satellites.rb1
-rw-r--r--db/migrate/20151103133339_add_shared_runners_setting.rb1
-rw-r--r--db/migrate/20151104105513_add_file_to_lfs_objects.rb1
-rw-r--r--db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb1
-rw-r--r--db/migrate/20151110125604_add_import_error_to_project.rb1
-rw-r--r--db/migrate/20151201203948_raise_hook_url_limit.rb1
-rw-r--r--db/migrate/20151209144329_migrate_ci_web_hooks.rb1
-rw-r--r--db/migrate/20151209145909_migrate_ci_emails.rb1
-rw-r--r--db/migrate/20151210030143_add_unlock_token_to_user.rb1
-rw-r--r--db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb1
-rw-r--r--db/migrate/20151210125232_migrate_ci_slack_service.rb1
-rw-r--r--db/migrate/20151210125927_migrate_ci_hip_chat_service.rb1
-rw-r--r--db/migrate/20151210125929_add_project_id_to_ci.rb1
-rw-r--r--db/migrate/20151210125930_migrate_ci_to_project.rb1
-rw-r--r--db/migrate/20151218154042_add_tfa_to_application_settings.rb1
-rw-r--r--db/migrate/20151221234414_add_tfa_additional_fields.rb1
-rw-r--r--db/migrate/20151224123230_rename_emojis.rb1
-rw-r--r--db/migrate/20151228175719_add_recaptcha_to_application_settings.rb1
-rw-r--r--db/migrate/20151229102248_influxdb_udp_port_setting.rb1
-rw-r--r--db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb1
-rw-r--r--db/migrate/20151231152326_add_akismet_to_application_settings.rb1
-rw-r--r--db/migrate/20160113111034_add_metrics_sample_interval.rb1
-rw-r--r--db/migrate/20160118155830_add_sentry_to_application_settings.rb1
-rw-r--r--db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb1
-rw-r--r--db/migrate/20160128233227_change_lfs_objects_size_column.rb1
-rw-r--r--db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb1
-rw-r--r--db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb1
-rw-r--r--db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb1
-rw-r--r--db/migrate/20160217100506_add_description_to_label.rb1
-rw-r--r--db/migrate/20160217174422_add_note_to_tasks.rb1
-rw-r--r--db/migrate/20160220123949_rename_tasks_to_todos.rb1
-rw-r--r--db/migrate/20160229193553_add_main_language_to_repository.rb1
-rw-r--r--db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb1
-rw-r--r--db/migrate/20160307221555_disallow_blank_line_code_on_note.rb1
-rw-r--r--db/migrate/20160316192622_change_target_id_to_null_on_todos.rb1
-rw-r--r--db/migrate/20160317092222_add_moved_to_to_issue.rb1
-rw-r--r--db/migrate/20160324020319_remove_todos_for_deleted_issues.rb1
-rw-r--r--db/migrate/20160328115649_migrate_new_notification_setting.rb1
-rw-r--r--db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb1
-rw-r--r--db/migrate/20160407120251_add_images_enabled_for_project.rb1
-rw-r--r--db/migrate/20160413115152_add_token_to_web_hooks.rb1
-rw-r--r--db/migrate/20160415062917_create_personal_access_tokens.rb1
-rw-r--r--db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb1
-rw-r--r--db/migrate/20160416182152_convert_award_note_to_emoji_award.rb1
-rw-r--r--db/migrate/20160419120017_add_metrics_packet_size.rb1
-rw-r--r--db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb1
-rw-r--r--db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb1
-rw-r--r--db/migrate/20160508215820_add_type_to_notes.rb1
-rw-r--r--db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb1
-rw-r--r--db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb1
-rw-r--r--db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb1
-rw-r--r--db/migrate/20160603180330_remove_duplicated_notification_settings.rb1
-rw-r--r--db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb1
-rw-r--r--db/migrate/20160610204157_add_deployments.rb2
-rw-r--r--db/migrate/20160610204158_add_environments.rb2
-rw-r--r--db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb1
-rw-r--r--db/migrate/20160616102642_remove_duplicated_keys.rb1
-rw-r--r--db/migrate/20160824124900_add_table_issue_metrics.rb2
-rw-r--r--db/migrate/20160825052008_add_table_merge_request_metrics.rb2
-rw-r--r--db/migrate/20161113184239_create_user_chat_names_table.rb1
-rw-r--r--db/migrate/20170130221926_create_uploads.rb1
-rw-r--r--db/migrate/20170222143317_drop_ci_projects.rb1
-rw-r--r--db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb1
-rw-r--r--db/migrate/20170329095907_create_ci_trigger_schedules.rb1
-rw-r--r--db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb2
-rw-r--r--db/migrate/20170425112128_create_pipeline_schedules_table.rb1
-rw-r--r--db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb1
-rw-r--r--db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb1
-rw-r--r--db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb1
-rw-r--r--db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb1
-rw-r--r--db/migrate/20180214093516_create_badges.rb1
-rw-r--r--db/migrate/20180227182112_add_group_id_to_boards_ce.rb2
-rw-r--r--db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb1
-rw-r--r--db/migrate/20180309160427_add_partial_indexes_on_todos.rb11
-rw-r--r--db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb1
-rw-r--r--db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb1
-rw-r--r--db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb1
-rw-r--r--db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb1
-rw-r--r--db/migrate/20180425075446_create_term_agreements.rb1
-rw-r--r--db/migrate/20180503131624_create_remote_mirrors.rb1
-rw-r--r--db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb1
-rw-r--r--db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb1
-rw-r--r--db/migrate/20180503193542_add_indexes_to_remote_mirror.rb1
-rw-r--r--db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb1
-rw-r--r--db/migrate/20180515005612_add_squash_to_merge_requests.rb1
-rw-r--r--db/migrate/20180515121227_create_notes_diff_files.rb1
-rw-r--r--db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb1
-rw-r--r--db/migrate/20180529093006_ensure_remote_mirror_columns.rb1
-rw-r--r--db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb4
-rw-r--r--db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb1
-rw-r--r--db/migrate/20180629153018_create_site_statistics.rb18
-rw-r--r--db/migrate/20180722103201_add_private_profile_to_users.rb10
-rw-r--r--db/migrate/gpg_keys_limits_to_mysql.rb1
-rw-r--r--db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb2
-rw-r--r--db/migrate/limits_to_mysql.rb1
-rw-r--r--db/optional_migrations/composite_primary_keys.rb6
-rw-r--r--db/post_migrate/20161221153951_rename_reserved_project_names.rb2
-rw-r--r--db/post_migrate/20170313133418_rename_more_reserved_project_names.rb2
-rw-r--r--db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb1
-rw-r--r--db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb1
-rw-r--r--db/post_migrate/20170711145558_migrate_stages_statuses.rb1
-rw-r--r--db/post_migrate/20170830150306_drop_events_for_migration_table.rb1
-rw-r--r--db/post_migrate/20171106154015_remove_issues_branch_name.rb1
-rw-r--r--db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb1
-rw-r--r--db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb1
-rw-r--r--db/post_migrate/20180223124427_build_user_interacted_projects_table.rb3
-rw-r--r--db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb1
-rw-r--r--db/post_migrate/20180424151928_fill_file_store.rb2
-rw-r--r--db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb1
-rw-r--r--db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb1
-rw-r--r--db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb2
-rw-r--r--db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb1
-rw-r--r--db/post_migrate/20180704145007_update_project_indexes.rb2
-rw-r--r--db/post_migrate/20180706223200_populate_site_statistics.rb25
-rw-r--r--db/schema.rb8
-rw-r--r--doc/administration/high_availability/gitlab.md5
-rw-r--r--doc/administration/pages/index.md44
-rw-r--r--doc/administration/raketasks/check.md39
-rw-r--r--doc/administration/troubleshooting/debug.md13
-rw-r--r--doc/api/issues.md6
-rw-r--r--doc/api/users.md17
-rw-r--r--doc/ci/docker/using_docker_build.md10
-rw-r--r--doc/ci/yaml/README.md38
-rw-r--r--doc/development/background_migrations.md8
-rw-r--r--doc/development/documentation/styleguide.md14
-rw-r--r--doc/install/kubernetes/preparation/tiller.md18
-rw-r--r--doc/security/rack_attack.md10
-rw-r--r--doc/user/profile/index.md22
-rw-r--r--doc/user/profile/personal_access_tokens.md1
-rw-r--r--doc/user/project/issue_board.md4
-rw-r--r--generator_templates/active_record/migration/create_table_migration.rb2
-rw-r--r--generator_templates/active_record/migration/migration.rb2
-rw-r--r--generator_templates/rails/post_deployment_migration/migration.rb2
-rw-r--r--lib/api/entities.rb3
-rw-r--r--lib/api/keys.rb2
-rw-r--r--lib/api/users.rb11
-rw-r--r--lib/banzai/filter/sanitization_filter.rb2
-rw-r--r--lib/gitlab/database.rb26
-rw-r--r--lib/gitlab/git/repository.rb10
-rw-r--r--lib/gitlab/git/wiki.rb8
-rw-r--r--lib/gitlab/gitaly_client.rb6
-rw-r--r--lib/gitlab/gitaly_client/repository_service.rb6
-rw-r--r--lib/gitlab/gitaly_client/wiki_service.rb4
-rw-r--r--lib/gitlab/import_export/merge_request_parser.rb1
-rw-r--r--lib/support/nginx/registry-ssl2
-rw-r--r--locale/gitlab.pot138
-rw-r--r--qa/qa/page/menu/side.rb6
-rw-r--r--qa/qa/page/project/show.rb2
-rw-r--r--spec/config/object_store_settings_spec.rb29
-rw-r--r--spec/controllers/projects/wikis_controller_spec.rb37
-rw-r--r--spec/controllers/users_controller_spec.rb64
-rw-r--r--spec/factories/projects.rb2
-rw-r--r--spec/factories/site_statistics.rb7
-rw-r--r--spec/features/issues/update_issues_spec.rb4
-rw-r--r--spec/features/merge_requests/user_mass_updates_spec.rb4
-rw-r--r--spec/features/users/add_email_to_existing_account.rb15
-rw-r--r--spec/features/users/show_spec.rb56
-rw-r--r--spec/finders/user_recent_events_finder_spec.rb15
-rw-r--r--spec/helpers/users_helper_spec.rb16
-rw-r--r--spec/javascripts/issue_show/components/app_spec.js4
-rw-r--r--spec/javascripts/issue_show/components/edited_spec.js6
-rw-r--r--spec/javascripts/lib/utils/common_utils_spec.js19
-rw-r--r--spec/javascripts/sidebar/assignees_spec.js8
-rw-r--r--spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js14
-rw-r--r--spec/lib/banzai/filter/sanitization_filter_spec.rb12
-rw-r--r--spec/lib/gitlab/background_migration/delete_diff_files_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb2
-rw-r--r--spec/lib/gitlab/database_spec.rb86
-rw-r--r--spec/lib/gitlab/git/wiki_spec.rb25
-rw-r--r--spec/lib/gitlab/gitaly_client/wiki_service_spec.rb22
-rw-r--r--spec/models/concerns/reactive_caching_spec.rb7
-rw-r--r--spec/models/project_feature_spec.rb42
-rw-r--r--spec/models/project_spec.rb16
-rw-r--r--spec/models/site_statistic_spec.rb83
-rw-r--r--spec/requests/api/users_spec.rb41
-rw-r--r--spec/requests/git_http_spec.rb8
483 files changed, 2182 insertions, 818 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index afe9da08495..c7ef75d1c32 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -447,9 +447,8 @@ danger-review:
- retry gem install danger --no-ri --no-rdoc
cache: {}
only:
- refs:
- - branches@gitlab-org/gitlab-ce
- - branches@gitlab-org/gitlab-ee
+ variables:
+ - $DANGER_GITLAB_API_TOKEN
except:
refs:
- master
diff --git a/.rubocop.yml b/.rubocop.yml
index 0582bfe8d70..c8b1ce327e2 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -10,9 +10,9 @@ AllCops:
Exclude:
- 'vendor/**/*'
- 'node_modules/**/*'
- - 'db/**/*'
- 'db/fixtures/**/*'
- - 'ee/db/**/*'
+ - 'db/schema.rb'
+ - 'ee/db/geo/schema.rb'
- 'tmp/**/*'
- 'bin/**/*'
- 'generator_templates/**/*'
@@ -34,6 +34,8 @@ Style/MutableConstant:
Naming/FileName:
ExpectMatchingDefinition: true
Exclude:
+ - 'db/**/*'
+ - 'ee/db/**/*'
- 'spec/**/*'
- 'features/**/*'
- 'ee/spec/**/*'
diff --git a/Dangerfile b/Dangerfile
index 84b72673c50..9217610da8b 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -4,3 +4,4 @@ danger.import_dangerfile(path: 'danger/changelog')
danger.import_dangerfile(path: 'danger/specs')
danger.import_dangerfile(path: 'danger/gemfile')
danger.import_dangerfile(path: 'danger/database')
+danger.import_dangerfile(path: 'danger/frozen_string')
diff --git a/Gemfile b/Gemfile
index 41190e71409..b330127cb82 100644
--- a/Gemfile
+++ b/Gemfile
@@ -233,7 +233,7 @@ gem 'ruby-fogbugz', '~> 0.2.1'
gem 'kubeclient', '~> 3.1.0'
# Sanitize user input
-gem 'sanitize', '~> 4.6.5'
+gem 'sanitize', '~> 4.6'
gem 'babosa', '~> 1.0.2'
# Sanitizes SVG input
@@ -400,6 +400,7 @@ gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text'
gem 'ruby-prof', '~> 0.17.0'
+gem 'rbtrace', '~> 0.4', require: false
# OAuth
gem 'oauth2', '~> 1.4'
@@ -422,7 +423,7 @@ group :ed25519 do
end
# Gitaly GRPC client
-gem 'gitaly-proto', '~> 0.106.0', require: 'gitaly'
+gem 'gitaly-proto', '~> 0.109.0', require: 'gitaly'
gem 'grpc', '~> 1.11.0'
# Locked until https://github.com/google/protobuf/issues/4210 is closed
diff --git a/Gemfile.lock b/Gemfile.lock
index 0976169bb11..f370adfc810 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -284,7 +284,7 @@ GEM
gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0)
rails (>= 3.2.0)
- gitaly-proto (0.106.0)
+ gitaly-proto (0.109.0)
google-protobuf (~> 3.1)
grpc (~> 1.10)
github-linguist (5.3.3)
@@ -397,7 +397,7 @@ GEM
hipchat (1.5.2)
httparty
mimemagic
- html-pipeline (2.8.3)
+ html-pipeline (2.8.4)
activesupport (>= 2)
nokogiri (>= 1.4)
html2text (0.2.0)
@@ -514,7 +514,7 @@ GEM
net-ldap (0.16.0)
net-ssh (5.0.1)
netrc (0.11.0)
- nokogiri (1.8.3)
+ nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
nokogumbo (1.5.0)
nokogiri
@@ -700,6 +700,10 @@ GEM
ffi (>= 0.5.0, < 2)
rblineprof (0.3.6)
debugger-ruby_core_source (~> 1.3)
+ rbtrace (0.4.10)
+ ffi (>= 1.0.6)
+ msgpack (>= 0.4.3)
+ trollop (>= 1.16.2)
rdoc (6.0.4)
re2 (1.1.1)
recaptcha (3.0.0)
@@ -808,7 +812,7 @@ GEM
et-orbi (~> 1.0)
rugged (0.27.2)
safe_yaml (1.0.4)
- sanitize (4.6.5)
+ sanitize (4.6.6)
crass (~> 1.0.2)
nokogiri (>= 1.4.4)
nokogumbo (~> 1.4)
@@ -911,6 +915,7 @@ GEM
parslet (~> 1.5.0)
toml-rb (1.0.0)
citrus (~> 3.0, > 3.0)
+ trollop (2.1.3)
truncato (0.7.10)
htmlentities (~> 4.3.1)
nokogiri (~> 1.8.0, >= 1.7.0)
@@ -1042,7 +1047,7 @@ DEPENDENCIES
gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3)
- gitaly-proto (~> 0.106.0)
+ gitaly-proto (~> 0.109.0)
github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2)
@@ -1133,6 +1138,7 @@ DEPENDENCIES
rainbow (~> 2.2)
raindrops (~> 0.18)
rblineprof (~> 0.3.6)
+ rbtrace (~> 0.4)
rdoc (~> 6.0)
re2 (~> 1.1.1)
recaptcha (~> 3.0)
@@ -1157,7 +1163,7 @@ DEPENDENCIES
ruby_parser (~> 3.8)
rufus-scheduler (~> 3.4)
rugged (~> 0.27)
- sanitize (~> 4.6.5)
+ sanitize (~> 4.6)
sass-rails (~> 5.0.6)
scss_lint (~> 0.56.0)
seed-fu (~> 2.3.7)
diff --git a/Gemfile.rails5.lock b/Gemfile.rails5.lock
index 1cf612fd4a6..cb64fe554ff 100644
--- a/Gemfile.rails5.lock
+++ b/Gemfile.rails5.lock
@@ -287,7 +287,7 @@ GEM
gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0)
rails (>= 3.2.0)
- gitaly-proto (0.106.0)
+ gitaly-proto (0.109.0)
google-protobuf (~> 3.1)
grpc (~> 1.10)
github-linguist (5.3.3)
@@ -709,6 +709,10 @@ GEM
ffi (>= 0.5.0, < 2)
rblineprof (0.3.6)
debugger-ruby_core_source (~> 1.3)
+ rbtrace (0.4.10)
+ ffi (>= 1.0.6)
+ msgpack (>= 0.4.3)
+ trollop (>= 1.16.2)
rdoc (6.0.4)
re2 (1.1.1)
recaptcha (3.0.0)
@@ -918,6 +922,7 @@ GEM
parslet (~> 1.5.0)
toml-rb (1.0.0)
citrus (~> 3.0, > 3.0)
+ trollop (2.1.3)
truncato (0.7.10)
htmlentities (~> 4.3.1)
nokogiri (~> 1.8.0, >= 1.7.0)
@@ -1052,7 +1057,7 @@ DEPENDENCIES
gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3)
- gitaly-proto (~> 0.106.0)
+ gitaly-proto (~> 0.109.0)
github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2)
@@ -1144,6 +1149,7 @@ DEPENDENCIES
rainbow (~> 2.2)
raindrops (~> 0.18)
rblineprof (~> 0.3.6)
+ rbtrace (~> 0.4)
rdoc (~> 6.0)
re2 (~> 1.1.1)
recaptcha (~> 3.0)
@@ -1168,7 +1174,7 @@ DEPENDENCIES
ruby_parser (~> 3.8)
rufus-scheduler (~> 3.4)
rugged (~> 0.27)
- sanitize (~> 4.6.5)
+ sanitize (~> 4.6)
sass-rails (~> 5.0.6)
scss_lint (~> 0.56.0)
seed-fu (~> 2.3.7)
diff --git a/app/assets/javascripts/issue_show/components/edited.vue b/app/assets/javascripts/issue_show/components/edited.vue
index 5ff5b1630b1..05cd976f196 100644
--- a/app/assets/javascripts/issue_show/components/edited.vue
+++ b/app/assets/javascripts/issue_show/components/edited.vue
@@ -46,7 +46,7 @@
by
<a
:href="updatedByPath"
- class="author_link"
+ class="author-link"
>
<span>{{ updatedByName }}</span>
</a>
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index 6b7550efff8..2f3dd6f6cbc 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -541,6 +541,26 @@ export const addSelectOnFocusBehaviour = (selector = '.js-select-on-focus') => {
});
};
+/**
+ * Method to round of values with decimal places
+ * with provided precision.
+ *
+ * Taken from https://stackoverflow.com/a/7343013/414749
+ *
+ * Eg; roundOffFloat(3.141592, 3) = 3.142
+ *
+ * Refer to spec/javascripts/lib/utils/common_utils_spec.js for
+ * more supported examples.
+ *
+ * @param {Float} number
+ * @param {Number} precision
+ */
+export const roundOffFloat = (number, precision = 0) => {
+ // eslint-disable-next-line no-restricted-properties
+ const multiplier = Math.pow(10, precision);
+ return Math.round(number * multiplier) / multiplier;
+};
+
window.gl = window.gl || {};
window.gl.utils = {
...(window.gl.utils || {}),
diff --git a/app/assets/javascripts/notes/components/note_edited_text.vue b/app/assets/javascripts/notes/components/note_edited_text.vue
index 391bb2ae179..d848335022f 100644
--- a/app/assets/javascripts/notes/components/note_edited_text.vue
+++ b/app/assets/javascripts/notes/components/note_edited_text.vue
@@ -42,7 +42,7 @@ export default {
by
<a
:href="editedBy.path"
- class="js-vue-author author_link">
+ class="js-vue-author author-link">
{{ editedBy.name }}
</a>
</template>
diff --git a/app/assets/javascripts/notes/index.js b/app/assets/javascripts/notes/index.js
index 6dd4c9d66ac..3aef30c608c 100644
--- a/app/assets/javascripts/notes/index.js
+++ b/app/assets/javascripts/notes/index.js
@@ -15,7 +15,7 @@ document.addEventListener('DOMContentLoaded', () => {
const notesDataset = document.getElementById('js-vue-notes').dataset;
const parsedUserData = JSON.parse(notesDataset.currentUserData);
const noteableData = JSON.parse(notesDataset.noteableData);
- const { markdownVersion } = notesDataset;
+ const markdownVersion = parseInt(notesDataset.markdownVersion, 10);
let currentUserData = {};
noteableData.noteableType = notesDataset.noteableType;
diff --git a/app/assets/javascripts/sidebar/components/assignees/assignees.vue b/app/assets/javascripts/sidebar/components/assignees/assignees.vue
index d22a1e1ac66..dd155c133ce 100644
--- a/app/assets/javascripts/sidebar/components/assignees/assignees.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/assignees.vue
@@ -187,7 +187,7 @@ export default {
<template v-else-if="hasOneUser">
<a
:href="assigneeUrl(firstUser)"
- class="author_link bold"
+ class="author-link bold"
>
<img
:alt="assigneeAlt(firstUser)"
diff --git a/app/assets/javascripts/sidebar/components/participants/participants.vue b/app/assets/javascripts/sidebar/components/participants/participants.vue
index 33dd6c981b6..56d57f6aac8 100644
--- a/app/assets/javascripts/sidebar/components/participants/participants.vue
+++ b/app/assets/javascripts/sidebar/components/participants/participants.vue
@@ -120,7 +120,7 @@
>
<a
:href="participant.web_url"
- class="author_link"
+ class="author-link"
>
<user-avatar-image
:lazy="true"
diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js
index e3d7645040d..e19bbbacf4d 100644
--- a/app/assets/javascripts/users_select.js
+++ b/app/assets/javascripts/users_select.js
@@ -206,8 +206,8 @@ function UsersSelect(currentUser, els, options = {}) {
return $collapsedSidebar.html(collapsedAssigneeTemplate(user));
});
};
- collapsedAssigneeTemplate = _.template('<% if( avatar ) { %> <a class="author_link" href="/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>');
- assigneeTemplate = _.template('<% if (username) { %> <a class="author_link bold" href="/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself"> No assignee - <a href="#" class="js-assign-yourself"> assign yourself </a> </span> <% } %>');
+ collapsedAssigneeTemplate = _.template('<% if( avatar ) { %> <a class="author-link" href="/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>');
+ assigneeTemplate = _.template('<% if (username) { %> <a class="author-link bold" href="/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself"> No assignee - <a href="#" class="js-assign-yourself"> assign yourself </a> </span> <% } %>');
return $dropdown.glDropdown({
showMenuAbove: showMenuAbove,
data: function(term, callback) {
diff --git a/app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue b/app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue
index b1c2df54ef6..f44d361c47e 100644
--- a/app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue
+++ b/app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue
@@ -1,4 +1,5 @@
<script>
+import { roundOffFloat } from '~/lib/utils/common_utils';
import tooltip from '~/vue_shared/directives/tooltip';
export default {
@@ -70,7 +71,7 @@ export default {
},
methods: {
getPercent(count) {
- return Math.ceil((count / this.totalCount) * 100);
+ return roundOffFloat((count / this.totalCount) * 100, 1);
},
barStyle(percent) {
return `width: ${percent}%;`;
diff --git a/app/assets/stylesheets/framework/avatar.scss b/app/assets/stylesheets/framework/avatar.scss
index c1ec11e434a..94fa7993133 100644
--- a/app/assets/stylesheets/framework/avatar.scss
+++ b/app/assets/stylesheets/framework/avatar.scss
@@ -7,7 +7,7 @@
.avatar-circle {
float: left;
margin-right: 15px;
- border-radius: $avatar_radius;
+ border-radius: $avatar-radius;
border: 1px solid $avatar-border;
&.s16 { @include avatar-size(16px, 6px); }
&.s18 { @include avatar-size(18px, 6px); }
@@ -110,7 +110,7 @@
color: $white-light;
border: 1px solid $avatar-border;
border-radius: 1em;
- font-family: $regular_font;
+ font-family: $regular-font;
font-size: 9px;
line-height: 16px;
text-align: center;
diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss
index 218e37602dd..637587de597 100644
--- a/app/assets/stylesheets/framework/common.scss
+++ b/app/assets/stylesheets/framework/common.scss
@@ -113,8 +113,6 @@ hr {
.item-title { font-weight: $gl-font-weight-bold; }
-/** FLASH message **/
-.author_link,
.author-link {
color: $gl-link-color;
}
diff --git a/app/assets/stylesheets/framework/forms.scss b/app/assets/stylesheets/framework/forms.scss
index a10ff3eecb3..d7149d93622 100644
--- a/app/assets/stylesheets/framework/forms.scss
+++ b/app/assets/stylesheets/framework/forms.scss
@@ -80,7 +80,7 @@ label {
.form-control {
height: 29px;
background: $white-light;
- font-family: $monospace_font;
+ font-family: $monospace-font;
}
.input-group-prepend .btn,
diff --git a/app/assets/stylesheets/framework/highlight.scss b/app/assets/stylesheets/framework/highlight.scss
index 813a1711ea2..452e946f95f 100644
--- a/app/assets/stylesheets/framework/highlight.scss
+++ b/app/assets/stylesheets/framework/highlight.scss
@@ -9,8 +9,8 @@
padding: 10px 0;
border: 0;
border-radius: 0;
- font-family: $monospace_font;
- font-size: $code_font_size;
+ font-family: $monospace-font;
+ font-size: $code-font-size;
line-height: 19px;
margin: 0;
overflow: auto;
@@ -22,7 +22,7 @@
code {
display: inline-block;
min-width: 100%;
- font-family: $monospace_font;
+ font-family: $monospace-font;
white-space: normal;
word-wrap: normal;
padding: 0;
@@ -44,7 +44,7 @@
float: left;
a {
- font-family: $monospace_font;
+ font-family: $monospace-font;
display: block;
font-size: $code_font_size !important;
min-height: 19px;
diff --git a/app/assets/stylesheets/framework/jquery.scss b/app/assets/stylesheets/framework/jquery.scss
index 300ba4f2de6..d1360a0c0eb 100644
--- a/app/assets/stylesheets/framework/jquery.scss
+++ b/app/assets/stylesheets/framework/jquery.scss
@@ -1,5 +1,5 @@
.ui-widget {
- font-family: $regular_font;
+ font-family: $regular-font;
font-size: $font-size-base;
.ui-state-default {
diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss
index d54490c87c6..4b67eab05b3 100644
--- a/app/assets/stylesheets/framework/lists.scss
+++ b/app/assets/stylesheets/framework/lists.scss
@@ -259,7 +259,7 @@ ul.controls {
margin-right: 0;
}
- .author_link {
+ .author-link {
.avatar-inline {
margin-left: 0;
margin-right: 0;
@@ -270,7 +270,7 @@ ul.controls {
.issuable-pipeline-broken a,
.issuable-pipeline-status a,
- .author_link {
+ .author-link {
display: flex;
}
}
diff --git a/app/assets/stylesheets/framework/mixins.scss b/app/assets/stylesheets/framework/mixins.scss
index 76ebfc22ef7..11d332be1be 100644
--- a/app/assets/stylesheets/framework/mixins.scss
+++ b/app/assets/stylesheets/framework/mixins.scss
@@ -3,13 +3,13 @@
* Mixins with fixed values
*/
-@mixin str-truncated($max_width: 82%) {
+@mixin str-truncated($max-width: 82%) {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
- max-width: $max_width;
+ max-width: $max-width;
}
/*
diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss
index 8c716400913..c4dbcf2ddc9 100644
--- a/app/assets/stylesheets/framework/sidebar.scss
+++ b/app/assets/stylesheets/framework/sidebar.scss
@@ -33,11 +33,11 @@
@include media-breakpoint-up(sm) {
&:not(.wiki-sidebar):not(.build-sidebar):not(.issuable-bulk-update-sidebar) .content-wrapper {
- padding-right: $gutter_collapsed_width;
+ padding-right: $gutter-collapsed-width;
}
.merge-request-tabs-holder.affix {
- right: $gutter_collapsed_width;
+ right: $gutter-collapsed-width;
}
}
@@ -67,21 +67,21 @@
@include media-breakpoint-only(sm) {
&:not(.wiki-sidebar):not(.build-sidebar):not(.issuable-bulk-update-sidebar) .content-wrapper {
- padding-right: $gutter_collapsed_width;
+ padding-right: $gutter-collapsed-width;
}
}
@include media-breakpoint-up(md) {
.content-wrapper {
- padding-right: $gutter_width;
+ padding-right: $gutter-width;
}
&:not(.with-overlay) .merge-request-tabs-holder.affix {
- right: $gutter_width;
+ right: $gutter-width;
}
&.with-overlay .merge-request-tabs-holder.affix {
- right: $gutter_collapsed_width;
+ right: $gutter-collapsed-width;
}
}
}
diff --git a/app/assets/stylesheets/framework/stacked_progress_bar.scss b/app/assets/stylesheets/framework/stacked_progress_bar.scss
index 528ba53a48b..29a2d5881f7 100644
--- a/app/assets/stylesheets/framework/stacked_progress_bar.scss
+++ b/app/assets/stylesheets/framework/stacked_progress_bar.scss
@@ -10,7 +10,7 @@
.status-neutral,
.status-red, {
height: 100%;
- min-width: 30px;
+ min-width: 40px;
padding: 0 5px;
font-size: $tooltip-font-size;
font-weight: normal;
diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss
index 9874c928604..56307777a72 100644
--- a/app/assets/stylesheets/framework/typography.scss
+++ b/app/assets/stylesheets/framework/typography.scss
@@ -44,7 +44,7 @@
// Single code lines should wrap
code {
- font-family: $monospace_font;
+ font-family: $monospace-font;
white-space: pre-wrap;
word-wrap: normal;
}
@@ -321,7 +321,7 @@ h6 {
/** CODE **/
pre {
- font-family: $monospace_font;
+ font-family: $monospace-font;
display: block;
padding: $gl-padding-8;
margin: 0 0 $gl-padding-8;
@@ -342,7 +342,7 @@ code {
}
.monospace {
- font-family: $monospace_font;
+ font-family: $monospace-font;
}
.weight-normal {
@@ -381,7 +381,7 @@ code {
*
*/
textarea.js-gfm-input {
- font-family: $monospace_font;
+ font-family: $monospace-font;
font-size: 13px;
}
diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss
index 6c2fdbe0608..efc54196b75 100644
--- a/app/assets/stylesheets/framework/variables.scss
+++ b/app/assets/stylesheets/framework/variables.scss
@@ -2,9 +2,9 @@
* Layout
*/
$grid-size: 8px;
-$gutter_collapsed_width: 62px;
-$gutter_width: 290px;
-$gutter_inner_width: 250px;
+$gutter-collapsed-width: 62px;
+$gutter-width: 290px;
+$gutter-inner-width: 250px;
$sidebar-transition-duration: 0.3s;
$sidebar-breakpoint: 1024px;
$default-transition-duration: 0.15s;
@@ -233,8 +233,8 @@ $md-area-border: #ddd;
/*
* Code
*/
-$code_font_size: 90%;
-$code_line_height: 1.6;
+$code-font-size: 90%;
+$code-line-height: 1.6;
/*
* Tooltips
@@ -371,9 +371,9 @@ $diff-jagged-border-gradient-color: darken($white-normal, 8%);
/*
* Fonts
*/
-$monospace_font: 'Menlo', 'DejaVu Sans Mono', 'Liberation Mono', 'Consolas', 'Ubuntu Mono',
+$monospace-font: 'Menlo', 'DejaVu Sans Mono', 'Liberation Mono', 'Consolas', 'Ubuntu Mono',
'Courier New', 'andale mono', 'lucida console', monospace;
-$regular_font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
+$regular-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
/*
@@ -526,7 +526,7 @@ $issue-board-list-difference-md: $issue-board-list-difference-sm + $issue-boards
/*
* Avatar
*/
-$avatar_radius: 50%;
+$avatar-radius: 50%;
$avatar-border: $gray-normal;
$avatar-border-hover: $gray-darker;
$avatar-background: $gray-lightest;
@@ -830,8 +830,8 @@ $secondary: $gray-light;
$input-disabled-bg: $gray-light;
$input-border-color: $theme-gray-200;
$input-color: $gl-text-color;
-$font-family-sans-serif: $regular_font;
-$font-family-monospace: $monospace_font;
+$font-family-sans-serif: $regular-font;
+$font-family-monospace: $monospace-font;
$input-line-height: 20px;
$btn-line-height: 20px;
$table-accent-bg: $gray-light;
diff --git a/app/assets/stylesheets/mailers/highlighted_diff_email.scss b/app/assets/stylesheets/mailers/highlighted_diff_email.scss
index 1835c4364d3..8b234a5a656 100644
--- a/app/assets/stylesheets/mailers/highlighted_diff_email.scss
+++ b/app/assets/stylesheets/mailers/highlighted_diff_email.scss
@@ -77,13 +77,13 @@ $highlighted-gc-bg: #eaf2f5;
.code {
background-color: $white-light;
font-family: monospace;
- font-size: $code_font_size;
+ font-size: $code-font-size;
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
> tr {
- line-height: $code_line_height;
+ line-height: $code-line-height;
}
}
diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss
index 5de53892fac..7347da2ae61 100644
--- a/app/assets/stylesheets/pages/boards.scss
+++ b/app/assets/stylesheets/pages/boards.scss
@@ -63,7 +63,7 @@
width: 100%;
&.is-compact {
- width: calc(100% - #{$gutter_width});
+ width: calc(100% - #{$gutter-width});
}
}
}
diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss
index 63585e26022..9b51c54a0fc 100644
--- a/app/assets/stylesheets/pages/commits.scss
+++ b/app/assets/stylesheets/pages/commits.scss
@@ -79,7 +79,7 @@
.commit-message-container {
background-color: $body-bg;
position: relative;
- font-family: $monospace_font;
+ font-family: $monospace-font;
$left: 12px;
overflow: hidden; // See https://gitlab.com/gitlab-org/gitlab-ce/issues/13987
.max-width-marker {
diff --git a/app/assets/stylesheets/pages/cycle_analytics.scss b/app/assets/stylesheets/pages/cycle_analytics.scss
index a22c666a525..e2c0a7a6225 100644
--- a/app/assets/stylesheets/pages/cycle_analytics.scss
+++ b/app/assets/stylesheets/pages/cycle_analytics.scss
@@ -368,7 +368,7 @@
.fa {
color: $gl-text-color-secondary;
- font-size: $code_font_size;
+ font-size: $code-font-size;
}
}
}
diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss
index 2e007c52592..37ed5ae674a 100644
--- a/app/assets/stylesheets/pages/detail_page.scss
+++ b/app/assets/stylesheets/pages/detail_page.scss
@@ -10,7 +10,7 @@
}
.issue_created_ago,
- .author_link {
+ .author-link {
white-space: nowrap;
}
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss
index 5e39bbb9890..b616357bb8d 100644
--- a/app/assets/stylesheets/pages/diff.scss
+++ b/app/assets/stylesheets/pages/diff.scss
@@ -56,7 +56,7 @@
table {
width: 100%;
- font-family: $monospace_font;
+ font-family: $monospace-font;
border: 0;
border-collapse: separate;
margin: 0;
@@ -73,8 +73,8 @@
}
.line_holder td {
- line-height: $code_line_height;
- font-size: $code_font_size;
+ line-height: $code-line-height;
+ font-size: $code-font-size;
&.noteable_line {
position: relative;
diff --git a/app/assets/stylesheets/pages/editor.scss b/app/assets/stylesheets/pages/editor.scss
index 437621299e0..ddd1f8cc98a 100644
--- a/app/assets/stylesheets/pages/editor.scss
+++ b/app/assets/stylesheets/pages/editor.scss
@@ -84,7 +84,7 @@
.soft-wrap-toggle {
display: inline-block;
vertical-align: top;
- font-family: $regular_font;
+ font-family: $regular-font;
}
.soft-wrap-toggle {
diff --git a/app/assets/stylesheets/pages/environments.scss b/app/assets/stylesheets/pages/environments.scss
index 8915b323b3c..8a074017344 100644
--- a/app/assets/stylesheets/pages/environments.scss
+++ b/app/assets/stylesheets/pages/environments.scss
@@ -478,7 +478,7 @@
}
.deploy-info-text-link {
- font-family: $monospace_font;
+ font-family: $monospace-font;
fill: $gl-link-color;
&:hover {
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index f9fd9f1ab8b..797b106de23 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -166,7 +166,7 @@
border-bottom: 1px solid $border-gray-normal;
// This prevents the mess when resizing the sidebar
// of elements repositioning themselves..
- width: $gutter_inner_width;
+ width: $gutter-inner-width;
// --
&.issuable-sidebar-header {
@@ -197,7 +197,7 @@
}
&.assignee {
- .author_link {
+ .author-link {
display: block;
padding-left: 42px;
position: relative;
@@ -290,7 +290,7 @@
}
&.right-sidebar-expanded {
- width: $gutter_width;
+ width: $gutter-width;
.value {
line-height: 1;
@@ -377,11 +377,11 @@
display: block;
}
- width: $gutter_collapsed_width;
+ width: $gutter-collapsed-width;
padding: 0;
.block {
- width: $gutter_collapsed_width - 2px;
+ width: $gutter-collapsed-width - 2px;
padding: 15px 0 0;
border-bottom: 0;
overflow: hidden;
@@ -486,7 +486,7 @@
padding-bottom: 0;
margin-bottom: 10px;
- .author_link {
+ .author-link {
padding-left: 0;
.avatar {
@@ -595,7 +595,7 @@
margin: 16px 0 0;
font-size: 85%;
- .author_link {
+ .author-link {
color: $gray-darkest;
}
}
@@ -620,7 +620,7 @@
padding-right: 0;
}
- .author_link {
+ .author-link {
display: block;
}
diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss
index 19fb99bfa93..212e5979273 100644
--- a/app/assets/stylesheets/pages/issues.scss
+++ b/app/assets/stylesheets/pages/issues.scss
@@ -12,7 +12,7 @@
}
.issuable-meta {
- .author_link {
+ .author-link {
display: inline-block;
}
diff --git a/app/assets/stylesheets/pages/merge_conflicts.scss b/app/assets/stylesheets/pages/merge_conflicts.scss
index e76525fdbf6..d26659701e1 100644
--- a/app/assets/stylesheets/pages/merge_conflicts.scss
+++ b/app/assets/stylesheets/pages/merge_conflicts.scss
@@ -1,167 +1,162 @@
// Disabled to use the color map for creating color schemes
// scss-lint:disable ColorVariable
$colors: (
- white_header_head_neutral : #e1fad7,
- white_line_head_neutral : #effdec,
- white_button_head_neutral : #9adb84,
+ white-header-head-neutral : #e1fad7,
+ white-line-head-neutral : #effdec,
+ white-button-head-neutral : #9adb84,
- white_header_head_chosen : #baf0a8,
- white_line_head_chosen : #e1fad7,
- white_button_head_chosen : #52c22d,
+ white-header-head-chosen : #baf0a8,
+ white-line-head-chosen : #e1fad7,
+ white-button-head-chosen : #52c22d,
- white_header_origin_neutral : #e0f0ff,
- white_line_origin_neutral : #f2f9ff,
- white_button_origin_neutral : #87c2fa,
+ white-header-origin-neutral : #e0f0ff,
+ white-line-origin-neutral : #f2f9ff,
+ white-button-origin-neutral : #87c2fa,
- white_header_origin_chosen : #add8ff,
- white_line_origin_chosen : #e0f0ff,
- white_button_origin_chosen : #268ced,
+ white-header-origin-chosen : #add8ff,
+ white-line-origin-chosen : #e0f0ff,
+ white-button-origin-chosen : #268ced,
- white_header_not_chosen : #f0f0f0,
- white_line_not_chosen : $gray-light,
+ white-header-not-chosen : #f0f0f0,
+ white-line-not-chosen : $gray-light,
+ dark-header-head-neutral : rgba(#3f3, .2),
+ dark-line-head-neutral : rgba(#3f3, .1),
+ dark-button-head-neutral : #40874f,
- dark_header_head_neutral : rgba(#3f3, .2),
- dark_line_head_neutral : rgba(#3f3, .1),
- dark_button_head_neutral : #40874f,
+ dark-header-head-chosen : rgba(#3f3, .33),
+ dark-line-head-chosen : rgba(#3f3, .2),
+ dark-button-head-chosen : #258537,
- dark_header_head_chosen : rgba(#3f3, .33),
- dark_line_head_chosen : rgba(#3f3, .2),
- dark_button_head_chosen : #258537,
+ dark-header-origin-neutral : rgba(#2878c9, .4),
+ dark-line-origin-neutral : rgba(#2878c9, .3),
+ dark-button-origin-neutral : #2a5c8c,
- dark_header_origin_neutral : rgba(#2878c9, .4),
- dark_line_origin_neutral : rgba(#2878c9, .3),
- dark_button_origin_neutral : #2a5c8c,
+ dark-header-origin-chosen : rgba(#2878c9, .6),
+ dark-line-origin-chosen : rgba(#2878c9, .4),
+ dark-button-origin-chosen : #1d6cbf,
- dark_header_origin_chosen : rgba(#2878c9, .6),
- dark_line_origin_chosen : rgba(#2878c9, .4),
- dark_button_origin_chosen : #1d6cbf,
+ dark-header-not-chosen : rgba(#fff, .25),
+ dark-line-not-chosen : rgba(#fff, .1),
- dark_header_not_chosen : rgba(#fff, .25),
- dark_line_not_chosen : rgba(#fff, .1),
+ monokai-header-head-neutral : rgba(#a6e22e, .25),
+ monokai-line-head-neutral : rgba(#a6e22e, .1),
+ monokai-button-head-neutral : #376b20,
+ monokai-header-head-chosen : rgba(#a6e22e, .4),
+ monokai-line-head-chosen : rgba(#a6e22e, .25),
+ monokai-button-head-chosen : #39800d,
- monokai_header_head_neutral : rgba(#a6e22e, .25),
- monokai_line_head_neutral : rgba(#a6e22e, .1),
- monokai_button_head_neutral : #376b20,
+ monokai-header-origin-neutral : rgba(#60d9f1, .35),
+ monokai-line-origin-neutral : rgba(#60d9f1, .15),
+ monokai-button-origin-neutral : #38848c,
- monokai_header_head_chosen : rgba(#a6e22e, .4),
- monokai_line_head_chosen : rgba(#a6e22e, .25),
- monokai_button_head_chosen : #39800d,
+ monokai-header-origin-chosen : rgba(#60d9f1, .5),
+ monokai-line-origin-chosen : rgba(#60d9f1, .35),
+ monokai-button-origin-chosen : #3ea4b2,
- monokai_header_origin_neutral : rgba(#60d9f1, .35),
- monokai_line_origin_neutral : rgba(#60d9f1, .15),
- monokai_button_origin_neutral : #38848c,
+ monokai-header-not-chosen : rgba(#76715d, .24),
+ monokai-line-not-chosen : rgba(#76715d, .1),
- monokai_header_origin_chosen : rgba(#60d9f1, .5),
- monokai_line_origin_chosen : rgba(#60d9f1, .35),
- monokai_button_origin_chosen : #3ea4b2,
+ solarized-light-header-head-neutral : rgba(#859900, .37),
+ solarized-light-line-head-neutral : rgba(#859900, .2),
+ solarized-light-button-head-neutral : #afb262,
- monokai_header_not_chosen : rgba(#76715d, .24),
- monokai_line_not_chosen : rgba(#76715d, .1),
+ solarized-light-header-head-chosen : rgba(#859900, .5),
+ solarized-light-line-head-chosen : rgba(#859900, .37),
+ solarized-light-button-head-chosen : #94993d,
+ solarized-light-header-origin-neutral : rgba(#2878c9, .37),
+ solarized-light-line-origin-neutral : rgba(#2878c9, .15),
+ solarized-light-button-origin-neutral : #60a1bf,
- solarized_light_header_head_neutral : rgba(#859900, .37),
- solarized_light_line_head_neutral : rgba(#859900, .2),
- solarized_light_button_head_neutral : #afb262,
+ solarized-light-header-origin-chosen : rgba(#2878c9, .6),
+ solarized-light-line-origin-chosen : rgba(#2878c9, .37),
+ solarized-light-button-origin-chosen : #2482b2,
- solarized_light_header_head_chosen : rgba(#859900, .5),
- solarized_light_line_head_chosen : rgba(#859900, .37),
- solarized_light_button_head_chosen : #94993d,
+ solarized-light-header-not-chosen : rgba(#839496, .37),
+ solarized-light-line-not-chosen : rgba(#839496, .2),
- solarized_light_header_origin_neutral : rgba(#2878c9, .37),
- solarized_light_line_origin_neutral : rgba(#2878c9, .15),
- solarized_light_button_origin_neutral : #60a1bf,
+ solarized-dark-header-head-neutral : rgba(#859900, .35),
+ solarized-dark-line-head-neutral : rgba(#859900, .15),
+ solarized-dark-button-head-neutral : #376b20,
- solarized_light_header_origin_chosen : rgba(#2878c9, .6),
- solarized_light_line_origin_chosen : rgba(#2878c9, .37),
- solarized_light_button_origin_chosen : #2482b2,
+ solarized-dark-header-head-chosen : rgba(#859900, .5),
+ solarized-dark-line-head-chosen : rgba(#859900, .35),
+ solarized-dark-button-head-chosen : #39800d,
- solarized_light_header_not_chosen : rgba(#839496, .37),
- solarized_light_line_not_chosen : rgba(#839496, .2),
+ solarized-dark-header-origin-neutral : rgba(#2878c9, .35),
+ solarized-dark-line-origin-neutral : rgba(#2878c9, .15),
+ solarized-dark-button-origin-neutral : #086799,
+ solarized-dark-header-origin-chosen : rgba(#2878c9, .6),
+ solarized-dark-line-origin-chosen : rgba(#2878c9, .35),
+ solarized-dark-button-origin-chosen : #0082cc,
- solarized_dark_header_head_neutral : rgba(#859900, .35),
- solarized_dark_line_head_neutral : rgba(#859900, .15),
- solarized_dark_button_head_neutral : #376b20,
-
- solarized_dark_header_head_chosen : rgba(#859900, .5),
- solarized_dark_line_head_chosen : rgba(#859900, .35),
- solarized_dark_button_head_chosen : #39800d,
-
- solarized_dark_header_origin_neutral : rgba(#2878c9, .35),
- solarized_dark_line_origin_neutral : rgba(#2878c9, .15),
- solarized_dark_button_origin_neutral : #086799,
-
- solarized_dark_header_origin_chosen : rgba(#2878c9, .6),
- solarized_dark_line_origin_chosen : rgba(#2878c9, .35),
- solarized_dark_button_origin_chosen : #0082cc,
-
- solarized_dark_header_not_chosen : rgba(#839496, .25),
- solarized_dark_line_not_chosen : rgba(#839496, .15)
+ solarized-dark-header-not-chosen : rgba(#839496, .25),
+ solarized-dark-line-not-chosen : rgba(#839496, .15)
);
// scss-lint:enable ColorVariable
-
@mixin color-scheme($color) {
.header.line_content,
.diff-line-num {
&.origin {
- background-color: map-get($colors, #{$color}_header_origin_neutral);
- border-color: map-get($colors, #{$color}_header_origin_neutral);
+ background-color: map-get($colors, #{$color}-header-origin-neutral);
+ border-color: map-get($colors, #{$color}-header-origin-neutral);
button {
- background-color: map-get($colors, #{$color}_button_origin_neutral);
- border-color: darken(map-get($colors, #{$color}_button_origin_neutral), 15);
+ background-color: map-get($colors, #{$color}-button-origin-neutral);
+ border-color: darken(map-get($colors, #{$color}-button-origin-neutral), 15);
}
&.selected {
- background-color: map-get($colors, #{$color}_header_origin_chosen);
- border-color: map-get($colors, #{$color}_header_origin_chosen);
+ background-color: map-get($colors, #{$color}-header-origin-chosen);
+ border-color: map-get($colors, #{$color}-header-origin-chosen);
button {
- background-color: map-get($colors, #{$color}_button_origin_chosen);
- border-color: darken(map-get($colors, #{$color}_button_origin_chosen), 15);
+ background-color: map-get($colors, #{$color}-button-origin-chosen);
+ border-color: darken(map-get($colors, #{$color}-button-origin-chosen), 15);
}
}
&.unselected {
- background-color: map-get($colors, #{$color}_header_not_chosen);
- border-color: map-get($colors, #{$color}_header_not_chosen);
+ background-color: map-get($colors, #{$color}-header-not-chosen);
+ border-color: map-get($colors, #{$color}-header-not-chosen);
button {
- background-color: lighten(map-get($colors, #{$color}_button_origin_neutral), 15);
- border-color: map-get($colors, #{$color}_button_origin_neutral);
+ background-color: lighten(map-get($colors, #{$color}-button-origin-neutral), 15);
+ border-color: map-get($colors, #{$color}-button-origin-neutral);
}
}
}
&.head {
- background-color: map-get($colors, #{$color}_header_head_neutral);
- border-color: map-get($colors, #{$color}_header_head_neutral);
+ background-color: map-get($colors, #{$color}-header-head-neutral);
+ border-color: map-get($colors, #{$color}-header-head-neutral);
button {
- background-color: map-get($colors, #{$color}_button_head_neutral);
- border-color: darken(map-get($colors, #{$color}_button_head_neutral), 15);
+ background-color: map-get($colors, #{$color}-button-head-neutral);
+ border-color: darken(map-get($colors, #{$color}-button-head-neutral), 15);
}
&.selected {
- background-color: map-get($colors, #{$color}_header_head_chosen);
- border-color: map-get($colors, #{$color}_header_head_chosen);
+ background-color: map-get($colors, #{$color}-header-head-chosen);
+ border-color: map-get($colors, #{$color}-header-head-chosen);
button {
- background-color: map-get($colors, #{$color}_button_head_chosen);
- border-color: darken(map-get($colors, #{$color}_button_head_chosen), 15);
+ background-color: map-get($colors, #{$color}-button-head-chosen);
+ border-color: darken(map-get($colors, #{$color}-button-head-chosen), 15);
}
}
&.unselected {
- background-color: map-get($colors, #{$color}_header_not_chosen);
- border-color: map-get($colors, #{$color}_header_not_chosen);
+ background-color: map-get($colors, #{$color}-header-not-chosen);
+ border-color: map-get($colors, #{$color}-header-not-chosen);
button {
- background-color: lighten(map-get($colors, #{$color}_button_head_neutral), 15);
- border-color: map-get($colors, #{$color}_button_head_neutral);
+ background-color: lighten(map-get($colors, #{$color}-button-head-neutral), 15);
+ border-color: map-get($colors, #{$color}-button-head-neutral);
}
}
}
@@ -169,32 +164,31 @@ $colors: (
.line_content {
&.origin {
- background-color: map-get($colors, #{$color}_line_origin_neutral);
+ background-color: map-get($colors, #{$color}-line-origin-neutral);
&.selected {
- background-color: map-get($colors, #{$color}_line_origin_chosen);
+ background-color: map-get($colors, #{$color}-line-origin-chosen);
}
&.unselected {
- background-color: map-get($colors, #{$color}_line_not_chosen);
+ background-color: map-get($colors, #{$color}-line-not-chosen);
}
}
&.head {
- background-color: map-get($colors, #{$color}_line_head_neutral);
+ background-color: map-get($colors, #{$color}-line-head-neutral);
&.selected {
- background-color: map-get($colors, #{$color}_line_head_chosen);
+ background-color: map-get($colors, #{$color}-line-head-chosen);
}
&.unselected {
- background-color: map-get($colors, #{$color}_line_not_chosen);
+ background-color: map-get($colors, #{$color}-line-not-chosen);
}
}
}
}
-
#conflicts {
.white {
@@ -210,11 +204,11 @@ $colors: (
}
.solarized-light {
- @include color-scheme('solarized_light')
+ @include color-scheme('solarized-light')
}
.solarized-dark {
- @include color-scheme('solarized_dark')
+ @include color-scheme('solarized-dark')
}
.diff-wrap-lines .line_content {
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index c8349a4ef79..7bd0f0bf1e0 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -208,7 +208,7 @@
position: absolute;
content: '...';
right: 0;
- font-family: $regular_font;
+ font-family: $regular-font;
background-color: $gray-light;
}
}
diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss
index 5e5696b1602..dcf590e7331 100644
--- a/app/assets/stylesheets/pages/note_form.scss
+++ b/app/assets/stylesheets/pages/note_form.scss
@@ -42,7 +42,7 @@
display: block;
padding: 10px 0;
color: $gl-text-color;
- font-family: $regular_font;
+ font-family: $regular-font;
border: 0;
&:focus {
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index 32d14049067..7fc2936c5e6 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -328,7 +328,7 @@ ul.notes {
}
.notes_holder {
- font-family: $regular_font;
+ font-family: $regular-font;
td {
border: 1px solid $white-normal;
@@ -403,7 +403,7 @@ ul.notes {
}
}
- .author_link {
+ .author-link {
color: $gl-text-color;
}
}
diff --git a/app/assets/stylesheets/pages/repo.scss b/app/assets/stylesheets/pages/repo.scss
index 8b1227b9131..2d76f0ce004 100644
--- a/app/assets/stylesheets/pages/repo.scss
+++ b/app/assets/stylesheets/pages/repo.scss
@@ -961,7 +961,7 @@
overflow: hidden;
.note-textarea {
- font-family: $monospace_font;
+ font-family: $monospace-font;
}
}
diff --git a/app/assets/stylesheets/snippets.scss b/app/assets/stylesheets/snippets.scss
index 0d6b0735f70..64110f9c3a0 100644
--- a/app/assets/stylesheets/snippets.scss
+++ b/app/assets/stylesheets/snippets.scss
@@ -6,9 +6,9 @@
$border-style: 1px solid $border-color;
- font-family: $regular_font;
+ font-family: $regular-font;
font-size: $gl-font-size;
- line-height: $code_line_height;
+ line-height: $code-line-height;
color: $gl-text-color;
margin: 20px;
font-weight: 200;
@@ -48,9 +48,9 @@
padding: 10px;
border: 0;
border-radius: 0;
- font-family: $monospace_font;
- font-size: $code_font_size;
- line-height: $code_line_height;
+ font-family: $monospace-font;
+ font-size: $code-font-size;
+ line-height: $code-line-height;
margin: 0;
overflow: auto;
overflow-y: hidden;
@@ -66,10 +66,10 @@
float: left;
.diff-line-num {
- font-family: $monospace_font;
+ font-family: $monospace-font;
display: block;
- font-size: $code_font_size;
- min-height: $code_line_height;
+ font-size: $code-font-size;
+ min-height: $code-line-height;
white-space: nowrap;
color: $black-transparent;
min-width: 30px;
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 074db361949..56a7b766b77 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -99,7 +99,8 @@ class ProfilesController < Profiles::ApplicationController
:username,
:website_url,
:organization,
- :preferred_language
+ :preferred_language,
+ :private_profile
)
end
end
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
index 9dc0c31be49..b7c656246ef 100644
--- a/app/controllers/projects/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -112,7 +112,7 @@ class Projects::WikisController < Projects::ApplicationController
private
def load_project_wiki
- @project_wiki = ProjectWiki.new(@project, current_user)
+ @project_wiki = load_wiki
# Call #wiki to make sure the Wiki Repo is initialized
@project_wiki.wiki
@@ -128,6 +128,10 @@ class Projects::WikisController < Projects::ApplicationController
false
end
+ def load_wiki
+ ProjectWiki.new(@project, current_user)
+ end
+
def wiki_params
params.require(:wiki).permit(:title, :content, :format, :message, :last_commit_sha)
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 31f47a7aa7c..2f65f4a7403 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -13,6 +13,8 @@ class UsersController < ApplicationController
skip_before_action :authenticate_user!
before_action :user, except: [:exists]
+ before_action :authorize_read_user_profile!,
+ only: [:calendar, :calendar_activities, :groups, :projects, :contributed_projects, :snippets]
def show
respond_to do |format|
@@ -148,4 +150,8 @@ class UsersController < ApplicationController
def build_canonical_path(user)
url_for(safe_params.merge(username: user.to_param))
end
+
+ def authorize_read_user_profile!
+ access_denied! unless can?(current_user, :read_user_profile, user)
+ end
end
diff --git a/app/finders/personal_projects_finder.rb b/app/finders/personal_projects_finder.rb
index 18adfea747f..a56a3a1e1a9 100644
--- a/app/finders/personal_projects_finder.rb
+++ b/app/finders/personal_projects_finder.rb
@@ -1,4 +1,6 @@
class PersonalProjectsFinder < UnionFinder
+ include Gitlab::Allowable
+
def initialize(user, params = {})
@user = user
@params = params
@@ -14,6 +16,8 @@ class PersonalProjectsFinder < UnionFinder
#
# Returns an ActiveRecord::Relation.
def execute(current_user = nil)
+ return Project.none unless can?(current_user, :read_user_profile, @user)
+
segments = all_projects(current_user)
find_union(segments, Project).includes(:namespace).order_updated_desc
diff --git a/app/finders/user_recent_events_finder.rb b/app/finders/user_recent_events_finder.rb
index 74776b2ed1f..876f086a3ef 100644
--- a/app/finders/user_recent_events_finder.rb
+++ b/app/finders/user_recent_events_finder.rb
@@ -7,6 +7,7 @@
class UserRecentEventsFinder
prepend FinderWithCrossProjectAccess
include FinderMethods
+ include Gitlab::Allowable
requires_cross_project_access
@@ -21,6 +22,8 @@ class UserRecentEventsFinder
end
def execute
+ return Event.none unless can?(current_user, :read_user_profile, target_user)
+
recent_events(params[:offset] || 0)
.joins(:project)
.with_associations
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 221f1aa9dd8..aaf9dff43ee 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -63,10 +63,10 @@ module ProjectsHelper
author_html = author_html.html_safe
if opts[:name]
- link_to(author_html, user_path(author), class: "author_link #{"#{opts[:extra_class]}" if opts[:extra_class]} #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe
+ link_to(author_html, user_path(author), class: "author-link #{"#{opts[:extra_class]}" if opts[:extra_class]} #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe
else
title = opts[:title].sub(":name", sanitize(author.name))
- link_to(author_html, user_path(author), class: "author_link has-tooltip", title: title, data: { container: 'body' }).html_safe
+ link_to(author_html, user_path(author), class: "author-link has-tooltip", title: title, data: { container: 'body' }).html_safe
end
end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 4d17b22a4a1..8ee4203b6f5 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -42,7 +42,13 @@ module UsersHelper
private
def get_profile_tabs
- [:activity, :groups, :contributed, :projects, :snippets]
+ tabs = []
+
+ if can?(current_user, :read_user_profile, @user)
+ tabs += [:activity, :groups, :contributed, :projects, :snippets]
+ end
+
+ tabs
end
def get_current_user_menu_items
diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb
index be0a5b49012..9155d82d567 100644
--- a/app/models/concerns/reactive_caching.rb
+++ b/app/models/concerns/reactive_caching.rb
@@ -59,6 +59,9 @@ module ReactiveCaching
raise NotImplementedError
end
+ def reactive_cache_updated(*args)
+ end
+
def with_reactive_cache(*args, &blk)
bootstrap = !within_reactive_cache_lifetime?(*args)
Rails.cache.write(alive_reactive_cache_key(*args), true, expires_in: self.class.reactive_cache_lifetime)
@@ -81,8 +84,11 @@ module ReactiveCaching
locking_reactive_cache(*args) do
if within_reactive_cache_lifetime?(*args)
enqueuing_update(*args) do
- value = calculate_reactive_cache(*args)
- Rails.cache.write(full_reactive_cache_key(*args), value)
+ key = full_reactive_cache_key(*args)
+ new_value = calculate_reactive_cache(*args)
+ old_value = Rails.cache.read(key)
+ Rails.cache.write(key, new_value)
+ reactive_cache_updated(*args) if new_value != old_value
end
end
end
diff --git a/app/models/email.rb b/app/models/email.rb
index d6516761f0a..15bdedeac33 100644
--- a/app/models/email.rb
+++ b/app/models/email.rb
@@ -25,6 +25,10 @@ class Email < ActiveRecord::Base
self.errors.add(:email, 'has already been taken') if User.exists?(email: self.email)
end
+ def accept_pending_invitations!
+ user.accept_pending_invitations!
+ end
+
# once email is confirmed, update the gpg signatures
def update_invalid_gpg_signatures
user.update_invalid_gpg_signatures if confirmed?
diff --git a/app/models/project.rb b/app/models/project.rb
index f880d728839..32315dfaa01 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -31,6 +31,7 @@ class Project < ActiveRecord::Base
BoardLimitExceeded = Class.new(StandardError)
+ STATISTICS_ATTRIBUTE = 'repositories_count'.freeze
NUMBER_OF_PERMITTED_BOARDS = 1
UNKNOWN_IMPORT_URL = 'http://unknown.git'.freeze
# Hashed Storage versions handle rolling out new storage to project and dependents models:
@@ -79,6 +80,10 @@ class Project < ActiveRecord::Base
after_create :create_project_feature, unless: :project_feature
+ after_create -> { SiteStatistic.track(STATISTICS_ATTRIBUTE) }
+ before_destroy ->(project) { project.project_feature.untrack_statistics_for_deletion! }
+ after_destroy -> { SiteStatistic.untrack(STATISTICS_ATTRIBUTE) }
+
after_create :create_ci_cd_settings,
unless: :ci_cd_settings,
if: proc { ProjectCiCdSetting.available? }
diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb
index bfb8d703ec9..9c768b13f78 100644
--- a/app/models/project_feature.rb
+++ b/app/models/project_feature.rb
@@ -19,6 +19,7 @@ class ProjectFeature < ActiveRecord::Base
ENABLED = 20
FEATURES = %i(issues merge_requests wiki snippets builds repository).freeze
+ STATISTICS_ATTRIBUTE = 'wikis_count'.freeze
class << self
def access_level_attribute(feature)
@@ -52,6 +53,9 @@ class ProjectFeature < ActiveRecord::Base
default_value_for :wiki_access_level, value: ENABLED, allows_nil: false
default_value_for :repository_access_level, value: ENABLED, allows_nil: false
+ after_create ->(model) { SiteStatistic.track(STATISTICS_ATTRIBUTE) if model.wiki_enabled? }
+ after_update :update_site_statistics
+
def feature_available?(feature, user)
get_permission(user, access_level(feature))
end
@@ -76,8 +80,30 @@ class ProjectFeature < ActiveRecord::Base
issues_access_level > DISABLED
end
+ # This is a workaround for the removal hooks not been triggered when removing a Project.
+ #
+ # ProjectFeature is removed using database cascade index rule.
+ # This method is called by Project model when deletion starts.
+ def untrack_statistics_for_deletion!
+ return unless wiki_enabled?
+
+ SiteStatistic.untrack(STATISTICS_ATTRIBUTE)
+ end
+
private
+ def update_site_statistics
+ return unless wiki_access_level_changed?
+
+ if self.wiki_access_level_was == DISABLED
+ # possible new states are PRIVATE / ENABLED, both should be tracked
+ SiteStatistic.track(STATISTICS_ATTRIBUTE)
+ elsif self.wiki_access_level == DISABLED
+ # old state was either PRIVATE / ENABLED, only untrack if new state is DISABLED
+ SiteStatistic.untrack(STATISTICS_ATTRIBUTE)
+ end
+ end
+
# Validates builds and merge requests access level
# which cannot be higher than repository access level
def repository_children_level
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index 3aa56b3983f..f4b3421f04b 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -82,7 +82,7 @@ class ProjectWiki
# Returns an Array of Gitlab WikiPage instances or an
# empty Array if this Wiki has no pages.
- def pages(limit: nil)
+ def pages(limit: 0)
wiki.pages(limit: limit).map { |page| WikiPage.new(self, page, true) }
end
diff --git a/app/models/site_statistic.rb b/app/models/site_statistic.rb
new file mode 100644
index 00000000000..9c9c3172fe6
--- /dev/null
+++ b/app/models/site_statistic.rb
@@ -0,0 +1,74 @@
+class SiteStatistic < ActiveRecord::Base
+ # prevents the creation of multiple rows
+ default_value_for :id, 1
+
+ COUNTER_ATTRIBUTES = %w(repositories_count wikis_count).freeze
+ REQUIRED_SCHEMA_VERSION = 20180629153018
+
+ # Tracks specific attribute
+ #
+ # @param [String] raw_attribute must be one of the values listed in COUNTER_ATTRIBUTES
+ def self.track(raw_attribute)
+ with_statistics_available(raw_attribute) do |attribute|
+ SiteStatistic.update_all(["#{attribute} = #{attribute}+1"])
+ end
+ end
+
+ # Untracks specific attribute
+ #
+ # @param [String] raw_attribute must be one of the values listed in COUNTER_ATTRIBUTES
+ def self.untrack(raw_attribute)
+ with_statistics_available(raw_attribute) do |attribute|
+ SiteStatistic.update_all(["#{attribute} = #{attribute}-1 WHERE #{attribute} > 0"])
+ end
+ end
+
+ # Wrapper for track/untrack operations with basic validations and enforced requirements
+ #
+ # @param [String] raw_attribute must be one of the values listed in COUNTER_ATTRIBUTES
+ # @yield [String] attribute quoted to be used inside SQL / Arel query
+ def self.with_statistics_available(raw_attribute)
+ unless raw_attribute.in?(COUNTER_ATTRIBUTES)
+ raise ArgumentError, "Invalid attribute: '#{raw_attribute}' to '#{caller_locations(1, 1)[0].label}' method. " \
+ "Valid attributes are: #{COUNTER_ATTRIBUTES.join(', ')}"
+ end
+
+ return unless available?
+
+ self.fetch # make sure record exists
+
+ attribute = self.connection.quote_column_name(raw_attribute)
+
+ # will be running on its own transaction context
+ yield(attribute)
+ end
+
+ # Returns a site statistic record with tracked information
+ #
+ # @return [SiteStatistic] record with tracked information
+ def self.fetch
+ SiteStatistic.transaction(requires_new: true) do
+ SiteStatistic.first_or_create!
+ end
+ rescue ActiveRecord::RecordNotUnique
+ retry
+ end
+
+ # Return whether required schema change is available
+ #
+ # This is needed in order to degrade gracefully when testing schema migrations
+ #
+ # @return [Boolean] whether schema is available
+ def self.available?
+ @available_flag ||= ActiveRecord::Migrator.current_version >= REQUIRED_SCHEMA_VERSION
+ end
+
+ # Resets cached column information
+ #
+ # This is called during schema migration specs, in order to reset internal cache state
+ def self.reset_column_information
+ @available_flag = nil
+
+ super
+ end
+end
diff --git a/app/policies/application_setting/term_policy.rb b/app/policies/application_setting/term_policy.rb
index f03bf748c76..17f00f33d35 100644
--- a/app/policies/application_setting/term_policy.rb
+++ b/app/policies/application_setting/term_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApplicationSetting
class TermPolicy < BasePolicy
include Gitlab::Utils::StrongMemoize
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb
index 603218aa6df..0d0f1c28bad 100644
--- a/app/policies/base_policy.rb
+++ b/app/policies/base_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'declarative_policy'
class BasePolicy < DeclarativePolicy::Base
diff --git a/app/policies/ci/build_policy.rb b/app/policies/ci/build_policy.rb
index 75c7e529902..3858b29c82c 100644
--- a/app/policies/ci/build_policy.rb
+++ b/app/policies/ci/build_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class BuildPolicy < CommitStatusPolicy
condition(:protected_ref) do
diff --git a/app/policies/ci/pipeline_policy.rb b/app/policies/ci/pipeline_policy.rb
index b81329d0625..f9623587957 100644
--- a/app/policies/ci/pipeline_policy.rb
+++ b/app/policies/ci/pipeline_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class PipelinePolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb
index ecba0488d3c..cf3f784f851 100644
--- a/app/policies/ci/pipeline_schedule_policy.rb
+++ b/app/policies/ci/pipeline_schedule_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class PipelineSchedulePolicy < PipelinePolicy
alias_method :pipeline_schedule, :subject
diff --git a/app/policies/ci/runner_policy.rb b/app/policies/ci/runner_policy.rb
index 895abe87d86..c44f22b6ad3 100644
--- a/app/policies/ci/runner_policy.rb
+++ b/app/policies/ci/runner_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class RunnerPolicy < BasePolicy
with_options scope: :subject, score: 0
diff --git a/app/policies/ci/trigger_policy.rb b/app/policies/ci/trigger_policy.rb
index 5592ac30812..209db44539c 100644
--- a/app/policies/ci/trigger_policy.rb
+++ b/app/policies/ci/trigger_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class TriggerPolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/clusters/cluster_policy.rb b/app/policies/clusters/cluster_policy.rb
index b5b24491655..147943a3d6c 100644
--- a/app/policies/clusters/cluster_policy.rb
+++ b/app/policies/clusters/cluster_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Clusters
class ClusterPolicy < BasePolicy
alias_method :cluster, :subject
diff --git a/app/policies/commit_status_policy.rb b/app/policies/commit_status_policy.rb
index 24b2a4cc7fd..eea2a24fb2d 100644
--- a/app/policies/commit_status_policy.rb
+++ b/app/policies/commit_status_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CommitStatusPolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/deploy_key_policy.rb b/app/policies/deploy_key_policy.rb
index 62a22a59be6..204c54a5b20 100644
--- a/app/policies/deploy_key_policy.rb
+++ b/app/policies/deploy_key_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeployKeyPolicy < BasePolicy
with_options scope: :subject, score: 0
condition(:private_deploy_key) { @subject.private? }
diff --git a/app/policies/deploy_token_policy.rb b/app/policies/deploy_token_policy.rb
index d1b459cfc90..e648df3edfc 100644
--- a/app/policies/deploy_token_policy.rb
+++ b/app/policies/deploy_token_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeployTokenPolicy < BasePolicy
with_options scope: :subject, score: 0
condition(:maintainer) { @subject.project.team.maintainer?(@user) }
diff --git a/app/policies/deployment_policy.rb b/app/policies/deployment_policy.rb
index 62b63b9f87b..56ac898b6ab 100644
--- a/app/policies/deployment_policy.rb
+++ b/app/policies/deployment_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeploymentPolicy < BasePolicy
delegate { @subject.project }
end
diff --git a/app/policies/environment_policy.rb b/app/policies/environment_policy.rb
index 2d07311db72..d1243491f5a 100644
--- a/app/policies/environment_policy.rb
+++ b/app/policies/environment_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnvironmentPolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/external_issue_policy.rb b/app/policies/external_issue_policy.rb
index e031b38078c..1106536e075 100644
--- a/app/policies/external_issue_policy.rb
+++ b/app/policies/external_issue_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ExternalIssuePolicy < BasePolicy
delegate { @subject.project }
end
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb
index 1cf5515d9d7..6e3827736b2 100644
--- a/app/policies/global_policy.rb
+++ b/app/policies/global_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GlobalPolicy < BasePolicy
desc "User is blocked"
with_options scope: :user, score: 0
diff --git a/app/policies/group_label_policy.rb b/app/policies/group_label_policy.rb
index e3dd3296699..9f3acd44b23 100644
--- a/app/policies/group_label_policy.rb
+++ b/app/policies/group_label_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupLabelPolicy < BasePolicy
delegate { @subject.group }
end
diff --git a/app/policies/group_member_policy.rb b/app/policies/group_member_policy.rb
index 23dd0d7cd23..6f1afb87c85 100644
--- a/app/policies/group_member_policy.rb
+++ b/app/policies/group_member_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupMemberPolicy < BasePolicy
delegate :group
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index dc339b71ec7..a8d7a05f509 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupPolicy < BasePolicy
desc "Group is public"
with_options scope: :subject, score: 0
diff --git a/app/policies/issuable_policy.rb b/app/policies/issuable_policy.rb
index b431d376e3d..198bb168d85 100644
--- a/app/policies/issuable_policy.rb
+++ b/app/policies/issuable_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssuablePolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb
index 263c6e3039c..94b5f37c682 100644
--- a/app/policies/issue_policy.rb
+++ b/app/policies/issue_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssuePolicy < IssuablePolicy
# This class duplicates the same check of Issue#readable_by? for performance reasons
# Make sure to sync this class checks with issue.rb to avoid security problems.
diff --git a/app/policies/merge_request_policy.rb b/app/policies/merge_request_policy.rb
index c3fe857f8a2..a2950951d03 100644
--- a/app/policies/merge_request_policy.rb
+++ b/app/policies/merge_request_policy.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
class MergeRequestPolicy < IssuablePolicy
end
diff --git a/app/policies/namespace_policy.rb b/app/policies/namespace_policy.rb
index eb01218eb0a..2babcb0a2d9 100644
--- a/app/policies/namespace_policy.rb
+++ b/app/policies/namespace_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NamespacePolicy < BasePolicy
rule { anonymous }.prevent_all
diff --git a/app/policies/nil_policy.rb b/app/policies/nil_policy.rb
index 13f46ba60f0..fc969f8cd05 100644
--- a/app/policies/nil_policy.rb
+++ b/app/policies/nil_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NilPolicy < BasePolicy
rule { default }.prevent_all
end
diff --git a/app/policies/note_policy.rb b/app/policies/note_policy.rb
index 077a6761ee6..bbc2b48b856 100644
--- a/app/policies/note_policy.rb
+++ b/app/policies/note_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NotePolicy < BasePolicy
delegate { @subject.project }
delegate { @subject.noteable if DeclarativePolicy.has_policy?(@subject.noteable) }
diff --git a/app/policies/personal_snippet_policy.rb b/app/policies/personal_snippet_policy.rb
index c1a84727cfa..777f933cdcd 100644
--- a/app/policies/personal_snippet_policy.rb
+++ b/app/policies/personal_snippet_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PersonalSnippetPolicy < BasePolicy
condition(:public_snippet, scope: :subject) { @subject.public? }
condition(:is_author) { @user && @subject.author == @user }
diff --git a/app/policies/project_label_policy.rb b/app/policies/project_label_policy.rb
index 2d0f021118b..5ce896ecaf2 100644
--- a/app/policies/project_label_policy.rb
+++ b/app/policies/project_label_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectLabelPolicy < BasePolicy
delegate { @subject.project }
end
diff --git a/app/policies/project_member_policy.rb b/app/policies/project_member_policy.rb
index 9aedb620be9..f2f18406bd3 100644
--- a/app/policies/project_member_policy.rb
+++ b/app/policies/project_member_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectMemberPolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index bc49092633f..f52a3bad77d 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectPolicy < BasePolicy
extend ClassMethods
diff --git a/app/policies/project_policy/class_methods.rb b/app/policies/project_policy/class_methods.rb
index 60e5aba00ba..42d993406a9 100644
--- a/app/policies/project_policy/class_methods.rb
+++ b/app/policies/project_policy/class_methods.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectPolicy
module ClassMethods
def create_read_update_admin_destroy(name)
diff --git a/app/policies/project_snippet_policy.rb b/app/policies/project_snippet_policy.rb
index dd270643bbf..288bf070cfc 100644
--- a/app/policies/project_snippet_policy.rb
+++ b/app/policies/project_snippet_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectSnippetPolicy < BasePolicy
delegate :project
diff --git a/app/policies/protected_branch_policy.rb b/app/policies/protected_branch_policy.rb
index 1a7faa4db40..0e83d2e5834 100644
--- a/app/policies/protected_branch_policy.rb
+++ b/app/policies/protected_branch_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProtectedBranchPolicy < BasePolicy
delegate { @subject.project }
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb
index ee219f0a0d0..b5717029354 100644
--- a/app/policies/user_policy.rb
+++ b/app/policies/user_policy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserPolicy < BasePolicy
desc "The current user is the user in question"
condition(:user_is_self, score: 0) { @subject == @user }
@@ -5,6 +7,9 @@ class UserPolicy < BasePolicy
desc "This is the ghost user"
condition(:subject_ghost, scope: :subject, score: 0) { @subject.ghost? }
+ desc "The profile is private"
+ condition(:private_profile, scope: :subject, score: 0) { @subject.private_profile? }
+
rule { ~restricted_public_level }.enable :read_user
rule { ~anonymous }.enable :read_user
@@ -12,4 +17,7 @@ class UserPolicy < BasePolicy
enable :destroy_user
enable :update_user
end
+
+ rule { default }.enable :read_user_profile
+ rule { private_profile & ~(user_is_self | admin) }.prevent :read_user_profile
end
diff --git a/app/presenters/ci/build_metadata_presenter.rb b/app/presenters/ci/build_metadata_presenter.rb
index 5048f967ea8..015b1f67db7 100644
--- a/app/presenters/ci/build_metadata_presenter.rb
+++ b/app/presenters/ci/build_metadata_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated
TIMEOUT_SOURCES = {
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb
index e0aaa5cb736..5331cdf632b 100644
--- a/app/presenters/ci/build_presenter.rb
+++ b/app/presenters/ci/build_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class BuildPresenter < CommitStatusPresenter
def erased_by_user?
diff --git a/app/presenters/ci/group_variable_presenter.rb b/app/presenters/ci/group_variable_presenter.rb
index 98d68bc7a83..99011150c84 100644
--- a/app/presenters/ci/group_variable_presenter.rb
+++ b/app/presenters/ci/group_variable_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class GroupVariablePresenter < Gitlab::View::Presenter::Delegated
presents :variable
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb
index cc2bce9862d..93a38f92073 100644
--- a/app/presenters/ci/pipeline_presenter.rb
+++ b/app/presenters/ci/pipeline_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize
diff --git a/app/presenters/ci/variable_presenter.rb b/app/presenters/ci/variable_presenter.rb
index 96159f88c59..f027f3aa560 100644
--- a/app/presenters/ci/variable_presenter.rb
+++ b/app/presenters/ci/variable_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ci
class VariablePresenter < Gitlab::View::Presenter::Delegated
presents :variable
diff --git a/app/presenters/clusters/cluster_presenter.rb b/app/presenters/clusters/cluster_presenter.rb
index a424da5ab24..dfdd8e82f97 100644
--- a/app/presenters/clusters/cluster_presenter.rb
+++ b/app/presenters/clusters/cluster_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Clusters
class ClusterPresenter < Gitlab::View::Presenter::Delegated
presents :cluster
diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb
index 9a7aaf4ef32..3a9088cfcb8 100644
--- a/app/presenters/commit_status_presenter.rb
+++ b/app/presenters/commit_status_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
CALLOUT_FAILURE_MESSAGES = {
unknown_failure: 'There is an unknown failure, please try again',
diff --git a/app/presenters/conversational_development_index/metric_presenter.rb b/app/presenters/conversational_development_index/metric_presenter.rb
index bb65ba2646b..e0312c6f431 100644
--- a/app/presenters/conversational_development_index/metric_presenter.rb
+++ b/app/presenters/conversational_development_index/metric_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ConversationalDevelopmentIndex
class MetricPresenter < Gitlab::View::Presenter::Simple
def cards
diff --git a/app/presenters/generic_commit_status_presenter.rb b/app/presenters/generic_commit_status_presenter.rb
index da09df29a37..a1dc72d5b98 100644
--- a/app/presenters/generic_commit_status_presenter.rb
+++ b/app/presenters/generic_commit_status_presenter.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
class GenericCommitStatusPresenter < CommitStatusPresenter
end
diff --git a/app/presenters/group_member_presenter.rb b/app/presenters/group_member_presenter.rb
index 8f53dfa105e..c4dcc9e60f9 100644
--- a/app/presenters/group_member_presenter.rb
+++ b/app/presenters/group_member_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupMemberPresenter < MemberPresenter
private
diff --git a/app/presenters/member_presenter.rb b/app/presenters/member_presenter.rb
index 7d2f9303b8f..2497bea4aff 100644
--- a/app/presenters/member_presenter.rb
+++ b/app/presenters/member_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MemberPresenter < Gitlab::View::Presenter::Delegated
presents :member
diff --git a/app/presenters/members_presenter.rb b/app/presenters/members_presenter.rb
index e4aba37b69e..03ebea36d49 100644
--- a/app/presenters/members_presenter.rb
+++ b/app/presenters/members_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MembersPresenter < Gitlab::View::Presenter::Delegated
include Enumerable
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb
index f77b3541644..ffa238a63d5 100644
--- a/app/presenters/merge_request_presenter.rb
+++ b/app/presenters/merge_request_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
include ActionView::Helpers::UrlHelper
include GitlabRoutingHelper
diff --git a/app/presenters/project_member_presenter.rb b/app/presenters/project_member_presenter.rb
index 7f42d2b70df..e4731074e86 100644
--- a/app/presenters/project_member_presenter.rb
+++ b/app/presenters/project_member_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectMemberPresenter < MemberPresenter
private
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index d4d622d84ab..4c2f33213d6 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectPresenter < Gitlab::View::Presenter::Delegated
include ActionView::Helpers::NumberHelper
include ActionView::Helpers::UrlHelper
diff --git a/app/presenters/projects/settings/deploy_keys_presenter.rb b/app/presenters/projects/settings/deploy_keys_presenter.rb
index c226586fba5..28eaef00a12 100644
--- a/app/presenters/projects/settings/deploy_keys_presenter.rb
+++ b/app/presenters/projects/settings/deploy_keys_presenter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Projects
module Settings
class DeployKeysPresenter < Gitlab::View::Presenter::Simple
diff --git a/app/serializers/analytics_build_entity.rb b/app/serializers/analytics_build_entity.rb
index bdc22d71202..99663c8d5eb 100644
--- a/app/serializers/analytics_build_entity.rb
+++ b/app/serializers/analytics_build_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsBuildEntity < Grape::Entity
include RequestAwareEntity
include EntityDateHelper
diff --git a/app/serializers/analytics_build_serializer.rb b/app/serializers/analytics_build_serializer.rb
index f172d67d356..9c9f76a1c28 100644
--- a/app/serializers/analytics_build_serializer.rb
+++ b/app/serializers/analytics_build_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsBuildSerializer < BaseSerializer
entity AnalyticsBuildEntity
end
diff --git a/app/serializers/analytics_commit_entity.rb b/app/serializers/analytics_commit_entity.rb
index 402cecbfd08..b25c603c9f0 100644
--- a/app/serializers/analytics_commit_entity.rb
+++ b/app/serializers/analytics_commit_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsCommitEntity < CommitEntity
include EntityDateHelper
diff --git a/app/serializers/analytics_commit_serializer.rb b/app/serializers/analytics_commit_serializer.rb
index cdbfecf2b70..0f65687a3c0 100644
--- a/app/serializers/analytics_commit_serializer.rb
+++ b/app/serializers/analytics_commit_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsCommitSerializer < BaseSerializer
entity AnalyticsCommitEntity
end
diff --git a/app/serializers/analytics_generic_serializer.rb b/app/serializers/analytics_generic_serializer.rb
index 9f4859e8410..10391c13034 100644
--- a/app/serializers/analytics_generic_serializer.rb
+++ b/app/serializers/analytics_generic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsGenericSerializer < BaseSerializer
def represent(resource, opts = {})
resource.symbolize_keys!
diff --git a/app/serializers/analytics_issue_entity.rb b/app/serializers/analytics_issue_entity.rb
index b7d95ea020f..ab15bd0ac7a 100644
--- a/app/serializers/analytics_issue_entity.rb
+++ b/app/serializers/analytics_issue_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsIssueEntity < Grape::Entity
include RequestAwareEntity
include EntityDateHelper
diff --git a/app/serializers/analytics_issue_serializer.rb b/app/serializers/analytics_issue_serializer.rb
index 4fb3e8f1bb4..4a1777276a4 100644
--- a/app/serializers/analytics_issue_serializer.rb
+++ b/app/serializers/analytics_issue_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsIssueSerializer < AnalyticsGenericSerializer
entity AnalyticsIssueEntity
end
diff --git a/app/serializers/analytics_merge_request_entity.rb b/app/serializers/analytics_merge_request_entity.rb
index 888265eaa38..b7134da9461 100644
--- a/app/serializers/analytics_merge_request_entity.rb
+++ b/app/serializers/analytics_merge_request_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsMergeRequestEntity < AnalyticsIssueEntity
expose :state
diff --git a/app/serializers/analytics_merge_request_serializer.rb b/app/serializers/analytics_merge_request_serializer.rb
index 4622a1dd855..f0b9115d02c 100644
--- a/app/serializers/analytics_merge_request_serializer.rb
+++ b/app/serializers/analytics_merge_request_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsMergeRequestSerializer < AnalyticsGenericSerializer
entity AnalyticsMergeRequestEntity
end
diff --git a/app/serializers/analytics_stage_entity.rb b/app/serializers/analytics_stage_entity.rb
index 3e355a13e06..ae7c20c3bba 100644
--- a/app/serializers/analytics_stage_entity.rb
+++ b/app/serializers/analytics_stage_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsStageEntity < Grape::Entity
include EntityDateHelper
diff --git a/app/serializers/analytics_stage_serializer.rb b/app/serializers/analytics_stage_serializer.rb
index 613cf6874d8..86786273240 100644
--- a/app/serializers/analytics_stage_serializer.rb
+++ b/app/serializers/analytics_stage_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsStageSerializer < BaseSerializer
entity AnalyticsStageEntity
end
diff --git a/app/serializers/analytics_summary_entity.rb b/app/serializers/analytics_summary_entity.rb
index 9c37afd53e1..39c6b4b06b2 100644
--- a/app/serializers/analytics_summary_entity.rb
+++ b/app/serializers/analytics_summary_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsSummaryEntity < Grape::Entity
expose :value, safe: true
expose :title
diff --git a/app/serializers/analytics_summary_serializer.rb b/app/serializers/analytics_summary_serializer.rb
index c87a24aa47c..b22bd737f03 100644
--- a/app/serializers/analytics_summary_serializer.rb
+++ b/app/serializers/analytics_summary_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnalyticsSummarySerializer < BaseSerializer
entity AnalyticsSummaryEntity
end
diff --git a/app/serializers/award_emoji_entity.rb b/app/serializers/award_emoji_entity.rb
index 6e03cd02392..212931a2fa9 100644
--- a/app/serializers/award_emoji_entity.rb
+++ b/app/serializers/award_emoji_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AwardEmojiEntity < Grape::Entity
expose :name
expose :user, using: API::Entities::UserSafe
diff --git a/app/serializers/base_serializer.rb b/app/serializers/base_serializer.rb
index 8cade280b0c..7b65bd22f54 100644
--- a/app/serializers/base_serializer.rb
+++ b/app/serializers/base_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BaseSerializer
attr_reader :params
diff --git a/app/serializers/blob_entity.rb b/app/serializers/blob_entity.rb
index b501fd5e964..3ac61481dea 100644
--- a/app/serializers/blob_entity.rb
+++ b/app/serializers/blob_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BlobEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/build_action_entity.rb b/app/serializers/build_action_entity.rb
index f2d76a8ad81..f9da3f63911 100644
--- a/app/serializers/build_action_entity.rb
+++ b/app/serializers/build_action_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BuildActionEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/build_artifact_entity.rb b/app/serializers/build_artifact_entity.rb
index 6e0e33bc09b..414f436e76e 100644
--- a/app/serializers/build_artifact_entity.rb
+++ b/app/serializers/build_artifact_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BuildArtifactEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index 2de9624aed4..b887b99d31c 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BuildDetailsEntity < JobEntity
expose :coverage, :erased_at, :duration
expose :tag_list, as: :tags
diff --git a/app/serializers/build_metadata_entity.rb b/app/serializers/build_metadata_entity.rb
index f16f3badffa..6242ee8957d 100644
--- a/app/serializers/build_metadata_entity.rb
+++ b/app/serializers/build_metadata_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BuildMetadataEntity < Grape::Entity
expose :timeout_human_readable
expose :timeout_source do |metadata|
diff --git a/app/serializers/build_serializer.rb b/app/serializers/build_serializer.rb
index bae9932847f..0649fdad6a8 100644
--- a/app/serializers/build_serializer.rb
+++ b/app/serializers/build_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BuildSerializer < BaseSerializer
entity JobEntity
diff --git a/app/serializers/cluster_application_entity.rb b/app/serializers/cluster_application_entity.rb
index 77fc3336521..2bd17e58086 100644
--- a/app/serializers/cluster_application_entity.rb
+++ b/app/serializers/cluster_application_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ClusterApplicationEntity < Grape::Entity
expose :name
expose :status_name, as: :status
diff --git a/app/serializers/cluster_entity.rb b/app/serializers/cluster_entity.rb
index 7e5b0997878..c59f68bbc49 100644
--- a/app/serializers/cluster_entity.rb
+++ b/app/serializers/cluster_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ClusterEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/cluster_serializer.rb b/app/serializers/cluster_serializer.rb
index 2e13c1501e7..4bb4d4880d4 100644
--- a/app/serializers/cluster_serializer.rb
+++ b/app/serializers/cluster_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ClusterSerializer < BaseSerializer
entity ClusterEntity
diff --git a/app/serializers/cohort_activity_month_entity.rb b/app/serializers/cohort_activity_month_entity.rb
index e6788a8b596..cdbc89a2dcd 100644
--- a/app/serializers/cohort_activity_month_entity.rb
+++ b/app/serializers/cohort_activity_month_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CohortActivityMonthEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
diff --git a/app/serializers/cohort_entity.rb b/app/serializers/cohort_entity.rb
index 7cdba5b0484..3d0213e1038 100644
--- a/app/serializers/cohort_entity.rb
+++ b/app/serializers/cohort_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CohortEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
diff --git a/app/serializers/cohorts_entity.rb b/app/serializers/cohorts_entity.rb
index 98f5995ba6f..a84d568bf30 100644
--- a/app/serializers/cohorts_entity.rb
+++ b/app/serializers/cohorts_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CohortsEntity < Grape::Entity
expose :months_included
expose :cohorts, using: CohortEntity
diff --git a/app/serializers/cohorts_serializer.rb b/app/serializers/cohorts_serializer.rb
index fe9367b13d8..ceca5e1e5a8 100644
--- a/app/serializers/cohorts_serializer.rb
+++ b/app/serializers/cohorts_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CohortsSerializer < AnalyticsGenericSerializer
entity CohortsEntity
end
diff --git a/app/serializers/commit_entity.rb b/app/serializers/commit_entity.rb
index c8dd98cc04d..b3287c66554 100644
--- a/app/serializers/commit_entity.rb
+++ b/app/serializers/commit_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CommitEntity < API::Entities::Commit
include RequestAwareEntity
diff --git a/app/serializers/concerns/with_pagination.rb b/app/serializers/concerns/with_pagination.rb
index 89631b73fcf..c8ffae355e8 100644
--- a/app/serializers/concerns/with_pagination.rb
+++ b/app/serializers/concerns/with_pagination.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module WithPagination
attr_accessor :paginator
diff --git a/app/serializers/container_repositories_serializer.rb b/app/serializers/container_repositories_serializer.rb
index 56dc70b5687..e1ce3c7b3ae 100644
--- a/app/serializers/container_repositories_serializer.rb
+++ b/app/serializers/container_repositories_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ContainerRepositoriesSerializer < BaseSerializer
entity ContainerRepositoryEntity
end
diff --git a/app/serializers/container_repository_entity.rb b/app/serializers/container_repository_entity.rb
index 1103cf30a07..59bf35f5aff 100644
--- a/app/serializers/container_repository_entity.rb
+++ b/app/serializers/container_repository_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ContainerRepositoryEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/container_tag_entity.rb b/app/serializers/container_tag_entity.rb
index 8f1488e6cbb..637294877f8 100644
--- a/app/serializers/container_tag_entity.rb
+++ b/app/serializers/container_tag_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ContainerTagEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/container_tags_serializer.rb b/app/serializers/container_tags_serializer.rb
index 6ff3adff135..982ce33f6e3 100644
--- a/app/serializers/container_tags_serializer.rb
+++ b/app/serializers/container_tags_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ContainerTagsSerializer < BaseSerializer
entity ContainerTagEntity
diff --git a/app/serializers/deploy_key_entity.rb b/app/serializers/deploy_key_entity.rb
index 2678f99510c..54bf030aba1 100644
--- a/app/serializers/deploy_key_entity.rb
+++ b/app/serializers/deploy_key_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeployKeyEntity < Grape::Entity
expose :id
expose :user_id
diff --git a/app/serializers/deploy_key_serializer.rb b/app/serializers/deploy_key_serializer.rb
index 8f849eb88b7..a1cd98b631b 100644
--- a/app/serializers/deploy_key_serializer.rb
+++ b/app/serializers/deploy_key_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeployKeySerializer < BaseSerializer
entity DeployKeyEntity
end
diff --git a/app/serializers/deploy_keys_project_entity.rb b/app/serializers/deploy_keys_project_entity.rb
index 568ef5ab75e..5775ad72d0d 100644
--- a/app/serializers/deploy_keys_project_entity.rb
+++ b/app/serializers/deploy_keys_project_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeployKeysProjectEntity < Grape::Entity
expose :can_push
expose :project, using: ProjectEntity
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb
index 241c689bccd..344148a1fb7 100644
--- a/app/serializers/deployment_entity.rb
+++ b/app/serializers/deployment_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeploymentEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/deployment_serializer.rb b/app/serializers/deployment_serializer.rb
index cba5c3f311f..04db6b88489 100644
--- a/app/serializers/deployment_serializer.rb
+++ b/app/serializers/deployment_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DeploymentSerializer < BaseSerializer
entity DeploymentEntity
diff --git a/app/serializers/diff_file_entity.rb b/app/serializers/diff_file_entity.rb
index 61135fba97b..79844c9210a 100644
--- a/app/serializers/diff_file_entity.rb
+++ b/app/serializers/diff_file_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiffFileEntity < Grape::Entity
include RequestAwareEntity
include BlobHelper
diff --git a/app/serializers/diffs_entity.rb b/app/serializers/diffs_entity.rb
index bb804e5347a..f75ace14d9c 100644
--- a/app/serializers/diffs_entity.rb
+++ b/app/serializers/diffs_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiffsEntity < Grape::Entity
include DiffHelper
include RequestAwareEntity
diff --git a/app/serializers/diffs_serializer.rb b/app/serializers/diffs_serializer.rb
index 6771e10c5ac..9e5eb1699d4 100644
--- a/app/serializers/diffs_serializer.rb
+++ b/app/serializers/diffs_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiffsSerializer < BaseSerializer
entity DiffsEntity
end
diff --git a/app/serializers/discussion_entity.rb b/app/serializers/discussion_entity.rb
index 7505bbdeb3d..6f95e6f9ca1 100644
--- a/app/serializers/discussion_entity.rb
+++ b/app/serializers/discussion_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiscussionEntity < Grape::Entity
include RequestAwareEntity
include NotesHelper
diff --git a/app/serializers/discussion_serializer.rb b/app/serializers/discussion_serializer.rb
index ed5e1224bb2..5be40e74175 100644
--- a/app/serializers/discussion_serializer.rb
+++ b/app/serializers/discussion_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiscussionSerializer < BaseSerializer
entity DiscussionEntity
end
diff --git a/app/serializers/entity_date_helper.rb b/app/serializers/entity_date_helper.rb
index 464217123b4..cc0c2abf863 100644
--- a/app/serializers/entity_date_helper.rb
+++ b/app/serializers/entity_date_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module EntityDateHelper
include ActionView::Helpers::DateHelper
include ActionView::Helpers::TagHelper
@@ -50,15 +52,20 @@ module EntityDateHelper
elsif entity.due_date
is_upcoming = (entity.due_date - Date.today).to_i > 0
time_ago = time_ago_in_words(entity.due_date)
- content = time_ago.gsub(/\d+/) { |match| "<strong>#{match}</strong>" }
- content.slice!("about ")
- content << " " + (is_upcoming ? _("remaining") : _("ago"))
- content.html_safe
+
+ # https://gitlab.com/gitlab-org/gitlab-ce/issues/49440
+ #
+ # Need to improve the i18n here and do a full translation
+ # of the string instead of piecewise translations.
+ content = time_ago
+ .gsub(/\d+/) { |match| "<strong>#{match}</strong>" }
+ .remove("about ")
+ remaining_or_ago = is_upcoming ? _("remaining") : _("ago")
+
+ "#{content} #{remaining_or_ago}".html_safe
elsif entity.start_date && entity.start_date.past?
- days = entity.elapsed_days
- content = content_tag(:strong, days)
- content << " #{'day'.pluralize(days)} elapsed"
- content.html_safe
+ days = entity.elapsed_days
+ "#{content_tag(:strong, days)} #{'day'.pluralize(days)} elapsed".html_safe
end
end
end
diff --git a/app/serializers/entity_request.rb b/app/serializers/entity_request.rb
index 456ba1174c0..49e026e8c2a 100644
--- a/app/serializers/entity_request.rb
+++ b/app/serializers/entity_request.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EntityRequest
# We use EntityRequest object to collect parameters and variables
# from the controller. Because options that are being passed to the entity
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index 83558fc6659..b18e9706db6 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnvironmentEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index 84722f33f59..dc1686c30c4 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnvironmentSerializer < BaseSerializer
include WithPagination
diff --git a/app/serializers/group_child_entity.rb b/app/serializers/group_child_entity.rb
index ee150eefd9e..f6804fe7f6a 100644
--- a/app/serializers/group_child_entity.rb
+++ b/app/serializers/group_child_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupChildEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
include RequestAwareEntity
diff --git a/app/serializers/group_child_serializer.rb b/app/serializers/group_child_serializer.rb
index 2baef0a5703..789707c2c9b 100644
--- a/app/serializers/group_child_serializer.rb
+++ b/app/serializers/group_child_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupChildSerializer < BaseSerializer
include WithPagination
diff --git a/app/serializers/group_entity.rb b/app/serializers/group_entity.rb
index 6d8466da902..c46c342ee5d 100644
--- a/app/serializers/group_entity.rb
+++ b/app/serializers/group_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
include RequestAwareEntity
diff --git a/app/serializers/group_serializer.rb b/app/serializers/group_serializer.rb
index 8cf7eb63bcf..38c5757a6c1 100644
--- a/app/serializers/group_serializer.rb
+++ b/app/serializers/group_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupSerializer < BaseSerializer
include WithPagination
diff --git a/app/serializers/group_variable_entity.rb b/app/serializers/group_variable_entity.rb
index 62cf0b21e1e..0edab4a3092 100644
--- a/app/serializers/group_variable_entity.rb
+++ b/app/serializers/group_variable_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupVariableEntity < Grape::Entity
expose :id
expose :key
diff --git a/app/serializers/group_variable_serializer.rb b/app/serializers/group_variable_serializer.rb
index 8f8205924aa..ed20b240cce 100644
--- a/app/serializers/group_variable_serializer.rb
+++ b/app/serializers/group_variable_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupVariableSerializer < BaseSerializer
entity GroupVariableEntity
end
diff --git a/app/serializers/issuable_entity.rb b/app/serializers/issuable_entity.rb
index 6f31fbd6b7c..e71bd3313fb 100644
--- a/app/serializers/issuable_entity.rb
+++ b/app/serializers/issuable_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssuableEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/issuable_sidebar_entity.rb b/app/serializers/issuable_sidebar_entity.rb
index 29138c803df..773d78d324c 100644
--- a/app/serializers/issuable_sidebar_entity.rb
+++ b/app/serializers/issuable_sidebar_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssuableSidebarEntity < Grape::Entity
include TimeTrackableEntity
include RequestAwareEntity
diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb
index 840fdbcbf14..16a477c92fa 100644
--- a/app/serializers/issue_entity.rb
+++ b/app/serializers/issue_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssueEntity < IssuableEntity
include TimeTrackableEntity
diff --git a/app/serializers/issue_serializer.rb b/app/serializers/issue_serializer.rb
index 2555595379b..37cf5e28396 100644
--- a/app/serializers/issue_serializer.rb
+++ b/app/serializers/issue_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssueSerializer < BaseSerializer
# This overrided method takes care of which entity should be used
# to serialize the `issue` based on `basic` key in `opts` param.
diff --git a/app/serializers/issue_sidebar_entity.rb b/app/serializers/issue_sidebar_entity.rb
index 6c823dbfe95..349ad9d1fef 100644
--- a/app/serializers/issue_sidebar_entity.rb
+++ b/app/serializers/issue_sidebar_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IssueSidebarEntity < IssuableSidebarEntity
expose :assignees, using: API::Entities::UserBasic
end
diff --git a/app/serializers/job_entity.rb b/app/serializers/job_entity.rb
index 960e7291ae6..7bc1d87dea5 100644
--- a/app/serializers/job_entity.rb
+++ b/app/serializers/job_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class JobEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/job_group_entity.rb b/app/serializers/job_group_entity.rb
index 8554de55517..0941a9d36be 100644
--- a/app/serializers/job_group_entity.rb
+++ b/app/serializers/job_group_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class JobGroupEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/label_entity.rb b/app/serializers/label_entity.rb
index 4452161051e..98743d62b50 100644
--- a/app/serializers/label_entity.rb
+++ b/app/serializers/label_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LabelEntity < Grape::Entity
expose :id, if: ->(label, _) { !label.is_a?(GlobalLabel) }
diff --git a/app/serializers/label_serializer.rb b/app/serializers/label_serializer.rb
index ad6ba8c46c9..25b9f7de243 100644
--- a/app/serializers/label_serializer.rb
+++ b/app/serializers/label_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LabelSerializer < BaseSerializer
entity LabelEntity
diff --git a/app/serializers/lfs_file_lock_entity.rb b/app/serializers/lfs_file_lock_entity.rb
index 264a77adc3f..7961c4e666b 100644
--- a/app/serializers/lfs_file_lock_entity.rb
+++ b/app/serializers/lfs_file_lock_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LfsFileLockEntity < Grape::Entity
root 'locks', 'lock'
diff --git a/app/serializers/lfs_file_lock_serializer.rb b/app/serializers/lfs_file_lock_serializer.rb
index ba8fb1a461d..0367097e376 100644
--- a/app/serializers/lfs_file_lock_serializer.rb
+++ b/app/serializers/lfs_file_lock_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LfsFileLockSerializer < BaseSerializer
entity LfsFileLockEntity
end
diff --git a/app/serializers/merge_request_basic_entity.rb b/app/serializers/merge_request_basic_entity.rb
index 1c06691026d..f7eb74cf392 100644
--- a/app/serializers/merge_request_basic_entity.rb
+++ b/app/serializers/merge_request_basic_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestBasicEntity < IssuableSidebarEntity
expose :assignee_id
expose :merge_status
diff --git a/app/serializers/merge_request_basic_serializer.rb b/app/serializers/merge_request_basic_serializer.rb
index cc5c664c8fa..a68b48b00db 100644
--- a/app/serializers/merge_request_basic_serializer.rb
+++ b/app/serializers/merge_request_basic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestBasicSerializer < BaseSerializer
entity MergeRequestBasicEntity
end
diff --git a/app/serializers/merge_request_create_entity.rb b/app/serializers/merge_request_create_entity.rb
index 11234313293..e7a93004dda 100644
--- a/app/serializers/merge_request_create_entity.rb
+++ b/app/serializers/merge_request_create_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestCreateEntity < Grape::Entity
expose :iid
diff --git a/app/serializers/merge_request_create_serializer.rb b/app/serializers/merge_request_create_serializer.rb
index 08daf473319..b6df9ee13fc 100644
--- a/app/serializers/merge_request_create_serializer.rb
+++ b/app/serializers/merge_request_create_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestCreateSerializer < BaseSerializer
entity MergeRequestCreateEntity
end
diff --git a/app/serializers/merge_request_diff_entity.rb b/app/serializers/merge_request_diff_entity.rb
index 32c761b45ac..433bfe60474 100644
--- a/app/serializers/merge_request_diff_entity.rb
+++ b/app/serializers/merge_request_diff_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestDiffEntity < Grape::Entity
include Gitlab::Routing
include GitHelper
diff --git a/app/serializers/merge_request_metrics_entity.rb b/app/serializers/merge_request_metrics_entity.rb
index 3548107ac16..1c9db08d103 100644
--- a/app/serializers/merge_request_metrics_entity.rb
+++ b/app/serializers/merge_request_metrics_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestMetricsEntity < Grape::Entity
expose :latest_closed_at, as: :closed_at
expose :merged_at
diff --git a/app/serializers/merge_request_serializer.rb b/app/serializers/merge_request_serializer.rb
index caf193bdae3..1f8c830e1aa 100644
--- a/app/serializers/merge_request_serializer.rb
+++ b/app/serializers/merge_request_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestSerializer < BaseSerializer
# This overrided method takes care of which entity should be used
# to serialize the `merge_request` based on `serializer` key in `opts` param.
diff --git a/app/serializers/merge_request_user_entity.rb b/app/serializers/merge_request_user_entity.rb
index 33fc7b724d5..fd2d2897113 100644
--- a/app/serializers/merge_request_user_entity.rb
+++ b/app/serializers/merge_request_user_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestUserEntity < UserEntity
include RequestAwareEntity
include BlobHelper
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb
index a78bd77cf7c..4fe04e4b206 100644
--- a/app/serializers/merge_request_widget_entity.rb
+++ b/app/serializers/merge_request_widget_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeRequestWidgetEntity < IssuableEntity
expose :state
expose :in_progress_merge_commit_sha
diff --git a/app/serializers/note_attachment_entity.rb b/app/serializers/note_attachment_entity.rb
index 1ad50568ab9..dc801e2bf4e 100644
--- a/app/serializers/note_attachment_entity.rb
+++ b/app/serializers/note_attachment_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NoteAttachmentEntity < Grape::Entity
expose :url
expose :filename
diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb
index 0e1f94a9f61..daa5c24d0f5 100644
--- a/app/serializers/note_entity.rb
+++ b/app/serializers/note_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NoteEntity < API::Entities::Note
include RequestAwareEntity
include NotesHelper
diff --git a/app/serializers/note_user_entity.rb b/app/serializers/note_user_entity.rb
index 7289f3a0222..b00dfa7d353 100644
--- a/app/serializers/note_user_entity.rb
+++ b/app/serializers/note_user_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NoteUserEntity < UserEntity
unexpose :web_url
end
diff --git a/app/serializers/pipeline_details_entity.rb b/app/serializers/pipeline_details_entity.rb
index 8ba9cac53c4..3b56767f774 100644
--- a/app/serializers/pipeline_details_entity.rb
+++ b/app/serializers/pipeline_details_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PipelineDetailsEntity < PipelineEntity
expose :details do
expose :ordered_stages, as: :stages, using: StageEntity
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb
index f782b411b84..6cf1925adda 100644
--- a/app/serializers/pipeline_entity.rb
+++ b/app/serializers/pipeline_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PipelineEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb
index 17a022539bb..4a33160afa1 100644
--- a/app/serializers/pipeline_serializer.rb
+++ b/app/serializers/pipeline_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PipelineSerializer < BaseSerializer
include WithPagination
entity PipelineDetailsEntity
diff --git a/app/serializers/project_entity.rb b/app/serializers/project_entity.rb
index b3e5fd21e97..60c4ba135d6 100644
--- a/app/serializers/project_entity.rb
+++ b/app/serializers/project_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/project_mirror_entity.rb b/app/serializers/project_mirror_entity.rb
index a9c08ac021a..8aba244cd11 100644
--- a/app/serializers/project_mirror_entity.rb
+++ b/app/serializers/project_mirror_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectMirrorEntity < Grape::Entity
expose :id
diff --git a/app/serializers/project_note_entity.rb b/app/serializers/project_note_entity.rb
index e541bfbee8d..d7c4d0aacc6 100644
--- a/app/serializers/project_note_entity.rb
+++ b/app/serializers/project_note_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectNoteEntity < NoteEntity
expose :human_access do |note|
note.project.team.human_max_access(note.author_id)
diff --git a/app/serializers/project_note_serializer.rb b/app/serializers/project_note_serializer.rb
index 763ad0bdb3f..2182904e815 100644
--- a/app/serializers/project_note_serializer.rb
+++ b/app/serializers/project_note_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectNoteSerializer < BaseSerializer
entity ProjectNoteEntity
end
diff --git a/app/serializers/project_serializer.rb b/app/serializers/project_serializer.rb
index 74de1e79a8f..23b96c2fc9e 100644
--- a/app/serializers/project_serializer.rb
+++ b/app/serializers/project_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ProjectSerializer < BaseSerializer
entity ProjectEntity
end
diff --git a/app/serializers/request_aware_entity.rb b/app/serializers/request_aware_entity.rb
index d53fcfb8c1b..1524c1291d8 100644
--- a/app/serializers/request_aware_entity.rb
+++ b/app/serializers/request_aware_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module RequestAwareEntity
extend ActiveSupport::Concern
diff --git a/app/serializers/runner_entity.rb b/app/serializers/runner_entity.rb
index db26eadab2d..04ec80e0efa 100644
--- a/app/serializers/runner_entity.rb
+++ b/app/serializers/runner_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RunnerEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/stage_entity.rb b/app/serializers/stage_entity.rb
index 2516df70ad9..00e6d32ee3a 100644
--- a/app/serializers/stage_entity.rb
+++ b/app/serializers/stage_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StageEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/stage_serializer.rb b/app/serializers/stage_serializer.rb
index 091d8e91e43..11fb0d3f852 100644
--- a/app/serializers/stage_serializer.rb
+++ b/app/serializers/stage_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StageSerializer < BaseSerializer
include WithPagination
diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb
index 47df7f9dcf9..306c30f0323 100644
--- a/app/serializers/status_entity.rb
+++ b/app/serializers/status_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StatusEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/submodule_entity.rb b/app/serializers/submodule_entity.rb
index ed1f1ae0ef0..e475a4f301f 100644
--- a/app/serializers/submodule_entity.rb
+++ b/app/serializers/submodule_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SubmoduleEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/time_trackable_entity.rb b/app/serializers/time_trackable_entity.rb
index e81cd7bec72..613d19703a4 100644
--- a/app/serializers/time_trackable_entity.rb
+++ b/app/serializers/time_trackable_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module TimeTrackableEntity
extend ActiveSupport::Concern
extend Grape
diff --git a/app/serializers/tree_entity.rb b/app/serializers/tree_entity.rb
index 9f1b485347f..9b7dc80e1d9 100644
--- a/app/serializers/tree_entity.rb
+++ b/app/serializers/tree_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TreeEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/tree_root_entity.rb b/app/serializers/tree_root_entity.rb
index 496f070ddbd..f1cfcd943d8 100644
--- a/app/serializers/tree_root_entity.rb
+++ b/app/serializers/tree_root_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`.
class TreeRootEntity < Grape::Entity
include RequestAwareEntity
diff --git a/app/serializers/tree_serializer.rb b/app/serializers/tree_serializer.rb
index 713ade23bc9..536b8ab1ae2 100644
--- a/app/serializers/tree_serializer.rb
+++ b/app/serializers/tree_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TreeSerializer < BaseSerializer
entity TreeRootEntity
end
diff --git a/app/serializers/user_entity.rb b/app/serializers/user_entity.rb
index 876512b12dc..6236d66ff4a 100644
--- a/app/serializers/user_entity.rb
+++ b/app/serializers/user_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserEntity < API::Entities::UserBasic
include RequestAwareEntity
diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb
index 49a71ebac61..2111e1b5667 100644
--- a/app/serializers/user_serializer.rb
+++ b/app/serializers/user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserSerializer < BaseSerializer
entity UserEntity
end
diff --git a/app/serializers/variable_entity.rb b/app/serializers/variable_entity.rb
index d576745c073..85cf367fe51 100644
--- a/app/serializers/variable_entity.rb
+++ b/app/serializers/variable_entity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class VariableEntity < Grape::Entity
expose :id
expose :key
diff --git a/app/serializers/variable_serializer.rb b/app/serializers/variable_serializer.rb
index 32ae82ab51c..586666cad8e 100644
--- a/app/serializers/variable_serializer.rb
+++ b/app/serializers/variable_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class VariableSerializer < BaseSerializer
entity VariableEntity
end
diff --git a/app/services/users/build_service.rb b/app/services/users/build_service.rb
index c69b46cab5a..acc2fa153ae 100644
--- a/app/services/users/build_service.rb
+++ b/app/services/users/build_service.rb
@@ -64,7 +64,8 @@ module Users
:theme_id,
:twitter,
:username,
- :website_url
+ :website_url,
+ :private_profile
]
end
diff --git a/app/views/layouts/_recaptcha_verification.html.haml b/app/views/layouts/_recaptcha_verification.html.haml
index e6f87ddd383..3405fb9d5ef 100644
--- a/app/views/layouts/_recaptcha_verification.html.haml
+++ b/app/views/layouts/_recaptcha_verification.html.haml
@@ -1,10 +1,10 @@
- humanized_resource_name = spammable.class.model_name.human.downcase
%h3.page-title
- Anti-spam verification
+ = _('Anti-spam verification')
%hr
%p
- #{"We detected potential spam in the #{humanized_resource_name}. Please solve the reCAPTCHA to proceed."}
+ = _("We detected potential spam in the %{humanized_resource_name}. Please solve the reCAPTCHA to proceed.") % { humanized_resource_name: humanized_resource_name }
= render 'shared/recaptcha_form', spammable: spammable
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml
index 91f796adb2e..556ad8cf306 100644
--- a/app/views/layouts/_search.html.haml
+++ b/app/views/layouts/_search.html.haml
@@ -1,7 +1,7 @@
- if controller.controller_path =~ /^groups/ && @group.persisted?
- - label = 'This group'
+ - label = _('This group')
- if controller.controller_path =~ /^projects/ && @project.persisted?
- - label = 'This project'
+ - label = _('This project')
- if @group && @group.persisted? && @group.path
- group_data_attrs = { group_path: j(@group.path), name: @group.name, issues_path: issues_group_path(j(@group.path)), mr_path: merge_requests_group_path(j(@group.path)) }
- if @project && @project.persisted?
@@ -13,21 +13,21 @@
.location-badge= label
.search-input-wrap
.dropdown{ data: { url: search_autocomplete_path } }
- = search_field_tag 'search', nil, placeholder: 'Search',
+ = search_field_tag 'search', nil, placeholder: _('Search'),
class: 'search-input dropdown-menu-toggle no-outline js-search-dashboard-options',
spellcheck: false,
tabindex: '1',
autocomplete: 'off',
data: { issues_path: issues_dashboard_path,
mr_path: merge_requests_dashboard_path },
- aria: { label: 'Search' }
+ aria: { label: _('Search') }
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
.dropdown-menu.dropdown-select
= dropdown_content do
%ul
%li.dropdown-menu-empty-item
%a
- Loading...
+ = _('Loading...')
= dropdown_loading
= sprite_icon('search', size: 16, css_class: 'search-icon')
= sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input')
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index 8595157a997..31259b8ac25 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -1,5 +1,5 @@
-- page_title "Admin Area"
-- header_title "Admin Area", admin_root_path
+- page_title _("Admin Area")
+- header_title _("Admin Area"), admin_root_path
- nav "admin"
- @left_sidebar = true
diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml
index cb96bcc2cf4..489ef245a4d 100644
--- a/app/views/layouts/dashboard.html.haml
+++ b/app/views/layouts/dashboard.html.haml
@@ -1,5 +1,5 @@
-- page_title "Dashboard"
-- header_title "Dashboard", root_path unless header_title
+- page_title _("Dashboard")
+- header_title _("Dashboard"), root_path unless header_title
- sidebar "dashboard"
= render template: "layouts/application"
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index 81f35615555..43bd07679ba 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -17,12 +17,11 @@
- if current_appearance&.description?
= brand_text
- else
- %h3 Open source software to collaborate on code
+ %h3
+ = _('Open source software to collaborate on code')
%p
- Manage Git repositories with fine-grained access controls that keep your code secure.
- Perform code reviews and enhance collaboration with merge requests.
- Each project can also have an issue tracker and a wiki.
+ = _('Manage Git repositories with fine-grained access controls that keep your code secure. Perform code reviews and enhance collaboration with merge requests. Each project can also have an issue tracker and a wiki.')
- if Gitlab::CurrentSettings.sign_in_text.present?
= markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text)
@@ -32,6 +31,6 @@
%hr.footer-fixed
.container.footer-container
.footer-links
- = link_to "Explore", explore_root_path
- = link_to "Help", help_path
- = link_to "About GitLab", "https://about.gitlab.com/"
+ = link_to _("Explore"), explore_root_path
+ = link_to _("Help"), help_path
+ = link_to _("About GitLab"), "https://about.gitlab.com/"
diff --git a/app/views/layouts/devise_empty.html.haml b/app/views/layouts/devise_empty.html.haml
index 52805e0da73..663e5b24368 100644
--- a/app/views/layouts/devise_empty.html.haml
+++ b/app/views/layouts/devise_empty.html.haml
@@ -12,6 +12,6 @@
%hr
.container
.footer-links
- = link_to "Explore", explore_root_path
- = link_to "Help", help_path
- = link_to "About GitLab", "https://about.gitlab.com/"
+ = link_to _("Explore"), explore_root_path
+ = link_to _("Help"), help_path
+ = link_to _("About GitLab"), "https://about.gitlab.com/"
diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml
index df65792be73..2ab9e55441b 100644
--- a/app/views/layouts/explore.html.haml
+++ b/app/views/layouts/explore.html.haml
@@ -1,5 +1,5 @@
-- page_title "Explore"
+- page_title = _("Explore")
- unless current_user
- - header_title "Explore GitLab", explore_root_path
+ - header_title = _("Explore GitLab"), explore_root_path
= render template: "layouts/application"
diff --git a/app/views/layouts/group_settings.html.haml b/app/views/layouts/group_settings.html.haml
index 66b115e36de..14c5f0ce04c 100644
--- a/app/views/layouts/group_settings.html.haml
+++ b/app/views/layouts/group_settings.html.haml
@@ -1,4 +1,4 @@
-- page_title "Settings"
+- page_title = _("Settings")
- nav "group"
= render template: "layouts/group"
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 3aa8eb18bf3..97c04dda8cb 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -4,7 +4,7 @@
.header-content
.title-container
%h1.title
- = link_to root_path, title: 'Dashboard', id: 'logo' do
+ = link_to root_path, title: _('Dashboard'), id: 'logo' do
= brand_header_logo
- logo_text = brand_header_logo_type
- if logo_text.present?
@@ -24,26 +24,26 @@
%li.nav-item.d-none.d-sm-none.d-md-block.m-auto
= render 'layouts/search' unless current_controller?(:search)
%li.nav-item.d-inline-block.d-sm-none.d-md-none
- = link_to search_path, title: 'Search', aria: { label: "Search" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
+ = link_to search_path, title: _('Search'), aria: { label: _("Search") }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('search', size: 16)
- if header_link?(:issues)
= nav_link(path: 'dashboard#issues', html_options: { class: "user-counter" }) do
- = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
+ = link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _("Issues") }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('issues', size: 16)
- issues_count = assigned_issuables_count(:issues)
%span.badge.badge-pill.issues-count{ class: ('hidden' if issues_count.zero?) }
= number_with_delimiter(issues_count)
- if header_link?(:merge_requests)
= nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
- = link_to assigned_mrs_dashboard_path, title: 'Merge requests', class: 'dashboard-shortcuts-merge_requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
+ = link_to assigned_mrs_dashboard_path, title: _('Merge requests'), class: 'dashboard-shortcuts-merge_requests', aria: { label: _("Merge requests") }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('git-merge', size: 16)
- merge_requests_count = assigned_issuables_count(:merge_requests)
%span.badge.badge-pill.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
= number_with_delimiter(merge_requests_count)
- if header_link?(:todos)
= nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
- = link_to dashboard_todos_path, title: 'Todos', aria: { label: "Todos" }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
+ = link_to dashboard_todos_path, title: _('Todos'), aria: { label: _("Todos") }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('todo-done', size: 16)
%span.badge.badge-pill.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
= todos_count_format(todos_pending_count)
@@ -56,16 +56,16 @@
= render 'layouts/header/current_user_dropdown'
- if header_link?(:admin_impersonation)
%li.nav-item.impersonation
- = link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: "Stop impersonation", aria: { label: 'Stop impersonation' }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
+ = link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: _("Stop impersonation"), aria: { label: _('Stop impersonation') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
= icon('user-secret')
- if header_link?(:sign_in)
%li.nav-item
%div
- - sign_in_text = allow_signup? ? 'Sign in / Register' : 'Sign in'
+ - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in')
= link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'
%button.navbar-toggler.d-block.d-sm-none{ type: 'button' }
- %span.sr-only Toggle navigation
+ %span.sr-only= _("Toggle navigation")
= sprite_icon('more', size: 12, css_class: 'more-icon js-navbar-toggle-right')
= sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')
diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml
index 792291bde75..e134f416c70 100644
--- a/app/views/layouts/header/_new_dropdown.haml
+++ b/app/views/layouts/header/_new_dropdown.haml
@@ -1,5 +1,5 @@
%li.header-new.dropdown
- = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static' } do
+ = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", title: _("New..."), ref: 'tooltip', aria: { label: _("New...") }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static' } do
= sprite_icon('plus-square', size: 16)
= sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu.dropdown-menu-right
@@ -8,13 +8,14 @@
- create_group_project = can?(current_user, :create_projects, @group)
- create_group_subgroup = can?(current_user, :create_subgroup, @group)
- if create_group_project || create_group_subgroup
- %li.dropdown-bold-header This group
+ %li.dropdown-bold-header
+ = _('This group')
- if create_group_project
%li.header-new-group-project
- = link_to 'New project', new_project_path(namespace_id: @group.id)
+ = link_to _('New project'), new_project_path(namespace_id: @group.id)
- if create_group_subgroup
%li
- = link_to 'New subgroup', new_group_path(parent_id: @group.id)
+ = link_to _('New subgroup'), new_group_path(parent_id: @group.id)
%li.divider
%li.dropdown-bold-header GitLab
@@ -23,23 +24,24 @@
- merge_project = merge_request_source_project_for_project(@project)
- create_project_snippet = can?(current_user, :create_project_snippet, @project)
- if create_project_issue || merge_project || create_project_snippet
- %li.dropdown-bold-header This project
+ %li.dropdown-bold-header
+ = _('This project')
- if create_project_issue
%li
- = link_to 'New issue', new_project_issue_path(@project)
+ = link_to _('New issue'), new_project_issue_path(@project)
- if merge_project
%li
- = link_to 'New merge request', project_new_merge_request_path(merge_project)
+ = link_to _('New merge request'), project_new_merge_request_path(merge_project)
- if create_project_snippet
%li.header-new-project-snippet
- = link_to 'New snippet', new_project_snippet_path(@project)
+ = link_to _('New snippet'), new_project_snippet_path(@project)
%li.divider
%li.dropdown-bold-header GitLab
- if current_user.can_create_project?
%li
- = link_to 'New project', new_project_path, class: 'qa-global-new-project-link'
+ = link_to _('New project'), new_project_path, class: 'qa-global-new-project-link'
- if current_user.can_create_group?
%li
- = link_to 'New group', new_group_path
+ = link_to _('New group'), new_group_path
%li
- = link_to 'New snippet', new_snippet_path
+ = link_to _('New snippet'), new_snippet_path
diff --git a/app/views/layouts/help.html.haml b/app/views/layouts/help.html.haml
index 78927bfffcd..a913bea0c93 100644
--- a/app/views/layouts/help.html.haml
+++ b/app/views/layouts/help.html.haml
@@ -1,5 +1,5 @@
-- @breadcrumb_title = "Help"
-- page_title "Help"
-- header_title "Help", help_path
+- @breadcrumb_title = _("Help")
+- page_title _("Help")
+- header_title _("Help"), help_path
= render template: "layouts/application"
diff --git a/app/views/layouts/koding.html.haml b/app/views/layouts/koding.html.haml
index 22319bba745..45ccd38f687 100644
--- a/app/views/layouts/koding.html.haml
+++ b/app/views/layouts/koding.html.haml
@@ -1,5 +1,5 @@
-- page_title "Koding"
-- page_description "Koding Dashboard"
-- header_title "Koding", koding_path
+- page_title _("Koding")
+- page_description _("Koding Dashboard")
+- header_title _("Koding"), koding_path
= render template: "layouts/application"
diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb
index 8e20c4a4b2a..8e11174f8d7 100644
--- a/app/views/layouts/mailer.text.erb
+++ b/app/views/layouts/mailer.text.erb
@@ -1,4 +1,4 @@
<%= yield -%>
-- <%# signature marker %>
-You're receiving this email because of your account on <%= Gitlab.config.gitlab.host %>.
+<%= _("You're receiving this email because of your account on %{host}.") % { host: Gitlab.config.gitlab.host } %>
diff --git a/app/views/layouts/mailer/devise.html.haml b/app/views/layouts/mailer/devise.html.haml
index 054b2c2fa26..beaaaa5cd68 100644
--- a/app/views/layouts/mailer/devise.html.haml
+++ b/app/views/layouts/mailer/devise.html.haml
@@ -3,17 +3,17 @@
%tr
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:1.6;color:#5c5c5c;" }
%div
- Everyone can contribute
+ = _('Everyone can contribute')
%div
- = link_to 'Blog', 'https://about.gitlab.com/blog/', style: "color:#3777b0;text-decoration:none;"
+ = link_to _('Blog'), 'https://about.gitlab.com/blog/', style: "color:#3777b0;text-decoration:none;"
&middot;
- = link_to 'Twitter', 'https://twitter.com/gitlab', style: "color:#3777b0;text-decoration:none;"
+ = link_to _('Twitter'), 'https://twitter.com/gitlab', style: "color:#3777b0;text-decoration:none;"
&middot;
- = link_to 'Facebook', 'https://www.facebook.com/gitlab/', style: "color:#3777b0;text-decoration:none;"
+ = link_to _('Facebook'), 'https://www.facebook.com/gitlab/', style: "color:#3777b0;text-decoration:none;"
&middot;
- = link_to 'YouTube', 'https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg', style: "color:#3777b0;text-decoration:none;"
+ = link_to _('YouTube'), 'https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg', style: "color:#3777b0;text-decoration:none;"
&middot;
- = link_to 'LinkedIn', 'https://www.linkedin.com/company/gitlab-com', style: "color:#3777b0;text-decoration:none;"
+ = link_to _('LinkedIn'), 'https://www.linkedin.com/company/gitlab-com', style: "color:#3777b0;text-decoration:none;"
= render layout: 'layouts/mailer' do
%tr
diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml
index 002922e13f1..f53bd2b5e4d 100644
--- a/app/views/layouts/nav/_breadcrumbs.html.haml
+++ b/app/views/layouts/nav/_breadcrumbs.html.haml
@@ -5,7 +5,7 @@
.breadcrumbs-container
- if defined?(@left_sidebar)
= button_tag class: 'toggle-mobile-nav', type: 'button' do
- %span.sr-only Open sidebar
+ %span.sr-only= _("Open sidebar")
= icon ('bars')
.breadcrumbs-links.js-title-container
%ul.list-unstyled.breadcrumbs-list.js-breadcrumbs-list
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index 4029287fc0e..a71a4b13a7e 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -2,7 +2,7 @@
- if dashboard_nav_link?(:projects)
= nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: { id: 'nav-projects-dropdown', class: "home dropdown header-projects qa-projects-dropdown" }) do
%button{ type: 'button', data: { toggle: "dropdown" } }
- Projects
+ = _('Projects')
= sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu.frequent-items-dropdown-menu
= render "layouts/nav/projects_dropdown/show"
@@ -10,68 +10,68 @@
- if dashboard_nav_link?(:groups)
= nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "home dropdown header-groups qa-groups-dropdown" }) do
%button{ type: 'button', data: { toggle: "dropdown" } }
- Groups
+ = _('Groups')
= sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu.frequent-items-dropdown-menu
= render "layouts/nav/groups_dropdown/show"
- if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity', html_options: { class: "d-none d-lg-block d-xl-block" }) do
- = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', title: 'Activity' do
- Activity
+ = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', title: _('Activity') do
+ = _('Activity')
- if dashboard_nav_link?(:milestones)
= nav_link(controller: 'dashboard/milestones', html_options: { class: "d-none d-lg-block d-xl-block" }) do
- = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', title: 'Milestones' do
- Milestones
+ = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', title: _('Milestones') do
+ = _('Milestones')
- if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets', html_options: { class: "d-none d-lg-block d-xl-block" }) do
- = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', title: 'Snippets' do
- Snippets
+ = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', title: _('Snippets') do
+ = _('Snippets')
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
%li.header-more.dropdown.d-lg-none.d-xl-none
%a{ href: "#", data: { toggle: "dropdown" } }
- More
+ = _('More')
= sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu
%ul
- if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity') do
- = link_to activity_dashboard_path, title: 'Activity' do
- Activity
+ = link_to activity_dashboard_path, title: _('Activity') do
+ = _('Activity')
- if dashboard_nav_link?(:milestones)
= nav_link(controller: 'dashboard/milestones') do
- = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', title: 'Milestones' do
- Milestones
+ = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', title: _('Milestones') do
+ = _('Milestones')
- if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets') do
- = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', title: 'Snippets' do
- Snippets
+ = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', title: _('Snippets') do
+ = _('Snippets')
-# Shortcut to Dashboard > Projects
- if dashboard_nav_link?(:projects)
%li.hidden
- = link_to dashboard_projects_path, title: 'Projects', class: 'dashboard-shortcuts-projects' do
- Projects
+ = link_to dashboard_projects_path, title: _('Projects'), class: 'dashboard-shortcuts-projects' do
+ = _('Projects')
- if current_controller?('ide')
%li.line-separator.d-none.d-sm-block
= nav_link(controller: 'ide') do
- = link_to '#', class: 'dashboard-shortcuts-web-ide', title: 'Web IDE' do
- Web IDE
+ = link_to '#', class: 'dashboard-shortcuts-web-ide', title: _('Web IDE') do
+ = _('Web IDE')
- if current_user.admin? || Gitlab::Sherlock.enabled?
%li.line-separator.d-none.d-sm-block
- if current_user.admin?
= nav_link(controller: 'admin/dashboard') do
- = link_to admin_root_path, class: 'admin-icon qa-admin-area-link', title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
+ = link_to admin_root_path, class: 'admin-icon qa-admin-area-link', title: _('Admin area'), aria: { label: _("Admin area") }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('admin', size: 18)
- if Gitlab::Sherlock.enabled?
%li
- = link_to sherlock_transactions_path, class: 'admin-icon', title: 'Sherlock Transactions',
+ = link_to sherlock_transactions_path, class: 'admin-icon', title: _('Sherlock Transactions'),
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('tachometer fw')
diff --git a/app/views/layouts/nav/_explore.html.haml b/app/views/layouts/nav/_explore.html.haml
index 50bde9d1754..7d18cd8978b 100644
--- a/app/views/layouts/nav/_explore.html.haml
+++ b/app/views/layouts/nav/_explore.html.haml
@@ -1,15 +1,15 @@
%ul.list-unstyled.navbar-sub-nav
- if explore_nav_link?(:projects)
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
- = link_to explore_root_path, title: 'Projects', class: 'dashboard-shortcuts-projects' do
- Projects
+ = link_to explore_root_path, title: _('Projects'), class: 'dashboard-shortcuts-projects' do
+ = _('Projects')
- if explore_nav_link?(:groups)
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
- = link_to explore_groups_path, title: 'Groups', class: 'dashboard-shortcuts-groups' do
- Groups
+ = link_to explore_groups_path, title: _('Groups'), class: 'dashboard-shortcuts-groups' do
+ = _('Groups')
- if explore_nav_link?(:snippets)
= nav_link(controller: :snippets) do
- = link_to explore_snippets_path, title: 'Snippets', class: 'dashboard-shortcuts-snippets' do
- Snippets
+ = link_to explore_snippets_path, title: _('Snippets'), class: 'dashboard-shortcuts-snippets' do
+ = _('Snippets')
%li
- = link_to "Help", help_path, title: 'About GitLab CE'
+ = link_to _("Help"), help_path, title: _('About GitLab CE')
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml
index 4c73da4c75b..0047efa363d 100644
--- a/app/views/layouts/nav/sidebar/_admin.html.haml
+++ b/app/views/layouts/nav/sidebar/_admin.html.haml
@@ -1,142 +1,143 @@
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
.context-header
- = link_to admin_root_path, title: 'Admin Overview' do
+ = link_to admin_root_path, title: _('Admin Overview') do
.avatar-container.s40.settings-avatar
= sprite_icon('admin', size: 24)
- .sidebar-context-title Admin Area
+ .sidebar-context-title
+ = _('Admin Area')
%ul.sidebar-top-level-items
= nav_link(controller: %w(dashboard admin projects users groups jobs runners gitaly_servers cohorts conversational_development_index), html_options: {class: 'home'}) do
= link_to admin_root_path, class: 'shortcuts-tree' do
.nav-icon-container
= sprite_icon('overview')
%span.nav-item-name
- Overview
+ = _('Overview')
%ul.sidebar-sub-level-items
= nav_link(controller: %w(dashboard admin projects users groups jobs runners gitaly_servers cohorts conversational_development_index), html_options: { class: "fly-out-top-item" } ) do
= link_to admin_root_path do
%strong.fly-out-top-item-name
- #{ _('Overview') }
+ = _('Overview')
%li.divider.fly-out-top-item
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
- = link_to admin_root_path, title: 'Overview' do
+ = link_to admin_root_path, title: _('Overview') do
%span
- Dashboard
+ = _('Dashboard')
= nav_link(controller: [:admin, :projects]) do
- = link_to admin_projects_path, title: 'Projects' do
+ = link_to admin_projects_path, title: _('Projects') do
%span
- Projects
+ = _('Projects')
= nav_link(controller: :users) do
- = link_to admin_users_path, title: 'Users' do
+ = link_to admin_users_path, title: _('Users') do
%span
- Users
+ = _('Users')
= nav_link(controller: :groups) do
- = link_to admin_groups_path, title: 'Groups' do
+ = link_to admin_groups_path, title: _('Groups') do
%span
- Groups
+ = _('Groups')
= nav_link path: 'jobs#index' do
- = link_to admin_jobs_path, title: 'Jobs' do
+ = link_to admin_jobs_path, title: _('Jobs') do
%span
- Jobs
+ = _('Jobs')
= nav_link path: ['runners#index', 'runners#show'] do
- = link_to admin_runners_path, title: 'Runners' do
+ = link_to admin_runners_path, title: _('Runners') do
%span
- Runners
+ = _('Runners')
= nav_link(controller: :gitaly_servers) do
= link_to admin_gitaly_servers_path, title: 'Gitaly Servers' do
%span
- Gitaly Servers
+ = _('Gitaly Servers')
= nav_link path: 'cohorts#index' do
- = link_to admin_cohorts_path, title: 'Cohorts' do
+ = link_to admin_cohorts_path, title: _('Cohorts') do
%span
- Cohorts
+ = _('Cohorts')
= nav_link(controller: :conversational_development_index) do
- = link_to admin_conversational_development_index_path, title: 'ConvDev Index' do
+ = link_to admin_conversational_development_index_path, title: _('ConvDev Index') do
%span
- ConvDev Index
+ = _('ConvDev Index')
= nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles)) do
= link_to admin_system_info_path do
.nav-icon-container
= sprite_icon('monitor')
%span.nav-item-name
- Monitoring
+ = _('Monitoring')
%ul.sidebar-sub-level-items
= nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles), html_options: { class: "fly-out-top-item" } ) do
= link_to admin_system_info_path do
%strong.fly-out-top-item-name
- #{ _('Monitoring') }
+ = _('Monitoring')
%li.divider.fly-out-top-item
= nav_link(controller: :system_info) do
- = link_to admin_system_info_path, title: 'System Info' do
+ = link_to admin_system_info_path, title: _('System Info') do
%span
- System Info
+ = _('System Info')
= nav_link(controller: :background_jobs) do
- = link_to admin_background_jobs_path, title: 'Background Jobs' do
+ = link_to admin_background_jobs_path, title: _('Background Jobs') do
%span
- Background Jobs
+ = _('Background Jobs')
= nav_link(controller: :logs) do
- = link_to admin_logs_path, title: 'Logs' do
+ = link_to admin_logs_path, title: _('Logs') do
%span
- Logs
+ = _('Logs')
= nav_link(controller: :health_check) do
- = link_to admin_health_check_path, title: 'Health Check' do
+ = link_to admin_health_check_path, title: _('Health Check') do
%span
- Health Check
+ = _('Health Check')
= nav_link(controller: :requests_profiles) do
- = link_to admin_requests_profiles_path, title: 'Requests Profiles' do
+ = link_to admin_requests_profiles_path, title: _('Requests Profiles') do
%span
- Requests Profiles
+ = _('Requests Profiles')
= nav_link(controller: :broadcast_messages) do
= link_to admin_broadcast_messages_path do
.nav-icon-container
= sprite_icon('messages')
%span.nav-item-name
- Messages
+ = _('Messages')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :broadcast_messages, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_broadcast_messages_path do
%strong.fly-out-top-item-name
- #{ _('Messages') }
+ = _('Messages')
= nav_link(controller: [:hooks, :hook_logs]) do
= link_to admin_hooks_path do
.nav-icon-container
= sprite_icon('hook')
%span.nav-item-name
- System Hooks
+ = _('System Hooks')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: [:hooks, :hook_logs], html_options: { class: "fly-out-top-item" } ) do
= link_to admin_hooks_path do
%strong.fly-out-top-item-name
- #{ _('System Hooks') }
+ = _('System Hooks')
= nav_link(controller: :applications) do
= link_to admin_applications_path do
.nav-icon-container
= sprite_icon('applications')
%span.nav-item-name
- Applications
+ = _('Applications')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :applications, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_applications_path do
%strong.fly-out-top-item-name
- #{ _('Applications') }
+ = _('Applications')
= nav_link(controller: :abuse_reports) do
= link_to admin_abuse_reports_path do
.nav-icon-container
= sprite_icon('slight-frown')
%span.nav-item-name
- Abuse Reports
+ = _('Abuse Reports')
%span.badge.badge-pill.count= number_with_delimiter(AbuseReport.count(:all))
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :abuse_reports, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_abuse_reports_path do
%strong.fly-out-top-item-name
- #{ _('Abuse Reports') }
+ = _('Abuse Reports')
%span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(AbuseReport.count(:all))
- if akismet_enabled?
@@ -145,71 +146,71 @@
.nav-icon-container
= sprite_icon('spam')
%span.nav-item-name
- Spam Logs
+ = _('Spam Logs')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :spam_logs, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_spam_logs_path do
%strong.fly-out-top-item-name
- #{ _('Spam Logs') }
+ = _('Spam Logs')
= nav_link(controller: :deploy_keys) do
= link_to admin_deploy_keys_path do
.nav-icon-container
= sprite_icon('key')
%span.nav-item-name
- Deploy Keys
+ = _('Deploy Keys')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :deploy_keys, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_deploy_keys_path do
%strong.fly-out-top-item-name
- #{ _('Deploy Keys') }
+ = _('Deploy Keys')
= nav_link(controller: :services) do
= link_to admin_application_settings_services_path do
.nav-icon-container
= sprite_icon('template')
%span.nav-item-name
- Service Templates
+ = _('Service Templates')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :services, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_application_settings_services_path do
%strong.fly-out-top-item-name
- #{ _('Service Templates') }
+ = _('Service Templates')
= nav_link(controller: :labels) do
= link_to admin_labels_path do
.nav-icon-container
= sprite_icon('labels')
%span.nav-item-name
- Labels
+ = _('Labels')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :labels, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_labels_path do
%strong.fly-out-top-item-name
- #{ _('Labels') }
+ = _('Labels')
= nav_link(controller: :appearances) do
= link_to admin_appearances_path do
.nav-icon-container
= sprite_icon('appearance')
%span.nav-item-name
- Appearance
+ = _('Appearance')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :appearances, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_appearances_path do
%strong.fly-out-top-item-name
- #{ _('Appearance') }
+ = _('Appearance')
= nav_link(controller: :application_settings) do
= link_to admin_application_settings_path do
.nav-icon-container
= sprite_icon('settings')
%span.nav-item-name
- Settings
+ = _('Settings')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :application_settings, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_application_settings_path do
%strong.fly-out-top-item-name
- #{ _('Settings') }
+ = _('Settings')
= render 'shared/sidebar_toggle_button'
diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml
index 39a033337ff..0a3b5ec7eea 100644
--- a/app/views/layouts/nav/sidebar/_group.html.haml
+++ b/app/views/layouts/nav/sidebar/_group.html.haml
@@ -17,24 +17,24 @@
.nav-icon-container
= sprite_icon('project')
%span.nav-item-name
- Overview
+ = _('Overview')
%ul.sidebar-sub-level-items
= nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: "fly-out-top-item" } ) do
= link_to group_path(@group) do
%strong.fly-out-top-item-name
- #{ _('Overview') }
+ = _('Overview')
%li.divider.fly-out-top-item
= nav_link(path: ['groups#show', 'groups#subgroups'], html_options: { class: 'home' }) do
- = link_to group_path(@group), title: 'Group details' do
+ = link_to group_path(@group), title: _('Group details') do
%span
- Details
+ = _('Details')
- if group_sidebar_link?(:activity)
= nav_link(path: 'groups#activity') do
- = link_to activity_group_path(@group), title: 'Activity' do
+ = link_to activity_group_path(@group), title: _('Activity') do
%span
- Activity
+ = _('Activity')
- if group_sidebar_link?(:issues)
= nav_link(path: issues_sub_menu_items) do
@@ -42,21 +42,21 @@
.nav-icon-container
= sprite_icon('issues')
%span.nav-item-name
- Issues
+ = _('Issues')
%span.badge.badge-pill.count= number_with_delimiter(issues_count)
%ul.sidebar-sub-level-items
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index'], html_options: { class: "fly-out-top-item" } ) do
= link_to issues_group_path(@group) do
%strong.fly-out-top-item-name
- #{ _('Issues') }
+ = _('Issues')
%span.badge.badge-pill.count.issue_counter.fly-out-badge= number_with_delimiter(issues_count)
%li.divider.fly-out-top-item
= nav_link(path: 'groups#issues', html_options: { class: 'home' }) do
- = link_to issues_group_path(@group), title: 'List' do
+ = link_to issues_group_path(@group), title: _('List') do
%span
- List
+ = _('List')
- if group_sidebar_link?(:boards)
= nav_link(path: ['boards#index', 'boards#show']) do
@@ -66,15 +66,15 @@
- if group_sidebar_link?(:labels)
= nav_link(path: 'labels#index') do
- = link_to group_labels_path(@group), title: 'Labels' do
+ = link_to group_labels_path(@group), title: _('Labels') do
%span
- Labels
+ = _('Labels')
- if group_sidebar_link?(:milestones)
= nav_link(path: 'milestones#index') do
- = link_to group_milestones_path(@group), title: 'Milestones' do
+ = link_to group_milestones_path(@group), title: _('Milestones') do
%span
- Milestones
+ = _('Milestones')
- if group_sidebar_link?(:merge_requests)
= nav_link(path: 'groups#merge_requests') do
@@ -82,13 +82,13 @@
.nav-icon-container
= sprite_icon('git-merge')
%span.nav-item-name
- Merge Requests
+ = _('Merge Requests')
%span.badge.badge-pill.count= number_with_delimiter(merge_requests_count)
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'groups#merge_requests', html_options: { class: "fly-out-top-item" } ) do
= link_to merge_requests_group_path(@group) do
%strong.fly-out-top-item-name
- #{ _('Merge Requests') }
+ = _('Merge Requests')
%span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(merge_requests_count)
- if group_sidebar_link?(:group_members)
@@ -97,12 +97,12 @@
.nav-icon-container
= sprite_icon('users')
%span.nav-item-name
- Members
+ = _('Members')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'group_members#index', html_options: { class: "fly-out-top-item" } ) do
= link_to group_group_members_path(@group) do
%strong.fly-out-top-item-name
- #{ _('Members') }
+ = _('Members')
- if group_sidebar_link?(:settings)
= nav_link(path: group_nav_link_paths) do
@@ -110,17 +110,17 @@
.nav-icon-container
= sprite_icon('settings')
%span.nav-item-name
- Settings
+ = _('Settings')
%ul.sidebar-sub-level-items
= nav_link(path: %w[groups#projects groups#edit badges#index ci_cd#show], html_options: { class: "fly-out-top-item" } ) do
= link_to edit_group_path(@group) do
%strong.fly-out-top-item-name
- #{ _('Settings') }
+ = _('Settings')
%li.divider.fly-out-top-item
= nav_link(path: 'groups#edit') do
- = link_to edit_group_path(@group), title: 'General' do
+ = link_to edit_group_path(@group), title: _('General') do
%span
- General
+ = _('General')
= nav_link(controller: :badges) do
= link_to group_settings_badges_path(@group), title: _('Project Badges') do
@@ -129,13 +129,13 @@
= nav_link(path: 'groups#projects') do
- = link_to projects_group_path(@group), title: 'Projects' do
+ = link_to projects_group_path(@group), title: _('Projects') do
%span
- Projects
+ = _('Projects')
= nav_link(controller: :ci_cd) do
- = link_to group_settings_ci_cd_path(@group), title: 'CI / CD' do
+ = link_to group_settings_ci_cd_path(@group), title: _('CI / CD') do
%span
- CI / CD
+ = _('CI / CD')
= render 'shared/sidebar_toggle_button'
diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml
index 6cbd163dd41..94863a3460d 100644
--- a/app/views/layouts/nav/sidebar/_profile.html.haml
+++ b/app/views/layouts/nav/sidebar/_profile.html.haml
@@ -1,7 +1,7 @@
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
.context-header
- = link_to profile_path, title: 'Profile Settings' do
+ = link_to profile_path, title: _('Profile Settings') do
.avatar-container.s40.settings-avatar
= sprite_icon('user', size: 24)
.sidebar-context-title User Settings
@@ -11,145 +11,145 @@
.nav-icon-container
= sprite_icon('profile')
%span.nav-item-name
- Profile
+ = _('Profile')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'profiles#show', html_options: { class: "fly-out-top-item" } ) do
= link_to profile_path do
%strong.fly-out-top-item-name
- #{ _('Profile') }
+ = _('Profile')
= nav_link(controller: [:accounts, :two_factor_auths]) do
= link_to profile_account_path do
.nav-icon-container
= sprite_icon('account')
%span.nav-item-name
- Account
+ = _('Account')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: [:accounts, :two_factor_auths], html_options: { class: "fly-out-top-item" } ) do
= link_to profile_account_path do
%strong.fly-out-top-item-name
- #{ _('Account') }
+ = _('Account')
- if Gitlab::CurrentSettings.user_oauth_applications?
= nav_link(controller: 'oauth/applications') do
= link_to applications_profile_path do
.nav-icon-container
= sprite_icon('applications')
%span.nav-item-name
- Applications
+ = _('Applications')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: 'oauth/applications', html_options: { class: "fly-out-top-item" } ) do
= link_to applications_profile_path do
%strong.fly-out-top-item-name
- #{ _('Applications') }
+ = _('Applications')
= nav_link(controller: :chat_names) do
= link_to profile_chat_names_path do
.nav-icon-container
= sprite_icon('comment')
%span.nav-item-name
- Chat
+ = _('Chat')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :chat_names, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_chat_names_path do
%strong.fly-out-top-item-name
- #{ _('Chat') }
+ = _('Chat')
= nav_link(controller: :personal_access_tokens) do
= link_to profile_personal_access_tokens_path do
.nav-icon-container
= sprite_icon('token')
%span.nav-item-name
- Access Tokens
+ = _('Access Tokens')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :personal_access_tokens, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_personal_access_tokens_path do
%strong.fly-out-top-item-name
- #{ _('Access Tokens') }
+ = _('Access Tokens')
= nav_link(controller: :emails) do
= link_to profile_emails_path do
.nav-icon-container
= sprite_icon('mail')
%span.nav-item-name
- Emails
+ = _('Emails')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :emails, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_emails_path do
%strong.fly-out-top-item-name
- #{ _('Emails') }
+ = _('Emails')
- if current_user.allow_password_authentication?
= nav_link(controller: :passwords) do
= link_to edit_profile_password_path do
.nav-icon-container
= sprite_icon('lock')
%span.nav-item-name
- Password
+ = _('Password')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :passwords, html_options: { class: "fly-out-top-item" } ) do
= link_to edit_profile_password_path do
%strong.fly-out-top-item-name
- #{ _('Password') }
+ = _('Password')
= nav_link(controller: :notifications) do
= link_to profile_notifications_path do
.nav-icon-container
= sprite_icon('notifications')
%span.nav-item-name
- Notifications
+ = _('Notifications')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :notifications, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_notifications_path do
%strong.fly-out-top-item-name
- #{ _('Notifications') }
+ = _('Notifications')
= nav_link(controller: :keys) do
= link_to profile_keys_path do
.nav-icon-container
= sprite_icon('key')
%span.nav-item-name
- SSH Keys
+ = _('SSH Keys')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :keys, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_keys_path do
%strong.fly-out-top-item-name
- #{ _('SSH Keys') }
+ = _('SSH Keys')
= nav_link(controller: :gpg_keys) do
= link_to profile_gpg_keys_path do
.nav-icon-container
= sprite_icon('key-2')
%span.nav-item-name
- GPG Keys
+ = _('GPG Keys')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :gpg_keys, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_gpg_keys_path do
%strong.fly-out-top-item-name
- #{ _('GPG Keys') }
+ = _('GPG Keys')
= nav_link(controller: :preferences) do
= link_to profile_preferences_path do
.nav-icon-container
= sprite_icon('preferences')
%span.nav-item-name
- Preferences
+ = _('Preferences')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :preferences, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_preferences_path do
%strong.fly-out-top-item-name
- #{ _('Preferences') }
+ = _('Preferences')
= nav_link(controller: :active_sessions) do
= link_to profile_active_sessions_path do
.nav-icon-container
= sprite_icon('monitor-lines')
%span.nav-item-name
- Active Sessions
+ = _('Active Sessions')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :active_sessions, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_active_sessions_path do
%strong.fly-out-top-item-name
- #{ _('Active Sessions') }
+ = _('Active Sessions')
= nav_link(path: 'profiles#audit_log') do
= link_to audit_log_profile_path do
.nav-icon-container
= sprite_icon('log')
%span.nav-item-name
- Authentication log
+ = _('Authentication log')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'profiles#audit_log', html_options: { class: "fly-out-top-item" } ) do
= link_to audit_log_profile_path do
%strong.fly-out-top-item-name
- #{ _('Authentication Log') }
+ = _('Authentication Log')
= render 'shared/sidebar_toggle_button'
diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml
index 33de74dbaa2..0ec61df1f0a 100644
--- a/app/views/layouts/nav/sidebar/_project.html.haml
+++ b/app/views/layouts/nav/sidebar/_project.html.haml
@@ -105,7 +105,7 @@
= number_with_delimiter(@project.open_issues_count(current_user))
%li.divider.fly-out-top-item
= nav_link(controller: :issues, action: :index) do
- = link_to project_issues_path(@project), title: 'Issues' do
+ = link_to project_issues_path(@project), title: _('Issues') do
%span
= _('List')
@@ -115,14 +115,14 @@
= boards_link_text
= nav_link(controller: :labels) do
- = link_to project_labels_path(@project), title: 'Labels' do
+ = link_to project_labels_path(@project), title: _('Labels') do
%span
= _('Labels')
= render_if_exists 'projects/sidebar/issues_service_desk'
= nav_link(controller: :milestones) do
- = link_to project_milestones_path(@project), title: 'Milestones', class: 'qa-milestones-link' do
+ = link_to project_milestones_path(@project), title: _('Milestones'), class: 'qa-milestones-link' do
%span
= _('Milestones')
- if project_nav_tab? :external_issue_tracker
@@ -172,25 +172,25 @@
%li.divider.fly-out-top-item
- if project_nav_tab? :pipelines
= nav_link(path: ['pipelines#index', 'pipelines#show']) do
- = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
+ = link_to project_pipelines_path(@project), title: _('Pipelines'), class: 'shortcuts-pipelines' do
%span
= _('Pipelines')
- if project_nav_tab? :builds
= nav_link(controller: [:jobs, :artifacts]) do
- = link_to project_jobs_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
+ = link_to project_jobs_path(@project), title: _('Jobs'), class: 'shortcuts-builds' do
%span
= _('Jobs')
- if project_nav_tab? :pipelines
= nav_link(controller: :pipeline_schedules) do
- = link_to pipeline_schedules_path(@project), title: 'Schedules', class: 'shortcuts-builds' do
+ = link_to pipeline_schedules_path(@project), title: _('Schedules'), class: 'shortcuts-builds' do
%span
= _('Schedules')
- if @project.feature_available?(:builds, current_user) && !@project.empty_repo?
= nav_link(path: 'pipelines#charts') do
- = link_to charts_project_pipelines_path(@project), title: 'Charts', class: 'shortcuts-pipelines-charts' do
+ = link_to charts_project_pipelines_path(@project), title: _('Charts'), class: 'shortcuts-pipelines-charts' do
%span
= _('Charts')
@@ -242,7 +242,7 @@
%p= _('Allows you to add and manage Kubernetes clusters.')
%p
= _('Protip:')
- = link_to 'Auto DevOps', help_page_path('topics/autodevops/index.md')
+ = link_to _('Auto DevOps'), help_page_path('topics/autodevops/index.md')
%span= _('uses Kubernetes clusters to deploy your code!')
%hr
%button.btn.btn-create.btn-sm.dismiss-feature-highlight{ type: 'button' }
@@ -305,11 +305,11 @@
= _('Settings')
%li.divider.fly-out-top-item
= nav_link(path: %w[projects#edit]) do
- = link_to edit_project_path(@project), title: 'General' do
+ = link_to edit_project_path(@project), title: _('General') do
%span
= _('General')
= nav_link(controller: :project_members) do
- = link_to project_project_members_path(@project), title: 'Members' do
+ = link_to project_project_members_path(@project), title: _('Members') do
%span
= _('Members')
- if can_edit
@@ -319,21 +319,21 @@
= _('Badges')
- if can_edit
= nav_link(controller: [:integrations, :services, :hooks, :hook_logs]) do
- = link_to project_settings_integrations_path(@project), title: 'Integrations' do
+ = link_to project_settings_integrations_path(@project), title: _('Integrations') do
%span
= _('Integrations')
= nav_link(controller: :repository) do
- = link_to project_settings_repository_path(@project), title: 'Repository' do
+ = link_to project_settings_repository_path(@project), title: _('Repository') do
%span
= _('Repository')
- if @project.feature_available?(:builds, current_user)
= nav_link(controller: :ci_cd) do
- = link_to project_settings_ci_cd_path(@project), title: 'CI / CD' do
+ = link_to project_settings_ci_cd_path(@project), title: _('CI / CD') do
%span
= _('CI / CD')
- if @project.pages_available?
= nav_link(controller: :pages) do
- = link_to project_pages_path(@project), title: 'Pages' do
+ = link_to project_pages_path(@project), title: _('Pages') do
%span
= _('Pages')
@@ -341,7 +341,7 @@
- else
= nav_link(controller: :project_members) do
- = link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do
+ = link_to project_settings_members_path(@project), title: _('Members'), class: 'shortcuts-tree' do
.nav-icon-container
= sprite_icon('users')
%span.nav-item-name
@@ -356,41 +356,41 @@
-# Shortcut to Project > Activity
%li.hidden
- = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
+ = link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do
%span
- Activity
+ = _('Activity')
-# Shortcut to Repository > Graph (formerly, Network)
- if project_nav_tab? :network
%li.hidden
- = link_to project_network_path(@project, current_ref), title: 'Network', class: 'shortcuts-network' do
- Graph
+ = link_to project_network_path(@project, current_ref), title: _('Network'), class: 'shortcuts-network' do
+ = _('Graph')
-# Shortcut to Repository > Charts (formerly, top-nav item "Graphs")
- unless @project.empty_repo?
%li.hidden
- = link_to charts_project_graph_path(@project, current_ref), title: 'Charts', class: 'shortcuts-repository-charts' do
- Charts
+ = link_to charts_project_graph_path(@project, current_ref), title: _('Charts'), class: 'shortcuts-repository-charts' do
+ = _('Charts')
-# Shortcut to Issues > New Issue
- if project_nav_tab?(:issues)
%li.hidden
= link_to new_project_issue_path(@project), class: 'shortcuts-new-issue' do
- Create a new issue
+ = _('Create a new issue')
-# Shortcut to Pipelines > Jobs
- if project_nav_tab? :builds
%li.hidden
- = link_to project_jobs_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
- Jobs
+ = link_to project_jobs_path(@project), title: _('Jobs'), class: 'shortcuts-builds' do
+ = _('Jobs')
-# Shortcut to commits page
- if project_nav_tab? :commits
%li.hidden
- = link_to project_commits_path(@project), title: 'Commits', class: 'shortcuts-commits' do
- Commits
+ = link_to project_commits_path(@project), title: _('Commits'), class: 'shortcuts-commits' do
+ = _('Commits')
-# Shortcut to issue boards
- if project_nav_tab?(:issues)
%li.hidden
- = link_to 'Issue Boards', project_boards_path(@project), title: 'Issue Boards', class: 'shortcuts-issue-boards'
+ = link_to _('Issue Boards'), project_boards_path(@project), title: _('Issue Boards'), class: 'shortcuts-issue-boards'
diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml
index ab8b1271212..31e02f1ee19 100644
--- a/app/views/layouts/notify.html.haml
+++ b/app/views/layouts/notify.html.haml
@@ -14,13 +14,12 @@
%br
- if @target_url
- if @reply_by_email
- Reply to this email directly or
- #{link_to "view it on GitLab", @target_url}.
+ = _('Reply to this email directly or %{view_it_on_gitlab}.') % { view_it_on_gitlab: link_to(_("view it on GitLab"), @target_url) }
- else
- #{link_to "View it on GitLab", @target_url}.
+ #{link_to _("View it on GitLab"), @target_url}.
%br
-# Don't link the host in the line below, one link in the email is easier to quickly click than two.
- You're receiving this email because #{notification_reason_text(@reason)}.
+ = _("You're receiving this email because %{reason}.") % { reason: notification_reason_text(@reason) }
If you'd like to receive fewer emails, you can
- if @labels_url
adjust your #{link_to 'label subscriptions', @labels_url}.
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index 67aa05b655c..7aca64663e0 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -1,5 +1,5 @@
-- page_title "User Settings"
-- header_title "User Settings", profile_path unless header_title
+- page_title _("User Settings")
+- header_title _("User Settings"), profile_path unless header_title
- sidebar "dashboard"
- nav "profile"
- @left_sidebar = true
diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml
index 4bc94bd132d..93214c2a674 100644
--- a/app/views/layouts/project_settings.html.haml
+++ b/app/views/layouts/project_settings.html.haml
@@ -1,4 +1,4 @@
-- page_title "Settings"
+- page_title _("Settings")
- nav "project"
= render template: "layouts/project"
diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml
index fd4c7ad21a7..dd4b9e45207 100644
--- a/app/views/layouts/search.html.haml
+++ b/app/views/layouts/search.html.haml
@@ -1,4 +1,4 @@
-- page_title "Search"
-- header_title "Search", search_path
+- page_title _("Search")
+- header_title _("Search"), search_path
= render template: "layouts/application"
diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml
index 849075a0ba5..6418500d5d1 100644
--- a/app/views/layouts/snippets.html.haml
+++ b/app/views/layouts/snippets.html.haml
@@ -1,4 +1,4 @@
-- header_title "Snippets", snippets_path
+- header_title _("Snippets"), snippets_path
- content_for :page_specific_javascripts do
- if @snippet && current_user
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index 507cd5dcc12..a4835584b50 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -69,6 +69,12 @@
= f.text_field :location
= f.text_field :organization
= f.text_area :bio, rows: 4, maxlength: 250, help: 'Tell us about yourself in fewer than 250 characters.'
+ %hr
+ %h5 Private profile
+ - private_profile_label = capture do
+ Don't display activity-related personal information on your profile
+ = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'private-profile')
+ = f.check_box :private_profile, label: private_profile_label
.prepend-top-default.append-bottom-default
= f.submit 'Update profile settings', class: 'btn btn-success'
= link_to 'Cancel', user_path(current_user), class: 'btn btn-cancel'
diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml
index e0832fd9136..9dd1c24fdfa 100644
--- a/app/views/shared/notes/_notes_with_form.html.haml
+++ b/app/views/shared/notes/_notes_with_form.html.haml
@@ -13,7 +13,7 @@
.flash-container.timeline-content
.timeline-icon.d-none.d-sm-none.d-md-block
- %a.author_link{ href: user_path(current_user) }
+ %a.author-link{ href: user_path(current_user) }
= image_tag avatar_icon_for_user(current_user), alt: current_user.to_reference, class: 'avatar s40'
.timeline-content.timeline-content-form
= render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index b2ec7166832..8d9e86d02c4 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -23,8 +23,9 @@
= link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn',
title: 'Report abuse', data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
= icon('exclamation-circle')
- = link_to user_path(@user, rss_url_options), class: 'btn btn-default has-tooltip', title: 'Subscribe', 'aria-label': 'Subscribe' do
- = icon('rss')
+ - if can?(current_user, :read_user_profile, @user)
+ = link_to user_path(@user, rss_url_options), class: 'btn btn-default has-tooltip', title: 'Subscribe', 'aria-label': 'Subscribe' do
+ = icon('rss')
- if current_user && current_user.admin?
= link_to [:admin, @user], class: 'btn btn-default', title: 'View user in admin area',
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
@@ -40,10 +41,12 @@
= @user.name
.cover-desc.member-date
- %span.middle-dot-divider
- @#{@user.username}
- %span.middle-dot-divider
- Member since #{@user.created_at.to_date.to_s(:long)}
+ %p
+ %span.middle-dot-divider
+ @#{@user.username}
+ - if can?(current_user, :read_user_profile, @user)
+ %span.middle-dot-divider
+ Member since #{@user.created_at.to_date.to_s(:long)}
.cover-desc
- unless @user.public_email.blank?
@@ -78,30 +81,31 @@
%p.profile-user-bio
= @user.bio
- .scrolling-tabs-container
- .fade-left= icon('angle-left')
- .fade-right= icon('angle-right')
- %ul.nav-links.user-profile-nav.scrolling-tabs.nav.nav-tabs
- - if profile_tab?(:activity)
- %li.js-activity-tab
- = link_to user_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
- Activity
- - if profile_tab?(:groups)
- %li.js-groups-tab
- = link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
- Groups
- - if profile_tab?(:contributed)
- %li.js-contributed-tab
- = link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
- Contributed projects
- - if profile_tab?(:projects)
- %li.js-projects-tab
- = link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
- Personal projects
- - if profile_tab?(:snippets)
- %li.js-snippets-tab
- = link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
- Snippets
+ - unless profile_tabs.empty?
+ .scrolling-tabs-container
+ .fade-left= icon('angle-left')
+ .fade-right= icon('angle-right')
+ %ul.nav-links.user-profile-nav.scrolling-tabs.nav.nav-tabs
+ - if profile_tab?(:activity)
+ %li.js-activity-tab
+ = link_to user_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
+ Activity
+ - if profile_tab?(:groups)
+ %li.js-groups-tab
+ = link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
+ Groups
+ - if profile_tab?(:contributed)
+ %li.js-contributed-tab
+ = link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
+ Contributed projects
+ - if profile_tab?(:projects)
+ %li.js-projects-tab
+ = link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
+ Personal projects
+ - if profile_tab?(:snippets)
+ %li.js-snippets-tab
+ = link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
+ Snippets
%div{ class: container_class }
.tab-content
@@ -137,3 +141,13 @@
.loading-status
= spinner
+
+ - if profile_tabs.empty?
+ .row
+ .col-12
+ .svg-content
+ = image_tag 'illustrations/profile_private_mode.svg'
+ .col-12.text-center
+ .text-content
+ %h4
+ This user has a private profile
diff --git a/changelogs/unreleased/38604-add-private-profile.yml b/changelogs/unreleased/38604-add-private-profile.yml
new file mode 100644
index 00000000000..e40e7d9321e
--- /dev/null
+++ b/changelogs/unreleased/38604-add-private-profile.yml
@@ -0,0 +1,5 @@
+---
+title: Add an option to have a private profile on GitLab.
+merge_request: 20387
+author: jxterry
+type: added
diff --git a/changelogs/unreleased/40973-disable-rack-attack-by-default.yml b/changelogs/unreleased/40973-disable-rack-attack-by-default.yml
new file mode 100644
index 00000000000..681aa761e2a
--- /dev/null
+++ b/changelogs/unreleased/40973-disable-rack-attack-by-default.yml
@@ -0,0 +1,5 @@
+---
+title: Rack attack is now disabled by default
+merge_request: 16669
+author:
+type: changed
diff --git a/changelogs/unreleased/43011-typecast-markdownversion-prop-notesapp.yml b/changelogs/unreleased/43011-typecast-markdownversion-prop-notesapp.yml
new file mode 100644
index 00000000000..b60aeba860a
--- /dev/null
+++ b/changelogs/unreleased/43011-typecast-markdownversion-prop-notesapp.yml
@@ -0,0 +1,5 @@
+---
+title: Fix Vue datatype errors for markdownVersion parsing
+merge_request: 20800
+author:
+type: fixed
diff --git a/changelogs/unreleased/49025-docs-kubernetes-tiller.yml b/changelogs/unreleased/49025-docs-kubernetes-tiller.yml
new file mode 100644
index 00000000000..c4f01490cfa
--- /dev/null
+++ b/changelogs/unreleased/49025-docs-kubernetes-tiller.yml
@@ -0,0 +1,5 @@
+---
+title: Update docs of Helm Tiller
+merge_request: 20515
+author: Takuya Noguchi
+type: other
diff --git a/changelogs/unreleased/ce-6064-geo-sql-query-for-counting-projects-with-wikis-is-very-slow.yml b/changelogs/unreleased/ce-6064-geo-sql-query-for-counting-projects-with-wikis-is-very-slow.yml
new file mode 100644
index 00000000000..b76437a8773
--- /dev/null
+++ b/changelogs/unreleased/ce-6064-geo-sql-query-for-counting-projects-with-wikis-is-very-slow.yml
@@ -0,0 +1,5 @@
+---
+title: Tracking the number of repositories and wikis with a cached counter for site-wide statistics
+merge_request: 20413
+author:
+type: performance
diff --git a/changelogs/unreleased/fix-email-confirmation-addtional-email.yml b/changelogs/unreleased/fix-email-confirmation-addtional-email.yml
new file mode 100644
index 00000000000..56a2efa4d60
--- /dev/null
+++ b/changelogs/unreleased/fix-email-confirmation-addtional-email.yml
@@ -0,0 +1,5 @@
+---
+title: Fix email confirmation bug when user adds additional email to account
+merge_request: 20084
+author: muhammadn
+type: fixed
diff --git a/changelogs/unreleased/frozen-string-danger.yml b/changelogs/unreleased/frozen-string-danger.yml
new file mode 100644
index 00000000000..9910139b8a9
--- /dev/null
+++ b/changelogs/unreleased/frozen-string-danger.yml
@@ -0,0 +1,5 @@
+---
+title: Add Dangerfile for frozen_string_literal
+merge_request: 20767
+author: gfyoung
+type: performance
diff --git a/changelogs/unreleased/frozen-string-enable-app-presenters-policies.yml b/changelogs/unreleased/frozen-string-enable-app-presenters-policies.yml
new file mode 100644
index 00000000000..5c6b1b1a904
--- /dev/null
+++ b/changelogs/unreleased/frozen-string-enable-app-presenters-policies.yml
@@ -0,0 +1,5 @@
+---
+title: Enable frozen string in app/presenters and app/policies
+merge_request: 20819
+author: gfyoung
+type: performance
diff --git a/changelogs/unreleased/frozen-string-enable-app-serializers.yml b/changelogs/unreleased/frozen-string-enable-app-serializers.yml
new file mode 100644
index 00000000000..40c7b695d39
--- /dev/null
+++ b/changelogs/unreleased/frozen-string-enable-app-serializers.yml
@@ -0,0 +1,5 @@
+---
+title: Enable frozen string in app/serializers/**/*.rb
+merge_request: 20726
+author: gfyoung
+type: performance
diff --git a/changelogs/unreleased/kp-stacked-progress-bar-decimal-places.yml b/changelogs/unreleased/kp-stacked-progress-bar-decimal-places.yml
new file mode 100644
index 00000000000..a2fca4c5b91
--- /dev/null
+++ b/changelogs/unreleased/kp-stacked-progress-bar-decimal-places.yml
@@ -0,0 +1,5 @@
+---
+title: Show decimal place up to single digit in Stacked Progress Bar
+merge_request: 20776
+author:
+type: changed
diff --git a/changelogs/unreleased/replace-all-snake-case-in-scss-variables.yml b/changelogs/unreleased/replace-all-snake-case-in-scss-variables.yml
new file mode 100644
index 00000000000..8d5ecdfa57e
--- /dev/null
+++ b/changelogs/unreleased/replace-all-snake-case-in-scss-variables.yml
@@ -0,0 +1,5 @@
+---
+title: Replace snake case in SCSS variables
+merge_request: 20799
+author: George Tsiolis
+type: other
diff --git a/changelogs/unreleased/replace-snake-case-css-classes.yml b/changelogs/unreleased/replace-snake-case-css-classes.yml
new file mode 100644
index 00000000000..28ec5ee097f
--- /dev/null
+++ b/changelogs/unreleased/replace-snake-case-css-classes.yml
@@ -0,0 +1,5 @@
+---
+title: Replace author_link snake case in stylesheets, specs, and helpers
+merge_request: 20797
+author: George Tsiolis
+type: other
diff --git a/changelogs/unreleased/sh-bump-sanitize-4-6-6.yml b/changelogs/unreleased/sh-bump-sanitize-4-6-6.yml
new file mode 100644
index 00000000000..b9444440cb9
--- /dev/null
+++ b/changelogs/unreleased/sh-bump-sanitize-4-6-6.yml
@@ -0,0 +1,5 @@
+---
+title: Bump nokogiri to 1.8.4 and sanitize to 4.6.6 for performance
+merge_request: 20795
+author:
+type: performance
diff --git a/changelogs/unreleased/sh-include-rbtrace.yml b/changelogs/unreleased/sh-include-rbtrace.yml
new file mode 100644
index 00000000000..41f0655e3f8
--- /dev/null
+++ b/changelogs/unreleased/sh-include-rbtrace.yml
@@ -0,0 +1,5 @@
+---
+title: Add rbtrace to Gemfile
+merge_request: 20831
+author:
+type: other
diff --git a/changelogs/unreleased/sh-revert-markdown-changes.yml b/changelogs/unreleased/sh-revert-markdown-changes.yml
new file mode 100644
index 00000000000..72540f710a1
--- /dev/null
+++ b/changelogs/unreleased/sh-revert-markdown-changes.yml
@@ -0,0 +1,5 @@
+---
+title: Fix slow Markdown rendering
+merge_request: 20820
+author:
+type: performance
diff --git a/changelogs/unreleased/sh-use-wiki-limit-parameter-gitaly.yml b/changelogs/unreleased/sh-use-wiki-limit-parameter-gitaly.yml
new file mode 100644
index 00000000000..e8c2e11ad31
--- /dev/null
+++ b/changelogs/unreleased/sh-use-wiki-limit-parameter-gitaly.yml
@@ -0,0 +1,5 @@
+---
+title: Use limit parameter to retrieve Wikis from Gitaly
+merge_request: 20764
+author:
+type: performance
diff --git a/changelogs/unreleased/zj-backup-timeout.yml b/changelogs/unreleased/zj-backup-timeout.yml
new file mode 100644
index 00000000000..b2ad2ed8c63
--- /dev/null
+++ b/changelogs/unreleased/zj-backup-timeout.yml
@@ -0,0 +1,5 @@
+---
+title: Disable Gitaly timeouts when creating or restoring backups
+merge_request: 20810
+author:
+type: fixed
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index c3122827a6b..9ad55e21d11 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -1,4 +1,5 @@
require_relative '../settings'
+require_relative '../object_store_settings'
# Default settings
Settings['ldap'] ||= Settingslogic.new({})
@@ -179,14 +180,7 @@ Settings.artifacts['storage_path'] = Settings.absolute(Settings.artifacts.values
# Settings.artifact['path'] is deprecated, use `storage_path` instead
Settings.artifacts['path'] = Settings.artifacts['storage_path']
Settings.artifacts['max_size'] ||= 100 # in megabytes
-Settings.artifacts['object_store'] ||= Settingslogic.new({})
-Settings.artifacts['object_store']['enabled'] = false if Settings.artifacts['object_store']['enabled'].nil?
-Settings.artifacts['object_store']['remote_directory'] ||= nil
-Settings.artifacts['object_store']['direct_upload'] = false if Settings.artifacts['object_store']['direct_upload'].nil?
-Settings.artifacts['object_store']['background_upload'] = true if Settings.artifacts['object_store']['background_upload'].nil?
-Settings.artifacts['object_store']['proxy_download'] = false if Settings.artifacts['object_store']['proxy_download'].nil?
-# Convert upload connection settings to use string keys, to make Fog happy
-Settings.artifacts['object_store']['connection']&.deep_stringify_keys!
+Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifacts['object_store'])
#
# Registry
@@ -225,14 +219,7 @@ Settings.pages.admin['certificate'] ||= ''
Settings['lfs'] ||= Settingslogic.new({})
Settings.lfs['enabled'] = true if Settings.lfs['enabled'].nil?
Settings.lfs['storage_path'] = Settings.absolute(Settings.lfs['storage_path'] || File.join(Settings.shared['path'], "lfs-objects"))
-Settings.lfs['object_store'] ||= Settingslogic.new({})
-Settings.lfs['object_store']['enabled'] = false if Settings.lfs['object_store']['enabled'].nil?
-Settings.lfs['object_store']['remote_directory'] ||= nil
-Settings.lfs['object_store']['direct_upload'] = false if Settings.lfs['object_store']['direct_upload'].nil?
-Settings.lfs['object_store']['background_upload'] = true if Settings.lfs['object_store']['background_upload'].nil?
-Settings.lfs['object_store']['proxy_download'] = false if Settings.lfs['object_store']['proxy_download'].nil?
-# Convert upload connection settings to use string keys, to make Fog happy
-Settings.lfs['object_store']['connection']&.deep_stringify_keys!
+Settings.lfs['object_store'] = ObjectStoreSettings.parse(Settings.lfs['object_store'])
#
# Uploads
@@ -240,14 +227,8 @@ Settings.lfs['object_store']['connection']&.deep_stringify_keys!
Settings['uploads'] ||= Settingslogic.new({})
Settings.uploads['storage_path'] = Settings.absolute(Settings.uploads['storage_path'] || 'public')
Settings.uploads['base_dir'] = Settings.uploads['base_dir'] || 'uploads/-/system'
-Settings.uploads['object_store'] ||= Settingslogic.new({})
-Settings.uploads['object_store']['enabled'] = false if Settings.uploads['object_store']['enabled'].nil?
+Settings.uploads['object_store'] = ObjectStoreSettings.parse(Settings.uploads['object_store'])
Settings.uploads['object_store']['remote_directory'] ||= 'uploads'
-Settings.uploads['object_store']['direct_upload'] = false if Settings.uploads['object_store']['direct_upload'].nil?
-Settings.uploads['object_store']['background_upload'] = true if Settings.uploads['object_store']['background_upload'].nil?
-Settings.uploads['object_store']['proxy_download'] = false if Settings.uploads['object_store']['proxy_download'].nil?
-# Convert upload connection settings to use string keys, to make Fog happy
-Settings.uploads['object_store']['connection']&.deep_stringify_keys!
#
# Mattermost
@@ -437,7 +418,7 @@ Settings['extra'] ||= Settingslogic.new({})
#
Settings['rack_attack'] ||= Settingslogic.new({})
Settings.rack_attack['git_basic_auth'] ||= Settingslogic.new({})
-Settings.rack_attack.git_basic_auth['enabled'] = true if Settings.rack_attack.git_basic_auth['enabled'].nil?
+Settings.rack_attack.git_basic_auth['enabled'] = false if Settings.rack_attack.git_basic_auth['enabled'].nil?
Settings.rack_attack.git_basic_auth['ip_whitelist'] ||= %w{127.0.0.1}
Settings.rack_attack.git_basic_auth['maxretry'] ||= 10
Settings.rack_attack.git_basic_auth['findtime'] ||= 1.minute
diff --git a/config/initializers/rbtrace.rb b/config/initializers/rbtrace.rb
new file mode 100644
index 00000000000..3a076c99ad0
--- /dev/null
+++ b/config/initializers/rbtrace.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+require 'rbtrace' if ENV['ENABLE_RBTRACE']
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb
new file mode 100644
index 00000000000..d85ff394dcc
--- /dev/null
+++ b/config/object_store_settings.rb
@@ -0,0 +1,15 @@
+# Set default values for object_store settings
+class ObjectStoreSettings
+ def self.parse(object_store)
+ object_store ||= Settingslogic.new({})
+ object_store['enabled'] = false if object_store['enabled'].nil?
+ object_store['remote_directory'] ||= nil
+ object_store['direct_upload'] = false if object_store['direct_upload'].nil?
+ object_store['background_upload'] = true if object_store['background_upload'].nil?
+ object_store['proxy_download'] = false if object_store['proxy_download'].nil?
+
+ # Convert upload connection settings to use string keys, to make Fog happy
+ object_store['connection']&.deep_stringify_keys!
+ object_store
+ end
+end
diff --git a/danger/frozen_string/Dangerfile b/danger/frozen_string/Dangerfile
new file mode 100644
index 00000000000..595176d597d
--- /dev/null
+++ b/danger/frozen_string/Dangerfile
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+FILE_EXTENSION = ".rb"
+MAGIC_COMMENT = "# frozen_string_literal: true"
+
+def get_files_with_no_magic_comment(files)
+ files.select do |file|
+ file.end_with?(FILE_EXTENSION) &&
+ !File.open(file, &:gets).start_with?(MAGIC_COMMENT)
+ end
+end
+
+files_to_check = git.added_files
+files_to_fix = get_files_with_no_magic_comment(files_to_check)
+
+if files_to_fix.any?
+ warn 'This merge request adds files that do not enforce frozen string literal. ' \
+ 'See https://gitlab.com/gitlab-org/gitlab-ce/issues/47424 for more information.'
+
+ markdown(<<~MARKDOWN)
+## Enable Frozen String Literal
+
+The following files should have `#{MAGIC_COMMENT}` in the first line:
+
+* #{files_to_fix.map { |path| "`#{path}`" }.join("\n* ")}
+ MARKDOWN
+end
diff --git a/db/migrate/20140313092127_init_schema.rb b/db/migrate/20140313092127_init_schema.rb
index 895298ed4ed..29fb386ad76 100644
--- a/db/migrate/20140313092127_init_schema.rb
+++ b/db/migrate/20140313092127_init_schema.rb
@@ -1,6 +1,7 @@
class InitSchema < ActiveRecord::Migration
DOWNTIME = true
+ # rubocop:disable Metrics/AbcSize
def up
create_table "broadcast_messages", force: :cascade do |t|
t.text "message", null: false
@@ -157,9 +158,9 @@ class InitSchema < ActiveRecord::Migration
add_index "notes", ["author_id"], name: "index_notes_on_author_id", using: :btree
add_index "notes", ["commit_id"], name: "index_notes_on_commit_id", using: :btree
add_index "notes", ["created_at"], name: "index_notes_on_created_at", using: :btree
- add_index "notes", ["noteable_id", "noteable_type"], name: "index_notes_on_noteable_id_and_noteable_type", using: :btree
+ add_index "notes", %w[noteable_id noteable_type], name: "index_notes_on_noteable_id_and_noteable_type", using: :btree
add_index "notes", ["noteable_type"], name: "index_notes_on_noteable_type", using: :btree
- add_index "notes", ["project_id", "noteable_type"], name: "index_notes_on_project_id_and_noteable_type", using: :btree
+ add_index "notes", %w[project_id noteable_type], name: "index_notes_on_project_id_and_noteable_type", using: :btree
add_index "notes", ["project_id"], name: "index_notes_on_project_id", using: :btree
create_table "project_group_links", force: :cascade do |t|
t.integer "project_id", null: false
@@ -241,7 +242,7 @@ class InitSchema < ActiveRecord::Migration
t.datetime "created_at"
end
add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree
- add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
+ add_index "taggings", %w[taggable_id taggable_type context], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
create_table "tags", force: :cascade do |t|
t.string "name"
end
@@ -292,7 +293,7 @@ class InitSchema < ActiveRecord::Migration
add_index "users", ["authentication_token"], name: "index_users_on_authentication_token", unique: true, using: :btree
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
- add_index "users", ["extern_uid", "provider"], name: "index_users_on_extern_uid_and_provider", unique: true, using: :btree
+ add_index "users", %w[extern_uid provider], name: "index_users_on_extern_uid_and_provider", unique: true, using: :btree
add_index "users", ["name"], name: "index_users_on_name", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_index "users", ["username"], name: "index_users_on_username", using: :btree
diff --git a/db/migrate/20140407135544_fix_namespaces.rb b/db/migrate/20140407135544_fix_namespaces.rb
index 0026ce645a6..3d2ca5c13c4 100644
--- a/db/migrate/20140407135544_fix_namespaces.rb
+++ b/db/migrate/20140407135544_fix_namespaces.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class FixNamespaces < ActiveRecord::Migration
DOWNTIME = false
diff --git a/db/migrate/20140415124820_limits_to_mysql.rb b/db/migrate/20140415124820_limits_to_mysql.rb
index c712423bcd1..3f6e62617c5 100644
--- a/db/migrate/20140415124820_limits_to_mysql.rb
+++ b/db/migrate/20140415124820_limits_to_mysql.rb
@@ -1,2 +1 @@
-# rubocop:disable all
require_relative 'limits_to_mysql'
diff --git a/db/migrate/20140729145339_migrate_project_tags.rb b/db/migrate/20140729145339_migrate_project_tags.rb
index ac46847f3e6..5760e4bfeaa 100644
--- a/db/migrate/20140729145339_migrate_project_tags.rb
+++ b/db/migrate/20140729145339_migrate_project_tags.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateProjectTags < ActiveRecord::Migration
def up
ActsAsTaggableOn::Tagging.where(taggable_type: 'Project', context: 'labels').update_all(context: 'tags')
diff --git a/db/migrate/20141121133009_add_timestamps_to_members.rb b/db/migrate/20141121133009_add_timestamps_to_members.rb
index 68f164cd35d..ef6d4dedf32 100644
--- a/db/migrate/20141121133009_add_timestamps_to_members.rb
+++ b/db/migrate/20141121133009_add_timestamps_to_members.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# In 20140914145549_migrate_to_new_members_model.rb we forgot to set the
# created_at and updated_at times for new records in the 'members' table. This
# became a problem after commit c8e78d972a5a628870eefca0f2ccea0199c55bda which
diff --git a/db/migrate/20141223135007_add_import_data_to_project_table.rb b/db/migrate/20141223135007_add_import_data_to_project_table.rb
index 9c8a483e4d5..5db78f94cc9 100644
--- a/db/migrate/20141223135007_add_import_data_to_project_table.rb
+++ b/db/migrate/20141223135007_add_import_data_to_project_table.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddImportDataToProjectTable < ActiveRecord::Migration
def change
add_column :projects, :import_type, :string
diff --git a/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb b/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
index 10e6549c729..aa179ce3a4d 100644
--- a/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
+++ b/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddHomePageUrlForApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :home_page_url, :string
diff --git a/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb b/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
index e083973615a..c28ba3197ac 100644
--- a/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
+++ b/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddGitlabAccessTokenToUser < ActiveRecord::Migration
def change
add_column :users, :gitlab_access_token, :string
diff --git a/db/migrate/20150206222854_add_notification_email_to_user.rb b/db/migrate/20150206222854_add_notification_email_to_user.rb
index ebae092cac8..ab80f7e582f 100644
--- a/db/migrate/20150206222854_add_notification_email_to_user.rb
+++ b/db/migrate/20150206222854_add_notification_email_to_user.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddNotificationEmailToUser < ActiveRecord::Migration
def up
add_column :users, :notification_email, :string
diff --git a/db/migrate/20150211174341_allow_null_in_services_project_id.rb b/db/migrate/20150211174341_allow_null_in_services_project_id.rb
index fea95c79adf..68f02812791 100644
--- a/db/migrate/20150211174341_allow_null_in_services_project_id.rb
+++ b/db/migrate/20150211174341_allow_null_in_services_project_id.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AllowNullInServicesProjectId < ActiveRecord::Migration
def change
change_column :services, :project_id, :integer, null: true
diff --git a/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb b/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
index 78e9fd0c3a9..23ac1b399ec 100644
--- a/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
+++ b/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddBitbucketAccessTokenAndSecretToUser < ActiveRecord::Migration
def change
add_column :users, :bitbucket_access_token, :string
diff --git a/db/migrate/20150223022001_set_missing_last_activity_at.rb b/db/migrate/20150223022001_set_missing_last_activity_at.rb
index 300381ad65b..3f6d4d83474 100644
--- a/db/migrate/20150223022001_set_missing_last_activity_at.rb
+++ b/db/migrate/20150223022001_set_missing_last_activity_at.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class SetMissingLastActivityAt < ActiveRecord::Migration
def up
execute "UPDATE projects SET last_activity_at = updated_at WHERE last_activity_at IS NULL"
diff --git a/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb b/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
index 7d8d65ef2ee..494c3033bff 100644
--- a/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
+++ b/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRestrictedVisibilityLevelsToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :restricted_visibility_levels, :text
diff --git a/db/migrate/20150320234437_add_location_to_user.rb b/db/migrate/20150320234437_add_location_to_user.rb
index df046570361..32731d37d75 100644
--- a/db/migrate/20150320234437_add_location_to_user.rb
+++ b/db/migrate/20150320234437_add_location_to_user.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddLocationToUser < ActiveRecord::Migration
def change
add_column :users, :location, :string
diff --git a/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
index 9f8b6f4bd59..42dc8173e46 100644
--- a/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
+++ b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration
def up
execute "UPDATE issues SET assignee_id = NULL WHERE assignee_id = -1"
diff --git a/db/migrate/20150327150017_add_import_data_to_project.rb b/db/migrate/20150327150017_add_import_data_to_project.rb
index 67b1554dfd1..12c00339eec 100644
--- a/db/migrate/20150327150017_add_import_data_to_project.rb
+++ b/db/migrate/20150327150017_add_import_data_to_project.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddImportDataToProject < ActiveRecord::Migration
def change
add_column :projects, :import_data, :text
diff --git a/db/migrate/20150327223628_add_devise_two_factor_to_users.rb b/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
index eccb0123e77..11b026ee8f3 100644
--- a/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
+++ b/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDeviseTwoFactorToUsers < ActiveRecord::Migration
def change
add_column :users, :encrypted_otp_secret, :string
diff --git a/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb b/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
index 4c56a2fb78b..1d161674a9a 100644
--- a/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
+++ b/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMaxAttachmentSizeToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :max_attachment_size, :integer, default: 10, null: false
diff --git a/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb b/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
index fdb6d72917e..913958db7c5 100644
--- a/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
+++ b/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration
def change
add_column :users, :otp_backup_codes, :text
diff --git a/db/migrate/20150411000035_fix_identities.rb b/db/migrate/20150411000035_fix_identities.rb
index a10fcc001f4..d9051f9fffd 100644
--- a/db/migrate/20150411000035_fix_identities.rb
+++ b/db/migrate/20150411000035_fix_identities.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class FixIdentities < ActiveRecord::Migration
def up
# Up until now, legacy 'ldap' references in the database were charitably
diff --git a/db/migrate/20150411180045_rename_buildbox_service.rb b/db/migrate/20150411180045_rename_buildbox_service.rb
index 9f3b25c3971..5a0b5d07e50 100644
--- a/db/migrate/20150411180045_rename_buildbox_service.rb
+++ b/db/migrate/20150411180045_rename_buildbox_service.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RenameBuildboxService < ActiveRecord::Migration
def up
execute "UPDATE services SET type = 'BuildkiteService' WHERE type = 'BuildboxService';"
diff --git a/db/migrate/20150417121913_create_project_import_data.rb b/db/migrate/20150417121913_create_project_import_data.rb
index fc357cbacc8..c78f5fde85e 100644
--- a/db/migrate/20150417121913_create_project_import_data.rb
+++ b/db/migrate/20150417121913_create_project_import_data.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class CreateProjectImportData < ActiveRecord::Migration
def change
create_table :project_import_data do |t|
diff --git a/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb b/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
index 129ce4d04af..50a9b2439e0 100644
--- a/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
+++ b/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration
def up
add_column :application_settings, :default_project_visibility, :integer
diff --git a/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
index 8f352414ffd..281c88d2a7d 100644
--- a/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# This migration is a duplicate of 20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
# It shold be applied before the index additions to ensure that `name` is case sensitive.
diff --git a/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
index 88829b87711..71f2d7f4330 100644
--- a/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# This migration comes from acts_as_taggable_on_engine (originally 4)
class AddMissingTaggableIndex < ActiveRecord::Migration
def self.up
diff --git a/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
index 642c4745321..bfb06bc7cda 100644
--- a/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# This migration comes from acts_as_taggable_on_engine (originally 5)
# This migration is added to circumvent issue #623 and have special characters
# work properly
diff --git a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
index dd13def4176..8f1b0cc8935 100644
--- a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
+++ b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration
def up
add_column :application_settings, :default_snippet_visibility, :integer
diff --git a/db/migrate/20150429002313_remove_abandoned_group_members_records.rb b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
index d2c7f3c442e..244637e1c4a 100644
--- a/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
+++ b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
def up
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
diff --git a/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb b/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
index b63ea9aec7a..184e2653610 100644
--- a/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
+++ b/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRestrictedSignupDomainsToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :restricted_signup_domains, :text
diff --git a/db/migrate/20150509180749_convert_legacy_reference_notes.rb b/db/migrate/20150509180749_convert_legacy_reference_notes.rb
index cd8bf90108d..b02605489be 100644
--- a/db/migrate/20150509180749_convert_legacy_reference_notes.rb
+++ b/db/migrate/20150509180749_convert_legacy_reference_notes.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# Convert legacy Markdown-emphasized notes to the current, non-emphasized format
#
# _mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666_
diff --git a/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb b/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
index 9b02eda56ab..6a78294f0b2 100644
--- a/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
+++ b/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddUserOauthApplicationsToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :user_oauth_applications, :bool, default: true
diff --git a/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb b/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
index 1f5cf1fe5f1..61ff0af41f4 100644
--- a/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
+++ b/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddSessionExpireDelayForApplicationSettings < ActiveRecord::Migration
def change
unless column_exists?(:application_settings, :session_expire_delay)
diff --git a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
index da0fd457a34..8eed8678b2f 100644
--- a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
+++ b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration
def up
execute %q{UPDATE users SET otp_required_for_login = FALSE WHERE otp_required_for_login IS NULL}
diff --git a/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb b/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
index be30e881c74..78d45c7f96b 100644
--- a/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
+++ b/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddUpdatedByToIssuablesAndNotes < ActiveRecord::Migration
def change
add_column :notes, :updated_by_id, :integer
diff --git a/db/migrate/20150818213832_add_sent_notifications.rb b/db/migrate/20150818213832_add_sent_notifications.rb
index fa0c3ce0acf..43e8d6a1a82 100644
--- a/db/migrate/20150818213832_add_sent_notifications.rb
+++ b/db/migrate/20150818213832_add_sent_notifications.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddSentNotifications < ActiveRecord::Migration
def change
create_table :sent_notifications do |t|
diff --git a/db/migrate/20150915001905_enable_ssl_verification_by_default.rb b/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
index 3f070139418..6e924262a13 100644
--- a/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
+++ b/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class EnableSslVerificationByDefault < ActiveRecord::Migration
def change
change_column :web_hooks, :enable_ssl_verification, :boolean, default: true
diff --git a/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb b/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
index ea2ab6e4093..90ce6c2db3d 100644
--- a/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
+++ b/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class EnableSslVerificationForWebHooks < ActiveRecord::Migration
def up
execute("UPDATE web_hooks SET enable_ssl_verification = true")
diff --git a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
index a504f25b1be..37a27f11935 100644
--- a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
+++ b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :help_page_text, :text
diff --git a/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb b/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
index c9b6e035122..6cf668a170e 100644
--- a/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
+++ b/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddCiEnabledToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :ci_enabled, :boolean, null: false, default: true
diff --git a/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb b/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
index e1818b566d7..0aad6fe5e6e 100644
--- a/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
+++ b/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveInvalidMilestonesFromMergeRequests < ActiveRecord::Migration
def up
execute("UPDATE merge_requests SET milestone_id = NULL where milestone_id NOT IN (SELECT id FROM milestones)")
diff --git a/db/migrate/20150920010715_add_consumed_timestep_to_users.rb b/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
index e6975f5b9fe..c8438b3f6aa 100644
--- a/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
+++ b/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddConsumedTimestepToUsers < ActiveRecord::Migration
def change
add_column :users, :consumed_timestep, :integer
diff --git a/db/migrate/20150920161119_add_line_code_to_sent_notification.rb b/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
index 1bcb06e4bda..d9af4e71751 100644
--- a/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
+++ b/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddLineCodeToSentNotification < ActiveRecord::Migration
def change
add_column :sent_notifications, :line_code, :string
diff --git a/db/migrate/20150924125150_add_project_id_to_ci_commit.rb b/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
index 905332b7dc7..1a761fe0f86 100644
--- a/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
+++ b/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddProjectIdToCiCommit < ActiveRecord::Migration
def up
add_column :ci_commits, :gl_project_id, :integer
diff --git a/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb b/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
index fb0e0ba1fa5..2be57b6062e 100644
--- a/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
+++ b/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateProjectIdForCiCommits < ActiveRecord::Migration
def up
subquery = 'SELECT gitlab_id FROM ci_projects WHERE ci_projects.id = ci_commits.project_id'
diff --git a/db/migrate/20150930001110_merge_request_error_field.rb b/db/migrate/20150930001110_merge_request_error_field.rb
index 71a8ae3938a..c2ee498ef3f 100644
--- a/db/migrate/20150930001110_merge_request_error_field.rb
+++ b/db/migrate/20150930001110_merge_request_error_field.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MergeRequestErrorField < ActiveRecord::Migration
def up
add_column :merge_requests, :merge_error, :string
diff --git a/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb b/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
index 229c9942b50..8d47dac6441 100644
--- a/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
+++ b/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddNullToNameForCiProjects < ActiveRecord::Migration
def up
change_column_null :ci_projects, :name, true
diff --git a/db/migrate/20151002112914_add_stage_idx_to_builds.rb b/db/migrate/20151002112914_add_stage_idx_to_builds.rb
index 4297ba0e7c8..68a745ffef4 100644
--- a/db/migrate/20151002112914_add_stage_idx_to_builds.rb
+++ b/db/migrate/20151002112914_add_stage_idx_to_builds.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddStageIdxToBuilds < ActiveRecord::Migration
def change
add_column :ci_builds, :stage_idx, :integer
diff --git a/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb b/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
index 3c0fcf6c45d..e3d2ac1cea5 100644
--- a/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
+++ b/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRefAndTagToBuilds < ActiveRecord::Migration
def change
add_column :ci_builds, :tag, :boolean
diff --git a/db/migrate/20151005075649_add_user_id_to_build.rb b/db/migrate/20151005075649_add_user_id_to_build.rb
index be9d403e002..0f4b92b8b79 100644
--- a/db/migrate/20151005075649_add_user_id_to_build.rb
+++ b/db/migrate/20151005075649_add_user_id_to_build.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddUserIdToBuild < ActiveRecord::Migration
def change
add_column :ci_builds, :user_id, :integer
diff --git a/db/migrate/20151008143519_add_admin_notification_email_setting.rb b/db/migrate/20151008143519_add_admin_notification_email_setting.rb
index f48ec9aa4a6..0bb581efe2c 100644
--- a/db/migrate/20151008143519_add_admin_notification_email_setting.rb
+++ b/db/migrate/20151008143519_add_admin_notification_email_setting.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddAdminNotificationEmailSetting < ActiveRecord::Migration
def change
add_column :application_settings, :admin_notification_email, :string
diff --git a/db/migrate/20151013092124_add_artifacts_file_to_builds.rb b/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
index a54ac9d57a4..5a299f7b26d 100644
--- a/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
+++ b/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddArtifactsFileToBuilds < ActiveRecord::Migration
def change
add_column :ci_builds, :artifacts_file, :text
diff --git a/db/migrate/20151019111551_fix_build_tags.rb b/db/migrate/20151019111551_fix_build_tags.rb
index 8c05acfc190..299a24b0a7c 100644
--- a/db/migrate/20151019111551_fix_build_tags.rb
+++ b/db/migrate/20151019111551_fix_build_tags.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class FixBuildTags < ActiveRecord::Migration
def up
execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
diff --git a/db/migrate/20151019111703_fail_build_without_names.rb b/db/migrate/20151019111703_fail_build_without_names.rb
index 362e31eb435..dcdb5d1b25d 100644
--- a/db/migrate/20151019111703_fail_build_without_names.rb
+++ b/db/migrate/20151019111703_fail_build_without_names.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class FailBuildWithoutNames < ActiveRecord::Migration
def up
execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
diff --git a/db/migrate/20151020173516_ci_limits_to_mysql.rb b/db/migrate/20151020173516_ci_limits_to_mysql.rb
index 5314611cbcd..9bb960082f5 100644
--- a/db/migrate/20151020173516_ci_limits_to_mysql.rb
+++ b/db/migrate/20151020173516_ci_limits_to_mysql.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class CiLimitsToMysql < ActiveRecord::Migration
def change
return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
diff --git a/db/migrate/20151023112551_fail_build_with_empty_name.rb b/db/migrate/20151023112551_fail_build_with_empty_name.rb
index 0666dfeaef4..41c0f0649cd 100644
--- a/db/migrate/20151023112551_fail_build_with_empty_name.rb
+++ b/db/migrate/20151023112551_fail_build_with_empty_name.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class FailBuildWithEmptyName < ActiveRecord::Migration
def up
execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'")
diff --git a/db/migrate/20151023144219_remove_satellites.rb b/db/migrate/20151023144219_remove_satellites.rb
index 98fe0bd7d1d..e73f300028a 100644
--- a/db/migrate/20151023144219_remove_satellites.rb
+++ b/db/migrate/20151023144219_remove_satellites.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
require 'fileutils'
class RemoveSatellites < ActiveRecord::Migration
diff --git a/db/migrate/20151103133339_add_shared_runners_setting.rb b/db/migrate/20151103133339_add_shared_runners_setting.rb
index b5b34d4ca61..4231dfd5c2e 100644
--- a/db/migrate/20151103133339_add_shared_runners_setting.rb
+++ b/db/migrate/20151103133339_add_shared_runners_setting.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddSharedRunnersSetting < ActiveRecord::Migration
def up
add_column :application_settings, :shared_runners_enabled, :boolean, default: true, null: false
diff --git a/db/migrate/20151104105513_add_file_to_lfs_objects.rb b/db/migrate/20151104105513_add_file_to_lfs_objects.rb
index 4e46ae8101c..7c57f3f0df6 100644
--- a/db/migrate/20151104105513_add_file_to_lfs_objects.rb
+++ b/db/migrate/20151104105513_add_file_to_lfs_objects.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddFileToLfsObjects < ActiveRecord::Migration
def change
add_column :lfs_objects, :file, :string
diff --git a/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb b/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
index 25106ace7e9..01d8c0f043e 100644
--- a/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
+++ b/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMaxArtifactsSizeToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :max_artifacts_size, :integer, default: 100, null: false
diff --git a/db/migrate/20151110125604_add_import_error_to_project.rb b/db/migrate/20151110125604_add_import_error_to_project.rb
index 793358c305e..7fc990f8d0a 100644
--- a/db/migrate/20151110125604_add_import_error_to_project.rb
+++ b/db/migrate/20151110125604_add_import_error_to_project.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddImportErrorToProject < ActiveRecord::Migration
def change
add_column :projects, :import_error, :text
diff --git a/db/migrate/20151201203948_raise_hook_url_limit.rb b/db/migrate/20151201203948_raise_hook_url_limit.rb
index c490b7ace0f..98a7fca6f6f 100644
--- a/db/migrate/20151201203948_raise_hook_url_limit.rb
+++ b/db/migrate/20151201203948_raise_hook_url_limit.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RaiseHookUrlLimit < ActiveRecord::Migration
def change
change_column :web_hooks, :url, :string, limit: 2000
diff --git a/db/migrate/20151209144329_migrate_ci_web_hooks.rb b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
index 62a6d334f04..e1e4729f821 100644
--- a/db/migrate/20151209144329_migrate_ci_web_hooks.rb
+++ b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateCiWebHooks < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20151209145909_migrate_ci_emails.rb b/db/migrate/20151209145909_migrate_ci_emails.rb
index 5de7b205fb1..e1d92f0157e 100644
--- a/db/migrate/20151209145909_migrate_ci_emails.rb
+++ b/db/migrate/20151209145909_migrate_ci_emails.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateCiEmails < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20151210030143_add_unlock_token_to_user.rb b/db/migrate/20151210030143_add_unlock_token_to_user.rb
index d23c648f782..0ea66ba65df 100644
--- a/db/migrate/20151210030143_add_unlock_token_to_user.rb
+++ b/db/migrate/20151210030143_add_unlock_token_to_user.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddUnlockTokenToUser < ActiveRecord::Migration
def change
add_column :users, :unlock_token, :string
diff --git a/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb b/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
index 92c7b5befd2..00f88180e46 100644
--- a/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
+++ b/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRunnersRegistrationTokenToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :runners_registration_token, :string
diff --git a/db/migrate/20151210125232_migrate_ci_slack_service.rb b/db/migrate/20151210125232_migrate_ci_slack_service.rb
index fff130b7b10..e6dca4c0008 100644
--- a/db/migrate/20151210125232_migrate_ci_slack_service.rb
+++ b/db/migrate/20151210125232_migrate_ci_slack_service.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateCiSlackService < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
index 824f6f84195..72fcebf2959 100644
--- a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
+++ b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateCiHipChatService < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20151210125929_add_project_id_to_ci.rb b/db/migrate/20151210125929_add_project_id_to_ci.rb
index b5de64b82ca..84273591fa2 100644
--- a/db/migrate/20151210125929_add_project_id_to_ci.rb
+++ b/db/migrate/20151210125929_add_project_id_to_ci.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddProjectIdToCi < ActiveRecord::Migration
def change
add_column :ci_builds, :gl_project_id, :integer
diff --git a/db/migrate/20151210125930_migrate_ci_to_project.rb b/db/migrate/20151210125930_migrate_ci_to_project.rb
index bb6d74ae212..c32c7feb193 100644
--- a/db/migrate/20151210125930_migrate_ci_to_project.rb
+++ b/db/migrate/20151210125930_migrate_ci_to_project.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class MigrateCiToProject < ActiveRecord::Migration
def up
migrate_project_id_for_table('ci_runner_projects')
diff --git a/db/migrate/20151218154042_add_tfa_to_application_settings.rb b/db/migrate/20151218154042_add_tfa_to_application_settings.rb
index afdaf76b917..dd95db775c5 100644
--- a/db/migrate/20151218154042_add_tfa_to_application_settings.rb
+++ b/db/migrate/20151218154042_add_tfa_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddTfaToApplicationSettings < ActiveRecord::Migration
def change
change_table :application_settings do |t|
diff --git a/db/migrate/20151221234414_add_tfa_additional_fields.rb b/db/migrate/20151221234414_add_tfa_additional_fields.rb
index c3e4aaa606a..c16df47932f 100644
--- a/db/migrate/20151221234414_add_tfa_additional_fields.rb
+++ b/db/migrate/20151221234414_add_tfa_additional_fields.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddTfaAdditionalFields < ActiveRecord::Migration
def change
change_table :users do |t|
diff --git a/db/migrate/20151224123230_rename_emojis.rb b/db/migrate/20151224123230_rename_emojis.rb
index 2c24f3beeea..62d921dfdcc 100644
--- a/db/migrate/20151224123230_rename_emojis.rb
+++ b/db/migrate/20151224123230_rename_emojis.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# Migration type: online without errors (works on previous version and new one)
class RenameEmojis < ActiveRecord::Migration
def up
diff --git a/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb b/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
index e0dd19b2b06..259fd0248d2 100644
--- a/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
+++ b/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRecaptchaToApplicationSettings < ActiveRecord::Migration
def change
change_table :application_settings do |t|
diff --git a/db/migrate/20151229102248_influxdb_udp_port_setting.rb b/db/migrate/20151229102248_influxdb_udp_port_setting.rb
index 3e1bfd43899..ae0499f936d 100644
--- a/db/migrate/20151229102248_influxdb_udp_port_setting.rb
+++ b/db/migrate/20151229102248_influxdb_udp_port_setting.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class InfluxdbUdpPortSetting < ActiveRecord::Migration
def change
add_column :application_settings, :metrics_port, :integer, default: 8089
diff --git a/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb b/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
index 4fcca06d905..6c282fc5039 100644
--- a/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
+++ b/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddArtifactsMetadataToCiBuild < ActiveRecord::Migration
def change
add_column :ci_builds, :artifacts_metadata, :text
diff --git a/db/migrate/20151231152326_add_akismet_to_application_settings.rb b/db/migrate/20151231152326_add_akismet_to_application_settings.rb
index 7b0fab6f557..3f52c758f9a 100644
--- a/db/migrate/20151231152326_add_akismet_to_application_settings.rb
+++ b/db/migrate/20151231152326_add_akismet_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddAkismetToApplicationSettings < ActiveRecord::Migration
def change
change_table :application_settings do |t|
diff --git a/db/migrate/20160113111034_add_metrics_sample_interval.rb b/db/migrate/20160113111034_add_metrics_sample_interval.rb
index c1041da818c..b741f5d2c75 100644
--- a/db/migrate/20160113111034_add_metrics_sample_interval.rb
+++ b/db/migrate/20160113111034_add_metrics_sample_interval.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMetricsSampleInterval < ActiveRecord::Migration
def change
add_column :application_settings, :metrics_sample_interval, :integer,
diff --git a/db/migrate/20160118155830_add_sentry_to_application_settings.rb b/db/migrate/20160118155830_add_sentry_to_application_settings.rb
index a6f715263ef..fa7ff9d9228 100644
--- a/db/migrate/20160118155830_add_sentry_to_application_settings.rb
+++ b/db/migrate/20160118155830_add_sentry_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddSentryToApplicationSettings < ActiveRecord::Migration
def change
change_table :application_settings do |t|
diff --git a/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb b/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
index 3837208f81e..d6c6aa4a4e8 100644
--- a/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
+++ b/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddBaseCommitShaToMergeRequestDiffs < ActiveRecord::Migration
def change
add_column :merge_request_diffs, :base_commit_sha, :string
diff --git a/db/migrate/20160128233227_change_lfs_objects_size_column.rb b/db/migrate/20160128233227_change_lfs_objects_size_column.rb
index 645c0cdb192..e7fd1f71777 100644
--- a/db/migrate/20160128233227_change_lfs_objects_size_column.rb
+++ b/db/migrate/20160128233227_change_lfs_objects_size_column.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class ChangeLfsObjectsSizeColumn < ActiveRecord::Migration
def change
change_column :lfs_objects, :size, :integer, limit: 8
diff --git a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
index b10c0602e24..d3ea956952e 100644
--- a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
+++ b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveDotAtomPathEndingOfProjects < ActiveRecord::Migration
include Gitlab::ShellAdapter
diff --git a/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb b/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
index 332b5a756e8..f0d94226514 100644
--- a/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
+++ b/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMergeCommitShaToMergeRequests < ActiveRecord::Migration
def change
add_column :merge_requests, :merge_commit_sha, :string
diff --git a/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb b/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
index 11b6ff31000..f996ae74dca 100644
--- a/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
+++ b/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRealSizeToMergeRequestDiffs < ActiveRecord::Migration
def change
add_column :merge_request_diffs, :real_size, :string
diff --git a/db/migrate/20160217100506_add_description_to_label.rb b/db/migrate/20160217100506_add_description_to_label.rb
index af5af167470..eed6d1f236a 100644
--- a/db/migrate/20160217100506_add_description_to_label.rb
+++ b/db/migrate/20160217100506_add_description_to_label.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDescriptionToLabel < ActiveRecord::Migration
def change
add_column :labels, :description, :string
diff --git a/db/migrate/20160217174422_add_note_to_tasks.rb b/db/migrate/20160217174422_add_note_to_tasks.rb
index a9a2b77e423..da5cb2e05db 100644
--- a/db/migrate/20160217174422_add_note_to_tasks.rb
+++ b/db/migrate/20160217174422_add_note_to_tasks.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddNoteToTasks < ActiveRecord::Migration
def change
add_reference :tasks, :note, index: true
diff --git a/db/migrate/20160220123949_rename_tasks_to_todos.rb b/db/migrate/20160220123949_rename_tasks_to_todos.rb
index f16b37537f3..30c10d27146 100644
--- a/db/migrate/20160220123949_rename_tasks_to_todos.rb
+++ b/db/migrate/20160220123949_rename_tasks_to_todos.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RenameTasksToTodos < ActiveRecord::Migration
def change
rename_table :tasks, :todos
diff --git a/db/migrate/20160229193553_add_main_language_to_repository.rb b/db/migrate/20160229193553_add_main_language_to_repository.rb
index ad5167b4c93..b5446c6a447 100644
--- a/db/migrate/20160229193553_add_main_language_to_repository.rb
+++ b/db/migrate/20160229193553_add_main_language_to_repository.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMainLanguageToRepository < ActiveRecord::Migration
def change
add_column :projects, :main_language, :string
diff --git a/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb b/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
index 1f400566f9f..ffcd64266e3 100644
--- a/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
+++ b/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddImportCredentialsToProjectImportData < ActiveRecord::Migration
def change
add_column :project_import_data, :encrypted_credentials, :text
diff --git a/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb b/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
index 10f2b8cc56a..49e787d9a9a 100644
--- a/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
+++ b/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class DisallowBlankLineCodeOnNote < ActiveRecord::Migration
def up
execute("UPDATE notes SET line_code = NULL WHERE line_code = ''")
diff --git a/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb b/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
index 65e0e61c78f..6871b3920df 100644
--- a/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
+++ b/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class ChangeTargetIdToNullOnTodos < ActiveRecord::Migration
def change
change_column_null :todos, :target_id, true
diff --git a/db/migrate/20160317092222_add_moved_to_to_issue.rb b/db/migrate/20160317092222_add_moved_to_to_issue.rb
index 9dde668ddff..461e7fb3a9b 100644
--- a/db/migrate/20160317092222_add_moved_to_to_issue.rb
+++ b/db/migrate/20160317092222_add_moved_to_to_issue.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMovedToToIssue < ActiveRecord::Migration
def change
add_reference :issues, :moved_to, references: :issues
diff --git a/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb b/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
index a9a851cfe63..1fff9759d1e 100644
--- a/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
+++ b/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveTodosForDeletedIssues < ActiveRecord::Migration
def up
execute <<-SQL
diff --git a/db/migrate/20160328115649_migrate_new_notification_setting.rb b/db/migrate/20160328115649_migrate_new_notification_setting.rb
index eb6b7d07219..3c81b2c37bf 100644
--- a/db/migrate/20160328115649_migrate_new_notification_setting.rb
+++ b/db/migrate/20160328115649_migrate_new_notification_setting.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# This migration will create one row of NotificationSetting for each Member row
# It can take long time on big instances.
#
diff --git a/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb b/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
index b15af79b9b5..54cea964ff2 100644
--- a/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
+++ b/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveTodosForDeletedMergeRequests < ActiveRecord::Migration
def up
execute <<-SQL
diff --git a/db/migrate/20160407120251_add_images_enabled_for_project.rb b/db/migrate/20160407120251_add_images_enabled_for_project.rb
index fcffc98b47a..47f0ca8e8de 100644
--- a/db/migrate/20160407120251_add_images_enabled_for_project.rb
+++ b/db/migrate/20160407120251_add_images_enabled_for_project.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddImagesEnabledForProject < ActiveRecord::Migration
def change
add_column :projects, :container_registry_enabled, :boolean
diff --git a/db/migrate/20160413115152_add_token_to_web_hooks.rb b/db/migrate/20160413115152_add_token_to_web_hooks.rb
index 628b1d51b30..f04225068cd 100644
--- a/db/migrate/20160413115152_add_token_to_web_hooks.rb
+++ b/db/migrate/20160413115152_add_token_to_web_hooks.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddTokenToWebHooks < ActiveRecord::Migration
def change
add_column :web_hooks, :token, :string
diff --git a/db/migrate/20160415062917_create_personal_access_tokens.rb b/db/migrate/20160415062917_create_personal_access_tokens.rb
index c7b49870bf7..94650026994 100644
--- a/db/migrate/20160415062917_create_personal_access_tokens.rb
+++ b/db/migrate/20160415062917_create_personal_access_tokens.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class CreatePersonalAccessTokens < ActiveRecord::Migration
def change
diff --git a/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb b/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
index b53b9bc6c3d..d493044c67b 100644
--- a/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
+++ b/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddSharedRunnersTextToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :shared_runners_text, :text
diff --git a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
index 95ee03611d9..50f159a80b1 100644
--- a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
+++ b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class ConvertAwardNoteToEmojiAward < ActiveRecord::Migration
disable_ddl_transaction!
diff --git a/db/migrate/20160419120017_add_metrics_packet_size.rb b/db/migrate/20160419120017_add_metrics_packet_size.rb
index c759427c590..78c163d62ac 100644
--- a/db/migrate/20160419120017_add_metrics_packet_size.rb
+++ b/db/migrate/20160419120017_add_metrics_packet_size.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddMetricsPacketSize < ActiveRecord::Migration
def change
add_column :application_settings, :metrics_packet_size, :integer, default: 1
diff --git a/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb b/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
index bf50616656c..facd33875ba 100644
--- a/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
+++ b/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddDisabledOauthSignInSourcesToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :disabled_oauth_sign_in_sources, :text
diff --git a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
index c60892a6279..84e5e4eabe2 100644
--- a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
+++ b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddRunUntaggedToCiRunner < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
diff --git a/db/migrate/20160508215820_add_type_to_notes.rb b/db/migrate/20160508215820_add_type_to_notes.rb
index c1d07c9363f..58944d4e651 100644
--- a/db/migrate/20160508215820_add_type_to_notes.rb
+++ b/db/migrate/20160508215820_add_type_to_notes.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddTypeToNotes < ActiveRecord::Migration
def change
add_column :notes, :type, :string
diff --git a/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb b/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
index b6a5bea79b6..9d729fec189 100644
--- a/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
+++ b/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddHealthCheckAccessTokenToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :health_check_access_token, :string
diff --git a/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb b/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
index 3e26be7c09c..7910120b4e0 100644
--- a/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
+++ b/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveNotificationSettingsForDeletedProjects < ActiveRecord::Migration
def up
execute <<-SQL
diff --git a/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb b/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
index d811fd5271e..e21376bd571 100644
--- a/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
+++ b/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
# This is ONLINE migration
class AddContainerRegistryTokenExpireDelayToApplicationSettings < ActiveRecord::Migration
diff --git a/db/migrate/20160603180330_remove_duplicated_notification_settings.rb b/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
index 4f4f58b1619..fe1c863b5b9 100644
--- a/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
+++ b/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveDuplicatedNotificationSettings < ActiveRecord::Migration
def up
duplicates = exec_query(%Q{
diff --git a/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb b/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
index 3c5d2ad910e..89826fb96cb 100644
--- a/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
+++ b/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class AddAfterSignUpTextToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :after_sign_up_text, :text
diff --git a/db/migrate/20160610204157_add_deployments.rb b/db/migrate/20160610204157_add_deployments.rb
index 0e7e6e747a3..0ee0b1f5a86 100644
--- a/db/migrate/20160610204157_add_deployments.rb
+++ b/db/migrate/20160610204157_add_deployments.rb
@@ -1,7 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-
-# rubocop:disable Migration/Datetime
class AddDeployments < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20160610204158_add_environments.rb b/db/migrate/20160610204158_add_environments.rb
index 699cee2b246..534a73a5fb6 100644
--- a/db/migrate/20160610204158_add_environments.rb
+++ b/db/migrate/20160610204158_add_environments.rb
@@ -1,7 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-
-# rubocop:disable Migration/Datetime
class AddEnvironments < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
index 013904b3f4f..d0e6d8d1ea1 100644
--- a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
+++ b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
@@ -1,6 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-# rubocop:disable all
class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20160616102642_remove_duplicated_keys.rb b/db/migrate/20160616102642_remove_duplicated_keys.rb
index 180a75e0998..5e41cc53e32 100644
--- a/db/migrate/20160616102642_remove_duplicated_keys.rb
+++ b/db/migrate/20160616102642_remove_duplicated_keys.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class RemoveDuplicatedKeys < ActiveRecord::Migration
def up
select_all("SELECT fingerprint FROM #{quote_table_name(:keys)} GROUP BY fingerprint HAVING COUNT(*) > 1").each do |row|
diff --git a/db/migrate/20160824124900_add_table_issue_metrics.rb b/db/migrate/20160824124900_add_table_issue_metrics.rb
index 30d35ef1db2..49be8bc949b 100644
--- a/db/migrate/20160824124900_add_table_issue_metrics.rb
+++ b/db/migrate/20160824124900_add_table_issue_metrics.rb
@@ -1,7 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-
-# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class AddTableIssueMetrics < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20160825052008_add_table_merge_request_metrics.rb b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
index 56b39634dfd..3c9dcc08190 100644
--- a/db/migrate/20160825052008_add_table_merge_request_metrics.rb
+++ b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
@@ -1,7 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-
-# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class AddTableMergeRequestMetrics < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20161113184239_create_user_chat_names_table.rb b/db/migrate/20161113184239_create_user_chat_names_table.rb
index 62ccb599f2e..7bead07fd76 100644
--- a/db/migrate/20161113184239_create_user_chat_names_table.rb
+++ b/db/migrate/20161113184239_create_user_chat_names_table.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class CreateUserChatNamesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170130221926_create_uploads.rb b/db/migrate/20170130221926_create_uploads.rb
index 4d9fa0bb692..6f06c5dd840 100644
--- a/db/migrate/20170130221926_create_uploads.rb
+++ b/db/migrate/20170130221926_create_uploads.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
class CreateUploads < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170222143317_drop_ci_projects.rb b/db/migrate/20170222143317_drop_ci_projects.rb
index 9973e53501c..4db8658f36f 100644
--- a/db/migrate/20170222143317_drop_ci_projects.rb
+++ b/db/migrate/20170222143317_drop_ci_projects.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
class DropCiProjects < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb b/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
index 0535c2ddaf2..ee802ab34ca 100644
--- a/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
+++ b/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
@@ -1,5 +1,4 @@
# rubocop:disable Migration/RemoveColumn
-# rubocop:disable Migration/Datetime
class RemoveUnusedCiTablesAndColumns < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170329095907_create_ci_trigger_schedules.rb b/db/migrate/20170329095907_create_ci_trigger_schedules.rb
index 06a2010db23..cfcfa27ebb5 100644
--- a/db/migrate/20170329095907_create_ci_trigger_schedules.rb
+++ b/db/migrate/20170329095907_create_ci_trigger_schedules.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
class CreateCiTriggerSchedules < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
index 84635fa39b9..42c90103262 100644
--- a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
+++ b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
@@ -1,7 +1,5 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-
-# rubocop:disable RemoveIndex
class RemoveIndexForUsersCurrentSignInAt < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170425112128_create_pipeline_schedules_table.rb b/db/migrate/20170425112128_create_pipeline_schedules_table.rb
index 4f9c56a1ad8..bd15b9eef19 100644
--- a/db/migrate/20170425112128_create_pipeline_schedules_table.rb
+++ b/db/migrate/20170425112128_create_pipeline_schedules_table.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class CreatePipelineSchedulesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb b/db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
index 008a94d8334..1c5d4997d40 100644
--- a/db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
+++ b/db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
@@ -1,2 +1 @@
-# rubocop:disable all
require_relative 'markdown_cache_limits_to_mysql'
diff --git a/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb b/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
index 470c3b8166c..f858611d24b 100644
--- a/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
+++ b/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
@@ -6,6 +6,7 @@ class RenameUsersLdapEmailToExternalEmail < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :users, :ldap_email, :external_email
end
diff --git a/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb b/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
index ad540b1e509..0f1e937545b 100644
--- a/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
+++ b/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
@@ -10,6 +10,7 @@ class AddTimezoneToIssuesClosedAt < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/UpdateLargeTable
change_column_type_concurrently(:issues, :closed_at, :datetime_with_timezone)
end
diff --git a/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb b/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
index 5a36dec6a9a..36a85b61968 100644
--- a/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
+++ b/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
@@ -25,6 +25,7 @@ class MigrateRemainingIssuesClosedAt < ActiveRecord::Migration
# Due to some EE merge problems some environments may not have the
# "closed_at_for_type_change" column. If this is the case we have no
# other option than to migrate the data _right now_.
+ # rubocop:disable Migration/UpdateLargeTable
change_column_type_concurrently(:issues, :closed_at, :datetime_with_timezone)
cleanup_concurrent_column_type_change(:issues, :closed_at)
end
diff --git a/db/migrate/20180214093516_create_badges.rb b/db/migrate/20180214093516_create_badges.rb
index 6559f834484..a1d77328f77 100644
--- a/db/migrate/20180214093516_create_badges.rb
+++ b/db/migrate/20180214093516_create_badges.rb
@@ -12,6 +12,7 @@ class CreateBadges < ActiveRecord::Migration
t.timestamps_with_timezone null: false
end
+ # rubocop:disable Migration/AddConcurrentForeignKey
add_foreign_key :badges, :namespaces, column: :group_id, on_delete: :cascade
end
end
diff --git a/db/migrate/20180227182112_add_group_id_to_boards_ce.rb b/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
index f54dd8d7687..5b2691b3a00 100644
--- a/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
+++ b/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
@@ -8,6 +8,7 @@ class AddGroupIdToBoardsCe < ActiveRecord::Migration
def up
return if group_id_exists?
+ # rubocop:disable Migration/AddConcurrentForeignKey
add_column :boards, :group_id, :integer
add_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade
add_concurrent_index :boards, :group_id
@@ -18,6 +19,7 @@ class AddGroupIdToBoardsCe < ActiveRecord::Migration
def down
return unless group_id_exists?
+ # rubocop:disable Migration/RemoveIndex
remove_foreign_key :boards, column: :group_id
remove_index :boards, :group_id if index_exists? :boards, :group_id
remove_column :boards, :group_id
diff --git a/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb b/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
index 8298979e96a..e6cec39e61f 100644
--- a/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
+++ b/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
@@ -8,6 +8,7 @@ class EnsureForeignKeysOnClustersApplications < ActiveRecord::Migration
disable_ddl_transaction!
+ # rubocop:disable Cop/InBatches
def up
existing = Clusters::Cluster
.joins(:application_ingress)
diff --git a/db/migrate/20180309160427_add_partial_indexes_on_todos.rb b/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
index 18a5c69df1b..671fa743cec 100644
--- a/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
+++ b/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
@@ -7,15 +7,16 @@ class AddPartialIndexesOnTodos < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
- disable_ddl_transaction!
+ disable_ddl_transaction!
+
+ INDEX_NAME_PENDING = "index_todos_on_user_id_and_id_pending"
+ INDEX_NAME_DONE = "index_todos_on_user_id_and_id_done"
- INDEX_NAME_PENDING="index_todos_on_user_id_and_id_pending"
- INDEX_NAME_DONE="index_todos_on_user_id_and_id_done"
-
def up
unless index_exists?(:todos, [:user_id, :id], name: INDEX_NAME_PENDING)
add_concurrent_index(:todos, [:user_id, :id], where: "state='pending'", name: INDEX_NAME_PENDING)
end
+
unless index_exists?(:todos, [:user_id, :id], name: INDEX_NAME_DONE)
add_concurrent_index(:todos, [:user_id, :id], where: "state='done'", name: INDEX_NAME_DONE)
end
@@ -24,5 +25,5 @@ class AddPartialIndexesOnTodos < ActiveRecord::Migration
def down
remove_concurrent_index(:todos, [:user_id, :id], where: "state='pending'", name: INDEX_NAME_PENDING)
remove_concurrent_index(:todos, [:user_id, :id], where: "state='done'", name: INDEX_NAME_DONE)
- end
+ end
end
diff --git a/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb b/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
index 007cbebaf1b..e852d50b25e 100644
--- a/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
+++ b/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
@@ -6,6 +6,7 @@ class RenameUsersRssTokenToFeedToken < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :users, :rss_token, :feed_token
end
diff --git a/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb b/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
index 582b89a3948..58de795472a 100644
--- a/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
+++ b/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
@@ -26,6 +26,7 @@ class AddIndexConstraintsToInternalIdTable < ActiveRecord::Migration
end
private
+
def replace_index(table, columns, name:)
temporary_name = "#{name}_old"
diff --git a/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
index 1084ca14a34..ac91624c3d5 100644
--- a/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
+++ b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
@@ -10,6 +10,7 @@ class AddIndexToCiJobArtifactsFileStore < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/RemoveIndex
remove_index :ci_job_artifacts, :file_store if index_exists?(:ci_job_artifacts, :file_store)
end
end
diff --git a/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb b/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
index 306cd737771..f5afdb0e4e6 100644
--- a/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
+++ b/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
@@ -4,6 +4,7 @@ class AddEnforceTermsToApplicationSettings < ActiveRecord::Migration
DOWNTIME = false
def change
+ # rubocop:disable Migration/SaferBooleanColumn
add_column :application_settings, :enforce_terms, :boolean, default: false
end
end
diff --git a/db/migrate/20180425075446_create_term_agreements.rb b/db/migrate/20180425075446_create_term_agreements.rb
index 22a9d7b574d..1fa2c8dd3be 100644
--- a/db/migrate/20180425075446_create_term_agreements.rb
+++ b/db/migrate/20180425075446_create_term_agreements.rb
@@ -21,6 +21,7 @@ class CreateTermAgreements < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/RemoveIndex
remove_index :term_agreements, name: 'term_agreements_unique_index'
drop_table :term_agreements
diff --git a/db/migrate/20180503131624_create_remote_mirrors.rb b/db/migrate/20180503131624_create_remote_mirrors.rb
index 7800186455f..249882f8613 100644
--- a/db/migrate/20180503131624_create_remote_mirrors.rb
+++ b/db/migrate/20180503131624_create_remote_mirrors.rb
@@ -23,6 +23,7 @@ class CreateRemoteMirrors < ActiveRecord::Migration
t.string :encrypted_credentials_iv
t.string :encrypted_credentials_salt
+ # rubocop:disable Migration/Timestamps
t.timestamps null: false
end
end
diff --git a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
index 4c4e576d49f..9e55690bd33 100644
--- a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
+++ b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
@@ -14,6 +14,7 @@ class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration
def down
if index_exists?(:namespaces, :runners_token, unique: true)
+ # rubocop:disable Migration/RemoveIndex
remove_index :namespaces, :runners_token
end
end
diff --git a/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb b/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
index 17570269b2e..b59b941c815 100644
--- a/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
+++ b/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
@@ -11,6 +11,7 @@ class AddIndexesToProjectMirrorData < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/RemoveIndex
remove_index :project_mirror_data, :jid if index_exists? :project_mirror_data, :jid
remove_index :project_mirror_data, :status if index_exists? :project_mirror_data, :status
end
diff --git a/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
index 9a9decffdab..4af42b4fb29 100644
--- a/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
+++ b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
@@ -10,6 +10,7 @@ class AddIndexesToRemoteMirror < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/RemoveIndex
remove_index :remote_mirrors, :last_successful_update_at if index_exists? :remote_mirrors, :last_successful_update_at
end
end
diff --git a/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb b/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
index 580f56007c7..f3ed20fd243 100644
--- a/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
+++ b/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
@@ -10,6 +10,7 @@ class AddIndexOnCiRunnersRunnerType < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/RemoveIndex
remove_index :ci_runners, :runner_type
end
end
diff --git a/db/migrate/20180515005612_add_squash_to_merge_requests.rb b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
index f526b45bd4b..fd85e968acd 100644
--- a/db/migrate/20180515005612_add_squash_to_merge_requests.rb
+++ b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
@@ -9,6 +9,7 @@ class AddSquashToMergeRequests < ActiveRecord::Migration
def up
unless column_exists?(:merge_requests, :squash)
+ # rubocop:disable Migration/UpdateLargeTable
add_column_with_default :merge_requests, :squash, :boolean, default: false, allow_null: false
end
end
diff --git a/db/migrate/20180515121227_create_notes_diff_files.rb b/db/migrate/20180515121227_create_notes_diff_files.rb
index 7108bc1a64b..efcd3bb9c7e 100644
--- a/db/migrate/20180515121227_create_notes_diff_files.rb
+++ b/db/migrate/20180515121227_create_notes_diff_files.rb
@@ -16,6 +16,7 @@ class CreateNotesDiffFiles < ActiveRecord::Migration
t.text :old_path, null: false
end
+ # rubocop:disable Migration/AddConcurrentForeignKey
add_foreign_key :note_diff_files, :notes, column: :diff_note_id, on_delete: :cascade
end
end
diff --git a/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb b/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb
index df84898003f..08ce8cc3094 100644
--- a/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb
+++ b/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb
@@ -1,2 +1 @@
-# rubocop:disable all
require_relative 'gpg_keys_limits_to_mysql'
diff --git a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
index 290416cb61c..22e9482cb1d 100644
--- a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
+++ b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
@@ -6,6 +6,7 @@ class EnsureRemoteMirrorColumns < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/Datetime
add_column :remote_mirrors, :last_update_started_at, :datetime unless column_exists?(:remote_mirrors, :last_update_started_at)
add_column :remote_mirrors, :remote_name, :string unless column_exists?(:remote_mirrors, :remote_name)
diff --git a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
index d0dcacc5b66..dbbbcd1f622 100644
--- a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
+++ b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
@@ -4,13 +4,13 @@ class ChangeDefaultValueForDsaKeyRestriction < ActiveRecord::Migration
def up
change_column :application_settings, :dsa_key_restriction, :integer, null: false,
- default: -1
+ default: -1
execute("UPDATE application_settings SET dsa_key_restriction = -1")
end
def down
change_column :application_settings, :dsa_key_restriction, :integer, null: false,
- default: 0
+ default: 0
end
end
diff --git a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
index dcbbef9bd4a..36f2a593fbe 100644
--- a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
+++ b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
@@ -11,6 +11,7 @@ class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration
def up
if column_exists?(:merge_requests, :allow_collaboration)
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
diff --git a/db/migrate/20180629153018_create_site_statistics.rb b/db/migrate/20180629153018_create_site_statistics.rb
new file mode 100644
index 00000000000..085ce1ba64b
--- /dev/null
+++ b/db/migrate/20180629153018_create_site_statistics.rb
@@ -0,0 +1,18 @@
+class CreateSiteStatistics < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ create_table :site_statistics do |t|
+ t.integer :repositories_count, default: 0, null: false
+ t.integer :wikis_count, default: 0, null: false
+ end
+
+ execute('INSERT INTO site_statistics (id) VALUES(1)')
+ end
+
+ def down
+ drop_table :site_statistics
+ end
+end
diff --git a/db/migrate/20180722103201_add_private_profile_to_users.rb b/db/migrate/20180722103201_add_private_profile_to_users.rb
new file mode 100644
index 00000000000..4f7ef1322d8
--- /dev/null
+++ b/db/migrate/20180722103201_add_private_profile_to_users.rb
@@ -0,0 +1,10 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddPrivateProfileToUsers < ActiveRecord::Migration
+ DOWNTIME = false
+
+ def change
+ add_column :users, :private_profile, :boolean
+ end
+end
diff --git a/db/migrate/gpg_keys_limits_to_mysql.rb b/db/migrate/gpg_keys_limits_to_mysql.rb
index 780340d0564..38729320d8c 100644
--- a/db/migrate/gpg_keys_limits_to_mysql.rb
+++ b/db/migrate/gpg_keys_limits_to_mysql.rb
@@ -1,5 +1,4 @@
class IncreaseMysqlTextLimitForGpgKeys < ActiveRecord::Migration
-
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
diff --git a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
index e1771912c3c..9fd23aae1e5 100644
--- a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
+++ b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
@@ -4,6 +4,6 @@ class LimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration
# Mysql needs MEDIUMTEXT type (up to 16MB) rather than TEXT (up to 64KB)
# Because 'raw_data' is always capped by Ci::BuildTraceChunk::CHUNK_SIZE, which is 128KB
- change_column :ci_build_trace_chunks, :raw_data, :binary, limit: 16.megabytes - 1 #MEDIUMTEXT
+ change_column :ci_build_trace_chunks, :raw_data, :binary, limit: 16.megabytes - 1 # MEDIUMTEXT
end
end
diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb
index 8f8d8f27410..7507a4bb431 100644
--- a/db/migrate/limits_to_mysql.rb
+++ b/db/migrate/limits_to_mysql.rb
@@ -1,4 +1,3 @@
-# rubocop:disable all
class LimitsToMysql < ActiveRecord::Migration
def up
return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
diff --git a/db/optional_migrations/composite_primary_keys.rb b/db/optional_migrations/composite_primary_keys.rb
index 0fd3fca52dd..d45705021b0 100644
--- a/db/optional_migrations/composite_primary_keys.rb
+++ b/db/optional_migrations/composite_primary_keys.rb
@@ -21,8 +21,8 @@ class CompositePrimaryKeysMigration < ActiveRecord::Migration
Index.new(:merge_request_diff_commits, 'index_merge_request_diff_commits_on_mr_diff_id_and_order', %i(merge_request_diff_id relative_order)),
Index.new(:project_authorizations, 'index_project_authorizations_on_user_id_project_id_access_level', %i(user_id project_id access_level)),
Index.new(:push_event_payloads, 'index_push_event_payloads_on_event_id', %i(event_id)),
- Index.new(:schema_migrations, 'unique_schema_migrations', %(version)),
- ]
+ Index.new(:schema_migrations, 'unique_schema_migrations', %(version))
+ ].freeze
disable_ddl_transaction!
@@ -45,6 +45,7 @@ class CompositePrimaryKeysMigration < ActiveRecord::Migration
end
private
+
def add_primary_key(index)
execute "ALTER TABLE #{index.table} ADD PRIMARY KEY USING INDEX #{index.name}"
end
@@ -60,4 +61,3 @@ class CompositePrimaryKeysMigration < ActiveRecord::Migration
execute "ALTER TABLE #{index.table} DROP CONSTRAINT IF EXISTS #{temp_index_name}"
end
end
-
diff --git a/db/post_migrate/20161221153951_rename_reserved_project_names.rb b/db/post_migrate/20161221153951_rename_reserved_project_names.rb
index d322844e2fd..017c58477ac 100644
--- a/db/post_migrate/20161221153951_rename_reserved_project_names.rb
+++ b/db/post_migrate/20161221153951_rename_reserved_project_names.rb
@@ -124,7 +124,7 @@ class RenameReservedProjectNames < ActiveRecord::Migration
def rename_project_row(project, path)
project.respond_to?(:update_attributes) &&
- project.update_attributes(path: path) &&
+ project.update(path: path) &&
project.respond_to?(:rename_repo)
end
end
diff --git a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
index 6a49450cc50..3e8ccfdb899 100644
--- a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
+++ b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
@@ -66,7 +66,7 @@ class RenameMoreReservedProjectNames < ActiveRecord::Migration
def rename_project_row(project, path)
project.respond_to?(:update_attributes) &&
- project.update_attributes(path: path) &&
+ project.update(path: path) &&
project.respond_to?(:rename_repo)
end
end
diff --git a/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb b/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
index 159b533eaaa..24750c58ef0 100644
--- a/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
+++ b/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/Datetime
class DropCiTriggerSchedulesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
diff --git a/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb b/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
index 15edb402b86..a70e3985005 100644
--- a/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
+++ b/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
@@ -10,6 +10,7 @@ class CleanupUsersLdapEmailRename < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :users, :external_email, :ldap_email
end
end
diff --git a/db/post_migrate/20170711145558_migrate_stages_statuses.rb b/db/post_migrate/20170711145558_migrate_stages_statuses.rb
index aeb900354db..65755c0e824 100644
--- a/db/post_migrate/20170711145558_migrate_stages_statuses.rb
+++ b/db/post_migrate/20170711145558_migrate_stages_statuses.rb
@@ -28,6 +28,7 @@ class MigrateStagesStatuses < ActiveRecord::Migration
def down
disable_statement_timeout
+ # rubocop:disable Migration/UpdateLargeTable
update_column_in_batches(:ci_stages, :status, nil)
end
end
diff --git a/db/post_migrate/20170830150306_drop_events_for_migration_table.rb b/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
index 763ee9a810d..69a612ead40 100644
--- a/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
+++ b/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
@@ -18,7 +18,6 @@ class DropEventsForMigrationTable < ActiveRecord::Migration
end
end
- # rubocop: disable Migration/Datetime
def down
create_table :events_for_migration do |t|
t.string :target_type, index: true
diff --git a/db/post_migrate/20171106154015_remove_issues_branch_name.rb b/db/post_migrate/20171106154015_remove_issues_branch_name.rb
index 162b6bafab4..3d08225c96d 100644
--- a/db/post_migrate/20171106154015_remove_issues_branch_name.rb
+++ b/db/post_migrate/20171106154015_remove_issues_branch_name.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Migration/RemoveColumn
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
diff --git a/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb b/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
index 88dd8f89ba6..53f376f216b 100644
--- a/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
+++ b/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
@@ -13,6 +13,7 @@ class CleanupAddTimezoneToIssuesClosedAt < ActiveRecord::Migration
end
# rubocop:disable Migration/Datetime
+ # rubocop:disable Migration/UpdateLargeTable
def down
change_column_type_concurrently(:issues, :closed_at, :datetime)
end
diff --git a/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb b/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
index fce1829c982..980f76e7d57 100644
--- a/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
+++ b/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-# rubocop:disable GitlabSecurity/SqlInjection
class SchedulePopulateMergeRequestMetricsWithEventsData < ActiveRecord::Migration
DOWNTIME = false
diff --git a/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb b/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
index 9addd36dca6..8c8dbb1a043 100644
--- a/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
+++ b/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
@@ -43,8 +43,6 @@ class BuildUserInteractedProjectsTable < ActiveRecord::Migration
end
end
- private
-
class PostgresStrategy < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
@@ -79,6 +77,7 @@ class BuildUserInteractedProjectsTable < ActiveRecord::Migration
end
private
+
def insert_missing_records
iteration = 0
records = 0
diff --git a/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb b/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
index bff83379087..3d77ff921c7 100644
--- a/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
+++ b/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
@@ -8,6 +8,7 @@ class CleanupUsersRssTokenRename < ActiveRecord::Migration
end
def down
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :users, :feed_token, :rss_token
end
end
diff --git a/db/post_migrate/20180424151928_fill_file_store.rb b/db/post_migrate/20180424151928_fill_file_store.rb
index b41feb233be..03d54dab250 100644
--- a/db/post_migrate/20180424151928_fill_file_store.rb
+++ b/db/post_migrate/20180424151928_fill_file_store.rb
@@ -38,7 +38,7 @@ class FillFileStore < ActiveRecord::Migration
def up
# NOTE: Schedule background migrations that fill 'NULL' value by '1'(ObjectStorage::Store::LOCAL) on `file_store`, `store` columns
- #
+ #
# Here are the target columns
# - ci_job_artifacts.file_store
# - lfs_objects.file_store
diff --git a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
index 38af5aae924..0e6ec46e5f0 100644
--- a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
+++ b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
@@ -9,6 +9,7 @@ class BackfillRunnerTypeForCiRunnersPostMigrate < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/UpdateColumnInBatches
update_column_in_batches(:ci_runners, :runner_type, INSTANCE_RUNNER_TYPE) do |table, query|
query.where(table[:is_shared].eq(true)).where(table[:runner_type].eq(nil))
end
diff --git a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb b/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
index e39cd33c414..08d7d64a2c5 100644
--- a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
+++ b/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
@@ -34,5 +34,4 @@ class MigrateImportAttributesDataFromProjectsToProjectMirrorData < ActiveRecord:
queue_background_migration_jobs_by_range_at_intervals(import_state, DOWN_MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE)
end
-
end
diff --git a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
index d9d9e93f5a3..fb9616f0c07 100644
--- a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
+++ b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
@@ -8,6 +8,8 @@ class SetMinimalProjectBuildTimeout < ActiveRecord::Migration
disable_ddl_transaction!
def up
+ # rubocop:disable Migration/UpdateLargeTable
+ # rubocop:disable Migration/UpdateColumnInBatches
update_column_in_batches(:projects, :build_timeout, MINIMUM_TIMEOUT) do |table, query|
query.where(table[:build_timeout].lt(MINIMUM_TIMEOUT))
end
diff --git a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
index 7301bcf2c6c..7eca7394f5f 100644
--- a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
+++ b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
@@ -11,6 +11,7 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
def down
if column_exists?(:merge_requests, :allow_collaboration)
+ # rubocop:disable Migration/UpdateLargeTable
rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
diff --git a/db/post_migrate/20180704145007_update_project_indexes.rb b/db/post_migrate/20180704145007_update_project_indexes.rb
index 193563b36db..0e2601ad4fa 100644
--- a/db/post_migrate/20180704145007_update_project_indexes.rb
+++ b/db/post_migrate/20180704145007_update_project_indexes.rb
@@ -14,7 +14,7 @@ class UpdateProjectIndexes < ActiveRecord::Migration
[:repository_storage, :created_at],
name: NEW_INDEX_NAME,
where: 'last_repository_check_at IS NULL'
- )
+ )
end
def down
diff --git a/db/post_migrate/20180706223200_populate_site_statistics.rb b/db/post_migrate/20180706223200_populate_site_statistics.rb
new file mode 100644
index 00000000000..e78e9eb900a
--- /dev/null
+++ b/db/post_migrate/20180706223200_populate_site_statistics.rb
@@ -0,0 +1,25 @@
+class PopulateSiteStatistics < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ transaction do
+ execute('SET LOCAL statement_timeout TO 0') if Gitlab::Database.postgresql? # see https://gitlab.com/gitlab-org/gitlab-ce/issues/48967
+
+ execute("UPDATE site_statistics SET repositories_count = (SELECT COUNT(*) FROM projects)")
+ end
+
+ transaction do
+ execute('SET LOCAL statement_timeout TO 0') if Gitlab::Database.postgresql? # see https://gitlab.com/gitlab-org/gitlab-ce/issues/48967
+
+ execute("UPDATE site_statistics SET wikis_count = (SELECT COUNT(*) FROM project_features WHERE wiki_access_level != 0)")
+ end
+ end
+
+ def down
+ # No downside in keeping the counter up-to-date
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1a5555fb3a4..8ae0197d1b4 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20180704204006) do
+ActiveRecord::Schema.define(version: 20180722103201) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1841,6 +1841,11 @@ ActiveRecord::Schema.define(version: 20180704204006) do
add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
add_index "services", ["template"], name: "index_services_on_template", using: :btree
+ create_table "site_statistics", force: :cascade do |t|
+ t.integer "repositories_count", default: 0, null: false
+ t.integer "wikis_count", default: 0, null: false
+ end
+
create_table "snippets", force: :cascade do |t|
t.string "title"
t.text "content"
@@ -2124,6 +2129,7 @@ ActiveRecord::Schema.define(version: 20180704204006) do
t.integer "theme_id", limit: 2
t.integer "accepted_term_id"
t.string "feed_token"
+ t.boolean "private_profile"
end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
diff --git a/doc/administration/high_availability/gitlab.md b/doc/administration/high_availability/gitlab.md
index 0d9c10687f2..637d44d2823 100644
--- a/doc/administration/high_availability/gitlab.md
+++ b/doc/administration/high_availability/gitlab.md
@@ -122,6 +122,11 @@ need some extra configuration.
from running on upgrade. Only the primary GitLab application server should
handle migrations.
+1. **Optional** Configure host keys. Copy all contents(primary and public keys) inside `/etc/ssh/` on
+ the primary application server to `/etc/ssh` on all secondary servers. This
+ prevents false man-in-the-middle-attack alerts when accessing servers in your
+ High Availability cluster behind a load balancer.
+
1. Run `sudo gitlab-ctl reconfigure` to compile the configuration.
## Troubleshooting
diff --git a/doc/administration/pages/index.md b/doc/administration/pages/index.md
index 056cca17d62..eefa86f8e42 100644
--- a/doc/administration/pages/index.md
+++ b/doc/administration/pages/index.md
@@ -124,11 +124,6 @@ The Pages daemon doesn't listen to the outside world.
```
1. [Reconfigure GitLab][reconfigure]
-1. Restart gitlab-pages by running the following command:
-
- ```shell
- sudo gitlab-ctl restart gitlab-pages
- ```
Watch the [video tutorial][video-admin] for this configuration.
@@ -161,11 +156,6 @@ outside world.
respectively.
1. [Reconfigure GitLab][reconfigure]
-1. Restart gitlab-pages by running the following command:
-
- ```shell
- sudo gitlab-ctl restart gitlab-pages
- ```
## Advanced configuration
@@ -203,11 +193,6 @@ world. Custom domains are supported, but no TLS.
listens on. If you don't have IPv6, you can omit the IPv6 address.
1. [Reconfigure GitLab][reconfigure]
-1. Restart gitlab-pages by running the following command:
-
- ```shell
- sudo gitlab-ctl restart gitlab-pages
- ```
### Custom domains with TLS support
@@ -241,11 +226,6 @@ world. Custom domains and TLS are supported.
listens on. If you don't have IPv6, you can omit the IPv6 address.
1. [Reconfigure GitLab][reconfigure]
-1. Restart gitlab-pages by running the following command:
-
- ```shell
- sudo gitlab-ctl restart gitlab-pages
- ```
### Custom domain verification
@@ -290,11 +270,29 @@ are stored.
```
1. [Reconfigure GitLab][reconfigure]
-1. Restart gitlab-pages by running the following command:
+
+## Configure listener for reverse proxy requests
+
+Follow the steps below to configure the proxy listener of GitLab Pages. [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/2533) in
+Omnibus GitLab 11.1.
+
+1. By default the listener is configured to listen for requests on `localhost:8090`.
+
+ If you wish to disable it you must configure this in
+ `/etc/gitlab/gitlab.rb`:
```shell
- sudo gitlab-ctl restart gitlab-pages
- ```
+ gitlab_pages['listen_proxy'] = nil
+ ```
+
+ If you wish to make it listen on a different port you must configure this also in
+ `/etc/gitlab/gitlab.rb`:
+
+ ```shell
+ gitlab_pages['listen_proxy'] = "localhost:10080"
+ ```
+
+1. [Reconfigure GitLab][reconfigure]
## Set maximum pages size
diff --git a/doc/administration/raketasks/check.md b/doc/administration/raketasks/check.md
index 2649bf61d74..0c145830f02 100644
--- a/doc/administration/raketasks/check.md
+++ b/doc/administration/raketasks/check.md
@@ -121,6 +121,45 @@ sudo gitlab-rake gitlab:lfs:check BATCH=100 ID_FROM=50 ID_TO=250
sudo gitlab-rake gitlab:uploads:check BATCH=100 ID_FROM=50 ID_TO=250
```
+Example output:
+
+```
+$ sudo gitlab-rake gitlab:uploads:check
+Checking integrity of Uploads
+- 1..1350: Failures: 0
+- 1351..2743: Failures: 0
+- 2745..4349: Failures: 2
+- 4357..5762: Failures: 1
+- 5764..7140: Failures: 2
+- 7142..8651: Failures: 0
+- 8653..10134: Failures: 0
+- 10135..11773: Failures: 0
+- 11777..13315: Failures: 0
+Done!
+```
+
+Example verbose output:
+
+```
+$ sudo gitlab-rake gitlab:uploads:check VERBOSE=1
+Checking integrity of Uploads
+- 1..1350: Failures: 0
+- 1351..2743: Failures: 0
+- 2745..4349: Failures: 2
+ - Upload: 3573: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /opt/gitlab/embedded/service/gitlab-rails/public/uploads/user-foo/project-bar/7a77cc52947bfe188adeff42f890bb77/image.png>
+ - Upload: 3580: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /opt/gitlab/embedded/service/gitlab-rails/public/uploads/user-foo/project-bar/2840ba1ba3b2ecfa3478a7b161375f8a/pug.png>
+- 4357..5762: Failures: 1
+ - Upload: 4636: #<Google::Apis::ServerError: Server error>
+- 5764..7140: Failures: 2
+ - Upload: 5812: #<NoMethodError: undefined method `hashed_storage?' for nil:NilClass>
+ - Upload: 5837: #<NoMethodError: undefined method `hashed_storage?' for nil:NilClass>
+- 7142..8651: Failures: 0
+- 8653..10134: Failures: 0
+- 10135..11773: Failures: 0
+- 11777..13315: Failures: 0
+Done!
+```
+
## LDAP Check
The LDAP check Rake task will test the bind_dn and password credentials
diff --git a/doc/administration/troubleshooting/debug.md b/doc/administration/troubleshooting/debug.md
index 83a714810c1..7ae4f7c1515 100644
--- a/doc/administration/troubleshooting/debug.md
+++ b/doc/administration/troubleshooting/debug.md
@@ -66,6 +66,19 @@ On CentOS:
sudo yum install gdb
```
+### rbtrace
+
+GitLab 11.2 ships with [rbtrace](https://github.com/tmm1/rbtrace), which
+allows you to trace Ruby code, view all running threads, take memory dumps,
+and more. However, this is not enabled by default. To enable it, define the
+`ENABLE_RBTRACE` variable to the environment. For example, in Omnibus:
+
+```ruby
+gitlab_rails['env'] = {"ENABLE_RBTRACE" => "1"}
+```
+
+Then reconfigure the system and restart Unicorn and Sidekiq.
+
## Common Problems
Many of the tips to diagnose issues below apply to many different situations. We'll use one
diff --git a/doc/api/issues.md b/doc/api/issues.md
index 5613cb6d915..92fb3e9c307 100644
--- a/doc/api/issues.md
+++ b/doc/api/issues.md
@@ -37,7 +37,7 @@ GET /issues?my_reaction_emoji=star
| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `state` | string | no | Return all issues or just those that are `opened` or `closed` |
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels |
-| `milestone` | string | no | The milestone title |
+| `milestone` | string | no | The milestone title. `No+Milestone` lists all issues with no milestone |
| `scope` | string | no | Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`. Defaults to `created_by_me`<br> For versions before 11.0, use the now deprecated `created-by-me` or `assigned-to-me` scopes instead.<br> _([Introduced][ce-13004] in GitLab 9.5. [Changed to snake_case][ce-18935] in GitLab 11.0)_ |
| `author_id` | integer | no | Return issues created by the given user `id`. Combine with `scope=all` or `scope=assigned_to_me`. _([Introduced][ce-13004] in GitLab 9.5)_ |
| `assignee_id` | integer | no | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_ |
@@ -151,7 +151,7 @@ GET /groups/:id/issues?my_reaction_emoji=star
| `state` | string | no | Return all issues or just those that are `opened` or `closed` |
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels |
| `iids[]` | Array[integer] | no | Return only the issues having the given `iid` |
-| `milestone` | string | no | The milestone title |
+| `milestone` | string | no | The milestone title. `No+Milestone` lists all issues with no milestone |
| `scope` | string | no | Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`.<br> For versions before 11.0, use the now deprecated `created-by-me` or `assigned-to-me` scopes instead.<br> _([Introduced][ce-13004] in GitLab 9.5. [Changed to snake_case][ce-18935] in GitLab 11.0)_ |
| `author_id` | integer | no | Return issues created by the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_ |
| `assignee_id` | integer | no | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_ |
@@ -265,7 +265,7 @@ GET /projects/:id/issues?my_reaction_emoji=star
| `iids[]` | Array[integer] | no | Return only the milestone having the given `iid` |
| `state` | string | no | Return all issues or just those that are `opened` or `closed` |
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels |
-| `milestone` | string | no | The milestone title |
+| `milestone` | string | no | The milestone title. `No+Milestone` lists all issues with no milestone |
| `scope` | string | no | Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`.<br> For versions before 11.0, use the now deprecated `created-by-me` or `assigned-to-me` scopes instead.<br> _([Introduced][ce-13004] in GitLab 9.5. [Changed to snake_case][ce-18935] in GitLab 11.0)_ |
| `author_id` | integer | no | Return issues created by the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_ |
| `assignee_id` | integer | no | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_ |
diff --git a/doc/api/users.md b/doc/api/users.md
index 72fdaaa2c74..07f9baf06d2 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -105,7 +105,8 @@ GET /users
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
- "external": false
+ "external": false,
+ "private_profile": false
},
{
"id": 2,
@@ -135,7 +136,8 @@ GET /users
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
- "external": false
+ "external": false,
+ "private_profile": false
}
]
```
@@ -248,7 +250,8 @@ Parameters:
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
- "external": false
+ "external": false,
+ "private_profile": false
}
```
@@ -288,6 +291,7 @@ Parameters:
- `skip_confirmation` (optional) - Skip confirmation - true or false (default)
- `external` (optional) - Flags the user as external - true or false(default)
- `avatar` (optional) - Image file for user's avatar
+- `private_profile` (optional) - User's profile is private - true or false
## User modification
@@ -318,6 +322,7 @@ Parameters:
- `skip_reconfirmation` (optional) - Skip reconfirmation - true or false (default)
- `external` (optional) - Flags the user as external - true or false(default)
- `avatar` (optional) - Image file for user's avatar
+- `private_profile` (optional) - User's profile is private - true or false
On password update, user will be forced to change it upon next login.
Note, at the moment this method does only return a `404` error,
@@ -382,7 +387,8 @@ GET /user
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
- "external": false
+ "external": false,
+ "private_profile": false
}
```
@@ -429,7 +435,8 @@ GET /user
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
- "external": false
+ "external": false,
+ "private_profile": false
}
```
diff --git a/doc/ci/docker/using_docker_build.md b/doc/ci/docker/using_docker_build.md
index fbac37e688e..63338ff632c 100644
--- a/doc/ci/docker/using_docker_build.md
+++ b/doc/ci/docker/using_docker_build.md
@@ -427,7 +427,7 @@ services:
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
- IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
+ IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
@@ -440,8 +440,10 @@ build:
```
Here, `$CI_REGISTRY_IMAGE` would be resolved to the address of the registry tied
-to this project, and `$CI_COMMIT_REF_NAME` would be resolved to the branch or
-tag name for this particular job. We also declare our own variable, `$IMAGE_TAG`,
+to this project. Since `$CI_COMMIT_REF_NAME` resolves to the branch or tag name,
+and your branch-name can contain forward slashes (e.g., feature/my-feature), it is
+safer to use `$CI_COMMIT_REF_SLUG` as the image tag. This is due to that image tags
+cannot contain forward slashes. We also declare our own variable, `$IMAGE_TAG`,
combining the two to save us some typing in the `script` section.
Here's a more elaborate example that splits up the tasks into 4 pipeline stages,
@@ -464,7 +466,7 @@ stages:
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
- CONTAINER_TEST_IMAGE: registry.example.com/my-group/my-project/my-image:$CI_COMMIT_REF_NAME
+ CONTAINER_TEST_IMAGE: registry.example.com/my-group/my-project/my-image:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: registry.example.com/my-group/my-project/my-image:latest
before_script:
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 096b64eb881..d95f8c7c8cc 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -1411,43 +1411,6 @@ variables:
You can set it globally or per-job in the [`variables`](#variables) section.
-### Custom build directories
-
-> [Introduced][gitlab-runner-876] in Gitlab Runner 11.1
-
-NOTE: **Note:**
-This can only be used when `custom_build_dir` is set to true in the [Runner's
-configuration](https://docs.gitlab.com/runner/configuration/advanced-configuration.html).
-
-By default, GitLab Runner clones the repository in the `/builds` directory,
-but sometimes your project might require to have the code in a specific
-directory, like the GO projects for example. In that case, you can specify
-the `CI_PROJECT_DIR` variable to tell the Runner in which directory to clone
-the repository:
-
-```yml
-image: golang:1.10-alpine3.7
-
-variables:
- CI_PROJECT_DIR: /go/src/gitlab.com/namespace/project-name
-
-stages:
- - test
-
-dir:
- stage: test
- script:
- - pwd # /go/src/gitlab.com/namespace/project-name
-```
-
-The following executors may use this feature only when
-[concurrent](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section)
-is set to `1`:
-
-- `shell`
-- `ssh`
-- `docker`, `docker+machine` when the job's working directory is mounted as a host volume.
-
## Special YAML features
It's possible to use special YAML features like anchors (`&`), aliases (`*`)
@@ -1641,6 +1604,5 @@ CI with various languages.
[ce-7983]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7983
[ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
-[gitlab-runner-876]: https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/876
[schedules]: ../../user/project/pipelines/schedules.md
[variables-expressions]: ../variables/README.md#variables-expressions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index 46c5baddb9c..16195cbbbdf 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -296,10 +296,18 @@ for more details.
## Best practices
+1. Make sure to know how much data you're dealing with
1. Make sure that background migration jobs are idempotent.
1. Make sure that tests you write are not false positives.
1. Make sure that if the data being migrated is critical and cannot be lost, the
clean-up migration also checks the final state of the data before completing.
+1. Make sure to know how much time it'll take to run all scheduled migrations
+1. When migrating many columns, make sure it won't generate too many
+ dead tuples in the process (you may need to directly query the number of dead tuples
+ and adjust the scheduling according to this piece of data)
+1. Make sure to discuss the numbers with a database specialist, the migration may add
+ more pressure on DB than you expect (measure on staging,
+ or ask someone to measure on production)
[migrations-readme]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec/migrations/README.md
[issue-rspec-hooks]: https://gitlab.com/gitlab-org/gitlab-ce/issues/35351
diff --git a/doc/development/documentation/styleguide.md b/doc/development/documentation/styleguide.md
index a315cfdc116..ad49c77aac8 100644
--- a/doc/development/documentation/styleguide.md
+++ b/doc/development/documentation/styleguide.md
@@ -219,28 +219,26 @@ below.
- Every piece of documentation that comes with a new feature should declare the
GitLab version that feature got introduced. Right below the heading add a
- note:
+ blockquote:
```md
> Introduced in GitLab 8.3.
```
-- Whenever possible, every feature should have a link to the MR, issue, or epic that introduced it.
- The above note would be then transformed to:
+- Whenever possible, every feature should have a link to the issue, MR or epic
+ (in that order) that introduced it. The above quote would be then transformed to:
```md
- > [Introduced][ce-1242] in GitLab 8.3.
+ > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/1242) in GitLab 8.3.
```
- , where the [link identifier](#links) is named after the repository (CE) and
- the MR number.
-
- If the feature is only available in GitLab Enterprise Edition, don't forget to mention
the [paid tier](https://about.gitlab.com/handbook/marketing/product-marketing/#tiers)
the feature is available in:
```md
- > [Introduced][ee-1234] in [GitLab Starter](https://about.gitlab.com/pricing/) 8.3.
+ > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/1242)
+ in [GitLab Starter](https://about.gitlab.com/pricing/) 8.3.
```
### Product badges
diff --git a/doc/install/kubernetes/preparation/tiller.md b/doc/install/kubernetes/preparation/tiller.md
index c92f8258e41..016aac2abeb 100644
--- a/doc/install/kubernetes/preparation/tiller.md
+++ b/doc/install/kubernetes/preparation/tiller.md
@@ -4,7 +4,7 @@ To make use of Helm, you must have a [Kubernetes][k8s-io] cluster. Ensure you ca
Helm consists of two parts, the `helm` client and a `tiller` server inside Kubernetes.
-> **Note**: If you are not able to run tiller in your cluster, for example on OpenShift, it is possible to use [tiller locally](#local-tiller) and avoid deploying it into the cluster. This should only be used when Tiller cannot be normally deployed.
+> **Note**: If you are not able to run Tiller in your cluster, for example on OpenShift, it is possible to use [Tiller locally](https://gitlab.com/charts/gitlab/tree/master/doc/helm#local-tiller) and avoid deploying it into the cluster. This should only be used when Tiller cannot be normally deployed.
## Initialize Helm and Tiller
@@ -65,28 +65,32 @@ kubectl --username=admin --password=xxxxxxxxxxxxxx create -f rbac-config.yaml
For other clusters like Amazon EKS, you can directly upload the RBAC configuration.
+```
kubectl create -f rbac-config.yaml
+```
## Initialize Helm
-Deploy Helm Tiller with a service account
+Deploy Helm Tiller with a service account:
```
helm init --service-account tiller
```
-If your cluster
-previously had Helm/Tiller installed, run the following to ensure that the deployed version of Tiller matches the local Helm version:
+If your cluster previously had Helm/Tiller installed,
+run the following to ensure that the deployed version of Tiller matches the local Helm version:
```
helm init --upgrade --service-account tiller
```
-### Patching Helm Tiller for EKS
+### Patching Helm Tiller for Amazon EKS
-Helm Tiller requires a flag to be enabled to work properly on EKS:
+Helm Tiller requires a flag to be enabled to work properly on Amazon EKS:
-`kubectl -n kube-system patch deployment tiller-deploy -p '{"spec": {"template": {"spec": {"automountServiceAccountToken": true}}}}'`
+```
+kubectl -n kube-system patch deployment tiller-deploy -p '{"spec": {"template": {"spec": {"automountServiceAccountToken": true}}}}'
+```
[helm]: https://helm.sh
[helm-using]: https://docs.helm.sh/using_helm
diff --git a/doc/security/rack_attack.md b/doc/security/rack_attack.md
index c61729581e8..3efb19c1526 100644
--- a/doc/security/rack_attack.md
+++ b/doc/security/rack_attack.md
@@ -9,13 +9,17 @@ In case you find throttling is not enough to protect you against abusive clients
Rack Attack offers IP whitelisting, blacklisting, Fail2ban style filtering and
tracking.
+**Note:** Starting with 11.2, Rack Attack is disabled by default. To continue
+using this feature, please enable it in your `gitlab.rb` by setting
+`gitlab_rails['rack_attack_git_basic_auth'] = true`.
+
By default, user sign-in, user sign-up (if enabled), and user password reset is
limited to 6 requests per minute. After trying for 6 times, the client will
have to wait for the next minute to be able to try again.
If you installed or upgraded GitLab by following the [official guides](../install/README.md)
-this should be enabled by default. If your instance is not exposed to any incoming
-connections, it is recommended to disable Rack Attack.
+this should be disabled by default. If your instance is not exposed to any incoming
+connections, it is recommended to leave Rack Attack disabled.
For more information on how to use these options check out
[rack-attack README](https://github.com/kickstarter/rack-attack/blob/master/README.md).
@@ -45,7 +49,7 @@ For more information on how to use these options check out
The following settings can be configured:
-- `enabled`: By default this is set to `true`. Set this to `false` to disable Rack Attack.
+- `enabled`: By default this is set to `false`. Set this to `true` to enable Rack Attack.
- `ip_whitelist`: Whitelist any IPs from being blocked. They must be formatted as strings within a ruby array.
For example, `["127.0.0.1", "127.0.0.2", "127.0.0.3"]`.
- `maxretry`: The maximum amount of times a request can be made in the
diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md
index 91cdef8d1dd..96a08c04905 100644
--- a/doc/user/profile/index.md
+++ b/doc/user/profile/index.md
@@ -68,6 +68,28 @@ Alternatively, you can follow [this detailed procedure from the GitLab Team Hand
which also covers the case where you have projects hosted with
[GitLab Pages](../project/pages/index.md).
+## Private profile
+
+The following information will be hidden from the user profile page (https://gitlab.example.com/username) if this feature is enabled:
+
+- Atom feed
+- Date when account is created
+- Activity tab
+- Groups tab
+- Contributed projects tab
+- Personal projects tab
+- Snippets tab
+
+To enable private profile:
+
+1. Navigate to your personal [profile settings](#profile-settings).
+1. Check the "Private profile" option.
+1. Hit **Update profile settings**.
+
+
+NOTE: **Note:**
+You and GitLab admins can see your the abovementioned information on your profile even if it is private.
+
## Troubleshooting
### Why do I keep getting signed out?
diff --git a/doc/user/profile/personal_access_tokens.md b/doc/user/profile/personal_access_tokens.md
index 9b4fdd65e2f..25d6c34409c 100644
--- a/doc/user/profile/personal_access_tokens.md
+++ b/doc/user/profile/personal_access_tokens.md
@@ -48,6 +48,7 @@ the following table.
| `api` | Grants complete access to the API (read/write) ([introduced][ce-5951] in GitLab 8.15). Required for accessing Git repositories over HTTP when 2FA is enabled. |
| `read_registry` | Allows to read [container registry] images if a project is private and authorization is required ([introduced][ce-11845] in GitLab 9.3). |
| `sudo` | Allows performing API actions as any user in the system (if the authenticated user is an admin) ([introduced][ce-14838] in GitLab 10.2). |
+| `read_repository` | Allows read-access to the repository through git clone. |
[2fa]: ../account/two_factor_authentication.md
[api]: ../../api/README.md
diff --git a/doc/user/project/issue_board.md b/doc/user/project/issue_board.md
index 860edb8e6f7..6dfdbe6c0d5 100644
--- a/doc/user/project/issue_board.md
+++ b/doc/user/project/issue_board.md
@@ -27,7 +27,7 @@ You create issues, host code, perform reviews, build, test,
and deploy from one single platform. Issue Boards help you to visualize
and manage the entire process _in_ GitLab.
-With [Multiple Issue Boards](#multiple-issue-boards), available
+With [Multiple Issue Boards](#use-cases-for-multiple-issue-boards), available
only in [GitLab Enterprise Edition](#features-per-tier),
you go even further, as you can not only keep yourself and your project
organized from a broader perspective with one Issue Board per project,
@@ -75,7 +75,7 @@ each team can have their own board to organize their workflow individually.
#### Scrum team
-With multiple Issue Boards, each team has one board. Now you can move issues through each
+With Multiple Issue Boards, each team has one board. Now you can move issues through each
part of the process. For instance: **To Do**, **Doing**, and **Done**.
#### Organization of topics
diff --git a/generator_templates/active_record/migration/create_table_migration.rb b/generator_templates/active_record/migration/create_table_migration.rb
index 59a9d37df0f..92e963911d0 100644
--- a/generator_templates/active_record/migration/create_table_migration.rb
+++ b/generator_templates/active_record/migration/create_table_migration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
diff --git a/generator_templates/active_record/migration/migration.rb b/generator_templates/active_record/migration/migration.rb
index 08752b3af50..38edab82550 100644
--- a/generator_templates/active_record/migration/migration.rb
+++ b/generator_templates/active_record/migration/migration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
diff --git a/generator_templates/rails/post_deployment_migration/migration.rb b/generator_templates/rails/post_deployment_migration/migration.rb
index f2dff84b618..353709f7c9c 100644
--- a/generator_templates/rails/post_deployment_migration/migration.rb
+++ b/generator_templates/rails/post_deployment_migration/migration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 464a31ee819..e883687f2db 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -30,7 +30,7 @@ module API
end
class User < UserBasic
- expose :created_at
+ expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) }
expose :bio, :location, :skype, :linkedin, :twitter, :website_url, :organization
end
@@ -55,6 +55,7 @@ module API
expose :can_create_project?, as: :can_create_project
expose :two_factor_enabled?, as: :two_factor_enabled
expose :external
+ expose :private_profile
end
class UserWithAdmin < UserPublic
diff --git a/lib/api/keys.rb b/lib/api/keys.rb
index 767f27ef334..fd93f797f72 100644
--- a/lib/api/keys.rb
+++ b/lib/api/keys.rb
@@ -12,7 +12,7 @@ module API
key = Key.find(params[:id])
- present key, with: Entities::SSHKeyWithUser
+ present key, with: Entities::SSHKeyWithUser, current_user: current_user
end
end
end
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 6da6c2b43de..e83887b3e9e 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -42,6 +42,7 @@ module API
optional :can_create_group, type: Boolean, desc: 'Flag indicating the user can create groups'
optional :external, type: Boolean, desc: 'Flag indicating the user is an external user'
optional :avatar, type: File, desc: 'Avatar image for user'
+ optional :private_profile, type: Boolean, desc: 'Flag indicating the user has a private profile'
optional :min_access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'Limit by minimum access level of authenticated user'
all_or_none_of :extern_uid, :provider
end
@@ -97,7 +98,7 @@ module API
entity = current_user&.admin? ? Entities::UserWithAdmin : Entities::UserBasic
users = users.preload(:identities, :u2f_registrations) if entity == Entities::UserWithAdmin
- users, options = with_custom_attributes(users, with: entity)
+ users, options = with_custom_attributes(users, { with: entity, current_user: current_user })
present paginate(users), options
end
@@ -114,7 +115,7 @@ module API
user = User.find_by(id: params[:id])
not_found!('User') unless user && can?(current_user, :read_user, user)
- opts = current_user&.admin? ? { with: Entities::UserWithAdmin } : { with: Entities::User }
+ opts = { with: current_user&.admin? ? Entities::UserWithAdmin : Entities::User, current_user: current_user }
user, opts = with_custom_attributes(user, opts)
present user, opts
@@ -140,7 +141,7 @@ module API
user = ::Users::CreateService.new(current_user, params).execute(skip_authorization: true)
if user.persisted?
- present user, with: Entities::UserPublic
+ present user, with: Entities::UserPublic, current_user: current_user
else
conflict!('Email has already been taken') if User
.where(email: user.email)
@@ -199,7 +200,7 @@ module API
result = ::Users::UpdateService.new(current_user, user_params.except(:extern_uid, :provider).merge(user: user)).execute
if result[:status] == :success
- present user, with: Entities::UserPublic
+ present user, with: Entities::UserPublic, current_user: current_user
else
render_validation_error!(user)
end
@@ -546,7 +547,7 @@ module API
Entities::UserPublic
end
- present current_user, with: entity
+ present current_user, with: entity, current_user: current_user
end
end
diff --git a/lib/banzai/filter/sanitization_filter.rb b/lib/banzai/filter/sanitization_filter.rb
index 80b9d3d045f..8ba09290e6d 100644
--- a/lib/banzai/filter/sanitization_filter.rb
+++ b/lib/banzai/filter/sanitization_filter.rb
@@ -13,7 +13,7 @@ module Banzai
def whitelist
strong_memoize(:whitelist) do
- customize_whitelist(super.dup)
+ customize_whitelist(super.deep_dup)
end
end
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index 872e70f9a5d..8eacad078c8 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -61,6 +61,10 @@ module Gitlab
@version ||= database_version.match(/\A(?:PostgreSQL |)([^\s]+).*\z/)[1]
end
+ def self.postgresql_9_or_less?
+ postgresql? && version.to_f < 10
+ end
+
def self.join_lateral_supported?
postgresql? && version.to_f >= 9.3
end
@@ -69,6 +73,28 @@ module Gitlab
postgresql? && version.to_f >= 9.4
end
+ def self.pg_stat_wal_receiver_supported?
+ postgresql? && version.to_f >= 9.6
+ end
+
+ # map some of the function names that changed between PostgreSQL 9 and 10
+ # https://wiki.postgresql.org/wiki/New_in_postgres_10
+ def self.pg_wal_lsn_diff
+ Gitlab::Database.postgresql_9_or_less? ? 'pg_xlog_location_diff' : 'pg_wal_lsn_diff'
+ end
+
+ def self.pg_current_wal_insert_lsn
+ Gitlab::Database.postgresql_9_or_less? ? 'pg_current_xlog_insert_location' : 'pg_current_wal_insert_lsn'
+ end
+
+ def self.pg_last_wal_receive_lsn
+ Gitlab::Database.postgresql_9_or_less? ? 'pg_last_xlog_receive_location' : 'pg_last_wal_receive_lsn'
+ end
+
+ def self.pg_last_wal_replay_lsn
+ Gitlab::Database.postgresql_9_or_less? ? 'pg_last_xlog_replay_location' : 'pg_last_wal_replay_lsn'
+ end
+
def self.nulls_last_order(field, direction = 'ASC')
order = "#{field} #{direction}"
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 21ac43f80fd..0356e8efc5c 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -353,8 +353,6 @@ module Gitlab
# offset: 5,
# after: Time.new(2016, 4, 21, 14, 32, 10)
# )
- #
- # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/446
def log(options)
default_options = {
limit: 10,
@@ -826,6 +824,10 @@ module Gitlab
end
end
+ # This method, fetch_ref, is used from within
+ # Gitlab::Git::OperationService. OperationService will eventually only
+ # exist in gitaly-ruby. When we delete OperationService from gitlab-ce
+ # we can also remove fetch_ref.
def fetch_ref(source_repository, source_ref:, target_ref:)
Gitlab::Git.check_namespace!(source_repository)
source_repository = RemoteRepository.new(source_repository) unless source_repository.is_a?(RemoteRepository)
@@ -1025,8 +1027,8 @@ module Gitlab
end
def clean_stale_repository_files
- gitaly_migrate(:repository_cleanup, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
- gitaly_repository_client.cleanup if is_enabled && exists?
+ wrapped_gitaly_errors do
+ gitaly_repository_client.cleanup if exists?
end
rescue Gitlab::Git::CommandError => e # Don't fail if we can't cleanup
Rails.logger.error("Unable to clean repository on storage #{storage} with relative path #{relative_path}: #{e.message}")
diff --git a/lib/gitlab/git/wiki.rb b/lib/gitlab/git/wiki.rb
index 8ee46b59830..9d992be66eb 100644
--- a/lib/gitlab/git/wiki.rb
+++ b/lib/gitlab/git/wiki.rb
@@ -44,9 +44,9 @@ module Gitlab
end
end
- def pages(limit: nil)
+ def pages(limit: 0)
@repository.wrapped_gitaly_errors do
- gitaly_get_all_pages
+ gitaly_get_all_pages(limit: limit)
end
end
@@ -158,8 +158,8 @@ module Gitlab
Gitlab::Git::WikiFile.new(wiki_file)
end
- def gitaly_get_all_pages
- gitaly_wiki_client.get_all_pages.map do |wiki_page, version|
+ def gitaly_get_all_pages(limit: 0)
+ gitaly_wiki_client.get_all_pages(limit: limit).map do |wiki_page, version|
Gitlab::Git::WikiPage.new(wiki_page, version)
end
end
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 58a4060cc96..c27972a84a4 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -407,7 +407,7 @@ module Gitlab
# The default timeout on all Gitaly calls
def self.default_timeout
- return 0 if Sidekiq.server?
+ return no_timeout if Sidekiq.server?
timeout(:gitaly_timeout_default)
end
@@ -420,6 +420,10 @@ module Gitlab
timeout(:gitaly_timeout_medium)
end
+ def self.no_timeout
+ 0
+ end
+
def self.timeout(timeout_name)
Gitlab::CurrentSettings.current_application_settings[timeout_name]
end
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb
index 64b9af4d70c..2956ed4b911 100644
--- a/lib/gitlab/gitaly_client/repository_service.rb
+++ b/lib/gitlab/gitaly_client/repository_service.rb
@@ -202,7 +202,7 @@ module Gitlab
save_path,
:create_bundle,
Gitaly::CreateBundleRequest,
- GitalyClient.default_timeout
+ GitalyClient.no_timeout
)
end
@@ -220,7 +220,7 @@ module Gitlab
bundle_path,
:create_repository_from_bundle,
Gitaly::CreateRepositoryFromBundleRequest,
- GitalyClient.default_timeout
+ GitalyClient.no_timeout
)
end
@@ -245,7 +245,7 @@ module Gitlab
:repository_service,
:create_repository_from_snapshot,
request,
- timeout: GitalyClient.default_timeout
+ timeout: GitalyClient.no_timeout
)
end
diff --git a/lib/gitlab/gitaly_client/wiki_service.rb b/lib/gitlab/gitaly_client/wiki_service.rb
index 6cb049c1f68..75be7d1f5a0 100644
--- a/lib/gitlab/gitaly_client/wiki_service.rb
+++ b/lib/gitlab/gitaly_client/wiki_service.rb
@@ -85,8 +85,8 @@ module Gitlab
wiki_page_from_iterator(response)
end
- def get_all_pages
- request = Gitaly::WikiGetAllPagesRequest.new(repository: @gitaly_repo)
+ def get_all_pages(limit: 0)
+ request = Gitaly::WikiGetAllPagesRequest.new(repository: @gitaly_repo, limit: limit)
response = GitalyClient.call(@repository.storage, :wiki_service, :wiki_get_all_pages, request, timeout: GitalyClient.medium_timeout)
pages = []
diff --git a/lib/gitlab/import_export/merge_request_parser.rb b/lib/gitlab/import_export/merge_request_parser.rb
index f3d7407383c..d0527f014a7 100644
--- a/lib/gitlab/import_export/merge_request_parser.rb
+++ b/lib/gitlab/import_export/merge_request_parser.rb
@@ -25,6 +25,7 @@ module Gitlab
@project.repository.create_branch(@merge_request.target_branch, @merge_request.target_branch_sha)
end
+ # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1295
def fetch_ref
@project.repository.fetch_ref(@project.repository, source_ref: @diff_head_sha, target_ref: @merge_request.source_branch)
end
diff --git a/lib/support/nginx/registry-ssl b/lib/support/nginx/registry-ssl
index 92511e26861..908d26a0da2 100644
--- a/lib/support/nginx/registry-ssl
+++ b/lib/support/nginx/registry-ssl
@@ -10,7 +10,7 @@ server {
listen *:80;
server_name registry.gitlab.example.com;
server_tokens off; ## Don't show the nginx version number, a security best practice
- return 301 https://$http_host:$request_uri;
+ return 301 https://$http_host$request_uri;
access_log /var/log/nginx/gitlab_registry_access.log gitlab_access;
error_log /var/log/nginx/gitlab_registry_error.log;
}
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 09a35b5da07..a5bbe8938ff 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -240,6 +240,12 @@ msgstr ""
msgid "A user with write access to the source branch selected this option"
msgstr ""
+msgid "About GitLab"
+msgstr ""
+
+msgid "About GitLab CE"
+msgstr ""
+
msgid "About auto deploy"
msgstr ""
@@ -312,6 +318,15 @@ msgstr ""
msgid "Add users to group"
msgstr ""
+msgid "Admin Area"
+msgstr ""
+
+msgid "Admin Overview"
+msgstr ""
+
+msgid "Admin area"
+msgstr ""
+
msgid "AdminArea|Stop all jobs"
msgstr ""
@@ -504,6 +519,9 @@ msgstr ""
msgid "Anonymous"
msgstr ""
+msgid "Anti-spam verification"
+msgstr ""
+
msgid "Any"
msgstr ""
@@ -597,6 +615,9 @@ msgstr ""
msgid "Authentication Log"
msgstr ""
+msgid "Authentication log"
+msgstr ""
+
msgid "Author"
msgstr ""
@@ -621,6 +642,9 @@ msgstr ""
msgid "Authors: %{authors}"
msgstr ""
+msgid "Auto DevOps"
+msgstr ""
+
msgid "Auto DevOps enabled"
msgstr ""
@@ -678,6 +702,9 @@ msgstr ""
msgid "Average per day: %{average}"
msgstr ""
+msgid "Background Jobs"
+msgstr ""
+
msgid "Background color"
msgstr ""
@@ -765,6 +792,9 @@ msgstr ""
msgid "Bitbucket import"
msgstr ""
+msgid "Blog"
+msgstr ""
+
msgid "Boards"
msgstr ""
@@ -1529,6 +1559,9 @@ msgstr ""
msgid "ClusterIntegration|sign up"
msgstr ""
+msgid "Cohorts"
+msgstr ""
+
msgid "Collapse"
msgstr ""
@@ -1755,6 +1788,9 @@ msgstr ""
msgid "Control the display of third party offers."
msgstr ""
+msgid "ConvDev Index"
+msgstr ""
+
msgid "Copy URL to clipboard"
msgstr ""
@@ -1791,6 +1827,9 @@ msgstr ""
msgid "Create a new branch and merge request"
msgstr ""
+msgid "Create a new issue"
+msgstr ""
+
msgid "Create a personal access token on your account to pull or push via %{protocol}."
msgstr ""
@@ -1917,6 +1956,9 @@ msgstr ""
msgid "CycleAnalyticsStage|Test"
msgstr ""
+msgid "Dashboard"
+msgstr ""
+
msgid "DashboardProjects|All"
msgstr ""
@@ -2396,6 +2438,9 @@ msgstr ""
msgid "Every week (Sundays at 4:00am)"
msgstr ""
+msgid "Everyone can contribute"
+msgstr ""
+
msgid "Expand"
msgstr ""
@@ -2405,6 +2450,9 @@ msgstr ""
msgid "Expand sidebar"
msgstr ""
+msgid "Explore"
+msgstr ""
+
msgid "Explore GitLab"
msgstr ""
@@ -2420,6 +2468,9 @@ msgstr ""
msgid "Explore public groups"
msgstr ""
+msgid "Facebook"
+msgstr ""
+
msgid "Failed"
msgstr ""
@@ -2671,6 +2722,9 @@ msgstr ""
msgid "Group avatar"
msgstr ""
+msgid "Group details"
+msgstr ""
+
msgid "Group info:"
msgstr ""
@@ -2994,6 +3048,9 @@ msgstr ""
msgid "Koding"
msgstr ""
+msgid "Koding Dashboard"
+msgstr ""
+
msgid "Kubernetes"
msgstr ""
@@ -3116,6 +3173,9 @@ msgstr ""
msgid "Leave the \"File type\" and \"Delivery method\" options on their default values."
msgstr ""
+msgid "LinkedIn"
+msgstr ""
+
msgid "List"
msgstr ""
@@ -3152,9 +3212,15 @@ msgstr ""
msgid "Locked to current projects"
msgstr ""
+msgid "Logs"
+msgstr ""
+
msgid "Make sure you're logged into the account that owns the projects you'd like to import."
msgstr ""
+msgid "Manage Git repositories with fine-grained access controls that keep your code secure. Perform code reviews and enhance collaboration with merge requests. Each project can also have an issue tracker and a wiki."
+msgstr ""
+
msgid "Manage access"
msgstr ""
@@ -3335,6 +3401,9 @@ msgstr ""
msgid "Monitoring"
msgstr ""
+msgid "More"
+msgstr ""
+
msgid "More actions"
msgstr ""
@@ -3377,6 +3446,9 @@ msgstr ""
msgid "Nav|Sign out and sign in with a different account"
msgstr ""
+msgid "Network"
+msgstr ""
+
msgid "New"
msgstr ""
@@ -3451,6 +3523,9 @@ msgstr ""
msgid "New tag"
msgstr ""
+msgid "New..."
+msgstr ""
+
msgid "No"
msgstr ""
@@ -3631,6 +3706,12 @@ msgstr ""
msgid "Open in Xcode"
msgstr ""
+msgid "Open sidebar"
+msgstr ""
+
+msgid "Open source software to collaborate on code"
+msgstr ""
+
msgid "OpenedNDaysAgo|Opened"
msgstr ""
@@ -3931,6 +4012,9 @@ msgstr ""
msgid "Profile"
msgstr ""
+msgid "Profile Settings"
+msgstr ""
+
msgid "Profiles|Account scheduled for removal."
msgstr ""
@@ -4261,6 +4345,9 @@ msgstr ""
msgid "Remove project"
msgstr ""
+msgid "Reply to this email directly or %{view_it_on_gitlab}."
+msgstr ""
+
msgid "Repository"
msgstr ""
@@ -4282,6 +4369,9 @@ msgstr ""
msgid "Request Access"
msgstr ""
+msgid "Requests Profiles"
+msgstr ""
+
msgid "Require all users to accept Terms of Service and Privacy Policy when they access GitLab."
msgstr ""
@@ -4530,6 +4620,9 @@ msgstr ""
msgid "Shared Runners"
msgstr ""
+msgid "Sherlock Transactions"
+msgstr ""
+
msgid "Show command"
msgstr ""
@@ -4559,6 +4652,12 @@ msgstr[1] ""
msgid "Side-by-side"
msgstr ""
+msgid "Sign in"
+msgstr ""
+
+msgid "Sign in / Register"
+msgstr ""
+
msgid "Sign out"
msgstr ""
@@ -4772,6 +4871,9 @@ msgstr ""
msgid "Status"
msgstr ""
+msgid "Stop impersonation"
+msgstr ""
+
msgid "Stop this environment"
msgstr ""
@@ -4805,6 +4907,9 @@ msgstr ""
msgid "System Hooks"
msgstr ""
+msgid "System Info"
+msgstr ""
+
msgid "Tag (%{tag_count})"
msgid_plural "Tags (%{tag_count})"
msgstr[0] ""
@@ -5044,6 +5149,9 @@ msgstr ""
msgid "This directory"
msgstr ""
+msgid "This group"
+msgstr ""
+
msgid "This group does not provide any group Runners yet."
msgstr ""
@@ -5333,12 +5441,18 @@ msgstr ""
msgid "Todo"
msgstr ""
+msgid "Todos"
+msgstr ""
+
msgid "Toggle Sidebar"
msgstr ""
msgid "Toggle discussion"
msgstr ""
+msgid "Toggle navigation"
+msgstr ""
+
msgid "Toggle sidebar"
msgstr ""
@@ -5375,6 +5489,9 @@ msgstr ""
msgid "Try again"
msgstr ""
+msgid "Twitter"
+msgstr ""
+
msgid "Unable to load the diff. %{button_try_again}"
msgstr ""
@@ -5464,6 +5581,9 @@ msgstr ""
msgid "Use your global notification setting"
msgstr ""
+msgid "User Settings"
+msgstr ""
+
msgid "User and IP Rate Limits"
msgstr ""
@@ -5497,6 +5617,9 @@ msgstr ""
msgid "View group labels"
msgstr ""
+msgid "View it on GitLab"
+msgstr ""
+
msgid "View jobs"
msgstr ""
@@ -5539,6 +5662,9 @@ msgstr ""
msgid "Want to see the data? Please ask an administrator for access."
msgstr ""
+msgid "We detected potential spam in the %{humanized_resource_name}. Please solve the reCAPTCHA to proceed."
+msgstr ""
+
msgid "We don't have enough data to show this stage."
msgstr ""
@@ -5812,9 +5938,18 @@ msgstr ""
msgid "You'll need to use different branch names to get a valid comparison."
msgstr ""
+msgid "You're receiving this email because %{reason}."
+msgstr ""
+
+msgid "You're receiving this email because of your account on %{host}."
+msgstr ""
+
msgid "You're receiving this email because of your account on %{host}. %{manage_notifications_link} &middot; %{help_link}"
msgstr ""
+msgid "YouTube"
+msgstr ""
+
msgid "Your Groups"
msgstr ""
@@ -6130,6 +6265,9 @@ msgstr ""
msgid "uses Kubernetes clusters to deploy your code!"
msgstr ""
+msgid "view it on GitLab"
+msgstr ""
+
msgid "with %{additions} additions, %{deletions} deletions."
msgstr ""
diff --git a/qa/qa/page/menu/side.rb b/qa/qa/page/menu/side.rb
index c14a835c2c9..354ccec2a5a 100644
--- a/qa/qa/page/menu/side.rb
+++ b/qa/qa/page/menu/side.rb
@@ -5,8 +5,8 @@ module QA
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :settings_item
element :settings_link, 'link_to edit_project_path'
- element :repository_link, "title: 'Repository'"
- element :pipelines_settings_link, "title: 'CI / CD'"
+ element :repository_link, "title: _('Repository')"
+ element :pipelines_settings_link, "title: _('CI / CD')"
element :operations_kubernetes_link, "title: _('Kubernetes')"
element :issues_link, /link_to.*shortcuts-issues/
element :issues_link_text, "Issues"
@@ -14,7 +14,7 @@ module QA
element :merge_requests_link_text, "Merge Requests"
element :top_level_items, '.sidebar-top-level-items'
element :operations_section, "class: 'shortcuts-operations'"
- element :activity_link, "title: 'Activity'"
+ element :activity_link, "title: _('Activity')"
element :wiki_link_text, "Wiki"
element :milestones_link
end
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 1d3dad4cda0..c751b472535 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -14,7 +14,7 @@ module QA
view 'app/views/layouts/header/_new_dropdown.haml' do
element :new_menu_toggle
- element :new_issue_link, "link_to 'New issue', new_project_issue_path(@project)"
+ element :new_issue_link, "link_to _('New issue'), new_project_issue_path(@project)"
end
view 'app/views/shared/_ref_switcher.html.haml' do
diff --git a/spec/config/object_store_settings_spec.rb b/spec/config/object_store_settings_spec.rb
new file mode 100644
index 00000000000..b1ada3c99db
--- /dev/null
+++ b/spec/config/object_store_settings_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+require Rails.root.join('config', 'object_store_settings.rb')
+
+describe ObjectStoreSettings do
+ describe '.parse' do
+ it 'should set correct default values' do
+ settings = described_class.parse(nil)
+
+ expect(settings['enabled']).to be false
+ expect(settings['direct_upload']).to be false
+ expect(settings['background_upload']).to be true
+ expect(settings['remote_directory']).to be nil
+ end
+
+ it 'respects original values' do
+ original_settings = Settingslogic.new({
+ 'enabled' => true,
+ 'remote_directory' => 'artifacts'
+ })
+
+ settings = described_class.parse(original_settings)
+
+ expect(settings['enabled']).to be true
+ expect(settings['direct_upload']).to be false
+ expect(settings['background_upload']).to be true
+ expect(settings['remote_directory']).to eq 'artifacts'
+ end
+ end
+end
diff --git a/spec/controllers/projects/wikis_controller_spec.rb b/spec/controllers/projects/wikis_controller_spec.rb
index 92addf30307..fed6677935e 100644
--- a/spec/controllers/projects/wikis_controller_spec.rb
+++ b/spec/controllers/projects/wikis_controller_spec.rb
@@ -1,8 +1,35 @@
require 'spec_helper'
describe Projects::WikisController do
- let(:project) { create(:project_empty_repo, :public) }
+ let(:project) { create(:project, :public, :repository) }
let(:user) { create(:user) }
+ let(:wiki) { ProjectWiki.new(project, user) }
+
+ describe 'GET #show' do
+ let(:wiki_title) { 'page-title-test' }
+
+ render_views
+
+ before do
+ create_page(wiki_title, 'hello world')
+ end
+
+ it 'limits the retrieved pages for the sidebar' do
+ sign_in(user)
+
+ expect(controller).to receive(:load_wiki).and_return(wiki)
+
+ # empty? call
+ expect(wiki).to receive(:pages).with(limit: 1).and_call_original
+ # Sidebar entries
+ expect(wiki).to receive(:pages).with(limit: 15).and_call_original
+
+ get :show, namespace_id: project.namespace, project_id: project, id: wiki_title
+
+ expect(response).to have_http_status(:ok)
+ expect(response.body).to include(wiki_title)
+ end
+ end
describe 'POST #preview_markdown' do
it 'renders json in a correct format' do
@@ -13,4 +40,12 @@ describe Projects::WikisController do
expect(JSON.parse(response.body).keys).to match_array(%w(body references))
end
end
+
+ def create_page(name, content)
+ project.wiki.wiki.write_page(name, :markdown, content, commit_details(name))
+ end
+
+ def commit_details(name)
+ Gitlab::Git::Wiki::CommitDetails.new(user.id, user.username, user.name, user.email, "created page #{name}")
+ end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index b0acf4a49ac..071f96a729e 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -2,6 +2,8 @@ require 'spec_helper'
describe UsersController do
let(:user) { create(:user) }
+ let(:private_user) { create(:user, private_profile: true) }
+ let(:public_user) { create(:user) }
describe 'GET #show' do
context 'with rendered views' do
@@ -98,16 +100,47 @@ describe UsersController do
expect(assigns(:events)).to be_empty
end
+
+ it 'hides events if the user has a private profile' do
+ Gitlab::DataBuilder::Push.build_sample(project, private_user)
+
+ get :show, username: private_user.username, format: :json
+
+ expect(assigns(:events)).to be_empty
+ end
end
end
describe 'GET #calendar' do
- it 'renders calendar' do
- sign_in(user)
+ context 'for user' do
+ let(:project) { create(:project) }
+
+ before do
+ sign_in(user)
+ project.add_developer(user)
+ end
+
+ context 'with public profile' do
+ it 'renders calendar' do
+ push_data = Gitlab::DataBuilder::Push.build_sample(project, public_user)
+ EventCreateService.new.push(project, public_user, push_data)
+
+ get :calendar, username: public_user.username, format: :json
- get :calendar, username: user.username, format: :json
+ expect(response).to have_gitlab_http_status(200)
+ end
+ end
+
+ context 'with private profile' do
+ it 'does not render calendar' do
+ push_data = Gitlab::DataBuilder::Push.build_sample(project, private_user)
+ EventCreateService.new.push(project, private_user, push_data)
- expect(response).to have_gitlab_http_status(200)
+ get :calendar, username: private_user.username, format: :json
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
end
context 'forked project' do
@@ -150,9 +183,26 @@ describe UsersController do
expect(assigns(:calendar_date)).to eq(Date.parse('2014-07-31'))
end
- it 'renders calendar_activities' do
- get :calendar_activities, username: user.username
- expect(response).to render_template('calendar_activities')
+ context 'for user' do
+ context 'with public profile' do
+ it 'renders calendar_activities' do
+ push_data = Gitlab::DataBuilder::Push.build_sample(project, public_user)
+ EventCreateService.new.push(project, public_user, push_data)
+
+ get :calendar_activities, username: public_user.username
+ expect(assigns[:events]).not_to be_empty
+ end
+ end
+
+ context 'with private profile' do
+ it 'does not render calendar_activities' do
+ push_data = Gitlab::DataBuilder::Push.build_sample(project, private_user)
+ EventCreateService.new.push(project, private_user, push_data)
+
+ get :calendar_activities, username: private_user.username
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
end
end
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index fec1bea2751..1215b04913e 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -34,7 +34,7 @@ FactoryBot.define do
builds_access_level = [evaluator.builds_access_level, evaluator.repository_access_level].min
merge_requests_access_level = [evaluator.merge_requests_access_level, evaluator.repository_access_level].min
- project.project_feature.update_columns(
+ project.project_feature.update(
wiki_access_level: evaluator.wiki_access_level,
builds_access_level: builds_access_level,
snippets_access_level: evaluator.snippets_access_level,
diff --git a/spec/factories/site_statistics.rb b/spec/factories/site_statistics.rb
new file mode 100644
index 00000000000..dd8c795515a
--- /dev/null
+++ b/spec/factories/site_statistics.rb
@@ -0,0 +1,7 @@
+FactoryBot.define do
+ factory :site_statistics, class: 'SiteStatistic' do
+ id 1
+ repositories_count 999
+ wikis_count 555
+ end
+end
diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb
index 845a7c5fc42..fd8629ae504 100644
--- a/spec/features/issues/update_issues_spec.rb
+++ b/spec/features/issues/update_issues_spec.rb
@@ -49,7 +49,7 @@ describe 'Multiple issue updating from issues#index', :js do
click_update_issues_button
page.within('.issue .controls') do
- expect(find('.author_link')["title"]).to have_content(user.name)
+ expect(find('.author-link')["title"]).to have_content(user.name)
end
end
@@ -63,7 +63,7 @@ describe 'Multiple issue updating from issues#index', :js do
click_link 'Unassigned'
click_update_issues_button
- expect(find('.issue:first-child .controls')).not_to have_css('.author_link')
+ expect(find('.issue:first-child .controls')).not_to have_css('.author-link')
end
end
diff --git a/spec/features/merge_requests/user_mass_updates_spec.rb b/spec/features/merge_requests/user_mass_updates_spec.rb
index bb327159cb0..cb6603d3f50 100644
--- a/spec/features/merge_requests/user_mass_updates_spec.rb
+++ b/spec/features/merge_requests/user_mass_updates_spec.rb
@@ -47,7 +47,7 @@ describe 'Merge requests > User mass updates', :js do
change_assignee(user.name)
page.within('.merge-request .controls') do
- expect(find('.author_link')["title"]).to have_content(user.name)
+ expect(find('.author-link')["title"]).to have_content(user.name)
end
end
end
@@ -62,7 +62,7 @@ describe 'Merge requests > User mass updates', :js do
it 'removes assignee from the merge request' do
change_assignee('Unassigned')
- expect(find('.merge-request .controls')).not_to have_css('.author_link')
+ expect(find('.merge-request .controls')).not_to have_css('.author-link')
end
end
end
diff --git a/spec/features/users/add_email_to_existing_account.rb b/spec/features/users/add_email_to_existing_account.rb
new file mode 100644
index 00000000000..4355f769429
--- /dev/null
+++ b/spec/features/users/add_email_to_existing_account.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe 'AdditionalEmailToExistingAccount' do
+ describe 'add secondary email associated with account' do
+ let(:user) { create(:user) }
+
+ it 'verifies confirmation of additional email' do
+ sign_in(user)
+
+ email = create(:email, user: user)
+ visit email_confirmation_path(confirmation_token: email.confirmation_token)
+ expect(page).to have_content 'Your email address has been successfully confirmed.'
+ end
+ end
+end
diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb
index 3e2fb704bc6..207c333c636 100644
--- a/spec/features/users/show_spec.rb
+++ b/spec/features/users/show_spec.rb
@@ -3,15 +3,53 @@ require 'spec_helper'
describe 'User page' do
let(:user) { create(:user) }
- it 'shows all the tabs' do
- visit(user_path(user))
-
- page.within '.nav-links' do
- expect(page).to have_link('Activity')
- expect(page).to have_link('Groups')
- expect(page).to have_link('Contributed projects')
- expect(page).to have_link('Personal projects')
- expect(page).to have_link('Snippets')
+ context 'with public profile' do
+ it 'shows all the tabs' do
+ visit(user_path(user))
+
+ page.within '.nav-links' do
+ expect(page).to have_link('Activity')
+ expect(page).to have_link('Groups')
+ expect(page).to have_link('Contributed projects')
+ expect(page).to have_link('Personal projects')
+ expect(page).to have_link('Snippets')
+ end
+ end
+
+ it 'does not show private profile message' do
+ visit(user_path(user))
+
+ expect(page).not_to have_content("This user has a private profile")
+ end
+ end
+
+ context 'with private profile' do
+ let(:user) { create(:user, private_profile: true) }
+
+ it 'shows no tab' do
+ visit(user_path(user))
+
+ expect(page).to have_css("div.profile-header")
+ expect(page).not_to have_css("ul.nav-links")
+ end
+
+ it 'shows private profile message' do
+ visit(user_path(user))
+
+ expect(page).to have_content("This user has a private profile")
+ end
+
+ it 'shows own tabs' do
+ sign_in(user)
+ visit(user_path(user))
+
+ page.within '.nav-links' do
+ expect(page).to have_link('Activity')
+ expect(page).to have_link('Groups')
+ expect(page).to have_link('Contributed projects')
+ expect(page).to have_link('Personal projects')
+ expect(page).to have_link('Snippets')
+ end
end
end
diff --git a/spec/finders/user_recent_events_finder_spec.rb b/spec/finders/user_recent_events_finder_spec.rb
index da043f94021..58470f4c84d 100644
--- a/spec/finders/user_recent_events_finder_spec.rb
+++ b/spec/finders/user_recent_events_finder_spec.rb
@@ -29,11 +29,22 @@ describe UserRecentEventsFinder do
public_project.add_developer(current_user)
end
- it 'returns all the events' do
- expect(finder.execute).to include(private_event, internal_event, public_event)
+ context 'when profile is public' do
+ it 'returns all the events' do
+ expect(finder.execute).to include(private_event, internal_event, public_event)
+ end
+ end
+
+ context 'when profile is private' do
+ it 'returns no event' do
+ allow(Ability).to receive(:allowed?).and_call_original
+ allow(Ability).to receive(:allowed?).with(current_user, :read_user_profile, project_owner).and_return(false)
+ expect(finder.execute).to be_empty
+ end
end
it 'does not include the events if the user cannot read cross project' do
+ expect(Ability).to receive(:allowed?).and_call_original
expect(Ability).to receive(:allowed?).with(current_user, :read_cross_project) { false }
expect(finder.execute).to be_empty
end
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb
index b18c045848f..b079802cb81 100644
--- a/spec/helpers/users_helper_spec.rb
+++ b/spec/helpers/users_helper_spec.rb
@@ -25,8 +25,20 @@ describe UsersHelper do
allow(helper).to receive(:can?).and_return(true)
end
- it 'includes all the expected tabs' do
- expect(tabs).to include(:activity, :groups, :contributed, :projects, :snippets)
+ context 'with public profile' do
+ it 'includes all the expected tabs' do
+ expect(tabs).to include(:activity, :groups, :contributed, :projects, :snippets)
+ end
+ end
+
+ context 'with private profile' do
+ before do
+ allow(helper).to receive(:can?).with(user, :read_user_profile, nil).and_return(false)
+ end
+
+ it 'is empty' do
+ expect(tabs).to be_empty
+ end
end
end
diff --git a/spec/javascripts/issue_show/components/app_spec.js b/spec/javascripts/issue_show/components/app_spec.js
index eb5e0bddb74..36328382448 100644
--- a/spec/javascripts/issue_show/components/app_spec.js
+++ b/spec/javascripts/issue_show/components/app_spec.js
@@ -76,7 +76,7 @@ describe('Issuable output', () => {
expect(vm.$el.querySelector('.wiki').innerHTML).toContain('<p>this is a description!</p>');
expect(vm.$el.querySelector('.js-task-list-field').value).toContain('this is a description');
expect(formatText(editedText.innerText)).toMatch(/Edited[\s\S]+?by Some User/);
- expect(editedText.querySelector('.author_link').href).toMatch(/\/some_user$/);
+ expect(editedText.querySelector('.author-link').href).toMatch(/\/some_user$/);
expect(editedText.querySelector('time')).toBeTruthy();
})
.then(() => {
@@ -90,7 +90,7 @@ describe('Issuable output', () => {
expect(vm.$el.querySelector('.js-task-list-field').value).toContain('42');
expect(vm.$el.querySelector('.edited-text')).toBeTruthy();
expect(formatText(vm.$el.querySelector('.edited-text').innerText)).toMatch(/Edited[\s\S]+?by Other User/);
- expect(editedText.querySelector('.author_link').href).toMatch(/\/other_user$/);
+ expect(editedText.querySelector('.author-link').href).toMatch(/\/other_user$/);
expect(editedText.querySelector('time')).toBeTruthy();
})
.then(done)
diff --git a/spec/javascripts/issue_show/components/edited_spec.js b/spec/javascripts/issue_show/components/edited_spec.js
index 2061def699b..7f09db837bb 100644
--- a/spec/javascripts/issue_show/components/edited_spec.js
+++ b/spec/javascripts/issue_show/components/edited_spec.js
@@ -18,7 +18,7 @@ describe('edited', () => {
}).$mount();
expect(formatText(editedComponent.$el.innerText)).toMatch(/Edited[\s\S]+?by Some User/);
- expect(editedComponent.$el.querySelector('.author_link').href).toMatch(/\/some_user$/);
+ expect(editedComponent.$el.querySelector('.author-link').href).toMatch(/\/some_user$/);
expect(editedComponent.$el.querySelector('time')).toBeTruthy();
});
@@ -31,7 +31,7 @@ describe('edited', () => {
}).$mount();
expect(formatText(editedComponent.$el.innerText)).toMatch(/Edited by Some User/);
- expect(editedComponent.$el.querySelector('.author_link').href).toMatch(/\/some_user$/);
+ expect(editedComponent.$el.querySelector('.author-link').href).toMatch(/\/some_user$/);
expect(editedComponent.$el.querySelector('time')).toBeFalsy();
});
@@ -43,7 +43,7 @@ describe('edited', () => {
}).$mount();
expect(formatText(editedComponent.$el.innerText)).not.toMatch(/by Some User/);
- expect(editedComponent.$el.querySelector('.author_link')).toBeFalsy();
+ expect(editedComponent.$el.querySelector('.author-link')).toBeFalsy();
expect(editedComponent.$el.querySelector('time')).toBeTruthy();
});
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js
index 41ff59949e5..71b26a315af 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js
+++ b/spec/javascripts/lib/utils/common_utils_spec.js
@@ -627,4 +627,23 @@ describe('common_utils', () => {
});
});
});
+
+ describe('roundOffFloat', () => {
+ it('Rounds off decimal places of a float number with provided precision', () => {
+ expect(commonUtils.roundOffFloat(3.141592, 3)).toBe(3.142);
+ });
+
+ it('Rounds off a float number to a whole number when provided precision is zero', () => {
+ expect(commonUtils.roundOffFloat(3.141592, 0)).toBe(3);
+ expect(commonUtils.roundOffFloat(3.5, 0)).toBe(4);
+ });
+
+ it('Rounds off float number to nearest 0, 10, 100, 1000 and so on when provided precision is below 0', () => {
+ expect(commonUtils.roundOffFloat(34567.14159, -1)).toBe(34570);
+ expect(commonUtils.roundOffFloat(34567.14159, -2)).toBe(34600);
+ expect(commonUtils.roundOffFloat(34567.14159, -3)).toBe(35000);
+ expect(commonUtils.roundOffFloat(34567.14159, -4)).toBe(30000);
+ expect(commonUtils.roundOffFloat(34567.14159, -5)).toBe(0);
+ });
+ });
});
diff --git a/spec/javascripts/sidebar/assignees_spec.js b/spec/javascripts/sidebar/assignees_spec.js
index 4e4343812bd..843e7002180 100644
--- a/spec/javascripts/sidebar/assignees_spec.js
+++ b/spec/javascripts/sidebar/assignees_spec.js
@@ -102,13 +102,13 @@ describe('Assignee component', () => {
},
}).$mount();
- expect(component.$el.querySelector('.author_link')).not.toBeNull();
+ expect(component.$el.querySelector('.author-link')).not.toBeNull();
// The image
- expect(component.$el.querySelector('.author_link img').getAttribute('src')).toEqual(UsersMock.user.avatar);
+ expect(component.$el.querySelector('.author-link img').getAttribute('src')).toEqual(UsersMock.user.avatar);
// Author name
- expect(component.$el.querySelector('.author_link .author').innerText.trim()).toEqual(UsersMock.user.name);
+ expect(component.$el.querySelector('.author-link .author').innerText.trim()).toEqual(UsersMock.user.name);
// Username
- expect(component.$el.querySelector('.author_link .username').innerText.trim()).toEqual(`@${UsersMock.user.username}`);
+ expect(component.$el.querySelector('.author-link .username').innerText.trim()).toEqual(`@${UsersMock.user.username}`);
});
it('has the root url present in the assigneeUrl method', () => {
diff --git a/spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js b/spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js
index de3bf667fb3..076d940961d 100644
--- a/spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js
+++ b/spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js
@@ -10,9 +10,9 @@ const createComponent = (config) => {
successLabel: 'Synced',
failureLabel: 'Failed',
neutralLabel: 'Out of sync',
- successCount: 10,
- failureCount: 5,
- totalCount: 20,
+ successCount: 25,
+ failureCount: 10,
+ totalCount: 5000,
}, config);
return mountComponent(Component, defaultConfig);
@@ -32,7 +32,7 @@ describe('StackedProgressBarComponent', () => {
describe('computed', () => {
describe('neutralCount', () => {
it('returns neutralCount based on totalCount, successCount and failureCount', () => {
- expect(vm.neutralCount).toBe(5); // 20 - 10 - 5
+ expect(vm.neutralCount).toBe(4965); // 5000 - 25 - 10
});
});
});
@@ -40,7 +40,11 @@ describe('StackedProgressBarComponent', () => {
describe('methods', () => {
describe('getPercent', () => {
it('returns percentage from provided count based on `totalCount`', () => {
- expect(vm.getPercent(10)).toBe(50);
+ expect(vm.getPercent(500)).toBe(10);
+ });
+
+ it('returns percentage with decimal place from provided count based on `totalCount`', () => {
+ expect(vm.getPercent(10)).toBe(0.2);
});
});
diff --git a/spec/lib/banzai/filter/sanitization_filter_spec.rb b/spec/lib/banzai/filter/sanitization_filter_spec.rb
index d930c608b18..0b3c2390304 100644
--- a/spec/lib/banzai/filter/sanitization_filter_spec.rb
+++ b/spec/lib/banzai/filter/sanitization_filter_spec.rb
@@ -54,6 +54,18 @@ describe Banzai::Filter::SanitizationFilter do
expect(instance.whitelist[:transformers].size).to eq control_count
end
+ it 'customizes the whitelist only once for different instances' do
+ instance1 = described_class.new('Foo1')
+ instance2 = described_class.new('Foo2')
+ control_count = instance1.whitelist[:transformers].size
+
+ instance1.whitelist
+ instance2.whitelist
+
+ expect(instance1.whitelist[:transformers].size).to eq control_count
+ expect(instance2.whitelist[:transformers].size).to eq control_count
+ end
+
it 'sanitizes `class` attribute from all elements' do
act = %q{<pre class="code highlight white c"><code>&lt;span class="k"&gt;def&lt;/span&gt;</code></pre>}
exp = %q{<pre><code>&lt;span class="k"&gt;def&lt;/span&gt;</code></pre>}
diff --git a/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb b/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb
index 64c994a268f..1969aed51da 100644
--- a/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb
+++ b/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, schema: 20180619121030 do
+describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, :sidekiq, schema: 20180619121030 do
describe '#perform' do
context 'when diff files can be deleted' do
let(:merge_request) { create(:merge_request, :merged) }
diff --git a/spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb b/spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb
index fb5093b0bd1..ec8ba0ce127 100644
--- a/spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb
+++ b/spec/lib/gitlab/background_migration/schedule_diff_files_deletion_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Gitlab::BackgroundMigration::ScheduleDiffFilesDeletion, :migration, schema: 20180619121030 do
+describe Gitlab::BackgroundMigration::ScheduleDiffFilesDeletion, :migration, :sidekiq, schema: 20180619121030 do
describe '#perform' do
let(:merge_request_diffs) { table(:merge_request_diffs) }
let(:merge_requests) { table(:merge_requests) }
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb
index 782e4e45a91..7d76519dddd 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -65,6 +65,28 @@ describe Gitlab::Database do
end
end
+ describe '.postgresql_9_or_less?' do
+ it 'returns false when using MySQL' do
+ allow(described_class).to receive(:postgresql?).and_return(false)
+
+ expect(described_class.postgresql_9_or_less?).to eq(false)
+ end
+
+ it 'returns true when using PostgreSQL 9.6' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('9.6')
+
+ expect(described_class.postgresql_9_or_less?).to eq(true)
+ end
+
+ it 'returns false when using PostgreSQL 10 or newer' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('10')
+
+ expect(described_class.postgresql_9_or_less?).to eq(false)
+ end
+ end
+
describe '.join_lateral_supported?' do
it 'returns false when using MySQL' do
allow(described_class).to receive(:postgresql?).and_return(false)
@@ -109,6 +131,70 @@ describe Gitlab::Database do
end
end
+ describe '.pg_wal_lsn_diff' do
+ it 'returns old name when using PostgreSQL 9.6' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('9.6')
+
+ expect(described_class.pg_wal_lsn_diff).to eq('pg_xlog_location_diff')
+ end
+
+ it 'returns new name when using PostgreSQL 10 or newer' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('10')
+
+ expect(described_class.pg_wal_lsn_diff).to eq('pg_wal_lsn_diff')
+ end
+ end
+
+ describe '.pg_current_wal_insert_lsn' do
+ it 'returns old name when using PostgreSQL 9.6' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('9.6')
+
+ expect(described_class.pg_current_wal_insert_lsn).to eq('pg_current_xlog_insert_location')
+ end
+
+ it 'returns new name when using PostgreSQL 10 or newer' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('10')
+
+ expect(described_class.pg_current_wal_insert_lsn).to eq('pg_current_wal_insert_lsn')
+ end
+ end
+
+ describe '.pg_last_wal_receive_lsn' do
+ it 'returns old name when using PostgreSQL 9.6' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('9.6')
+
+ expect(described_class.pg_last_wal_receive_lsn).to eq('pg_last_xlog_receive_location')
+ end
+
+ it 'returns new name when using PostgreSQL 10 or newer' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('10')
+
+ expect(described_class.pg_last_wal_receive_lsn).to eq('pg_last_wal_receive_lsn')
+ end
+ end
+
+ describe '.pg_last_wal_replay_lsn' do
+ it 'returns old name when using PostgreSQL 9.6' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('9.6')
+
+ expect(described_class.pg_last_wal_replay_lsn).to eq('pg_last_xlog_replay_location')
+ end
+
+ it 'returns new name when using PostgreSQL 10 or newer' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+ allow(described_class).to receive(:version).and_return('10')
+
+ expect(described_class.pg_last_wal_replay_lsn).to eq('pg_last_wal_replay_lsn')
+ end
+ end
+
describe '.nulls_last_order' do
context 'when using PostgreSQL' do
before do
diff --git a/spec/lib/gitlab/git/wiki_spec.rb b/spec/lib/gitlab/git/wiki_spec.rb
index b63658e1b3b..c5666e4ec61 100644
--- a/spec/lib/gitlab/git/wiki_spec.rb
+++ b/spec/lib/gitlab/git/wiki_spec.rb
@@ -6,6 +6,31 @@ describe Gitlab::Git::Wiki do
let(:project_wiki) { ProjectWiki.new(project, user) }
subject { project_wiki.wiki }
+ describe '#pages' do
+ before do
+ create_page('page1', 'content')
+ create_page('page2', 'content2')
+ end
+
+ after do
+ destroy_page('page1')
+ destroy_page('page2')
+ end
+
+ it 'returns all the pages' do
+ expect(subject.pages.count).to eq(2)
+ expect(subject.pages.first.title).to eq 'page1'
+ expect(subject.pages.last.title).to eq 'page2'
+ end
+
+ it 'returns only one page' do
+ pages = subject.pages(limit: 1)
+
+ expect(pages.count).to eq(1)
+ expect(pages.first.title).to eq 'page1'
+ end
+ end
+
describe '#page' do
before do
create_page('page1', 'content')
diff --git a/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb b/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb
index 6ad9f5ef766..5f67fe6b952 100644
--- a/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb
@@ -70,6 +70,15 @@ describe Gitlab::GitalyClient::WikiService do
subject
end
+ it 'sends a limit of 0 to wiki_get_all_pages' do
+ expect_any_instance_of(Gitaly::WikiService::Stub)
+ .to receive(:wiki_get_all_pages)
+ .with(gitaly_request_with_params(limit: 0), kind_of(Hash))
+ .and_return([].each)
+
+ subject
+ end
+
it 'concatenates the raw data and returns a pair of WikiPage and WikiPageVersion for each page' do
expect_any_instance_of(Gitaly::WikiService::Stub)
.to receive(:wiki_get_all_pages)
@@ -84,5 +93,18 @@ describe Gitlab::GitalyClient::WikiService do
expect(wiki_page_2.raw_data).to eq('cd')
expect(wiki_page_2_version.format).to eq('markdown')
end
+
+ context 'with limits' do
+ subject { client.get_all_pages(limit: 1) }
+
+ it 'sends a request with the limit' do
+ expect_any_instance_of(Gitaly::WikiService::Stub)
+ .to receive(:wiki_get_all_pages)
+ .with(gitaly_request_with_params(limit: 1), kind_of(Hash))
+ .and_return([].each)
+
+ subject
+ end
+ end
end
end
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb
index 0f156619e9e..79f75c0ffa0 100644
--- a/spec/models/concerns/reactive_caching_spec.rb
+++ b/spec/models/concerns/reactive_caching_spec.rb
@@ -125,6 +125,13 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
go!
end
+ it "calls a reactive_cache_updated only once if content did not change on subsequent update" do
+ expect(instance).to receive(:calculate_reactive_cache).twice
+ expect(instance).to receive(:reactive_cache_updated).once
+
+ 2.times { instance.exclusively_update_reactive_cache! }
+ end
+
context 'and #calculate_reactive_cache raises an exception' do
before do
stub_reactive_cache(instance, "preexisting")
diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb
index cd7f77024da..10617edec0f 100644
--- a/spec/models/project_feature_spec.rb
+++ b/spec/models/project_feature_spec.rb
@@ -119,4 +119,46 @@ describe ProjectFeature do
end
end
end
+
+ context 'Site Statistics' do
+ set(:project_with_wiki) { create(:project, :wiki_enabled) }
+ set(:project_without_wiki) { create(:project, :wiki_disabled) }
+
+ context 'when creating a project' do
+ it 'tracks wiki availability when wikis are enabled by default' do
+ expect { create(:project) }.to change { SiteStatistic.fetch.wikis_count }.by(1)
+ end
+
+ it 'does not track wiki availability when wikis are disabled by default' do
+ expect { create(:project, :wiki_disabled) }.not_to change { SiteStatistic.fetch.wikis_count }
+ end
+ end
+
+ context 'when updating a project_feature' do
+ it 'untracks wiki availability when disabling wiki access' do
+ expect { project_with_wiki.project_feature.update_attribute(:wiki_access_level, ProjectFeature::DISABLED) }
+ .to change { SiteStatistic.fetch.wikis_count }.by(-1)
+ end
+
+ it 'tracks again wiki availability when re-enabling wiki access as public' do
+ expect { project_without_wiki.project_feature.update_attribute(:wiki_access_level, ProjectFeature::ENABLED) }
+ .to change { SiteStatistic.fetch.wikis_count }.by(1)
+ end
+
+ it 'tracks again wiki availability when re-enabling wiki access as private' do
+ expect { project_without_wiki.project_feature.update_attribute(:wiki_access_level, ProjectFeature::PRIVATE) }
+ .to change { SiteStatistic.fetch.wikis_count }.by(1)
+ end
+ end
+
+ context 'when removing a project' do
+ it 'untracks wiki availability when removing a project with previous wiki access' do
+ expect { project_with_wiki.destroy }.to change { SiteStatistic.fetch.wikis_count }.by(-1)
+ end
+
+ it 'does not untrack wiki availability when removing a project without wiki access' do
+ expect { project_without_wiki.destroy }.not_to change { SiteStatistic.fetch.wikis_count }
+ end
+ end
+ end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index b0ec725bf70..88442247093 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -102,6 +102,22 @@ describe Project do
end
end
+ context 'Site Statistics' do
+ context 'when creating a new project' do
+ it 'tracks project in SiteStatistic' do
+ expect { create(:project) }.to change { SiteStatistic.fetch.repositories_count }.by(1)
+ end
+ end
+
+ context 'when deleting a project' do
+ it 'untracks project in SiteStatistic' do
+ project = create(:project)
+
+ expect { project.destroy }.to change { SiteStatistic.fetch.repositories_count }.by(-1)
+ end
+ end
+ end
+
context 'updating cd_cd_settings' do
it 'does not raise an error' do
project = create(:project)
diff --git a/spec/models/site_statistic_spec.rb b/spec/models/site_statistic_spec.rb
new file mode 100644
index 00000000000..9b056fbf332
--- /dev/null
+++ b/spec/models/site_statistic_spec.rb
@@ -0,0 +1,83 @@
+require 'spec_helper'
+
+describe SiteStatistic do
+ describe '.fetch' do
+ context 'existing record' do
+ it 'returns existing SiteStatistic model' do
+ statistics = create(:site_statistics)
+
+ expect(described_class.fetch).to be_a(described_class)
+ expect(described_class.fetch).to eq(statistics)
+ end
+ end
+
+ context 'non existing record' do
+ it 'creates a new SiteStatistic model' do
+ expect(described_class.first).to be_nil
+ expect(described_class.fetch).to be_a(described_class)
+ end
+ end
+ end
+
+ describe '.track' do
+ context 'with allowed attributes' do
+ let(:statistics) { create(:site_statistics) }
+
+ it 'increases the attribute counter' do
+ expect { described_class.track('repositories_count') }.to change { statistics.reload.repositories_count }.by(1)
+ expect { described_class.track('wikis_count') }.to change { statistics.reload.wikis_count }.by(1)
+ end
+
+ it 'doesnt increase the attribute counter when an exception happens during transaction' do
+ expect do
+ begin
+ described_class.transaction do
+ described_class.track('repositories_count')
+
+ raise StandardError
+ end
+ rescue StandardError
+ # no-op
+ end
+ end.not_to change { statistics.reload.repositories_count }
+ end
+ end
+
+ context 'with not allowed attributes' do
+ it 'returns error' do
+ expect { described_class.track('something_else') }.to raise_error(ArgumentError).with_message(/Invalid attribute: \'something_else\' to \'track\' method/)
+ end
+ end
+ end
+
+ describe '.untrack' do
+ context 'with allowed attributes' do
+ let(:statistics) { create(:site_statistics) }
+
+ it 'decreases the attribute counter' do
+ expect { described_class.untrack('repositories_count') }.to change { statistics.reload.repositories_count }.by(-1)
+ expect { described_class.untrack('wikis_count') }.to change { statistics.reload.wikis_count }.by(-1)
+ end
+
+ it 'doesnt decrease the attribute counter when an exception happens during transaction' do
+ expect do
+ begin
+ described_class.transaction do
+ described_class.track('repositories_count')
+
+ raise StandardError
+ end
+ rescue StandardError
+ # no-op
+ end
+ end.not_to change { described_class.fetch.repositories_count }
+ end
+ end
+
+ context 'with not allowed attributes' do
+ it 'returns error' do
+ expect { described_class.untrack('something_else') }.to raise_error(ArgumentError).with_message(/Invalid attribute: \'something_else\' to \'untrack\' method/)
+ end
+ end
+ end
+end
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index b3079c0a77b..6a051f865aa 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -11,6 +11,7 @@ describe API::Users do
let(:ldap_blocked_user) { create(:omniauth_user, provider: 'ldapmain', state: 'ldap_blocked') }
let(:not_existing_user_id) { (User.maximum('id') || 0 ) + 10 }
let(:not_existing_pat_id) { (PersonalAccessToken.maximum('id') || 0 ) + 10 }
+ let(:private_user) { create(:user, private_profile: true) }
describe 'GET /users' do
context "when unauthenticated" do
@@ -254,6 +255,13 @@ describe API::Users do
expect(response).to match_response_schema('public_api/v4/user/admin')
expect(json_response['is_admin']).to be(false)
end
+
+ it "includes the `created_at` field for private users" do
+ get api("/users/#{private_user.id}", admin)
+
+ expect(response).to match_response_schema('public_api/v4/user/admin')
+ expect(json_response.keys).to include 'created_at'
+ end
end
context 'for an anonymous user' do
@@ -272,6 +280,20 @@ describe API::Users do
expect(response).to have_gitlab_http_status(404)
end
+
+ it "returns the `created_at` field for public users" do
+ get api("/users/#{user.id}")
+
+ expect(response).to match_response_schema('public_api/v4/user/basic')
+ expect(json_response.keys).to include 'created_at'
+ end
+
+ it "does not return the `created_at` field for private users" do
+ get api("/users/#{private_user.id}")
+
+ expect(response).to match_response_schema('public_api/v4/user/basic')
+ expect(json_response.keys).not_to include 'created_at'
+ end
end
it "returns a 404 error if user id not found" do
@@ -374,6 +396,18 @@ describe API::Users do
expect(new_user.recently_sent_password_reset?).to eq(true)
end
+ it "creates user with private profile" do
+ post api('/users', admin), attributes_for(:user, private_profile: true)
+
+ expect(response).to have_gitlab_http_status(201)
+
+ user_id = json_response['id']
+ new_user = User.find(user_id)
+
+ expect(new_user).not_to eq(nil)
+ expect(new_user.private_profile?).to eq(true)
+ end
+
it "does not create user with invalid email" do
post api('/users', admin),
email: 'invalid email',
@@ -583,6 +617,13 @@ describe API::Users do
expect(user.reload.external?).to be_truthy
end
+ it "updates private profile" do
+ put api("/users/#{user.id}", admin), { private_profile: true }
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(user.reload.private_profile).to eq(true)
+ end
+
it "does not update admin status" do
put api("/users/#{admin_user.id}", admin), { can_create_group: false }
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 0f3e7157e14..c71eae9164a 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -381,6 +381,10 @@ describe 'Git HTTP requests' do
context "when authentication fails" do
context "when the user is IP banned" do
+ before do
+ Gitlab.config.rack_attack.git_basic_auth['enabled'] = true
+ end
+
it "responds with status 401" do
expect(Rack::Attack::Allow2Ban).to receive(:filter).and_return(true)
allow_any_instance_of(Rack::Request).to receive(:ip).and_return('1.2.3.4')
@@ -420,6 +424,10 @@ describe 'Git HTTP requests' do
end
context "when the user isn't blocked" do
+ before do
+ Gitlab.config.rack_attack.git_basic_auth['enabled'] = true
+ end
+
it "resets the IP in Rack Attack on download" do
expect(Rack::Attack::Allow2Ban).to receive(:reset).twice