提交 9fe4c279 编写于 作者: G Grzegorz Bizon

Merge branch 'master' into 1499-api-endpoint-for-configuring-pull-mirroring-via-http-ce

...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
documentation](doc/development/changelog.md) for instructions on adding your own documentation](doc/development/changelog.md) for instructions on adding your own
entry. entry.
## 11.1.3 (2018-07-27)
### Fixed (8 changes, 1 of them is from the community)
- Rework some projects table indexes around repository_storage field. !20377
- Fix navigation to First and Next discussion on MR Changes tab. !20434
- Fix showing outdated discussions on Changes tab. !20445
- Fix autosave and ESC confirmation issues for MR discussions. !20569
- Fix rendering of the context lines in MR diffs page. !20642
- Don't overflow project/group dropdown results. !20704 (gfyoung)
- Fixed IDE not opening JSON files. !20798
- Disable Gitaly timeouts when creating or restoring backups. !20810
### Performance (1 change)
- Reduces the client side memory footprint on merge requests. !20744
## 11.1.2 (2018-07-26) ## 11.1.2 (2018-07-26)
### Security (4 changes) ### Security (4 changes)
......
...@@ -14,7 +14,7 @@ import tooltip from '../../../vue_shared/directives/tooltip'; ...@@ -14,7 +14,7 @@ import tooltip from '../../../vue_shared/directives/tooltip';
* "id": 4256, * "id": 4256,
* "name": "test", * "name": "test",
* "status": { * "status": {
* "icon": "icon_status_success", * "icon": "status_success",
* "text": "passed", * "text": "passed",
* "label": "passed", * "label": "passed",
* "group": "success", * "group": "success",
......
...@@ -13,7 +13,7 @@ import tooltip from '../../../vue_shared/directives/tooltip'; ...@@ -13,7 +13,7 @@ import tooltip from '../../../vue_shared/directives/tooltip';
* "id": 4256, * "id": 4256,
* "name": "test", * "name": "test",
* "status": { * "status": {
* "icon": "icon_status_success", * "icon": "status_success",
* "text": "passed", * "text": "passed",
* "label": "passed", * "label": "passed",
* "group": "success", * "group": "success",
......
...@@ -248,6 +248,7 @@ class User < ActiveRecord::Base ...@@ -248,6 +248,7 @@ class User < ActiveRecord::Base
scope :todo_authors, ->(user_id, state) { where(id: Todo.where(user_id: user_id, state: state).select(:author_id)) } scope :todo_authors, ->(user_id, state) { where(id: Todo.where(user_id: user_id, state: state).select(:author_id)) }
scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) } scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) }
scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'ASC')) } scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'ASC')) }
scope :confirmed, -> { where.not(confirmed_at: nil) }
def self.with_two_factor_indistinct def self.with_two_factor_indistinct
joins("LEFT OUTER JOIN u2f_registrations AS u2f ON u2f.user_id = users.id") joins("LEFT OUTER JOIN u2f_registrations AS u2f ON u2f.user_id = users.id")
...@@ -293,14 +294,17 @@ class User < ActiveRecord::Base ...@@ -293,14 +294,17 @@ class User < ActiveRecord::Base
end end
# Find a User by their primary email or any associated secondary email # Find a User by their primary email or any associated secondary email
def find_by_any_email(email) def find_by_any_email(email, confirmed: false)
by_any_email(email).take by_any_email(email, confirmed: confirmed).take
end end
# Returns a relation containing all the users for the given Email address # Returns a relation containing all the users for the given Email address
def by_any_email(email) def by_any_email(email, confirmed: false)
users = where(email: email) users = where(email: email)
users = users.confirmed if confirmed
emails = joins(:emails).where(emails: { email: email }) emails = joins(:emails).where(emails: { email: email })
emails = emails.confirmed if confirmed
union = Gitlab::SQL::Union.new([users, emails]) union = Gitlab::SQL::Union.new([users, emails])
from("(#{union.to_sql}) #{table_name}") from("(#{union.to_sql}) #{table_name}")
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
- HasStatus::ORDERED_STATUSES.each do |build_status| - HasStatus::ORDERED_STATUSES.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build| - builds.select{|build| build.status == build_status}.each do |build|
.build-job{ class: sidebar_build_class(build, @build), data: { stage: build.stage } } .build-job{ class: sidebar_build_class(build, @build), data: { stage: build.stage } }
- tooltip = sanitize(build.tooltip_message) - tooltip = sanitize(build.tooltip_message.dup)
= link_to(project_job_path(@project, build), data: { toggle: 'tooltip', html: 'true', title: tooltip, container: 'body' }) do = link_to(project_job_path(@project, build), data: { toggle: 'tooltip', html: 'true', title: tooltip, container: 'body' }) do
= sprite_icon('arrow-right', size:16, css_class: 'icon-arrow-right') = sprite_icon('arrow-right', size:16, css_class: 'icon-arrow-right')
%span{ class: "ci-status-icon-#{build.status}" } %span{ class: "ci-status-icon-#{build.status}" }
......
---
title: Rework some projects table indexes around repository_storage field
merge_request: 20377
author:
type: fixed
---
title: Remove changes_count from MR API documentation where necessary
merge_request: 19745
author: Jan Beckmann
type: fixed
---
title: Fix navigation to First and Next discussion on MR Changes tab
merge_request: 20434
author:
type: fixed
---
title: Fix rendering of the context lines in MR diffs page
merge_request: 20642
author:
type: fixed
---
title: Fix autosave and ESC confirmation issues for MR discussions
merge_request: 20569
author:
type: fixed
---
title: Fix showing outdated discussions on Changes tab
merge_request: 20445
author:
type: fixed
---
title: Fixed IDE not opening JSON files
merge_request: 20798
author:
type: fixed
---
title: Don't overflow project/group dropdown results
merge_request: 20704
author: gfyoung
type: fixed
---
title: Add support for searching users by confirmed e-mails
merge_request: 20893
author:
type: other
---
title: Reduces the client side memory footprint on merge requests
merge_request: 20744
author:
type: performance
---
title: Disable Gitaly timeouts when creating or restoring backups
merge_request: 20810
author:
type: fixed
...@@ -15,11 +15,6 @@ given state (`opened`, `closed`, `locked`, or `merged`) or all of them (`all`). ...@@ -15,11 +15,6 @@ given state (`opened`, `closed`, `locked`, or `merged`) or all of them (`all`).
The pagination parameters `page` and `per_page` can be used to The pagination parameters `page` and `per_page` can be used to
restrict the list of merge requests. restrict the list of merge requests.
**Note**: the `changes_count` value in the response is a string, not an
integer. This is because when an MR has too many changes to display and store,
it will be capped at 1,000. In that case, the API will return the string
`"1000+"` for the changes count.
``` ```
GET /merge_requests GET /merge_requests
GET /merge_requests?state=opened GET /merge_requests?state=opened
...@@ -104,7 +99,6 @@ Parameters: ...@@ -104,7 +99,6 @@ Parameters:
"sha": "8888888888888888888888888888888888888888", "sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null, "merge_commit_sha": null,
"user_notes_count": 1, "user_notes_count": 1,
"changes_count": "1",
"should_remove_source_branch": true, "should_remove_source_branch": true,
"force_remove_source_branch": false, "force_remove_source_branch": false,
"squash": false, "squash": false,
...@@ -144,10 +138,6 @@ will be the same. In the case of a merge request from a fork, ...@@ -144,10 +138,6 @@ will be the same. In the case of a merge request from a fork,
`target_project_id` and `project_id` will be the same and `target_project_id` and `project_id` will be the same and
`source_project_id` will be the fork project's ID. `source_project_id` will be the fork project's ID.
**Note**: the `changes_count` value in the response is a string, not an
integer. This is because when an MR has too many changes to display and store,
it will be capped at 1,000. In that case, the API will return the string
`"1000+"` for the changes count.
Parameters: Parameters:
...@@ -224,7 +214,6 @@ Parameters: ...@@ -224,7 +214,6 @@ Parameters:
"sha": "8888888888888888888888888888888888888888", "sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null, "merge_commit_sha": null,
"user_notes_count": 1, "user_notes_count": 1,
"changes_count": "1",
"should_remove_source_branch": true, "should_remove_source_branch": true,
"force_remove_source_branch": false, "force_remove_source_branch": false,
"squash": false, "squash": false,
...@@ -331,7 +320,6 @@ Parameters: ...@@ -331,7 +320,6 @@ Parameters:
"sha": "8888888888888888888888888888888888888888", "sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null, "merge_commit_sha": null,
"user_notes_count": 1, "user_notes_count": 1,
"changes_count": "1",
"should_remove_source_branch": true, "should_remove_source_branch": true,
"force_remove_source_branch": false, "force_remove_source_branch": false,
"web_url": "http://example.com/example/example/merge_requests/1", "web_url": "http://example.com/example/example/merge_requests/1",
...@@ -350,6 +338,11 @@ Parameters: ...@@ -350,6 +338,11 @@ Parameters:
Shows information about a single merge request. Shows information about a single merge request.
**Note**: the `changes_count` value in the response is a string, not an
integer. This is because when an MR has too many changes to display and store,
it will be capped at 1,000. In that case, the API will return the string
`"1000+"` for the changes count.
``` ```
GET /projects/:id/merge_requests/:merge_request_iid GET /projects/:id/merge_requests/:merge_request_iid
``` ```
......
...@@ -12,7 +12,7 @@ describe('dropdown job component', () => { ...@@ -12,7 +12,7 @@ describe('dropdown job component', () => {
id: 4256, id: 4256,
name: '<img src=x onerror=alert(document.domain)>', name: '<img src=x onerror=alert(document.domain)>',
status: { status: {
icon: 'icon_status_success', icon: 'status_success',
text: 'passed', text: 'passed',
label: 'passed', label: 'passed',
tooltip: 'passed', tooltip: 'passed',
...@@ -31,7 +31,7 @@ describe('dropdown job component', () => { ...@@ -31,7 +31,7 @@ describe('dropdown job component', () => {
id: 4299, id: 4299,
name: 'test', name: 'test',
status: { status: {
icon: 'icon_status_success', icon: 'status_success',
text: 'passed', text: 'passed',
label: 'passed', label: 'passed',
tooltip: 'passed', tooltip: 'passed',
...@@ -50,7 +50,7 @@ describe('dropdown job component', () => { ...@@ -50,7 +50,7 @@ describe('dropdown job component', () => {
name: 'rspec:linux', name: 'rspec:linux',
size: 2, size: 2,
status: { status: {
icon: 'icon_status_success', icon: 'status_success',
text: 'passed', text: 'passed',
label: 'passed', label: 'passed',
tooltip: 'passed', tooltip: 'passed',
......
...@@ -169,7 +169,7 @@ describe('pipeline graph job component', () => { ...@@ -169,7 +169,7 @@ describe('pipeline graph job component', () => {
id: 4259, id: 4259,
name: '<img src=x onerror=alert(document.domain)>', name: '<img src=x onerror=alert(document.domain)>',
status: { status: {
icon: 'icon_status_success', icon: 'status_success',
label: 'success', label: 'success',
tooltip: 'failed', tooltip: 'failed',
}, },
......
...@@ -949,6 +949,7 @@ describe User do ...@@ -949,6 +949,7 @@ describe User do
user = create(:user, email: 'foo@example.com') user = create(:user, email: 'foo@example.com')
expect(described_class.find_by_any_email(user.email)).to eq user expect(described_class.find_by_any_email(user.email)).to eq user
expect(described_class.find_by_any_email(user.email, confirmed: true)).to eq user
end end
it 'finds by secondary email' do it 'finds by secondary email' do
...@@ -956,11 +957,19 @@ describe User do ...@@ -956,11 +957,19 @@ describe User do
user = email.user user = email.user
expect(described_class.find_by_any_email(email.email)).to eq user expect(described_class.find_by_any_email(email.email)).to eq user
expect(described_class.find_by_any_email(email.email, confirmed: true)).to eq user
end end
it 'returns nil when nothing found' do it 'returns nil when nothing found' do
expect(described_class.find_by_any_email('')).to be_nil expect(described_class.find_by_any_email('')).to be_nil
end end
it 'returns nil when user is not confirmed' do
user = create(:user, email: 'foo@example.com', confirmed_at: nil)
expect(described_class.find_by_any_email(user.email, confirmed: false)).to eq(user)
expect(described_class.find_by_any_email(user.email, confirmed: true)).to be_nil
end
end end
describe '.by_any_email' do describe '.by_any_email' do
...@@ -974,6 +983,12 @@ describe User do ...@@ -974,6 +983,12 @@ describe User do
expect(described_class.by_any_email(user.email)).to eq([user]) expect(described_class.by_any_email(user.email)).to eq([user])
end end
it 'returns a relation of users for confirmed users' do
user = create(:user)
expect(described_class.by_any_email(user.email, confirmed: true)).to eq([user])
end
end end
describe '.search' do describe '.search' do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册