diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 21:07:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 21:07:57 +0000 |
commit | 5aa96ff14229dba7e35f213354963febf3ad2833 (patch) | |
tree | 544f3233c05f7f1aa723ea9f13036f2f45d91745 | |
parent | 7ebcead8cfd2edb810dd0cbda816b6cfbd170fe3 (diff) | |
download | gitlab-ce-5aa96ff14229dba7e35f213354963febf3ad2833.tar.gz |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | .haml-lint_todo.yml | 103 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/components/gl_mentions.vue | 101 | ||||
-rw-r--r-- | app/assets/stylesheets/vendors/tribute.scss | 41 | ||||
-rw-r--r-- | app/workers/namespaces/root_statistics_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/namespaces/schedule_aggregation_worker.rb | 8 | ||||
-rw-r--r-- | config/initializers/sidekiq.rb | 5 | ||||
-rw-r--r-- | config/webpack.config.js | 4 | ||||
-rw-r--r-- | doc/administration/logs.md | 15 | ||||
-rw-r--r-- | doc/api/audit_events.md | 6 | ||||
-rw-r--r-- | doc/development/mass_insert.md | 2 | ||||
-rw-r--r-- | lib/gitlab/sidekiq_logging/client_logger.rb | 11 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/gl_mentions_spec.js | 34 | ||||
-rw-r--r-- | spec/workers/namespaces/root_statistics_worker_spec.rb | 2 | ||||
-rw-r--r-- | spec/workers/namespaces/schedule_aggregation_worker_spec.rb | 2 | ||||
-rw-r--r-- | yarn.lock | 5 |
16 files changed, 233 insertions, 115 deletions
diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 3f0d3d8ddf8..7ee4f639633 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2019-05-07 19:04:08 +0100 using Haml-Lint version 0.30.0. +# on 2020-03-04 13:16:29 +0100 using Haml-Lint version 0.34.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 2075 + # Offense count: 1646 NoPlainNodes: enabled: true exclude: @@ -19,13 +19,11 @@ linters: - 'app/views/admin/application_settings/_gitaly.html.haml' - 'app/views/admin/application_settings/_influx.html.haml' - 'app/views/admin/application_settings/_ip_limits.html.haml' - - 'app/views/admin/application_settings/_logging.html.haml' - 'app/views/admin/application_settings/_performance.html.haml' - 'app/views/admin/application_settings/_plantuml.html.haml' - 'app/views/admin/application_settings/_prometheus.html.haml' - 'app/views/admin/application_settings/_realtime.html.haml' - 'app/views/admin/application_settings/_repository_check.html.haml' - - 'app/views/admin/application_settings/_repository_storage.html.haml' - 'app/views/admin/application_settings/_signin.html.haml' - 'app/views/admin/application_settings/_signup.html.haml' - 'app/views/admin/application_settings/_spam.html.haml' @@ -42,13 +40,11 @@ linters: - 'app/views/admin/broadcast_messages/index.html.haml' - 'app/views/admin/dashboard/index.html.haml' - 'app/views/admin/deploy_keys/new.html.haml' - - 'app/views/admin/groups/show.html.haml' - 'app/views/admin/health_check/show.html.haml' - 'app/views/admin/hook_logs/_index.html.haml' - 'app/views/admin/hook_logs/show.html.haml' - 'app/views/admin/hooks/_form.html.haml' - 'app/views/admin/hooks/edit.html.haml' - - 'app/views/admin/hooks/index.html.haml' - 'app/views/admin/labels/_form.html.haml' - 'app/views/admin/logs/show.html.haml' - 'app/views/admin/projects/_projects.html.haml' @@ -78,8 +74,6 @@ linters: - 'app/views/dashboard/milestones/index.html.haml' - 'app/views/dashboard/projects/_blank_state_admin_welcome.html.haml' - 'app/views/dashboard/projects/_blank_state_welcome.html.haml' - - 'app/views/dashboard/projects/_zero_authorized_projects.html.haml' - - 'app/views/dashboard/snippets/index.html.haml' - 'app/views/dashboard/todos/_todo.html.haml' - 'app/views/dashboard/todos/index.html.haml' - 'app/views/devise/confirmations/almost_there.haml' @@ -97,12 +91,10 @@ linters: - 'app/views/devise/sessions/two_factor.html.haml' - 'app/views/devise/shared/_omniauth_box.html.haml' - 'app/views/devise/shared/_sign_in_link.html.haml' - - 'app/views/devise/shared/_signup_box.html.haml' - 'app/views/devise/shared/_tabs_normal.html.haml' - 'app/views/discussions/_discussion.html.haml' - 'app/views/discussions/_headline.html.haml' - 'app/views/discussions/_notes.html.haml' - - 'app/views/discussions/_resolve_all.html.haml' - 'app/views/doorkeeper/applications/_delete_form.html.haml' - 'app/views/doorkeeper/authorized_applications/_delete_form.html.haml' - 'app/views/errors/encoding.html.haml' @@ -114,8 +106,6 @@ linters: - 'app/views/events/event/_push.html.haml' - 'app/views/groups/_create_chat_team.html.haml' - 'app/views/groups/_group_admin_settings.html.haml' - - 'app/views/groups/group_members/_new_group_member.html.haml' - - 'app/views/groups/group_members/index.html.haml' - 'app/views/groups/labels/edit.html.haml' - 'app/views/groups/labels/new.html.haml' - 'app/views/groups/milestones/edit.html.haml' @@ -130,18 +120,14 @@ linters: - 'app/views/help/instance_configuration.html.haml' - 'app/views/help/instance_configuration/_gitlab_ci.html.haml' - 'app/views/help/instance_configuration/_gitlab_pages.html.haml' - - 'app/views/help/instance_configuration/_ssh_info.html.haml' - 'app/views/help/ui.html.haml' - 'app/views/import/bitbucket/status.html.haml' - 'app/views/import/bitbucket_server/status.html.haml' - - 'app/views/instance_statistics/cohorts/_cohorts_table.html.haml' - - 'app/views/instance_statistics/cohorts/_usage_ping.html.haml' - 'app/views/invites/show.html.haml' - 'app/views/layouts/_mailer.html.haml' - 'app/views/layouts/header/_default.html.haml' - 'app/views/layouts/header/_new_dropdown.haml' - 'app/views/layouts/mailer/devise.html.haml' - - 'app/views/layouts/nav/sidebar/_profile.html.haml' - 'app/views/layouts/notify.html.haml' - 'app/views/notify/_failed_builds.html.haml' - 'app/views/notify/_reassigned_issuable_email.html.haml' @@ -153,7 +139,6 @@ linters: - 'app/views/notify/issue_moved_email.html.haml' - 'app/views/notify/member_access_denied_email.html.haml' - 'app/views/notify/member_invite_accepted_email.html.haml' - - 'app/views/notify/member_invite_declined_email.html.haml' - 'app/views/notify/member_invited_email.html.haml' - 'app/views/notify/new_gpg_key_email.html.haml' - 'app/views/notify/new_mention_in_issue_email.html.haml' @@ -172,31 +157,11 @@ linters: - 'app/views/notify/removed_milestone_issue_email.html.haml' - 'app/views/notify/removed_milestone_merge_request_email.html.haml' - 'app/views/notify/repository_push_email.html.haml' - - 'app/views/peek/views/_gc.html.haml' - - 'app/views/peek/views/_redis.html.haml' - - 'app/views/peek/views/_sidekiq.html.haml' - - 'app/views/profiles/_event_table.html.haml' - - 'app/views/profiles/active_sessions/_active_session.html.haml' - - 'app/views/profiles/active_sessions/index.html.haml' - - 'app/views/profiles/audit_log.html.haml' - 'app/views/profiles/chat_names/_chat_name.html.haml' - 'app/views/profiles/chat_names/index.html.haml' - 'app/views/profiles/chat_names/new.html.haml' - - 'app/views/profiles/emails/index.html.haml' - - 'app/views/profiles/gpg_keys/_key.html.haml' - - 'app/views/profiles/gpg_keys/index.html.haml' - 'app/views/profiles/keys/_key.html.haml' - - 'app/views/profiles/keys/_key_details.html.haml' - - 'app/views/profiles/keys/index.html.haml' - - 'app/views/profiles/notifications/show.html.haml' - - 'app/views/profiles/passwords/edit.html.haml' - - 'app/views/profiles/personal_access_tokens/index.html.haml' - - 'app/views/profiles/preferences/show.html.haml' - 'app/views/profiles/show.html.haml' - - 'app/views/profiles/two_factor_auths/_codes.html.haml' - - 'app/views/profiles/two_factor_auths/codes.html.haml' - - 'app/views/profiles/two_factor_auths/create.html.haml' - - 'app/views/profiles/two_factor_auths/show.html.haml' - 'app/views/projects/_bitbucket_import_modal.html.haml' - 'app/views/projects/_customize_workflow.html.haml' - 'app/views/projects/_deletion_failed.html.haml' @@ -206,10 +171,8 @@ linters: - 'app/views/projects/_import_project_pane.html.haml' - 'app/views/projects/_issuable_by_email.html.haml' - 'app/views/projects/_md_preview.html.haml' - - 'app/views/projects/_new_project_fields.html.haml' - 'app/views/projects/_readme.html.haml' - 'app/views/projects/artifacts/_artifact.html.haml' - - 'app/views/projects/artifacts/_search_bar.html.haml' - 'app/views/projects/artifacts/_tree_file.html.haml' - 'app/views/projects/artifacts/browse.html.haml' - 'app/views/projects/blame/_age_map_legend.html.haml' @@ -219,7 +182,6 @@ linters: - 'app/views/projects/blob/_new_dir.html.haml' - 'app/views/projects/blob/_remove.html.haml' - 'app/views/projects/blob/_render_error.html.haml' - - 'app/views/projects/blob/_template_selectors.html.haml' - 'app/views/projects/blob/_upload.html.haml' - 'app/views/projects/blob/edit.html.haml' - 'app/views/projects/blob/new.html.haml' @@ -244,8 +206,6 @@ linters: - 'app/views/projects/deploy_keys/_form.html.haml' - 'app/views/projects/deploy_keys/_index.html.haml' - 'app/views/projects/deploy_keys/edit.html.haml' - - 'app/views/projects/deploy_tokens/_revoke_modal.html.haml' - - 'app/views/projects/deploy_tokens/_table.html.haml' - 'app/views/projects/deployments/_deployment.html.haml' - 'app/views/projects/diffs/_file_header.html.haml' - 'app/views/projects/diffs/_replaced_image_diff.html.haml' @@ -254,10 +214,8 @@ linters: - 'app/views/projects/environments/show.html.haml' - 'app/views/projects/forks/error.html.haml' - 'app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml' - - 'app/views/projects/graphs/charts.html.haml' - 'app/views/projects/hook_logs/_index.html.haml' - 'app/views/projects/hook_logs/show.html.haml' - - 'app/views/projects/hooks/_index.html.haml' - 'app/views/projects/hooks/edit.html.haml' - 'app/views/projects/imports/new.html.haml' - 'app/views/projects/imports/show.html.haml' @@ -294,20 +252,9 @@ linters: - 'app/views/projects/merge_requests/widget/open/_error.html.haml' - 'app/views/projects/mirrors/_regenerate_public_ssh_key_confirm_modal.html.haml' - 'app/views/projects/mirrors/_ssh_host_keys.html.haml' - - 'app/views/projects/new.html.haml' - 'app/views/projects/no_repo.html.haml' - - 'app/views/projects/pages/_access.html.haml' - - 'app/views/projects/pages/_destroy.haml' - - 'app/views/projects/pages/_https_only.html.haml' - - 'app/views/projects/pages/_list.html.haml' - - 'app/views/projects/pages/_no_domains.html.haml' - - 'app/views/projects/pages/_use.html.haml' - - 'app/views/projects/pages/show.html.haml' - 'app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml' - 'app/views/projects/pipelines/_info.html.haml' - - 'app/views/projects/pipelines/charts/_pipelines.haml' - - 'app/views/projects/protected_branches/shared/_branches_list.html.haml' - - 'app/views/projects/protected_branches/shared/_create_protected_branch.html.haml' - 'app/views/projects/protected_branches/shared/_dropdown.html.haml' - 'app/views/projects/protected_branches/shared/_index.html.haml' - 'app/views/projects/protected_branches/shared/_matching_branch.html.haml' @@ -325,7 +272,6 @@ linters: - 'app/views/projects/runners/_shared_runners.html.haml' - 'app/views/projects/runners/edit.html.haml' - 'app/views/projects/services/_form.html.haml' - - 'app/views/projects/services/_index.html.haml' - 'app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml' - 'app/views/projects/services/mattermost_slash_commands/_help.html.haml' - 'app/views/projects/services/prometheus/_metrics.html.haml' @@ -338,25 +284,21 @@ linters: - 'app/views/projects/tags/releases/edit.html.haml' - 'app/views/projects/tree/_tree_row.html.haml' - 'app/views/projects/tree/_truncated_notice_tree_row.html.haml' - - 'app/views/projects/triggers/_content.html.haml' - 'app/views/projects/triggers/_form.html.haml' - 'app/views/projects/triggers/_index.html.haml' - 'app/views/projects/triggers/_trigger.html.haml' - 'app/views/projects/triggers/edit.html.haml' - - 'app/views/projects/wikis/_new.html.haml' - 'app/views/projects/wikis/_pages_wiki_page.html.haml' - 'app/views/projects/wikis/edit.html.haml' - 'app/views/projects/wikis/history.html.haml' - - 'app/views/repository_check_mailer/notify.html.haml' - - 'app/views/search/_form.html.haml' - 'app/views/search/results/_issue.html.haml' - 'app/views/search/results/_note.html.haml' - 'app/views/search/results/_snippet_blob.html.haml' - 'app/views/search/results/_snippet_title.html.haml' - 'app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml' - 'app/views/shared/_commit_message_container.html.haml' - - 'app/views/shared/_confirm_modal.html.haml' - 'app/views/shared/_confirm_fork_modal.html.haml' + - 'app/views/shared/_confirm_modal.html.haml' - 'app/views/shared/_delete_label_modal.html.haml' - 'app/views/shared/_group_form.html.haml' - 'app/views/shared/_group_tips.html.haml' @@ -364,18 +306,14 @@ linters: - 'app/views/shared/_no_password.html.haml' - 'app/views/shared/_no_ssh.html.haml' - 'app/views/shared/_outdated_browser.html.haml' - - 'app/views/shared/_personal_access_tokens_created_container.html.haml' - - 'app/views/shared/_personal_access_tokens_table.html.haml' - 'app/views/shared/_ping_consent.html.haml' - 'app/views/shared/_project_limit.html.haml' - - 'app/views/shared/_service_settings.html.haml' - 'app/views/shared/boards/components/_board.html.haml' - 'app/views/shared/boards/components/_sidebar.html.haml' - 'app/views/shared/boards/components/sidebar/_due_date.html.haml' - 'app/views/shared/boards/components/sidebar/_labels.html.haml' - 'app/views/shared/boards/components/sidebar/_milestone.html.haml' - 'app/views/shared/deploy_tokens/_revoke_modal.html.haml' - - 'app/views/shared/empty_states/_priority_labels.html.haml' - 'app/views/shared/hook_logs/_content.html.haml' - 'app/views/shared/issuable/_assignees.html.haml' - 'app/views/shared/issuable/_board_create_list_dropdown.html.haml' @@ -400,57 +338,42 @@ linters: - 'app/views/shared/notifications/_button.html.haml' - 'app/views/shared/notifications/_custom_notifications.html.haml' - 'app/views/shared/notifications/_new_button.html.haml' - - 'app/views/shared/notifications/_notification_dropdown.html.haml' - - 'app/views/shared/plugins/_index.html.haml' - - 'app/views/shared/projects/_dropdown.html.haml' - - 'app/views/shared/projects/_list.html.haml' - - 'app/views/shared/projects/_project.html.haml' - 'app/views/shared/runners/_runner_description.html.haml' - 'app/views/shared/runners/show.html.haml' - - 'app/views/shared/snippets/_embed.html.haml' - 'app/views/shared/snippets/_header.html.haml' - 'app/views/shared/snippets/_snippet.html.haml' - - 'app/views/shared/tokens/_scopes_list.html.haml' - 'app/views/shared/web_hooks/_form.html.haml' - 'app/views/shared/web_hooks/_hook.html.haml' - - 'app/views/shared/web_hooks/_test_button.html.haml' - 'app/views/u2f/_authenticate.html.haml' - 'app/views/u2f/_register.html.haml' - 'app/views/users/_deletion_guidance.html.haml' - 'ee/app/views/admin/_namespace_plan_info.html.haml' - 'ee/app/views/admin/application_settings/_templates.html.haml' - 'ee/app/views/admin/audit_logs/index.html.haml' - - 'ee/app/views/admin/dashboard/stats.html.haml' - 'ee/app/views/admin/emails/show.html.haml' - 'ee/app/views/admin/geo/nodes/edit.html.haml' - 'ee/app/views/admin/geo/nodes/new.html.haml' - 'ee/app/views/admin/geo/projects/_registry_failed.html.haml' - 'ee/app/views/admin/geo/projects/_registry_never.html.haml' - - 'ee/app/views/admin/licenses/_breakdown.html.haml' - 'ee/app/views/admin/licenses/_upload_trial_license.html.haml' - - 'ee/app/views/admin/licenses/missing.html.haml' - 'ee/app/views/admin/licenses/new.html.haml' - 'ee/app/views/admin/licenses/show.html.haml' - 'ee/app/views/admin/monitoring/ee/_nav.html.haml' - 'ee/app/views/admin/projects/_shared_runner_status.html.haml' - - 'ee/app/views/admin/push_rules/show.html.haml' + - 'ee/app/views/admin/users/_auditor_access_level_radio.html.haml' + - 'ee/app/views/admin/users/_auditor_user_badge.html.haml' - 'ee/app/views/admin/users/_limits.html.haml' - 'ee/app/views/admin/users/_user_detail_note.html.haml' - 'ee/app/views/dashboard/projects/_blank_state_ee_trial.html.haml' - 'ee/app/views/errors/kerberos_denied.html.haml' - - 'ee/app/views/groups/analytics/show.html.haml' - - 'ee/app/views/groups/audit_events/index.html.haml' - 'ee/app/views/groups/ee/_settings_nav.html.haml' - 'ee/app/views/groups/epics/_epic.html.haml' - 'ee/app/views/groups/group_members/_ldap_sync.html.haml' - 'ee/app/views/groups/group_members/_sync_button.html.haml' - 'ee/app/views/groups/hooks/edit.html.haml' - - 'ee/app/views/groups/hooks/index.html.haml' - 'ee/app/views/groups/ldap_group_links/index.html.haml' - - 'ee/app/views/groups/pipeline_quota/index.html.haml' - 'ee/app/views/jira_connect/subscriptions/index.html.haml' - 'ee/app/views/layouts/jira_connect.html.haml' - - 'ee/app/views/layouts/nav/ee/_epic_link.html.haml' - 'ee/app/views/layouts/nav/ee/admin/_new_monitoring_sidebar.html.haml' - 'ee/app/views/layouts/service_desk.html.haml' - 'ee/app/views/ldap_group_links/_form.html.haml' @@ -466,26 +389,22 @@ linters: - 'ee/app/views/notify/epic_status_changed_email.html.haml' - 'ee/app/views/notify/issues_csv_email.html.haml' - 'ee/app/views/notify/new_review_email.html.haml' - - 'ee/app/views/notify/prometheus_alert_fired_email.html.haml' - 'ee/app/views/notify/send_admin_notification.html.haml' - 'ee/app/views/notify/send_unsubscribed_notification.html.haml' - 'ee/app/views/notify/unapproved_merge_request_email.html.haml' - 'ee/app/views/oauth/geo_auth/error.html.haml' - 'ee/app/views/profiles/pipeline_quota/index.haml' - - 'ee/app/views/projects/audit_events/index.html.haml' - 'ee/app/views/projects/blob/_owners.html.haml' - 'ee/app/views/projects/commits/_mirror_status.html.haml' - - 'ee/app/views/projects/feature_flags/_configure_feature_flags_modal.html.haml' - 'ee/app/views/projects/issues/_issue_weight.html.haml' - - 'ee/app/views/projects/issues/_related_issues.html.haml' - 'ee/app/views/projects/issues/export_csv/_modal.html.haml' - 'ee/app/views/projects/jobs/_shared_runner_limit_warning.html.haml' - 'ee/app/views/projects/merge_requests/_approvals_count.html.haml' - 'ee/app/views/projects/merge_requests/widget/open/_geo.html.haml' - 'ee/app/views/projects/mirrors/_mirrored_repositories_count.html.haml' + - 'ee/app/views/projects/protected_branches/_update_protected_branch.html.haml' - 'ee/app/views/projects/protected_branches/ee/_create_protected_branch.html.haml' - 'ee/app/views/projects/protected_branches/ee/_dropdown.html.haml' - - 'ee/app/views/projects/protected_branches/ee/_fallback_update_protected_branch.html.haml' - 'ee/app/views/projects/protected_tags/_protected_tag_extra_create_access_levels.haml' - 'ee/app/views/projects/protected_tags/ee/_create_protected_tag.html.haml' - 'ee/app/views/projects/push_rules/_index.html.haml' @@ -495,22 +414,16 @@ linters: - 'ee/app/views/projects/settings/slacks/edit.html.haml' - 'ee/app/views/shared/_additional_email_text.html.haml' - 'ee/app/views/shared/_mirror_update_button.html.haml' - - 'ee/app/views/shared/_shared_runners_minutes_limit.html.haml' - - 'ee/app/views/shared/audit_events/_event_table.html.haml' - 'ee/app/views/shared/boards/components/_list_weight.html.haml' - - 'ee/app/views/shared/boards/components/sidebar/_epic.html.haml' - - 'ee/app/views/shared/ee/_import_form.html.haml' - 'ee/app/views/shared/epic/_search_bar.html.haml' - 'ee/app/views/shared/issuable/_approvals.html.haml' - 'ee/app/views/shared/issuable/_board_create_list_dropdown.html.haml' - 'ee/app/views/shared/issuable/_filter_weight.html.haml' - - 'ee/app/views/shared/issuable/_sidebar_item_epic.haml' - 'ee/app/views/shared/members/ee/_ldap_tag.html.haml' - 'ee/app/views/shared/members/ee/_override_member_buttons.html.haml' - 'ee/app/views/shared/members/ee/_sso_badge.html.haml' - 'ee/app/views/shared/milestones/_burndown.html.haml' - 'ee/app/views/shared/milestones/_weight.html.haml' - - 'ee/app/views/shared/promotions/_promote_audit_events.html.haml' - 'ee/app/views/shared/promotions/_promote_burndown_charts.html.haml' - 'ee/app/views/shared/promotions/_promote_csv_export.html.haml' - 'ee/app/views/shared/promotions/_promote_issue_weights.html.haml' @@ -518,7 +431,3 @@ linters: - 'ee/app/views/shared/promotions/_promote_servicedesk.html.haml' - 'ee/app/views/shared/push_rules/_form.html.haml' - 'ee/app/views/unsubscribes/show.html.haml' - - 'ee/app/views/admin/users/_auditor_access_level_radio.html.haml' - - 'ee/app/views/admin/users/_auditor_user_badge.html.haml' - - 'ee/app/views/projects/protected_branches/_update_protected_branch.html.haml' - - 'ee/app/views/analytics/cycle_analytics/show.html.haml' diff --git a/app/assets/javascripts/vue_shared/components/gl_mentions.vue b/app/assets/javascripts/vue_shared/components/gl_mentions.vue new file mode 100644 index 00000000000..bbf293664a6 --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/gl_mentions.vue @@ -0,0 +1,101 @@ +<script> +import escape from 'lodash/escape'; +import sanitize from 'sanitize-html'; +import Tribute from 'tributejs'; +import axios from '~/lib/utils/axios_utils'; +import { spriteIcon } from '~/lib/utils/common_utils'; + +/** + * Creates the HTML template for each row of the mentions dropdown. + * + * @param original An object from the array returned from the `autocomplete_sources/members` API + * @returns {string} An HTML template + */ +function createMenuItemTemplate({ original }) { + const rectAvatarClass = original.type === 'Group' ? 'rect-avatar' : ''; + + const avatarClasses = `avatar avatar-inline center s26 ${rectAvatarClass} + align-items-center d-inline-flex justify-content-center`; + + const avatarTag = original.avatar_url + ? `<img + src="${original.avatar_url}" + alt="${original.username}'s avatar" + class="${avatarClasses}"/>` + : `<div class="${avatarClasses}">${original.username.charAt(0).toUpperCase()}</div>`; + + const name = escape(sanitize(original.name)); + + const count = original.count && !original.mentionsDisabled ? ` (${original.count})` : ''; + + const icon = original.mentionsDisabled + ? spriteIcon('notifications-off', 's16 vertical-align-middle prepend-left-5') + : ''; + + return `${avatarTag} + ${original.username} + <small class="small font-weight-normal gl-color-inherit">${name}${count}</small> + ${icon}`; +} + +/** + * Creates the list of users to show in the mentions dropdown. + * + * @param inputText The text entered by the user in the mentions input field + * @param processValues Callback function to set the list of users to show in the mentions dropdown + */ +function getMembers(inputText, processValues) { + if (this.members) { + processValues(this.members); + } else if (this.dataSources.members) { + axios + .get(this.dataSources.members) + .then(response => { + this.members = response.data; + processValues(response.data); + }) + .catch(() => {}); + } else { + processValues([]); + } +} + +export default { + name: 'GlMentions', + props: { + dataSources: { + type: Object, + required: false, + default: () => gl.GfmAutoComplete?.dataSources || {}, + }, + }, + data() { + return { + members: undefined, + options: { + trigger: '@', + fillAttr: 'username', + lookup(value) { + return value.name + value.username; + }, + menuItemTemplate: createMenuItemTemplate.bind(this), + values: getMembers.bind(this), + }, + }; + }, + mounted() { + const input = this.$slots.default[0].elm; + this.tribute = new Tribute(this.options); + this.tribute.attach(input); + }, + beforeDestroy() { + const input = this.$slots.default[0].elm; + if (this.tribute) { + this.tribute.detach(input); + } + }, + render(h) { + return h('div', this.$slots.default); + }, +}; +</script> diff --git a/app/assets/stylesheets/vendors/tribute.scss b/app/assets/stylesheets/vendors/tribute.scss new file mode 100644 index 00000000000..95b1d80a586 --- /dev/null +++ b/app/assets/stylesheets/vendors/tribute.scss @@ -0,0 +1,41 @@ +.tribute-container { + background: $white-light; + border: 1px solid $gl-gray-100; + border-radius: $border-radius-base; + box-shadow: 0 0 5px $issue-boards-card-shadow; + color: $black; + margin-top: $gl-padding-12; + max-height: 200px; + min-width: 120px; + overflow-y: auto; + z-index: 11110 !important; + + ul { + list-style: none; + margin-bottom: 0; + padding: $gl-padding-8 1px; + } + + li { + cursor: pointer; + padding: $gl-padding-8 $gl-padding; + white-space: nowrap; + + small { + color: $gl-gray-500; + } + + &.highlight { + background-color: $gray-darker; + + .avatar { + @include disable-all-animation; + border: 1px solid $white-light; + } + + small { + color: inherit; + } + } + } +} diff --git a/app/workers/namespaces/root_statistics_worker.rb b/app/workers/namespaces/root_statistics_worker.rb index 5fceeb8e03d..70b2510488b 100644 --- a/app/workers/namespaces/root_statistics_worker.rb +++ b/app/workers/namespaces/root_statistics_worker.rb @@ -16,13 +16,7 @@ module Namespaces namespace.aggregation_schedule.destroy rescue ::Namespaces::StatisticsRefresherService::RefresherError, ActiveRecord::RecordNotFound => ex - log_error(namespace.full_path, ex.message) if namespace - end - - private - - def log_error(namespace_path, error_message) - Gitlab::SidekiqLogger.error("Namespace statistics can't be updated for #{namespace_path}: #{error_message}") + Gitlab::ErrorTracking.track_exception(ex, namespace_id: namespace_id, namespace: namespace&.full_path) end end end diff --git a/app/workers/namespaces/schedule_aggregation_worker.rb b/app/workers/namespaces/schedule_aggregation_worker.rb index 60210e2f5a7..94343a9e378 100644 --- a/app/workers/namespaces/schedule_aggregation_worker.rb +++ b/app/workers/namespaces/schedule_aggregation_worker.rb @@ -16,8 +16,8 @@ module Namespaces return if root_ancestor.aggregation_scheduled? Namespace::AggregationSchedule.safe_find_or_create_by!(namespace_id: root_ancestor.id) - rescue ActiveRecord::RecordNotFound - log_error(namespace_id) + rescue ActiveRecord::RecordNotFound => ex + Gitlab::ErrorTracking.track_exception(ex, namespace_id: namespace_id) end private @@ -34,9 +34,5 @@ module Namespaces Namespace::AggregationSchedule.table_exists? end - - def log_error(root_ancestor_id) - Gitlab::SidekiqLogger.error("Namespace can't be scheduled for aggregation: #{root_ancestor_id} does not exist") - end end end diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 88e198116a0..fa4fc2d2c7b 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -108,6 +108,11 @@ end Sidekiq.configure_client do |config| config.redis = queues_config_hash + # We only need to do this for other clients. If Sidekiq-server is the + # client scheduling jobs, we have access to the regular sidekiq logger that + # writes to STDOUT + Sidekiq.logger = Gitlab::SidekiqLogging::ClientLogger.build + Sidekiq.logger.formatter = Gitlab::SidekiqLogging::JSONFormatter.new if enable_json_logs config.client_middleware(&Gitlab::SidekiqMiddleware.client_configurator) end diff --git a/config/webpack.config.js b/config/webpack.config.js index 05a217c04fe..e220482d769 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -161,7 +161,9 @@ module.exports = { }, { test: /\.js$/, - exclude: path => /node_modules|vendor[\\/]assets/.test(path) && !/\.vue\.js/.test(path), + exclude: path => + /node_modules\/(?!tributejs)|node_modules|vendor[\\/]assets/.test(path) && + !/\.vue\.js/.test(path), loader: 'babel-loader', options: { cacheDirectory: path.join(CACHE_PATH, 'babel-loader'), diff --git a/doc/administration/logs.md b/doc/administration/logs.md index e45e39c4651..222d79ddc35 100644 --- a/doc/administration/logs.md +++ b/doc/administration/logs.md @@ -400,6 +400,21 @@ For source installations, edit the `gitlab.yml` and set the Sidekiq log_format: json ``` +## `sidekiq_client.log` + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26586) in GitLab 12.9. + +This file lives in `/var/log/gitlab/gitlab-rails/sidekiq_client.log` for +Omnibus GitLab packages or in `/home/git/gitlab/log/sidekiq_client.log` for +installations from source. + +This file contains logging information about jobs before they are start +being processed by Sidekiq, for example before being enqueued. + +This logfile follows the same structure as +[`sidekiq.log`](#sidekiqlog), so it will be structured as JSON if +you've configured this for Sidekiq as mentioned above. + ## `gitlab-shell.log` This file lives in `/var/log/gitlab/gitaly/gitlab-shell.log` for diff --git a/doc/api/audit_events.md b/doc/api/audit_events.md index cba7da4ac1b..944d99d8eab 100644 --- a/doc/api/audit_events.md +++ b/doc/api/audit_events.md @@ -91,6 +91,10 @@ Example response: GET /audit_events/:id ``` +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of the audit event | + ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/audit_events/1 ``` @@ -195,7 +199,7 @@ GET /groups/:id/audit_events/:audit_event_id | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | -| `audit_event_id` | integer | yes | ID of the audit event | +| `audit_event_id` | integer | yes | The ID of the audit event | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/groups/60/audit_events/2 diff --git a/doc/development/mass_insert.md b/doc/development/mass_insert.md index 891ce0db87d..47f993a921e 100644 --- a/doc/development/mass_insert.md +++ b/doc/development/mass_insert.md @@ -9,5 +9,5 @@ the following snippet in the rails console. ```ruby u = User.find(1) -Project.last(100).each { |p| p.set_create_timestamps && p.add_maintainer(u, current_user: u) } # Change 100 to whatever number of projects you need access to +Project.last(100).each { |p| p.set_timestamps_for_create && p.add_maintainer(u, current_user: u) } # Change 100 to whatever number of projects you need access to ``` diff --git a/lib/gitlab/sidekiq_logging/client_logger.rb b/lib/gitlab/sidekiq_logging/client_logger.rb new file mode 100644 index 00000000000..8be755a55db --- /dev/null +++ b/lib/gitlab/sidekiq_logging/client_logger.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Gitlab + module SidekiqLogging + class ClientLogger < Gitlab::Logger + def self.file_name_noext + 'sidekiq_client' + end + end + end +end diff --git a/package.json b/package.json index 77d5f154091..d2e2d436a6e 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "tiptap": "^1.8.0", "tiptap-commands": "^1.4.0", "tiptap-extensions": "^1.8.0", + "tributejs": "4.1.3", "underscore": "^1.9.0", "unfetch": "^4.1.0", "url-loader": "^2.1.0", diff --git a/spec/frontend/vue_shared/components/gl_mentions_spec.js b/spec/frontend/vue_shared/components/gl_mentions_spec.js new file mode 100644 index 00000000000..32fc055a77d --- /dev/null +++ b/spec/frontend/vue_shared/components/gl_mentions_spec.js @@ -0,0 +1,34 @@ +import { shallowMount } from '@vue/test-utils'; +import Tribute from 'tributejs'; +import GlMentions from '~/vue_shared/components/gl_mentions.vue'; + +describe('GlMentions', () => { + let wrapper; + + describe('Tribute', () => { + const mentions = '/gitlab-org/gitlab-test/-/autocomplete_sources/members?type=Issue&type_id=1'; + + beforeEach(() => { + wrapper = shallowMount(GlMentions, { + propsData: { + dataSources: { + mentions, + }, + }, + slots: { + default: ['<input/>'], + }, + }); + }); + + it('is set to tribute instance variable', () => { + expect(wrapper.vm.tribute instanceof Tribute).toBe(true); + }); + + it('contains the slot input element', () => { + wrapper.find('input').setValue('@'); + + expect(wrapper.vm.tribute.current.element).toBe(wrapper.find('input').element); + }); + }); +}); diff --git a/spec/workers/namespaces/root_statistics_worker_spec.rb b/spec/workers/namespaces/root_statistics_worker_spec.rb index 6bbdfe03ceb..45e75c9b0da 100644 --- a/spec/workers/namespaces/root_statistics_worker_spec.rb +++ b/spec/workers/namespaces/root_statistics_worker_spec.rb @@ -42,7 +42,7 @@ describe Namespaces::RootStatisticsWorker, '#perform' do allow_any_instance_of(Namespace::AggregationSchedule) .to receive(:schedule_root_storage_statistics).and_return(nil) - expect(Gitlab::SidekiqLogger).to receive(:error).once + expect(Gitlab::ErrorTracking).to receive(:track_exception).once worker.perform(group.id) end diff --git a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb index be722f451e0..a2ce9891b5f 100644 --- a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb +++ b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb @@ -48,7 +48,7 @@ describe Namespaces::ScheduleAggregationWorker, '#perform', :clean_gitlab_redis_ context 'when namespace does not exist' do it 'logs the error' do - expect(Gitlab::SidekiqLogger).to receive(:error).once + expect(Gitlab::ErrorTracking).to receive(:track_exception).once worker.perform(12345) end diff --git a/yarn.lock b/yarn.lock index 772951f7b98..10d46bba902 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11273,6 +11273,11 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +tributejs@4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/tributejs/-/tributejs-4.1.3.tgz#2e1be7d9a1e403ed4c394f91d859812267e4691c" + integrity sha512-+VUqyi8p7tCdaqCINCWHf95E2hJFMIML180BhplTpXNooz3E2r96AONXI9qO2Ru6Ugp7MsMPJjB+rnBq+hAmzA== + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" |