diff --git a/.gitignore b/.gitignore index 388718898e4..9d9730bf406 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ ee/changelogs/unreleased-ee tags.lock tags.temp .stylelintcache +.solargraph.yml diff --git a/.solargraph.yml.example b/.solargraph.yml.example new file mode 100644 index 00000000000..ff8225eb73c --- /dev/null +++ b/.solargraph.yml.example @@ -0,0 +1,16 @@ +--- +include: +- "**/*.rb" +exclude: +- "**/spec/**/*" +- qa/qa/specs/features/**/* +- vendor/**/* +- ".bundle/**/*" +require: [] +domains: [] +reporters: +- rubocop +- require_not_found +require_paths: [] +plugins: [] +max_files: 15000 diff --git a/Gemfile b/Gemfile index 556b40317a7..bca5b1607b6 100644 --- a/Gemfile +++ b/Gemfile @@ -346,6 +346,7 @@ end group :development do gem 'lefthook', '~> 0.7.0', require: false + gem 'solargraph', '~> 0.40.4', require: false gem 'letter_opener_web', '~> 1.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 358d58cf566..4fac86a77e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,10 +133,12 @@ GEM net-http-persistent (~> 4.0) nokogiri (~> 1.11.0.rc2) babosa (1.0.2) + backport (1.1.2) base32 (0.3.2) batch-loader (2.0.1) bcrypt (3.1.16) bcrypt_pbkdf (1.0.0) + benchmark (0.1.1) benchmark-ips (2.3.0) benchmark-memory (0.1.2) memory_profiler (~> 0.9) @@ -306,6 +308,7 @@ GEM dry-equalizer (~> 0.3) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) + e2mmap (0.1.0) ecma-re-validator (0.2.1) regexp_parser (~> 1.2) ed25519 (1.2.4) @@ -633,6 +636,7 @@ GEM jaeger-client (1.1.0) opentracing (~> 0.3) thrift + jaro_winkler (1.5.4) jira-ruby (2.1.4) activesupport atlassian-jwt @@ -1194,6 +1198,20 @@ GEM slop (3.6.0) snowplow-tracker (0.6.1) contracts (~> 0.7, <= 0.11) + solargraph (0.40.4) + backport (~> 1.1) + benchmark + bundler (>= 1.17.2) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) @@ -1334,6 +1352,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yajl-ruby (1.4.1) + yard (0.9.26) zeitwerk (2.4.2) PLATFORMS @@ -1587,6 +1606,7 @@ DEPENDENCIES simplecov-cobertura (~> 1.3.1) slack-messenger (~> 2.3.4) snowplow-tracker (~> 0.6.1) + solargraph (~> 0.40.4) spring (~> 2.1.0) spring-commands-rspec (~> 1.0.4) sprockets (~> 3.7.0) diff --git a/app/assets/javascripts/pages/projects/snippets/show/index.js b/app/assets/javascripts/pages/projects/snippets/show/index.js index f955a41e18a..c719601ee0b 100644 --- a/app/assets/javascripts/pages/projects/snippets/show/index.js +++ b/app/assets/javascripts/pages/projects/snippets/show/index.js @@ -1 +1,9 @@ import '~/snippet/snippet_show'; + +const awardEmojiEl = document.getElementById('js-vue-awards-block'); + +if (awardEmojiEl) { + import('~/emoji/awards_app') + .then((m) => m.default(awardEmojiEl)) + .catch(() => {}); +} diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index 63048777724..47505093140 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -25,6 +25,10 @@ export default { type: Object, required: true, }, + showLinks: { + type: Boolean, + required: true, + }, viewType: { type: String, required: true, @@ -91,8 +95,8 @@ export default { collectMetrics: true, }; }, - shouldHideLinks() { - return this.isStageView; + showJobLinks() { + return !this.isStageView && this.showLinks; }, shouldShowStageName() { return !this.isStageView; @@ -188,6 +192,7 @@ export default { :config-paths="configPaths" :linked-pipelines="upstreamPipelines" :column-title="__('Upstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.UPSTREAM" :view-type="viewType" @error="onError" @@ -202,9 +207,8 @@ export default { :container-measurements="measurements" :highlighted-job="hoveredJobName" :metrics-config="metricsConfig" - :never-show-links="shouldHideLinks" + :show-links="showJobLinks" :view-type="viewType" - default-link-color="gl-stroke-transparent" @error="onError" @highlightedJobsChange="updateHighlightedJobs" > @@ -234,6 +238,7 @@ export default { :config-paths="configPaths" :linked-pipelines="downstreamPipelines" :column-title="__('Downstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.DOWNSTREAM" :view-type="viewType" @downstreamHovered="setSourceJob" diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index 0bc6d883245..bff5d3ccdab 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -48,6 +48,7 @@ export default { pipeline: null, pipelineLayers: null, showAlert: false, + showLinks: false, }; }, errorTexts: { @@ -182,6 +183,9 @@ export default { } }, /* eslint-enable @gitlab/require-i18n-strings */ + updateShowLinksState(val) { + this.showLinks = val; + }, updateViewType(type) { this.currentViewType = type; }, @@ -202,7 +206,9 @@ export default { @@ -211,6 +217,7 @@ export default { :config-paths="configPaths" :pipeline="pipeline" :pipeline-layers="getPipelineLayers()" + :show-links="showLinks" :view-type="currentViewType" @error="reportFailure" @refreshPipelineGraph="refreshPipelineGraph" diff --git a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue index f33e6290e37..bc038dde21c 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue @@ -1,17 +1,20 @@ diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue index 7f772e35e55..89ca6f43abc 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue @@ -32,6 +32,10 @@ export default { type: Array, required: true, }, + showLinks: { + type: Boolean, + required: true, + }, type: { type: String, required: true, @@ -217,6 +221,7 @@ export default { :config-paths="configPaths" :pipeline="currentPipeline" :pipeline-layers="getPipelineLayers(pipeline.id)" + :show-links="showLinks" :is-linked-pipeline="true" :view-type="viewType" /> diff --git a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue index 8dbab245f44..83843de8085 100644 --- a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue +++ b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue @@ -1,5 +1,4 @@