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 ...@@ -281,7 +281,7 @@ group :metrics do
gem 'influxdb', '~> 0.2', require: false gem 'influxdb', '~> 0.2', require: false
# Prometheus # Prometheus
gem 'prometheus-client-mmap', '~>0.7.0.beta14' gem 'prometheus-client-mmap', '~>0.7.0.beta17'
gem 'raindrops', '~> 0.18' gem 'raindrops', '~> 0.18'
end end
......
...@@ -620,7 +620,7 @@ GEM ...@@ -620,7 +620,7 @@ GEM
parser parser
unparser unparser
procto (0.0.3) procto (0.0.3)
prometheus-client-mmap (0.7.0.beta14) prometheus-client-mmap (0.7.0.beta17)
mmap2 (~> 2.2, >= 2.2.7) mmap2 (~> 2.2, >= 2.2.7)
pry (0.10.4) pry (0.10.4)
coderay (~> 1.1.0) coderay (~> 1.1.0)
...@@ -1103,7 +1103,7 @@ DEPENDENCIES ...@@ -1103,7 +1103,7 @@ DEPENDENCIES
pg (~> 0.18.2) pg (~> 0.18.2)
poltergeist (~> 1.9.0) poltergeist (~> 1.9.0)
premailer-rails (~> 1.9.7) 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-byebug (~> 3.4.1)
pry-rails (~> 0.3.4) pry-rails (~> 0.3.4)
rack-attack (~> 4.4.1) rack-attack (~> 4.4.1)
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
}, },
showError(message) { showError(message) {
Flash((errorMessages[message])); Flash(errorMessages[message]);
}, },
}, },
}; };
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
}, },
showError(message) { showError(message) {
Flash((errorMessages[message])); Flash(errorMessages[message]);
}, },
}, },
}; };
......
...@@ -4,7 +4,7 @@ class ContainerTagEntity < Grape::Entity ...@@ -4,7 +4,7 @@ class ContainerTagEntity < Grape::Entity
expose :name, :location, :revision, :short_revision, :total_size, :created_at expose :name, :location, :revision, :short_revision, :total_size, :created_at
expose :destroy_path, if: -> (*) { can_destroy? } do |tag| 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 end
private private
......
...@@ -44,4 +44,4 @@ ...@@ -44,4 +44,4 @@
= render "discussions/diff_with_notes", discussion: discussion = render "discussions/diff_with_notes", discussion: discussion
- else - else
.panel.panel-default .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,10 +281,15 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -281,10 +281,15 @@ constraints(ProjectUrlConstrainer.new) do
namespace :registry do namespace :registry do
resources :repository, only: [] do resources :repository, only: [] do
# 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], resources :tags, only: [:index, :destroy],
constraints: { id: Gitlab::Regex.container_registry_tag_regex } constraints: { id: Gitlab::Regex.container_registry_tag_regex }
end end
end end
end
resources :milestones, constraints: { id: /\d+/ } do resources :milestones, constraints: { id: /\d+/ } do
member do member do
......
...@@ -14,9 +14,9 @@ module Gitlab ...@@ -14,9 +14,9 @@ module Gitlab
ENCODING_CONFIDENCE_THRESHOLD = 50 ENCODING_CONFIDENCE_THRESHOLD = 50
def encode!(message) 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") message.force_encoding("UTF-8")
return message if message.valid_encoding? return message if message.valid_encoding?
...@@ -50,6 +50,9 @@ module Gitlab ...@@ -50,6 +50,9 @@ module Gitlab
end end
def encode_utf8(message) 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) detect = CharlockHolmes::EncodingDetector.detect(message)
if detect && detect[:encoding] if detect && detect[:encoding]
begin begin
......
...@@ -6,6 +6,9 @@ describe Gitlab::EncodingHelper do ...@@ -6,6 +6,9 @@ describe Gitlab::EncodingHelper do
describe '#encode!' 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', 'leaves ascii only string as is',
'ascii only string', 'ascii only string',
...@@ -81,6 +84,9 @@ describe Gitlab::EncodingHelper do ...@@ -81,6 +84,9 @@ describe Gitlab::EncodingHelper do
describe '#encode_utf8' 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", "encodes valid utf8 encoded string to utf8",
"λ, λ, λ".encode("UTF-8"), "λ, λ, λ".encode("UTF-8"),
...@@ -95,12 +101,18 @@ describe Gitlab::EncodingHelper do ...@@ -95,12 +101,18 @@ describe Gitlab::EncodingHelper do
"encodes valid ISO-8859-1 encoded string to utf8", "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("ISO-8859-1", "UTF-8"),
"Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.".encode("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| ].each do |description, test_string, xpect|
it description do 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).to eq(xpect)
expect(r.encoding.name).to eq('UTF-8') expect(r.encoding.name).to eq('UTF-8') if xpect
end end
end end
......
...@@ -121,16 +121,33 @@ shared_examples 'discussion comments' do |resource_name| ...@@ -121,16 +121,33 @@ shared_examples 'discussion comments' do |resource_name|
end end
end end
it 'clicking "Start discussion" will post a discussion' do describe 'creating a discussion' do
before do
find(submit_selector).click find(submit_selector).click
find(comments_selector, match: :first) find(comments_selector, match: :first)
end
it 'clicking "Start discussion" will post a discussion' do
new_comment = all(comments_selector).last new_comment = all(comments_selector).last
expect(new_comment).to have_content 'a' expect(new_comment).to have_content 'a'
expect(new_comment).to have_selector '.discussion' expect(new_comment).to have_selector '.discussion'
end 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)
refresh
click_button "Toggle discussion"
expect(page).to have_selector('.note-row-1', visible: true)
end
end
end
if resource_name == 'issue' if resource_name == 'issue'
it "clicking 'Start discussion & close #{resource_name}' will post a discussion and close the #{resource_name}" do it "clicking 'Start discussion & close #{resource_name}' will post a discussion and close the #{resource_name}" do
find(close_selector).click find(close_selector).click
......
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