BigW Consortium Gitlab

Commit bb1f4e38 by Winnie Hellmann

Merge branch '10-1-stable-prepare-rc4' into '10-1-stable'

Prepare 10.1 RC4 release See merge request gitlab-org/gitlab-ce!14953
parents 1652288f 8b744b21
......@@ -281,7 +281,7 @@ group :metrics do
gem 'influxdb', '~> 0.2', require: false
# Prometheus
gem 'prometheus-client-mmap', '~>0.7.0.beta14'
gem 'prometheus-client-mmap', '~>0.7.0.beta17'
gem 'raindrops', '~> 0.18'
end
......
......@@ -620,7 +620,7 @@ GEM
parser
unparser
procto (0.0.3)
prometheus-client-mmap (0.7.0.beta14)
prometheus-client-mmap (0.7.0.beta17)
mmap2 (~> 2.2, >= 2.2.7)
pry (0.10.4)
coderay (~> 1.1.0)
......@@ -1103,7 +1103,7 @@ DEPENDENCIES
pg (~> 0.18.2)
poltergeist (~> 1.9.0)
premailer-rails (~> 1.9.7)
prometheus-client-mmap (~> 0.7.0.beta14)
prometheus-client-mmap (~> 0.7.0.beta17)
pry-byebug (~> 3.4.1)
pry-rails (~> 0.3.4)
rack-attack (~> 4.4.1)
......
......@@ -57,7 +57,7 @@
},
showError(message) {
Flash((errorMessages[message]));
Flash(errorMessages[message]);
},
},
};
......
......@@ -57,7 +57,7 @@
},
showError(message) {
Flash((errorMessages[message]));
Flash(errorMessages[message]);
},
},
};
......
......@@ -4,7 +4,7 @@ class ContainerTagEntity < Grape::Entity
expose :name, :location, :revision, :short_revision, :total_size, :created_at
expose :destroy_path, if: -> (*) { can_destroy? } do |tag|
project_registry_repository_tag_path(project, tag.repository, tag.name, format: :json)
project_registry_repository_tag_path(project, tag.repository, tag.name)
end
private
......
......@@ -44,4 +44,4 @@
= render "discussions/diff_with_notes", discussion: discussion
- else
.panel.panel-default
= render "discussions/notes", discussion: discussion
= render partial: "discussions/notes", locals: { discussion: discussion, disable_collapse_class: true }
---
title: Force non diff resolved discussion to display when collapse toggled
merge_request:
author:
type: fixed
......@@ -281,8 +281,13 @@ constraints(ProjectUrlConstrainer.new) do
namespace :registry do
resources :repository, only: [] do
resources :tags, only: [:index, :destroy],
constraints: { id: Gitlab::Regex.container_registry_tag_regex }
# We default to JSON format in the controller to avoid ambiguity.
# `latest.json` could either be a request for a tag named `latest`
# in JSON format, or a request for tag named `latest.json`.
scope format: false do
resources :tags, only: [:index, :destroy],
constraints: { id: Gitlab::Regex.container_registry_tag_regex }
end
end
end
......
......@@ -14,9 +14,9 @@ module Gitlab
ENCODING_CONFIDENCE_THRESHOLD = 50
def encode!(message)
return nil unless message.respond_to? :force_encoding
return nil unless message.respond_to?(:force_encoding)
return message if message.encoding == Encoding::UTF_8 && message.valid_encoding?
# if message is utf-8 encoding, just return it
message.force_encoding("UTF-8")
return message if message.valid_encoding?
......@@ -50,6 +50,9 @@ module Gitlab
end
def encode_utf8(message)
return nil unless message.is_a?(String)
return message if message.encoding == Encoding::UTF_8 && message.valid_encoding?
detect = CharlockHolmes::EncodingDetector.detect(message)
if detect && detect[:encoding]
begin
......
......@@ -6,6 +6,9 @@ describe Gitlab::EncodingHelper do
describe '#encode!' do
[
["nil", nil, nil],
["empty string", "".encode("ASCII-8BIT"), "".encode("UTF-8")],
["invalid utf-8 encoded string", "my bad string\xE5".force_encoding("UTF-8"), "my bad string"],
[
'leaves ascii only string as is',
'ascii only string',
......@@ -81,6 +84,9 @@ describe Gitlab::EncodingHelper do
describe '#encode_utf8' do
[
["nil", nil, nil],
["empty string", "".encode("ASCII-8BIT"), "".encode("UTF-8")],
["invalid utf-8 encoded string", "my bad string\xE5".force_encoding("UTF-8"), "my bad stringå"],
[
"encodes valid utf8 encoded string to utf8",
"λ, λ, λ".encode("UTF-8"),
......@@ -95,12 +101,18 @@ describe Gitlab::EncodingHelper do
"encodes valid ISO-8859-1 encoded string to utf8",
"Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.".encode("ISO-8859-1", "UTF-8"),
"Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.".encode("UTF-8")
],
[
# Test case from https://gitlab.com/gitlab-org/gitlab-ce/issues/39227
"Equifax branch name",
"refs/heads/Equifax".encode("UTF-8"),
"refs/heads/Equifax".encode("UTF-8")
]
].each do |description, test_string, xpect|
it description do
r = ext_class.encode_utf8(test_string.force_encoding('UTF-8'))
r = ext_class.encode_utf8(test_string)
expect(r).to eq(xpect)
expect(r.encoding.name).to eq('UTF-8')
expect(r.encoding.name).to eq('UTF-8') if xpect
end
end
......
......@@ -121,14 +121,31 @@ shared_examples 'discussion comments' do |resource_name|
end
end
it 'clicking "Start discussion" will post a discussion' do
find(submit_selector).click
describe 'creating a discussion' do
before do
find(submit_selector).click
find(comments_selector, match: :first)
end
it 'clicking "Start discussion" will post a discussion' do
new_comment = all(comments_selector).last
expect(new_comment).to have_content 'a'
expect(new_comment).to have_selector '.discussion'
end
if resource_name == 'merge request'
it 'shows resolved discussion when toggled' do
click_button "Resolve discussion"
expect(page).to have_selector('.note-row-1', visible: true)
find(comments_selector, match: :first)
new_comment = all(comments_selector).last
refresh
click_button "Toggle discussion"
expect(new_comment).to have_content 'a'
expect(new_comment).to have_selector '.discussion'
expect(page).to have_selector('.note-row-1', visible: true)
end
end
end
if resource_name == 'issue'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment