From 8e9c787794b19759c17e83f13e770c0ff40fd8ca Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 27 Jul 2018 17:48:20 +0800 Subject: tooltip_message is frozen so dup it before sanitizing It's sad that sanitizing is updating the string directly. --- app/views/projects/jobs/_sidebar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/jobs/_sidebar.html.haml b/app/views/projects/jobs/_sidebar.html.haml index 64c441492bc..759efd4e9d4 100644 --- a/app/views/projects/jobs/_sidebar.html.haml +++ b/app/views/projects/jobs/_sidebar.html.haml @@ -86,7 +86,7 @@ - HasStatus::ORDERED_STATUSES.each do |build_status| - builds.select{|build| build.status == build_status}.each do |build| .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 = sprite_icon('arrow-right', size:16, css_class: 'icon-arrow-right') %span{ class: "ci-status-icon-#{build.status}" } -- cgit v1.2.3 From 7553046b8a469a3aec76733cf17a7e1441256f0d Mon Sep 17 00:00:00 2001 From: GitLab Release Tools Bot Date: Fri, 27 Jul 2018 21:20:34 +0000 Subject: Update CHANGELOG.md for 11.1.3 [ci skip] --- CHANGELOG.md | 18 ++++++++++++++++++ changelogs/unreleased/4525-fix-project-indexes.yml | 5 ----- .../48817-fix-mr-changes-discussion-navigation.yml | 5 ----- .../unreleased/_acet-fix-expanding-context-lines.yml | 5 ----- changelogs/unreleased/_acet-fix-mr-autosave.yml | 5 ----- .../unreleased/_acet-fix-outdated-discussions.yml | 5 ----- changelogs/unreleased/ide-edit-json-files.yml | 5 ----- .../unreleased/project-dropdown-list-overflow.yml | 5 ----- .../unreleased/tz-mr-refactor-memory-reduction.yml | 5 ----- changelogs/unreleased/zj-backup-timeout.yml | 5 ----- 10 files changed, 18 insertions(+), 45 deletions(-) delete mode 100644 changelogs/unreleased/4525-fix-project-indexes.yml delete mode 100644 changelogs/unreleased/48817-fix-mr-changes-discussion-navigation.yml delete mode 100644 changelogs/unreleased/_acet-fix-expanding-context-lines.yml delete mode 100644 changelogs/unreleased/_acet-fix-mr-autosave.yml delete mode 100644 changelogs/unreleased/_acet-fix-outdated-discussions.yml delete mode 100644 changelogs/unreleased/ide-edit-json-files.yml delete mode 100644 changelogs/unreleased/project-dropdown-list-overflow.yml delete mode 100644 changelogs/unreleased/tz-mr-refactor-memory-reduction.yml delete mode 100644 changelogs/unreleased/zj-backup-timeout.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba36bbad7b..b4b672b55c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ documentation](doc/development/changelog.md) for instructions on adding your own 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) ### Security (4 changes) diff --git a/changelogs/unreleased/4525-fix-project-indexes.yml b/changelogs/unreleased/4525-fix-project-indexes.yml deleted file mode 100644 index 930e3b934c2..00000000000 --- a/changelogs/unreleased/4525-fix-project-indexes.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Rework some projects table indexes around repository_storage field -merge_request: 20377 -author: -type: fixed diff --git a/changelogs/unreleased/48817-fix-mr-changes-discussion-navigation.yml b/changelogs/unreleased/48817-fix-mr-changes-discussion-navigation.yml deleted file mode 100644 index ec4b843b863..00000000000 --- a/changelogs/unreleased/48817-fix-mr-changes-discussion-navigation.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix navigation to First and Next discussion on MR Changes tab -merge_request: 20434 -author: -type: fixed diff --git a/changelogs/unreleased/_acet-fix-expanding-context-lines.yml b/changelogs/unreleased/_acet-fix-expanding-context-lines.yml deleted file mode 100644 index 41b4dbca5d6..00000000000 --- a/changelogs/unreleased/_acet-fix-expanding-context-lines.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix rendering of the context lines in MR diffs page -merge_request: 20642 -author: -type: fixed diff --git a/changelogs/unreleased/_acet-fix-mr-autosave.yml b/changelogs/unreleased/_acet-fix-mr-autosave.yml deleted file mode 100644 index f87b32f68e2..00000000000 --- a/changelogs/unreleased/_acet-fix-mr-autosave.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix autosave and ESC confirmation issues for MR discussions -merge_request: 20569 -author: -type: fixed diff --git a/changelogs/unreleased/_acet-fix-outdated-discussions.yml b/changelogs/unreleased/_acet-fix-outdated-discussions.yml deleted file mode 100644 index d31483b4765..00000000000 --- a/changelogs/unreleased/_acet-fix-outdated-discussions.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix showing outdated discussions on Changes tab -merge_request: 20445 -author: -type: fixed diff --git a/changelogs/unreleased/ide-edit-json-files.yml b/changelogs/unreleased/ide-edit-json-files.yml deleted file mode 100644 index 2a6e6b80de1..00000000000 --- a/changelogs/unreleased/ide-edit-json-files.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fixed IDE not opening JSON files -merge_request: 20798 -author: -type: fixed diff --git a/changelogs/unreleased/project-dropdown-list-overflow.yml b/changelogs/unreleased/project-dropdown-list-overflow.yml deleted file mode 100644 index 9b74a68291b..00000000000 --- a/changelogs/unreleased/project-dropdown-list-overflow.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Don't overflow project/group dropdown results -merge_request: 20704 -author: gfyoung -type: fixed diff --git a/changelogs/unreleased/tz-mr-refactor-memory-reduction.yml b/changelogs/unreleased/tz-mr-refactor-memory-reduction.yml deleted file mode 100644 index 16003fa9cad..00000000000 --- a/changelogs/unreleased/tz-mr-refactor-memory-reduction.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Reduces the client side memory footprint on merge requests -merge_request: 20744 -author: -type: performance diff --git a/changelogs/unreleased/zj-backup-timeout.yml b/changelogs/unreleased/zj-backup-timeout.yml deleted file mode 100644 index b2ad2ed8c63..00000000000 --- a/changelogs/unreleased/zj-backup-timeout.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Disable Gitaly timeouts when creating or restoring backups -merge_request: 20810 -author: -type: fixed -- cgit v1.2.3 From cef41153962a6dc5da1615f9f0e690c34ab8269e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 27 Jul 2018 15:35:12 -0700 Subject: Fix Karma failures due to invalid icon names The icon JSON field has been renamed from icon_status_success to status_success. --- .../pipelines/components/graph/dropdown_job_component.vue | 2 +- app/assets/javascripts/pipelines/components/graph/job_component.vue | 2 +- spec/javascripts/pipelines/graph/dropdown_job_component_spec.js | 6 +++--- spec/javascripts/pipelines/graph/job_component_spec.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue b/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue index 14518f86dc7..8487c8036ee 100644 --- a/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue @@ -14,7 +14,7 @@ import tooltip from '../../../vue_shared/directives/tooltip'; * "id": 4256, * "name": "test", * "status": { - * "icon": "icon_status_success", + * "icon": "status_success", * "text": "passed", * "label": "passed", * "group": "success", diff --git a/app/assets/javascripts/pipelines/components/graph/job_component.vue b/app/assets/javascripts/pipelines/components/graph/job_component.vue index 84a3d58b770..66f95147193 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_component.vue @@ -13,7 +13,7 @@ import tooltip from '../../../vue_shared/directives/tooltip'; * "id": 4256, * "name": "test", * "status": { - * "icon": "icon_status_success", + * "icon": "status_success", * "text": "passed", * "label": "passed", * "group": "success", diff --git a/spec/javascripts/pipelines/graph/dropdown_job_component_spec.js b/spec/javascripts/pipelines/graph/dropdown_job_component_spec.js index 608a0d4be67..ff584396d61 100644 --- a/spec/javascripts/pipelines/graph/dropdown_job_component_spec.js +++ b/spec/javascripts/pipelines/graph/dropdown_job_component_spec.js @@ -12,7 +12,7 @@ describe('dropdown job component', () => { id: 4256, name: '', status: { - icon: 'icon_status_success', + icon: 'status_success', text: 'passed', label: 'passed', tooltip: 'passed', @@ -31,7 +31,7 @@ describe('dropdown job component', () => { id: 4299, name: 'test', status: { - icon: 'icon_status_success', + icon: 'status_success', text: 'passed', label: 'passed', tooltip: 'passed', @@ -50,7 +50,7 @@ describe('dropdown job component', () => { name: 'rspec:linux', size: 2, status: { - icon: 'icon_status_success', + icon: 'status_success', text: 'passed', label: 'passed', tooltip: 'passed', diff --git a/spec/javascripts/pipelines/graph/job_component_spec.js b/spec/javascripts/pipelines/graph/job_component_spec.js index 59f18d9397d..215ce1e81b5 100644 --- a/spec/javascripts/pipelines/graph/job_component_spec.js +++ b/spec/javascripts/pipelines/graph/job_component_spec.js @@ -169,7 +169,7 @@ describe('pipeline graph job component', () => { id: 4259, name: '', status: { - icon: 'icon_status_success', + icon: 'status_success', label: 'success', tooltip: 'failed', }, -- cgit v1.2.3 From 45ff4e31094a8b79ed603ae506990b6fa0e7c96e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 28 Jul 2018 22:17:21 -0700 Subject: Add support for searching users by confirmed e-mails This is in preparation for modifying importers to assign e-mails for only confirmed emails. --- app/models/user.rb | 10 +++++++--- .../sh-support-users-find-by-confirmed-emails.yml | 5 +++++ spec/models/user_spec.rb | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/sh-support-users-find-by-confirmed-emails.yml diff --git a/app/models/user.rb b/app/models/user.rb index 58429f8d607..03549872924 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 :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 :confirmed, -> { where.not(confirmed_at: nil) } def self.with_two_factor_indistinct joins("LEFT OUTER JOIN u2f_registrations AS u2f ON u2f.user_id = users.id") @@ -293,14 +294,17 @@ class User < ActiveRecord::Base end # Find a User by their primary email or any associated secondary email - def find_by_any_email(email) - by_any_email(email).take + def find_by_any_email(email, confirmed: false) + by_any_email(email, confirmed: confirmed).take end # 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 = users.confirmed if confirmed + emails = joins(:emails).where(emails: { email: email }) + emails = emails.confirmed if confirmed union = Gitlab::SQL::Union.new([users, emails]) from("(#{union.to_sql}) #{table_name}") diff --git a/changelogs/unreleased/sh-support-users-find-by-confirmed-emails.yml b/changelogs/unreleased/sh-support-users-find-by-confirmed-emails.yml new file mode 100644 index 00000000000..4b0c8117b3e --- /dev/null +++ b/changelogs/unreleased/sh-support-users-find-by-confirmed-emails.yml @@ -0,0 +1,5 @@ +--- +title: Add support for searching users by confirmed e-mails +merge_request: 20893 +author: +type: other diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index fc46551c3be..982d24e7eab 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -949,6 +949,7 @@ describe User do 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, confirmed: true)).to eq user end it 'finds by secondary email' do @@ -956,11 +957,19 @@ describe User do user = email.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 it 'returns nil when nothing found' do expect(described_class.find_by_any_email('')).to be_nil 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 describe '.by_any_email' do @@ -974,6 +983,12 @@ describe User do expect(described_class.by_any_email(user.email)).to eq([user]) 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 describe '.search' do -- cgit v1.2.3 From 59fdc168dcaaa7135bdf430691fd89e45a6a713c Mon Sep 17 00:00:00 2001 From: Jan Beckmann Date: Mon, 30 Jul 2018 08:54:49 +0000 Subject: Resolve "Merge Request API response is missing changes_count" --- .../unreleased/47728-mr-api-documentation-changes.yml | 5 +++++ doc/api/merge_requests.md | 17 +++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 changelogs/unreleased/47728-mr-api-documentation-changes.yml diff --git a/changelogs/unreleased/47728-mr-api-documentation-changes.yml b/changelogs/unreleased/47728-mr-api-documentation-changes.yml new file mode 100644 index 00000000000..12720f280a1 --- /dev/null +++ b/changelogs/unreleased/47728-mr-api-documentation-changes.yml @@ -0,0 +1,5 @@ +--- +title: Remove changes_count from MR API documentation where necessary +merge_request: 19745 +author: Jan Beckmann +type: fixed diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 34c2dd7b34d..58d05a70d05 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -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 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?state=opened @@ -104,7 +99,6 @@ Parameters: "sha": "8888888888888888888888888888888888888888", "merge_commit_sha": null, "user_notes_count": 1, - "changes_count": "1", "should_remove_source_branch": true, "force_remove_source_branch": false, "squash": false, @@ -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 `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: @@ -224,7 +214,6 @@ Parameters: "sha": "8888888888888888888888888888888888888888", "merge_commit_sha": null, "user_notes_count": 1, - "changes_count": "1", "should_remove_source_branch": true, "force_remove_source_branch": false, "squash": false, @@ -331,7 +320,6 @@ Parameters: "sha": "8888888888888888888888888888888888888888", "merge_commit_sha": null, "user_notes_count": 1, - "changes_count": "1", "should_remove_source_branch": true, "force_remove_source_branch": false, "web_url": "http://example.com/example/example/merge_requests/1", @@ -350,6 +338,11 @@ Parameters: 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 ``` -- cgit v1.2.3