summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 12:08:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 12:08:40 +0000
commitbe3e24ea3c9f497efde85900df298ce9bc42fce8 (patch)
treefd0de9443253a1b21ca9a2741dc34ba3aef795be /app
parent001243986195143c395a9811d8254bbf1b9ebfa1 (diff)
downloadgitlab-ce-be3e24ea3c9f497efde85900df298ce9bc42fce8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes/components/discussion_filter_note.vue6
-rw-r--r--app/assets/javascripts/notes/components/note_attachment.vue16
-rw-r--r--app/assets/javascripts/notes/components/note_header.vue7
-rw-r--r--app/assets/javascripts/releases/list/components/release_block.vue12
-rw-r--r--app/graphql/types/blob_viewers/type_enum.rb14
-rw-r--r--app/graphql/types/snippet_type.rb8
-rw-r--r--app/graphql/types/snippets/blob_type.rb46
-rw-r--r--app/graphql/types/snippets/blob_viewer_type.rb41
-rw-r--r--app/models/epic.rb2
-rw-r--r--app/presenters/blob_presenter.rb6
-rw-r--r--app/presenters/snippet_blob_presenter.rb31
-rw-r--r--app/services/submit_usage_ping_service.rb6
-rw-r--r--app/workers/all_queues.yml129
13 files changed, 233 insertions, 91 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_filter_note.vue b/app/assets/javascripts/notes/components/discussion_filter_note.vue
index 889731df180..8dc4b43d69a 100644
--- a/app/assets/javascripts/notes/components/discussion_filter_note.vue
+++ b/app/assets/javascripts/notes/components/discussion_filter_note.vue
@@ -38,12 +38,12 @@ export default {
<icon name="comment" />
</div>
<div class="timeline-content">
- <div v-html="timelineContent"></div>
+ <div ref="timelineContent" v-html="timelineContent"></div>
<div class="discussion-filter-actions mt-2">
- <gl-button variant="default" @click="selectFilter(0)">
+ <gl-button ref="showAllActivity" variant="default" @click="selectFilter(0)">
{{ __('Show all activity') }}
</gl-button>
- <gl-button variant="default" @click="selectFilter(1)">
+ <gl-button ref="showComments" variant="default" @click="selectFilter(1)">
{{ __('Show comments only') }}
</gl-button>
</div>
diff --git a/app/assets/javascripts/notes/components/note_attachment.vue b/app/assets/javascripts/notes/components/note_attachment.vue
index b6d8c831e2e..72f9a4c7e74 100644
--- a/app/assets/javascripts/notes/components/note_attachment.vue
+++ b/app/assets/javascripts/notes/components/note_attachment.vue
@@ -12,11 +12,23 @@ export default {
<template>
<div class="note-attachment">
- <a v-if="attachment.image" :href="attachment.url" target="_blank" rel="noopener noreferrer">
+ <a
+ v-if="attachment.image"
+ ref="attachmentImage"
+ :href="attachment.url"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
<img :src="attachment.url" class="note-image-attach" />
</a>
<div class="attachment">
- <a v-if="attachment.url" :href="attachment.url" target="_blank" rel="noopener noreferrer">
+ <a
+ v-if="attachment.url"
+ ref="attachmentUrl"
+ :href="attachment.url"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
<i class="fa fa-paperclip" aria-hidden="true"> </i> {{ attachment.filename }}
</a>
</div>
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue
index e4f09492d9c..16351baedb7 100644
--- a/app/assets/javascripts/notes/components/note_header.vue
+++ b/app/assets/javascripts/notes/components/note_header.vue
@@ -63,13 +63,13 @@ export default {
<template>
<div class="note-header-info">
- <div v-if="includeToggle" class="discussion-actions">
+ <div v-if="includeToggle" ref="discussionActions" class="discussion-actions">
<button
class="note-action-button discussion-toggle-button js-vue-toggle-button"
type="button"
@click="handleToggle"
>
- <i :class="toggleChevronClass" class="fa" aria-hidden="true"></i>
+ <i ref="chevronIcon" :class="toggleChevronClass" class="fa" aria-hidden="true"></i>
{{ __('Toggle thread') }}
</button>
</div>
@@ -90,10 +90,11 @@ export default {
<span class="note-headline-light note-headline-meta">
<span class="system-note-message"> <slot></slot> </span>
<template v-if="createdAt">
- <span class="system-note-separator">
+ <span ref="actionText" class="system-note-separator">
<template v-if="actionText">{{ actionText }}</template>
</span>
<a
+ ref="noteTimestamp"
:href="noteTimestampLink"
class="note-timestamp system-note-separator"
@click="updateTargetNoteHash"
diff --git a/app/assets/javascripts/releases/list/components/release_block.vue b/app/assets/javascripts/releases/list/components/release_block.vue
index d924b5795f0..e6bb5325120 100644
--- a/app/assets/javascripts/releases/list/components/release_block.vue
+++ b/app/assets/javascripts/releases/list/components/release_block.vue
@@ -1,9 +1,11 @@
<script>
import _ from 'underscore';
+import $ from 'jquery';
import { slugify } from '~/lib/utils/text_utility';
import { getLocationHash } from '~/lib/utils/url_utility';
import { scrollToElement } from '~/lib/utils/common_utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
+import '~/behaviors/markdown/render_gfm';
import EvidenceBlock from './evidence_block.vue';
import ReleaseBlockAssets from './release_block_assets.vue';
import ReleaseBlockFooter from './release_block_footer.vue';
@@ -65,7 +67,10 @@ export default {
return Boolean(this.glFeatures.releaseIssueSummary && !_.isEmpty(this.release.milestones));
},
},
+
mounted() {
+ this.renderGFM();
+
const hash = getLocationHash();
if (hash && slugify(hash) === this.id) {
this.isHighlighted = true;
@@ -76,6 +81,11 @@ export default {
scrollToElement(this.$el);
}
},
+ methods: {
+ renderGFM() {
+ $(this.$refs['gfm-content']).renderGFM();
+ },
+ },
};
</script>
<template>
@@ -91,7 +101,7 @@ export default {
<release-block-assets v-if="shouldRenderAssets" :assets="assets" />
<evidence-block v-if="hasEvidence && shouldShowEvidence" :release="release" />
- <div class="card-text prepend-top-default">
+ <div ref="gfm-content" class="card-text prepend-top-default">
<div v-html="release.description_html"></div>
</div>
</div>
diff --git a/app/graphql/types/blob_viewers/type_enum.rb b/app/graphql/types/blob_viewers/type_enum.rb
new file mode 100644
index 00000000000..35e659197e5
--- /dev/null
+++ b/app/graphql/types/blob_viewers/type_enum.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module Types
+ module BlobViewers
+ class TypeEnum < BaseEnum
+ graphql_name 'BlobViewersType'
+ description 'Types of blob viewers'
+
+ value 'rich', value: :rich
+ value 'simple', value: :simple
+ value 'auxiliary', value: :auxiliary
+ end
+ end
+end
diff --git a/app/graphql/types/snippet_type.rb b/app/graphql/types/snippet_type.rb
index 3f780528945..c4d65174990 100644
--- a/app/graphql/types/snippet_type.rb
+++ b/app/graphql/types/snippet_type.rb
@@ -36,10 +36,6 @@ module Types
description: 'File Name of the snippet',
null: true
- field :content, GraphQL::STRING_TYPE,
- description: 'Content of the snippet',
- null: false
-
field :description, GraphQL::STRING_TYPE,
description: 'Description of the snippet',
null: true
@@ -64,6 +60,10 @@ module Types
description: 'Raw URL of the snippet',
null: false
+ field :blob, type: Types::Snippets::BlobType,
+ description: 'Snippet blob',
+ null: false
+
markdown_field :description_html, null: true, method: :description
end
end
diff --git a/app/graphql/types/snippets/blob_type.rb b/app/graphql/types/snippets/blob_type.rb
new file mode 100644
index 00000000000..f398fe9c121
--- /dev/null
+++ b/app/graphql/types/snippets/blob_type.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+module Types
+ module Snippets
+ # rubocop: disable Graphql/AuthorizeTypes
+ class BlobType < BaseObject
+ graphql_name 'SnippetBlob'
+ description 'Represents the snippet blob'
+ present_using SnippetBlobPresenter
+
+ field :highlighted_data, GraphQL::STRING_TYPE,
+ description: 'Blob highlighted data',
+ null: true
+
+ field :raw_path, GraphQL::STRING_TYPE,
+ description: 'Blob raw content endpoint path',
+ null: false
+
+ field :size, GraphQL::INT_TYPE,
+ description: 'Blob size',
+ null: false
+
+ field :binary, GraphQL::BOOLEAN_TYPE,
+ description: 'Shows whether the blob is binary',
+ method: :binary?,
+ null: false
+
+ field :name, GraphQL::STRING_TYPE,
+ description: 'Blob name',
+ null: true
+
+ field :path, GraphQL::STRING_TYPE,
+ description: 'Blob path',
+ null: true
+
+ field :simple_viewer, type: Types::Snippets::BlobViewerType,
+ description: 'Blob content simple viewer',
+ null: false
+
+ field :rich_viewer, type: Types::Snippets::BlobViewerType,
+ description: 'Blob content rich viewer',
+ null: true
+ end
+ # rubocop: enable Graphql/AuthorizeTypes
+ end
+end
diff --git a/app/graphql/types/snippets/blob_viewer_type.rb b/app/graphql/types/snippets/blob_viewer_type.rb
new file mode 100644
index 00000000000..3e653576d07
--- /dev/null
+++ b/app/graphql/types/snippets/blob_viewer_type.rb
@@ -0,0 +1,41 @@
+# frozen_string_literal: true
+
+module Types
+ module Snippets
+ class BlobViewerType < BaseObject # rubocop:disable Graphql/AuthorizeTypes
+ graphql_name 'SnippetBlobViewer'
+ description 'Represents how the blob content should be displayed'
+
+ field :type, Types::BlobViewers::TypeEnum,
+ description: 'Type of blob viewer',
+ null: false
+
+ field :load_async, GraphQL::BOOLEAN_TYPE,
+ description: 'Shows whether the blob content is loaded async',
+ null: false
+
+ field :collapsed, GraphQL::BOOLEAN_TYPE,
+ description: 'Shows whether the blob should be displayed collapsed',
+ method: :collapsed?,
+ null: false
+
+ field :too_large, GraphQL::BOOLEAN_TYPE,
+ description: 'Shows whether the blob too large to be displayed',
+ method: :too_large?,
+ null: false
+
+ field :render_error, GraphQL::STRING_TYPE,
+ description: 'Error rendering the blob content',
+ null: true
+
+ field :file_type, GraphQL::STRING_TYPE,
+ description: 'Content file type',
+ method: :partial_name,
+ null: false
+
+ field :loading_partial_name, GraphQL::STRING_TYPE,
+ description: 'Loading partial name',
+ null: false
+ end
+ end
+end
diff --git a/app/models/epic.rb b/app/models/epic.rb
index 1203c6c1fc3..ea4a231931d 100644
--- a/app/models/epic.rb
+++ b/app/models/epic.rb
@@ -5,8 +5,6 @@
class Epic < ApplicationRecord
include IgnorableColumns
- ignore_column :milestone_id, remove_after: '2020-02-01', remove_with: '12.8'
-
def self.link_reference_pattern
nil
end
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 3a71d2b87f3..e0077db8d5c 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -9,7 +9,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
Gitlab::Highlight.highlight(
blob.path,
limited_blob_data(to: to),
- language: blob.language_from_gitattributes,
+ language: language,
plain: plain
)
end
@@ -37,4 +37,8 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
def all_lines
@all_lines ||= blob.data.lines
end
+
+ def language
+ blob.language_from_gitattributes
+ end
end
diff --git a/app/presenters/snippet_blob_presenter.rb b/app/presenters/snippet_blob_presenter.rb
new file mode 100644
index 00000000000..9baaacdbb24
--- /dev/null
+++ b/app/presenters/snippet_blob_presenter.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class SnippetBlobPresenter < BlobPresenter
+ def highlighted_data
+ return if blob.binary?
+
+ if blob.rich_viewer&.partial_name == 'markup'
+ blob.rendered_markup
+ else
+ highlight
+ end
+ end
+
+ def raw_path
+ if snippet.is_a?(ProjectSnippet)
+ raw_project_snippet_path(snippet.project, snippet)
+ else
+ raw_snippet_path(snippet)
+ end
+ end
+
+ private
+
+ def snippet
+ blob.snippet
+ end
+
+ def language
+ nil
+ end
+end
diff --git a/app/services/submit_usage_ping_service.rb b/app/services/submit_usage_ping_service.rb
index 7927ab265c5..3265eb106eb 100644
--- a/app/services/submit_usage_ping_service.rb
+++ b/app/services/submit_usage_ping_service.rb
@@ -36,10 +36,12 @@ class SubmitUsagePingService
private
def store_metrics(response)
- return unless response['conv_index'].present?
+ metrics = response['conv_index'] || response['dev_ops_score']
+
+ return unless metrics.present?
DevOpsScore::Metric.create!(
- response['conv_index'].slice(*METRICS)
+ metrics.slice(*METRICS)
)
end
end
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index f19dd0e4a48..87feecf4bbb 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -1,93 +1,93 @@
+# This file is generated automatically by
+# bin/rake gitlab:sidekiq:all_queues_yml:generate
+#
+# Do not edit it manually!
---
- auto_devops:auto_devops_disable
-
- auto_merge:auto_merge_process
-
- chaos:chaos_cpu_spin
- chaos:chaos_db_spin
- chaos:chaos_kill
- chaos:chaos_leak_mem
- chaos:chaos_sleep
-
+- container_repository:cleanup_container_repository
+- container_repository:delete_container_repository
- cronjob:admin_email
+- cronjob:ci_archive_traces_cron
- cronjob:container_expiration_policy
- cronjob:expire_build_artifacts
- cronjob:gitlab_usage_ping
- cronjob:import_export_project_cleanup
-- cronjob:pages_domain_verification_cron
+- cronjob:issue_due_scheduler
+- cronjob:namespaces_prune_aggregation_schedules
- cronjob:pages_domain_removal_cron
- cronjob:pages_domain_ssl_renewal_cron
+- cronjob:pages_domain_verification_cron
- cronjob:personal_access_tokens_expiring
- cronjob:pipeline_schedule
- cronjob:prune_old_events
+- cronjob:prune_web_hook_logs
- cronjob:remove_expired_group_links
- cronjob:remove_expired_members
- cronjob:remove_unreferenced_lfs_objects
- cronjob:repository_archive_cache
- cronjob:repository_check_dispatch
- cronjob:requests_profiles
+- cronjob:schedule_migrate_external_diffs
- cronjob:stuck_ci_jobs
- cronjob:stuck_import_jobs
- cronjob:stuck_merge_jobs
-- cronjob:ci_archive_traces_cron
- cronjob:trending_projects
-- cronjob:issue_due_scheduler
-- cronjob:prune_web_hook_logs
-- cronjob:schedule_migrate_external_diffs
-- cronjob:namespaces_prune_aggregation_schedules
-
+- deployment:deployments_finished
+- deployment:deployments_success
+- gcp_cluster:cluster_configure
- gcp_cluster:cluster_install_app
- gcp_cluster:cluster_patch_app
-- gcp_cluster:cluster_upgrade_app
+- gcp_cluster:cluster_project_configure
- gcp_cluster:cluster_provision
-- gcp_cluster:clusters_cleanup_app
-- gcp_cluster:clusters_cleanup_project_namespace
-- gcp_cluster:clusters_cleanup_service_account
+- gcp_cluster:cluster_upgrade_app
- gcp_cluster:cluster_wait_for_app_installation
-- gcp_cluster:wait_for_cluster_creation
- gcp_cluster:cluster_wait_for_ingress_ip_address
-- gcp_cluster:cluster_configure
-- gcp_cluster:cluster_project_configure
-- gcp_cluster:clusters_applications_wait_for_uninstall_app
+- gcp_cluster:clusters_applications_activate_service
+- gcp_cluster:clusters_applications_deactivate_service
- gcp_cluster:clusters_applications_uninstall
+- gcp_cluster:clusters_applications_wait_for_uninstall_app
- gcp_cluster:clusters_cleanup_app
- gcp_cluster:clusters_cleanup_project_namespace
- gcp_cluster:clusters_cleanup_service_account
-- gcp_cluster:clusters_applications_activate_service
-- gcp_cluster:clusters_applications_deactivate_service
-
-- github_import_advance_stage
+- gcp_cluster:wait_for_cluster_creation
- github_importer:github_import_import_diff_note
- github_importer:github_import_import_issue
-- github_importer:github_import_import_note
- github_importer:github_import_import_lfs_object
+- github_importer:github_import_import_note
- github_importer:github_import_import_pull_request
- github_importer:github_import_refresh_import_jid
- github_importer:github_import_stage_finish_import
- github_importer:github_import_stage_import_base_data
- github_importer:github_import_stage_import_issues_and_diff_notes
-- github_importer:github_import_stage_import_notes
- github_importer:github_import_stage_import_lfs_objects
+- github_importer:github_import_stage_import_notes
- github_importer:github_import_stage_import_pull_requests
- github_importer:github_import_stage_import_repository
-
- hashed_storage:hashed_storage_migrator
-- hashed_storage:hashed_storage_rollbacker
- hashed_storage:hashed_storage_project_migrate
- hashed_storage:hashed_storage_project_rollback
-
+- hashed_storage:hashed_storage_rollbacker
- mail_scheduler:mail_scheduler_issue_due
- mail_scheduler:mail_scheduler_notification_service
-
+- notifications:new_release
+- object_pool:object_pool_create
+- object_pool:object_pool_destroy
+- object_pool:object_pool_join
+- object_pool:object_pool_schedule_join
- object_storage:object_storage_background_move
- object_storage:object_storage_migrate_uploads
-
+- pipeline_background:archive_trace
+- pipeline_background:ci_build_trace_chunk_flush
- pipeline_cache:expire_job_cache
- pipeline_cache:expire_pipeline_cache
- pipeline_creation:create_pipeline
- pipeline_creation:run_pipeline_schedule
-- pipeline_background:archive_trace
-- pipeline_background:ci_build_trace_chunk_flush
- pipeline_default:build_coverage
- pipeline_default:build_trace_sections
- pipeline_default:pipeline_metrics
@@ -95,74 +95,67 @@
- pipeline_hooks:build_hooks
- pipeline_hooks:pipeline_hooks
- pipeline_processing:build_finished
-- pipeline_processing:ci_build_prepare
- pipeline_processing:build_queue
- pipeline_processing:build_success
+- pipeline_processing:ci_build_prepare
+- pipeline_processing:ci_build_schedule
+- pipeline_processing:ci_resource_groups_assign_resource_from_resource_group
- pipeline_processing:pipeline_process
- pipeline_processing:pipeline_success
- pipeline_processing:pipeline_update
- pipeline_processing:stage_update
- pipeline_processing:update_head_pipeline_for_merge_request
-- pipeline_processing:ci_build_schedule
-- pipeline_processing:ci_resource_groups_assign_resource_from_resource_group
-
-- deployment:deployments_success
-- deployment:deployments_finished
-
-- repository_check:repository_check_clear
- repository_check:repository_check_batch
+- repository_check:repository_check_clear
- repository_check:repository_check_single_repository
-
- todos_destroyer:todos_destroyer_confidential_issue
- todos_destroyer:todos_destroyer_entity_leave
- todos_destroyer:todos_destroyer_group_private
-- todos_destroyer:todos_destroyer_project_private
- todos_destroyer:todos_destroyer_private_features
-
-- update_namespace_statistics:namespaces_schedule_aggregation
+- todos_destroyer:todos_destroyer_project_private
- update_namespace_statistics:namespaces_root_statistics
-
-- object_pool:object_pool_create
-- object_pool:object_pool_schedule_join
-- object_pool:object_pool_join
-- object_pool:object_pool_destroy
-
-- container_repository:delete_container_repository
-- container_repository:cleanup_container_repository
-
-- notifications:new_release
-
-- default
-- mailers # ActionMailer::DeliveryJob.queue_name
-
+- update_namespace_statistics:namespaces_schedule_aggregation
- authorized_projects
- background_migration
- chat_notification
+- create_evidence
- create_gpg_signature
+- create_note_diff_file
+- default
+- delete_diff_files
- delete_merged_branches
+- delete_stored_files
- delete_user
+- detect_repository_languages
- email_receiver
- emails_on_push
- error_tracking_issue_link
- expire_build_instance_artifacts
+- file_hook
- git_garbage_collect
+- github_import_advance_stage
- gitlab_shell
- group_destroy
+- group_export
+- import_issues_csv
- invalid_gpg_signature_update
- irker
+- mailers
- merge
+- merge_request_mergeability_check
- migrate_external_diffs
- namespaceless_project_destroy
- new_issue
- new_merge_request
- new_note
- pages
-- pages_domain_verification
- pages_domain_ssl_renewal
-- file_hook
+- pages_domain_verification
+- phabricator_import_import_tasks
- post_receive
- process_commit
- project_cache
+- project_daily_statistics
- project_destroy
- project_export
- project_service
@@ -170,26 +163,16 @@
- reactive_caching
- rebase
- remote_mirror_notification
+- repository_cleanup
- repository_fork
- repository_import
- repository_remove_remote
+- repository_update_remote_mirror
+- self_monitoring_project_create
+- self_monitoring_project_delete
- system_hook_push
- update_external_pull_requests
- update_merge_requests
- update_project_statistics
- upload_checksum
- web_hook
-- repository_update_remote_mirror
-- create_note_diff_file
-- delete_diff_files
-- detect_repository_languages
-- repository_cleanup
-- delete_stored_files
-- import_issues_csv
-- project_daily_statistics
-- create_evidence
-- group_export
-- self_monitoring_project_create
-- self_monitoring_project_delete
-- merge_request_mergeability_check
-- phabricator_import_import_tasks