From 50c128944e5e65fb5124aeb790cc0f1ec06049d3 Mon Sep 17 00:00:00 2001 From: Kia Mei Somabes Date: Mon, 9 Jul 2018 09:55:36 +0800 Subject: Add single file download in repository --- app/helpers/blob_helper.rb | 18 +++++++++--------- app/views/projects/blob/_header.html.haml | 5 +++-- .../23705-add-single-file-download-in-repo.yml | 5 +++++ 3 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 changelogs/unreleased/23705-add-single-file-download-in-repo.yml diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 3db28fd6da3..16a8764dc41 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -226,18 +226,18 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? - - if blob.raw_binary? || blob.stored_externally? - icon = sprite_icon('download') - title = 'Download' - else - icon = icon('file-code-o') - title = 'Open raw' - end - + icon = icon('file-code-o') + title = 'Open raw' link_to icon, blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end + def download_button(blob) + return if blob.empty? + icon = sprite_icon('download') + title = 'Download' + link_to icon, blob_raw_path, download: '', class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + end + def blob_render_error_reason(viewer) case viewer.render_error when :collapsed diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml index 0a0b3ce1d6f..b3ae1734225 100644 --- a/app/views/projects/blob/_header.html.haml +++ b/app/views/projects/blob/_header.html.haml @@ -7,9 +7,10 @@ .btn-group{ role: "group" }< = copy_blob_source_button(blob) unless blame - = open_raw_blob_button(blob) + - if !(blob.raw_binary? || blob.stored_externally?) + = open_raw_blob_button(blob) + = download_button(blob) = view_on_environment_button(@commit.sha, @path, @environment) if @environment - .btn-group{ role: "group" }< = render_if_exists 'projects/blob/header_file_locks_link' = edit_blob_button diff --git a/changelogs/unreleased/23705-add-single-file-download-in-repo.yml b/changelogs/unreleased/23705-add-single-file-download-in-repo.yml new file mode 100644 index 00000000000..a3ec853f03c --- /dev/null +++ b/changelogs/unreleased/23705-add-single-file-download-in-repo.yml @@ -0,0 +1,5 @@ +--- +title: Add download button for single file (including raw files) in repository +merge_request: +author: +type: added -- cgit v1.2.1 From 9f57ae11e935d2a8a2b175d8382ed87020727845 Mon Sep 17 00:00:00 2001 From: Kia Mei Somabes Date: Thu, 12 Jul 2018 10:23:00 +0800 Subject: Set content-disposition header for single file download in repository --- app/controllers/projects/raw_controller.rb | 3 +-- app/helpers/blob_helper.rb | 16 ++++++++-------- app/helpers/workhorse_helper.rb | 4 ++-- app/views/projects/blob/_header.html.haml | 5 ++--- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index 9bc774b7636..f6bfe4a5747 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -10,7 +10,6 @@ class Projects::RawController < Projects::ApplicationController def show @blob = @repository.blob_at(@commit.id, @path) - if @blob headers['X-Content-Type-Options'] = 'nosniff' @@ -19,7 +18,7 @@ class Projects::RawController < Projects::ApplicationController if @blob.stored_externally? send_lfs_object else - send_git_blob @repository, @blob + send_git_blob @repository, @blob, params[:inline] end else render_404 diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 16a8764dc41..0fec8e891b7 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -114,7 +114,7 @@ module BlobHelper icon("#{file_type_icon_class('file', mode, name)} fw") end - def blob_raw_url(only_path: false) + def blob_raw_url(only_path: false, inline: nil) if @build && @entry raw_project_job_artifacts_url(@project, @build, path: @entry.path, only_path: only_path) elsif @snippet @@ -124,7 +124,7 @@ module BlobHelper raw_snippet_url(@snippet, only_path: only_path) end elsif @blob - project_raw_url(@project, @id, only_path: only_path) + project_raw_url(@project, @id, only_path: only_path, inline: inline) end end @@ -226,16 +226,16 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? - icon = icon('file-code-o') - title = 'Open raw' - link_to icon, blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + unless blob.raw_binary? || blob.stored_externally? + title = 'Open raw' + link_to icon('file-code-o'), blob_raw_url(:inline => true), class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + end end - def download_button(blob) + def download_blob_button(blob) return if blob.empty? - icon = sprite_icon('download') title = 'Download' - link_to icon, blob_raw_path, download: '', class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + link_to sprite_icon('download'), blob_raw_url, download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end def blob_render_error_reason(viewer) diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb index a82271ce0ee..980d07c8800 100644 --- a/app/helpers/workhorse_helper.rb +++ b/app/helpers/workhorse_helper.rb @@ -2,9 +2,9 @@ # Workhorse will also serve files when using `send_file`. module WorkhorseHelper # Send a Git blob through Workhorse - def send_git_blob(repository, blob) + def send_git_blob(repository, blob, inline) headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob)) - headers['Content-Disposition'] = 'inline' + inline ? (headers['Content-Disposition'] = 'inline') : (headers['Content-Disposition'] = 'attachment') headers['Content-Type'] = safe_content_type(blob) render plain: "" end diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml index b3ae1734225..84ccd816d80 100644 --- a/app/views/projects/blob/_header.html.haml +++ b/app/views/projects/blob/_header.html.haml @@ -7,9 +7,8 @@ .btn-group{ role: "group" }< = copy_blob_source_button(blob) unless blame - - if !(blob.raw_binary? || blob.stored_externally?) - = open_raw_blob_button(blob) - = download_button(blob) + = open_raw_blob_button(blob) + = download_blob_button(blob) = view_on_environment_button(@commit.sha, @path, @environment) if @environment .btn-group{ role: "group" }< = render_if_exists 'projects/blob/header_file_locks_link' -- cgit v1.2.1 From 1e0f0de30253cf20533fe4002272e3e3861b3883 Mon Sep 17 00:00:00 2001 From: Kia Mei Somabes Date: Fri, 13 Jul 2018 09:24:11 +0800 Subject: Refactor code for single file download in repository --- app/controllers/projects/raw_controller.rb | 2 +- app/helpers/blob_helper.rb | 23 +++++++++++----------- app/helpers/workhorse_helper.rb | 4 ++-- app/views/projects/artifacts/file.html.haml | 2 +- .../23705-add-single-file-download-in-repo.yml | 4 ++-- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index f6bfe4a5747..1cba0011304 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -18,7 +18,7 @@ class Projects::RawController < Projects::ApplicationController if @blob.stored_externally? send_lfs_object else - send_git_blob @repository, @blob, params[:inline] + send_git_blob @repository, @blob, inline: (params[:inline] != 'false') end else render_404 diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 0fec8e891b7..3ba49277b5e 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -114,22 +114,22 @@ module BlobHelper icon("#{file_type_icon_class('file', mode, name)} fw") end - def blob_raw_url(only_path: false, inline: nil) + def blob_raw_url(**kwargs) if @build && @entry - raw_project_job_artifacts_url(@project, @build, path: @entry.path, only_path: only_path) + raw_project_job_artifacts_url(@project, @build, path: @entry.path, **kwargs) elsif @snippet if @snippet.project_id - raw_project_snippet_url(@project, @snippet, only_path: only_path) + raw_project_snippet_url(@project, @snippet, **kwargs) else - raw_snippet_url(@snippet, only_path: only_path) + raw_snippet_url(@snippet, **kwargs) end elsif @blob - project_raw_url(@project, @id, only_path: only_path, inline: inline) + project_raw_url(@project, @id, **kwargs) end end - def blob_raw_path - blob_raw_url(only_path: true) + def blob_raw_path(**kwargs) + blob_raw_url(**kwargs, only_path: true) end # SVGs can contain malicious JavaScript; only include whitelisted @@ -226,16 +226,15 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? - unless blob.raw_binary? || blob.stored_externally? - title = 'Open raw' - link_to icon('file-code-o'), blob_raw_url(:inline => true), class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } - end + return if blob.raw_binary? || blob.stored_externally? + title = 'Open raw' + link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end def download_blob_button(blob) return if blob.empty? title = 'Download' - link_to sprite_icon('download'), blob_raw_url, download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end def blob_render_error_reason(viewer) diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb index 980d07c8800..fd1d78bd9b8 100644 --- a/app/helpers/workhorse_helper.rb +++ b/app/helpers/workhorse_helper.rb @@ -2,9 +2,9 @@ # Workhorse will also serve files when using `send_file`. module WorkhorseHelper # Send a Git blob through Workhorse - def send_git_blob(repository, blob, inline) + def send_git_blob(repository, blob, inline: true) headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob)) - inline ? (headers['Content-Disposition'] = 'inline') : (headers['Content-Disposition'] = 'attachment') + headers['Content-Disposition'] = inline ? 'inline' : 'attachment' headers['Content-Type'] = safe_content_type(blob) render plain: "" end diff --git a/app/views/projects/artifacts/file.html.haml b/app/views/projects/artifacts/file.html.haml index aac7a1870df..f7174d6b2c6 100644 --- a/app/views/projects/artifacts/file.html.haml +++ b/app/views/projects/artifacts/file.html.haml @@ -27,6 +27,6 @@ .btn-group{ role: "group" }< = copy_blob_source_button(blob) - = open_raw_blob_button(blob) + = download_blob_button(blob) = render 'projects/blob/content', blob: blob diff --git a/changelogs/unreleased/23705-add-single-file-download-in-repo.yml b/changelogs/unreleased/23705-add-single-file-download-in-repo.yml index a3ec853f03c..f156bfb1101 100644 --- a/changelogs/unreleased/23705-add-single-file-download-in-repo.yml +++ b/changelogs/unreleased/23705-add-single-file-download-in-repo.yml @@ -1,5 +1,5 @@ --- title: Add download button for single file (including raw files) in repository -merge_request: -author: +merge_request: 20480 +author: Kia Mei Somabes type: added -- cgit v1.2.1 From 3099d1433fd01558a8cc8aba3635e31c8ce063f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Jun 2018 15:47:49 +0200 Subject: Reduce CE/EE difference in app/views/projects/protected_tags/_protected_tag.html.haml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/models/concerns/protected_ref_access.rb | 5 +++++ app/views/projects/protected_tags/_protected_tag.html.haml | 4 +++- .../protected_tags/_protected_tag_create_access_levels.haml | 8 ++++++++ app/views/projects/protected_tags/_update_protected_tag.haml | 5 ----- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 app/views/projects/protected_tags/_protected_tag_create_access_levels.haml delete mode 100644 app/views/projects/protected_tags/_update_protected_tag.haml diff --git a/app/models/concerns/protected_ref_access.rb b/app/models/concerns/protected_ref_access.rb index 71b0c3468b9..5ff7b41b82b 100644 --- a/app/models/concerns/protected_ref_access.rb +++ b/app/models/concerns/protected_ref_access.rb @@ -17,6 +17,11 @@ module ProtectedRefAccess scope :master, -> { maintainer } # @deprecated scope :maintainer, -> { where(access_level: Gitlab::Access::MAINTAINER) } scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) } + scope :by_user, -> (user) { where(user_id: user ) } + scope :by_group, -> (group) { where(group_id: group ) } + scope :for_role, -> { where(user_id: nil, group_id: nil) } + scope :for_user, -> { where.not(user_id: nil) } + scope :for_group, -> { where.not(group_id: nil) } validates :access_level, presence: true, if: :role?, inclusion: { in: ALLOWED_ACCESS_LEVELS diff --git a/app/views/projects/protected_tags/_protected_tag.html.haml b/app/views/projects/protected_tags/_protected_tag.html.haml index da1f97c8d6a..e0912bf39c0 100644 --- a/app/views/projects/protected_tags/_protected_tag.html.haml +++ b/app/views/projects/protected_tags/_protected_tag.html.haml @@ -1,2 +1,4 @@ = render layout: 'projects/protected_tags/shared/protected_tag', locals: { protected_tag: protected_tag } do - = render partial: 'projects/protected_tags/update_protected_tag', locals: { protected_tag: protected_tag } + %td + = render 'projects/protected_tags/protected_tag_create_access_levels', protected_tag: protected_tag, create_access_level: protected_tag.create_access_levels.for_role.first + = render_if_exists 'projects/protected_tags/protected_tag_extra_create_access_levels', protected_tag: protected_tag diff --git a/app/views/projects/protected_tags/_protected_tag_create_access_levels.haml b/app/views/projects/protected_tags/_protected_tag_create_access_levels.haml new file mode 100644 index 00000000000..1d4e9565156 --- /dev/null +++ b/app/views/projects/protected_tags/_protected_tag_create_access_levels.haml @@ -0,0 +1,8 @@ +- protected_tag = local_assigns.fetch(:protected_tag) +- create_access_level = local_assigns.fetch(:create_access_level) +- dropdown_label = create_access_level&.humanize || 'Select' + += hidden_field_tag "allowed_to_create_#{protected_tag.id}", create_access_level&.access_level += dropdown_tag(dropdown_label, + options: { toggle_class: 'js-allowed-to-create', dropdown_class: 'dropdown-menu-selectable capitalize-header js-allowed-to-create-container', + data: { field_name: "allowed_to_create_#{protected_tag.id}", access_level_id: create_access_level&.id }}) diff --git a/app/views/projects/protected_tags/_update_protected_tag.haml b/app/views/projects/protected_tags/_update_protected_tag.haml deleted file mode 100644 index cc80bd04dd0..00000000000 --- a/app/views/projects/protected_tags/_update_protected_tag.haml +++ /dev/null @@ -1,5 +0,0 @@ -%td - = hidden_field_tag "allowed_to_create_#{protected_tag.id}", protected_tag.create_access_levels.first.access_level - = dropdown_tag( (protected_tag.create_access_levels.first.humanize || 'Select') , - options: { toggle_class: 'js-allowed-to-create', dropdown_class: 'dropdown-menu-selectable capitalize-header js-allowed-to-create-container', - data: { field_name: "allowed_to_create_#{protected_tag.id}", access_level_id: protected_tag.create_access_levels.first.id }}) -- cgit v1.2.1 From ff744d5fb1eb8fb89b40a2e88b5069b53d444616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Jun 2018 15:59:50 +0200 Subject: Reduce CE/EE difference in app/views/projects/services/prometheus/_show.html.haml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- .../services/prometheus/_metrics.html.haml | 30 ++++++++++++++++++++ .../projects/services/prometheus/_show.html.haml | 33 ++-------------------- locale/gitlab.pot | 6 ++-- 3 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 app/views/projects/services/prometheus/_metrics.html.haml diff --git a/app/views/projects/services/prometheus/_metrics.html.haml b/app/views/projects/services/prometheus/_metrics.html.haml new file mode 100644 index 00000000000..98d64fafe86 --- /dev/null +++ b/app/views/projects/services/prometheus/_metrics.html.haml @@ -0,0 +1,30 @@ +- project = local_assigns.fetch(:project) + +.card.js-panel-monitored-metrics{ data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/metrics') } } + .card-header + %h3.card-title + = s_('PrometheusService|Common metrics') + %span.badge.badge-pill.js-monitored-count 0 + .card-body + .loading-metrics.js-loading-metrics + %p.prepend-top-10.prepend-left-10 + = icon('spinner spin', class: 'metrics-load-spinner') + = s_('PrometheusService|Finding and configuring metrics...') + .empty-metrics.hidden.js-empty-metrics + %p.text-tertiary.prepend-top-10.prepend-left-10 + = s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics') + %ul.list-unstyled.metrics-list.hidden.js-metrics-list + +.card.hidden.js-panel-missing-env-vars + .card-header + %h3.card-title + = icon('caret-right lg fw', class: 'panel-toggle js-panel-toggle', 'aria-label' => 'Toggle panel') + = s_('PrometheusService|Missing environment variable') + %span.badge.badge-pill.js-env-var-count 0 + .card-body.hidden + .flash-container + .flash-notice + .flash-text + = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "$CI_ENVIRONMENT_SLUG" }).html_safe + = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels') + %ul.list-unstyled.metrics-list.js-missing-var-metrics-list diff --git a/app/views/projects/services/prometheus/_show.html.haml b/app/views/projects/services/prometheus/_show.html.haml index bda597cc02b..9741b783db3 100644 --- a/app/views/projects/services/prometheus/_show.html.haml +++ b/app/views/projects/services/prometheus/_show.html.haml @@ -3,35 +3,8 @@ %h4.prepend-top-0 = s_('PrometheusService|Metrics') %p - = s_('PrometheusService|Metrics are automatically configured and monitored based on a library of metrics from popular exporters.') - = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus') + = s_('PrometheusService|Common metrics are automatically monitored based on a library of metrics from popular exporters.') + = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus_library/metrics'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.js-panel-monitored-metrics{ data: { active_metrics: active_common_project_prometheus_metrics_path(@project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/metrics') } } - .card-header - %h3.card-title - = s_('PrometheusService|Common metrics') - %span.badge.badge-pill.js-monitored-count 0 - .card-body - .loading-metrics.js-loading-metrics - %p.prepend-top-10.prepend-left-10 - = icon('spinner spin', class: 'metrics-load-spinner') - = s_('PrometheusService|Finding and configuring metrics...') - .empty-metrics.hidden.js-empty-metrics - %p.text-tertiary.prepend-top-10.prepend-left-10 - = s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics') - %ul.list-unstyled.metrics-list.hidden.js-metrics-list - - .card.hidden.js-panel-missing-env-vars - .card-header - %h3.card-title - = icon('caret-right lg fw', class: 'panel-toggle js-panel-toggle', 'aria-label' => 'Toggle panel') - = s_('PrometheusService|Missing environment variable') - %span.badge.badge-pill.js-env-var-count 0 - .card-body.hidden - .flash-container - .flash-notice - .flash-text - = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "$CI_ENVIRONMENT_SLUG" }).html_safe - = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels') - %ul.list-unstyled.metrics-list.js-missing-var-metrics-list + = render_if_exists 'projects/services/prometheus/metrics', project: @project diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1b68156a503..157a02123f2 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -4106,6 +4106,9 @@ msgstr "" msgid "PrometheusService|Common metrics" msgstr "" +msgid "PrometheusService|Common metrics are automatically monitored based on a library of metrics from popular exporters." +msgstr "" + msgid "PrometheusService|Finding and configuring metrics..." msgstr "" @@ -4121,9 +4124,6 @@ msgstr "" msgid "PrometheusService|Metrics" msgstr "" -msgid "PrometheusService|Metrics are automatically configured and monitored based on a library of metrics from popular exporters." -msgstr "" - msgid "PrometheusService|Missing environment variable" msgstr "" -- cgit v1.2.1 From 444b54ee38f9dfbc88ee9f99533832ef0ddce600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Jun 2018 18:06:26 +0200 Subject: Reduce CE/EE difference in app/views/projects/tags/index.html.haml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/views/projects/tags/index.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml index 96ecac815c0..dab95ba09f2 100644 --- a/app/views/projects/tags/index.html.haml +++ b/app/views/projects/tags/index.html.haml @@ -26,6 +26,8 @@ = link_to new_project_tag_path(@project), class: 'btn btn-create new-tag-btn' do = s_('TagsPage|New tag') + = render_if_exists 'projects/commits/mirror_status' + .tags - if @tags.any? %ul.flex-list.content-list -- cgit v1.2.1 From ab1a8d10452d112fcfa4c1f98375942e06cae831 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 20:03:16 +0100 Subject: Delete unneeded user avatar formData --- app/assets/javascripts/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/profile/profile.js b/app/assets/javascripts/profile/profile.js index 8cf7f2f23d0..e49c67ffb5c 100644 --- a/app/assets/javascripts/profile/profile.js +++ b/app/assets/javascripts/profile/profile.js @@ -49,13 +49,15 @@ export default class Profile { saveForm() { const self = this; - const formData = new FormData(this.form[0]); + const formData = new FormData(this.form.get(0)); const avatarBlob = this.avatarGlCrop.getBlob(); if (avatarBlob != null) { formData.append('user[avatar]', avatarBlob, 'avatar.png'); } + formData.delete('user[avatar]-trigger'); + axios({ method: this.form.attr('method'), url: this.form.attr('action'), -- cgit v1.2.1 From 820c37716b6190db6c09e1be1a836df5554db518 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 17 Jul 2018 20:06:58 +0100 Subject: add changelog entry --- .../45443-unable-to-save-user-profile-update-with-safari.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/45443-unable-to-save-user-profile-update-with-safari.yml diff --git a/changelogs/unreleased/45443-unable-to-save-user-profile-update-with-safari.yml b/changelogs/unreleased/45443-unable-to-save-user-profile-update-with-safari.yml new file mode 100644 index 00000000000..b18f7aec546 --- /dev/null +++ b/changelogs/unreleased/45443-unable-to-save-user-profile-update-with-safari.yml @@ -0,0 +1,5 @@ +--- +title: Resolve "Unable to save user profile update with Safari" +merge_request: 20676 +author: +type: fixed -- cgit v1.2.1 From cb99e0518c36cca62b14f16178e4396a8c7dcee2 Mon Sep 17 00:00:00 2001 From: Kia Mei Somabes Date: Wed, 18 Jul 2018 09:19:53 +0800 Subject: Refactor code for single file download in repository --- app/helpers/blob_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 3ba49277b5e..1919b8995f5 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -227,12 +227,14 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? return if blob.raw_binary? || blob.stored_externally? + title = 'Open raw' link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end def download_blob_button(blob) return if blob.empty? + title = 'Download' link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end -- cgit v1.2.1 From 3239860f0aea2ff7721f36b4c424e6e8957c51c7 Mon Sep 17 00:00:00 2001 From: Kia Mei Somabes Date: Wed, 18 Jul 2018 11:16:30 +0800 Subject: Refactor code for single file download in repository --- app/helpers/blob_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 1919b8995f5..7eb45ddd117 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -234,7 +234,7 @@ module BlobHelper def download_blob_button(blob) return if blob.empty? - + title = 'Download' link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end -- cgit v1.2.1 From cfbb256b8b755e84f8156bc01bc1ba278eeaafa9 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 19 Jul 2018 10:37:46 +0200 Subject: MigrateProcessCommitWorkerJobs to use Gitaly This old migration used Rugged to find a commit, while Gitaly is the prefered way now. By migrating this to Gitaly, Gitaly is now a required running component for this migration. Part of https://gitlab.com/gitlab-org/gitaly/issues/1106 --- ...124141322_migrate_process_commit_worker_jobs.rb | 54 +++++++++---------- lib/gitlab/git/repository.rb | 1 - .../migrate_process_commit_worker_jobs_spec.rb | 63 ++++++++-------------- 3 files changed, 48 insertions(+), 70 deletions(-) diff --git a/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb b/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb index dc16d5c5169..1eb6a8fa5df 100644 --- a/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb +++ b/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb @@ -1,9 +1,19 @@ -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration include Gitlab::Database::MigrationHelpers + class Repository + attr_reader :storage + + def initialize(storage, relative_path) + @storage = storage + @relative_path = relative_path + end + + def gitaly_repository + Gitaly::Repository.new(storage_name: @storage, relative_path: @relative_path) + end + end + class Project < ActiveRecord::Base def self.find_including_path(id) select("projects.*, CONCAT(namespaces.path, '/', projects.path) AS path_with_namespace") @@ -11,19 +21,12 @@ class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration .find_by(id: id) end - def repository_storage_path - Gitlab::GitalyClient::StorageSettings.allow_disk_access do - Gitlab.config.repositories.storages[repository_storage].legacy_disk_path - end - end - - def repository_path - # TODO: review if the change from Legacy storage needs to reflect here as well. - File.join(repository_storage_path, read_attribute(:path_with_namespace) + '.git') + def commit(rev) + Gitlab::GitalyClient::CommitService.new(repository).find_commit(rev) end def repository - @repository ||= Rugged::Repository.new(repository_path) + @repository ||= Repository.new(repository_storage, read_attribute(:path_with_namespace) + '.git') end end @@ -42,22 +45,19 @@ class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration next unless project - begin - commit = project.repository.lookup(payload['args'][2]) - rescue Rugged::OdbError - next - end + commit = project.commit(payload['args'][2]) + next unless commit hash = { - id: commit.oid, - message: encode(commit.message), - parent_ids: commit.parent_ids, - authored_date: commit.author[:time], - author_name: encode(commit.author[:name]), - author_email: encode(commit.author[:email]), - committed_date: commit.committer[:time], - committer_email: encode(commit.committer[:email]), - committer_name: encode(commit.committer[:name]) + id: commit.id, + message: encode(commit.body), + parent_ids: commit.parent_ids.to_a, + authored_date: Time.at(commit.author.date.seconds).utc, + author_name: encode(commit.author.name), + author_email: encode(commit.author.email), + committed_date: Time.at(commit.committer.date.seconds).utc, + committer_email: encode(commit.committer.email), + committer_name: encode(commit.committer.name) } payload['args'][2] = hash diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 39fbf6e2526..f6d3894a71e 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1,4 +1,3 @@ -# Gitlab::Git::Repository is a wrapper around native Rugged::Repository object require 'tempfile' require 'forwardable' require "rubygems/package" diff --git a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb index a30e6c23ac9..bbb591281d5 100644 --- a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb +++ b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb @@ -4,14 +4,11 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20161124141322_migrate_process_commit_worker_jobs.rb') describe MigrateProcessCommitWorkerJobs do - let(:project) { create(:project, :legacy_storage, :repository) } # rubocop:disable RSpec/FactoriesInMigrationSpecs - let(:user) { create(:user) } # rubocop:disable RSpec/FactoriesInMigrationSpecs - let(:rugged) do - Gitlab::GitalyClient::StorageSettings.allow_disk_access do - project.repository.rugged - end + set(:project) { create(:project, :legacy_storage, :repository) } # rubocop:disable RSpec/FactoriesInMigrationSpecs + set(:user) { create(:user) } # rubocop:disable RSpec/FactoriesInMigrationSpecs + let(:commit) do + Gitlab::Git::Commit.last(project.repository.raw) end - let(:commit) { rugged.rev_parse(project.commit.id) } describe 'Project' do describe 'find_including_path' do @@ -29,32 +26,13 @@ describe MigrateProcessCommitWorkerJobs do end end - describe '#repository_storage_path' do - it 'returns the storage path for the repository' do - migration_project = described_class::Project - .find_including_path(project.id) - - expect(File.directory?(migration_project.repository_storage_path)) - .to eq(true) - end - end - - describe '#repository_path' do - it 'returns the path to the repository' do - migration_project = described_class::Project - .find_including_path(project.id) - - expect(File.directory?(migration_project.repository_path)).to eq(true) - end - end - describe '#repository' do it 'returns a Rugged::Repository' do migration_project = described_class::Project .find_including_path(project.id) - expect(migration_project.repository) - .to be_an_instance_of(Rugged::Repository) + expect(migration_project.repository).to respond_to(:storage) + expect(migration_project.repository).to respond_to(:gitaly_repository) end end end @@ -72,7 +50,7 @@ describe MigrateProcessCommitWorkerJobs do before do Sidekiq.redis do |redis| - job = JSON.dump(args: [project.id, user.id, commit.oid]) + job = JSON.dump(args: [project.id, user.id, commit.id]) redis.lpush('queue:process_commit', job) end end @@ -88,9 +66,10 @@ describe MigrateProcessCommitWorkerJobs do end it 'skips jobs using commits that no longer exist' do - allow_any_instance_of(Rugged::Repository).to receive(:lookup) - .with(commit.oid) - .and_raise(Rugged::OdbError) + allow_any_instance_of(Gitlab::GitalyClient::CommitService) + .to receive(:find_commit) + .with(commit.id) + .and_return(nil) migration.up @@ -105,7 +84,7 @@ describe MigrateProcessCommitWorkerJobs do it 'encodes data to UTF-8' do allow_any_instance_of(Rugged::Repository).to receive(:lookup) - .with(commit.oid) + .with(commit.id) .and_return(commit) allow(commit).to receive(:message) @@ -140,7 +119,7 @@ describe MigrateProcessCommitWorkerJobs do end it 'includes the commit ID' do - expect(commit_hash['id']).to eq(commit.oid) + expect(commit_hash['id']).to eq(commit.id) end it 'includes the commit message' do @@ -152,27 +131,27 @@ describe MigrateProcessCommitWorkerJobs do end it 'includes the author date' do - expect(commit_hash['authored_date']).to eq(commit.author[:time].to_s) + expect(commit_hash['authored_date']).to eq(commit.authored_date.to_s) end it 'includes the author name' do - expect(commit_hash['author_name']).to eq(commit.author[:name]) + expect(commit_hash['author_name']).to eq(commit.author_name) end it 'includes the author Email' do - expect(commit_hash['author_email']).to eq(commit.author[:email]) + expect(commit_hash['author_email']).to eq(commit.author_email) end it 'includes the commit date' do - expect(commit_hash['committed_date']).to eq(commit.committer[:time].to_s) + expect(commit_hash['committed_date']).to eq(commit.committed_date.to_s) end it 'includes the committer name' do - expect(commit_hash['committer_name']).to eq(commit.committer[:name]) + expect(commit_hash['committer_name']).to eq(commit.committer_name) end it 'includes the committer Email' do - expect(commit_hash['committer_email']).to eq(commit.committer[:email]) + expect(commit_hash['committer_email']).to eq(commit.committer_email) end end end @@ -186,7 +165,7 @@ describe MigrateProcessCommitWorkerJobs do before do Sidekiq.redis do |redis| - job = JSON.dump(args: [project.id, user.id, commit.oid]) + job = JSON.dump(args: [project.id, user.id, commit.id]) redis.lpush('queue:process_commit', job) migration.up @@ -215,7 +194,7 @@ describe MigrateProcessCommitWorkerJobs do end it 'includes the commit SHA' do - expect(job['args'][2]).to eq(commit.oid) + expect(job['args'][2]).to eq(commit.id) end end end -- cgit v1.2.1 From f84d3dc0ee9131ce1ab8716b833764d40c025eee Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 19 Jul 2018 14:00:35 +0200 Subject: Fix deserializing yaml variables in imported projects --- lib/gitlab/serializer/ci/variables.rb | 5 +++-- spec/lib/gitlab/serializer/ci/variables_spec.rb | 6 +++--- spec/models/ci/build_spec.rb | 28 +++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/lib/gitlab/serializer/ci/variables.rb b/lib/gitlab/serializer/ci/variables.rb index c059c454eac..292c8de6229 100644 --- a/lib/gitlab/serializer/ci/variables.rb +++ b/lib/gitlab/serializer/ci/variables.rb @@ -13,8 +13,9 @@ module Gitlab object = YAML.safe_load(string, [Symbol]) object.map do |variable| - variable[:key] = variable[:key].to_s - variable + variable.symbolize_keys.tap do |variable| + variable[:key] = variable[:key].to_s + end end end diff --git a/spec/lib/gitlab/serializer/ci/variables_spec.rb b/spec/lib/gitlab/serializer/ci/variables_spec.rb index c4b7fda5dbb..1d1fd5b0763 100644 --- a/spec/lib/gitlab/serializer/ci/variables_spec.rb +++ b/spec/lib/gitlab/serializer/ci/variables_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require 'fast_spec_helper' describe Gitlab::Serializer::Ci::Variables do subject do @@ -6,11 +6,11 @@ describe Gitlab::Serializer::Ci::Variables do end let(:object) do - [{ key: :key, value: 'value', public: true }, + [{ 'key' => :key, 'value' => 'value', 'public' => true }, { key: 'wee', value: 1, public: false }] end - it 'converts keys into strings' do + it 'converts keys into strings and symbolizes hash' do is_expected.to eq([ { key: 'key', value: 'value', public: true }, { key: 'wee', value: 1, public: false } diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index ee923374480..e7bca70b548 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2269,6 +2269,34 @@ describe Ci::Build do end end + describe '#yaml_variables' do + before do + build.update_attribute(:yaml_variables, variables) + end + + context 'when serialized valu is a symbolized hash' do + let(:variables) do + [{ key: :VARIABLE, value: 'my value 1' }] + end + + it 'keeps symbolizes keys and stringifies variables names' do + expect(build.yaml_variables) + .to eq [{ key: 'VARIABLE', value: 'my value 1' }] + end + end + + context 'when serialized value is a hash with string keys' do + let(:variables) do + [{'key' => :VARIABLE, 'value' => 'my value 2' }] + end + + it 'symblizes variables hash' do + expect(build.yaml_variables) + .to eq [{ key: 'VARIABLE', value: 'my value 2' }] + end + end + end + describe 'state transition: any => [:pending]' do let(:build) { create(:ci_build, :created) } -- cgit v1.2.1 From 3779d76d6ef8eec8eb335fd005bff7178a74c26e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 19 Jul 2018 14:05:02 +0200 Subject: Add changelog for accessing imported builds fix --- changelogs/unreleased/fix-gb-fix-deserializing-ci-yaml-variables.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/fix-gb-fix-deserializing-ci-yaml-variables.yml diff --git a/changelogs/unreleased/fix-gb-fix-deserializing-ci-yaml-variables.yml b/changelogs/unreleased/fix-gb-fix-deserializing-ci-yaml-variables.yml new file mode 100644 index 00000000000..80b069c9251 --- /dev/null +++ b/changelogs/unreleased/fix-gb-fix-deserializing-ci-yaml-variables.yml @@ -0,0 +1,5 @@ +--- +title: Fix accessing imported pipeline builds +merge_request: 20713 +author: +type: fixed -- cgit v1.2.1 From 6f88b7d986a0c2d9348db1e16b34e0b894ff00ba Mon Sep 17 00:00:00 2001 From: Amit Rathi Date: Thu, 19 Jul 2018 17:39:32 +0530 Subject: Specify Jupyter Image to use with JupyterHub Installation --- vendor/jupyter/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/jupyter/values.yaml b/vendor/jupyter/values.yaml index 90817de0f1b..4ea5b44c59c 100644 --- a/vendor/jupyter/values.yaml +++ b/vendor/jupyter/values.yaml @@ -4,6 +4,7 @@ rbac: hub: extraEnv: JUPYTER_ENABLE_LAB: 1 + SINGLEUSER_IMAGE: 'registry.gitlab.com/gitlab-org/jupyterhub-user-image:latest' extraConfig: | c.KubeSpawner.cmd = ['jupyter-labhub'] -- cgit v1.2.1 From fd4fd25d3c1f81b669711755eda07089353b86b3 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 19 Jul 2018 14:13:49 +0200 Subject: Fix passing a hash with string keys when fabricating a variable --- lib/gitlab/ci/variables/collection/item.rb | 2 +- spec/lib/gitlab/ci/variables/collection/item_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb index 222aa06b800..7da6d09d440 100644 --- a/lib/gitlab/ci/variables/collection/item.rb +++ b/lib/gitlab/ci/variables/collection/item.rb @@ -34,7 +34,7 @@ module Gitlab def self.fabricate(resource) case resource when Hash - self.new(resource) + self.new(resource.symbolize_keys) when ::HasVariable self.new(resource.to_runner_variable) when self diff --git a/spec/lib/gitlab/ci/variables/collection/item_spec.rb b/spec/lib/gitlab/ci/variables/collection/item_spec.rb index adb3ff4321f..46874662edd 100644 --- a/spec/lib/gitlab/ci/variables/collection/item_spec.rb +++ b/spec/lib/gitlab/ci/variables/collection/item_spec.rb @@ -75,6 +75,14 @@ describe Gitlab::Ci::Variables::Collection::Item do expect(resource).to eq variable end + it 'supports using a hash with stringified values' do + variable = { 'key' => 'VARIABLE', 'value' => 'my value' } + + resource = described_class.fabricate(variable) + + expect(resource).to eq(key: 'VARIABLE', value: 'my value') + end + it 'supports using an active record resource' do variable = create(:ci_variable, key: 'CI_VAR', value: '123') resource = described_class.fabricate(variable) -- cgit v1.2.1 From 80c61639f3a3da4895ec0a50437497dc97b4eb49 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 19 Jul 2018 14:47:11 +0200 Subject: Remove refs cleanup job Introduced by f20eadcbbeb88e98c2608cbaf23f0d09ca002a98, meant to remove refs from Git using the wrong name. That never made it to a non-rc release and can be safely removed now. --- lib/tasks/gitlab/cleanup.rake | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index 52ae1330d7f..5e07b12ee1c 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -104,28 +104,5 @@ namespace :gitlab do puts "To block these users run this command with BLOCK=true".color(:yellow) end end - - # This is a rake task which removes faulty refs. These refs where only - # created in the 8.13.RC cycle, and fixed in the stable builds which were - # released. So likely this should only be run once on gitlab.com - # Faulty refs are moved so they are kept around, else some features break. - desc 'GitLab | Cleanup | Remove faulty deployment refs' - task move_faulty_deployment_refs: :gitlab_environment do - projects = Project.where(id: Deployment.select(:project_id).distinct) - - projects.find_each do |project| - rugged = project.repository.rugged - - max_iid = project.deployments.maximum(:iid) - - rugged.references.each('refs/environments/**/*') do |ref| - id = ref.name.split('/').last.to_i - next unless id > max_iid - - project.deployments.find(id).create_ref - project.repository.delete_refs(ref) - end - end - end end end -- cgit v1.2.1 From a53a4a4309c3aa5cee0ad5f028d9a6255ec5d59e Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 19 Jul 2018 10:55:55 +0200 Subject: Remove direct disk access in RemoveDotGitFromUsernames Prior to this change, the migration touched the disk path. This has been removed. Further, I believe it also fixes a bug. It seems that GitLab Shell checks if the root path exists, when the path is duplicated. For example, if the shard is located at /home/git, it did check if `/home/git/home/git` existed. --- db/migrate/20161226122833_remove_dot_git_from_usernames.rb | 12 +++--------- spec/migrations/migrate_process_commit_worker_jobs_spec.rb | 8 ++------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb index 133435523e1..db10426b483 100644 --- a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb +++ b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb @@ -1,11 +1,7 @@ -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - class RemoveDotGitFromUsernames < ActiveRecord::Migration include Gitlab::Database::MigrationHelpers include Gitlab::ShellAdapter - # Set this constant to true if this migration requires downtime. DOWNTIME = false def up @@ -64,16 +60,14 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration # we rename suffix instead of removing it path = path.sub(/\.git\z/, '_git') - Gitlab::GitalyClient::StorageSettings.allow_disk_access do - check_routes(path.dup, 0, path) - end + check_routes(path.dup, 0, path) end def check_routes(base, counter, path) route_exists = route_exists?(path) - Gitlab.config.repositories.storages.each do |shard, storage| - if route_exists || path_exists?(shard, storage.legacy_disk_path) + Gitlab.config.repositories.storages.each do |shard, _storage| + if route_exists || path_exists?(shard, path) counter += 1 path = "#{base}#{counter}" diff --git a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb index bbb591281d5..6219a67c900 100644 --- a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb +++ b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb @@ -27,7 +27,7 @@ describe MigrateProcessCommitWorkerJobs do end describe '#repository' do - it 'returns a Rugged::Repository' do + it 'returns a mock implemention of ::Repository' do migration_project = described_class::Project .find_including_path(project.id) @@ -83,11 +83,7 @@ describe MigrateProcessCommitWorkerJobs do end it 'encodes data to UTF-8' do - allow_any_instance_of(Rugged::Repository).to receive(:lookup) - .with(commit.id) - .and_return(commit) - - allow(commit).to receive(:message) + allow(commit).to receive(:body) .and_return('김치'.force_encoding('BINARY')) migration.up -- cgit v1.2.1 From 0deb8547af52ea1ccb147a07629705ec5e435bfb Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Thu, 19 Jul 2018 17:11:31 -0500 Subject: Replace label-light with label-bold. Because it's bold, not light --- .../javascripts/boards/components/board_new_issue.vue | 2 +- .../javascripts/boards/components/project_select.vue | 2 +- .../javascripts/ide/components/new_dropdown/modal.vue | 2 +- .../shared/components/interval_pattern_input.vue | 14 +++++++------- .../permissions/components/project_setting_row.vue | 2 +- app/assets/stylesheets/framework/forms.scss | 2 +- app/views/admin/application_settings/_abuse.html.haml | 2 +- .../application_settings/_account_and_limit.html.haml | 10 +++++----- .../application_settings/_background_jobs.html.haml | 4 ++-- app/views/admin/application_settings/_ci_cd.html.haml | 8 ++++---- app/views/admin/application_settings/_gitaly.html.haml | 6 +++--- .../admin/application_settings/_help_page.html.haml | 4 ++-- app/views/admin/application_settings/_influx.html.haml | 14 +++++++------- .../admin/application_settings/_ip_limits.html.haml | 12 ++++++------ app/views/admin/application_settings/_koding.html.haml | 2 +- app/views/admin/application_settings/_logging.html.haml | 4 ++-- app/views/admin/application_settings/_pages.html.haml | 2 +- .../application_settings/_performance_bar.html.haml | 2 +- app/views/admin/application_settings/_plantuml.html.haml | 2 +- app/views/admin/application_settings/_realtime.html.haml | 2 +- app/views/admin/application_settings/_registry.html.haml | 2 +- .../application_settings/_repository_check.html.haml | 6 +++--- .../_repository_mirrors_form.html.haml | 2 +- .../application_settings/_repository_storage.html.haml | 12 ++++++------ app/views/admin/application_settings/_signin.html.haml | 12 ++++++------ app/views/admin/application_settings/_signup.html.haml | 10 +++++----- app/views/admin/application_settings/_spam.html.haml | 10 +++++----- app/views/admin/application_settings/_terminal.html.haml | 2 +- .../_visibility_and_access.html.haml | 16 ++++++++-------- app/views/admin/hooks/_form.html.haml | 8 ++++---- app/views/doorkeeper/applications/_form.html.haml | 6 +++--- app/views/groups/settings/_general.html.haml | 6 +++--- app/views/import/gitlab_projects/new.html.haml | 6 +++--- app/views/import/manifest/_form.html.haml | 4 ++-- app/views/profiles/accounts/show.html.haml | 2 +- app/views/profiles/emails/index.html.haml | 2 +- app/views/profiles/gpg_keys/_form.html.haml | 2 +- app/views/profiles/keys/_form.html.haml | 4 ++-- app/views/profiles/notifications/show.html.haml | 4 ++-- app/views/profiles/passwords/edit.html.haml | 6 +++--- .../profiles/personal_access_tokens/index.html.haml | 4 ++-- app/views/profiles/preferences/show.html.haml | 6 +++--- app/views/profiles/two_factor_auths/show.html.haml | 2 +- .../_merge_request_merge_method_settings.html.haml | 2 +- app/views/projects/_new_project_fields.html.haml | 8 ++++---- app/views/projects/_project_templates.html.haml | 2 +- app/views/projects/clusters/gcp/_form.html.haml | 12 ++++++------ app/views/projects/clusters/user/_form.html.haml | 12 ++++++------ app/views/projects/clusters/user/_show.html.haml | 10 +++++----- app/views/projects/commit/_change.html.haml | 2 +- app/views/projects/deploy_keys/_form.html.haml | 4 ++-- app/views/projects/deploy_tokens/_form.html.haml | 10 +++++----- app/views/projects/edit.html.haml | 16 ++++++++-------- app/views/projects/environments/_form.html.haml | 4 ++-- .../merge_requests/conflicts/_submit_form.html.haml | 2 +- app/views/projects/mirrors/_push.html.haml | 6 +++--- app/views/projects/pipeline_schedules/_form.html.haml | 12 ++++++------ .../project_members/_new_project_member.html.haml | 6 +++--- .../projects/project_members/_new_shared_group.html.haml | 6 +++--- app/views/projects/settings/ci_cd/_form.html.haml | 8 ++++---- app/views/projects/triggers/_form.html.haml | 4 ++-- app/views/shared/_import_form.html.haml | 2 +- app/views/shared/_personal_access_tokens_form.html.haml | 6 +++--- app/views/shared/tokens/_scopes_form.html.haml | 2 +- app/views/shared/web_hooks/_form.html.haml | 8 ++++---- config/initializers/bootstrap_form.rb | 2 +- .../ide/components/new_dropdown/modal_spec.js | 2 +- 67 files changed, 190 insertions(+), 190 deletions(-) diff --git a/app/assets/javascripts/boards/components/board_new_issue.vue b/app/assets/javascripts/boards/components/board_new_issue.vue index ec23b1e7c11..271c6eac81a 100644 --- a/app/assets/javascripts/boards/components/board_new_issue.vue +++ b/app/assets/javascripts/boards/components/board_new_issue.vue @@ -105,7 +105,7 @@ export default { diff --git a/app/assets/javascripts/boards/components/project_select.vue b/app/assets/javascripts/boards/components/project_select.vue index eb335f352d3..dc887db1e73 100644 --- a/app/assets/javascripts/boards/components/project_select.vue +++ b/app/assets/javascripts/boards/components/project_select.vue @@ -68,7 +68,7 @@ export default {