Commit 603acf6d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ce-to-ee-2018-09-24' into 'master'

CE upstream - 2018-09-24 18:22 UTC

See merge request gitlab-org/gitlab-ee!7469
parents f15c7dd8 18defcaa
...@@ -1114,7 +1114,8 @@ review: ...@@ -1114,7 +1114,8 @@ review:
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
stage: test stage: test
allow_failure: true allow_failure: true
before_script: [] before_script:
- gem install gitlab --no-document
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
HOST_SUFFIX: "$CI_ENVIRONMENT_SLUG" HOST_SUFFIX: "$CI_ENVIRONMENT_SLUG"
......
...@@ -173,15 +173,23 @@ ...@@ -173,15 +173,23 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
button {
display: none;
}
} }
.board-title { .board-title {
padding: 0; padding: 0;
border-bottom: 0; border-bottom: 0;
justify-content: center;
> span { > span {
width: 100%;
margin-top: -12px;
display: block; display: block;
transform: rotate(90deg) translate(35px, 10px); transform: rotate(90deg) translate(35px, 0);
overflow: initial;
} }
} }
......
...@@ -10,10 +10,7 @@ class Groups::LabelsController < Groups::ApplicationController ...@@ -10,10 +10,7 @@ class Groups::LabelsController < Groups::ApplicationController
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
@labels = @group.labels @labels = GroupLabelsFinder.new(@group, params.merge(sort: sort)).execute
.optionally_search(params[:search])
.order_by(sort)
.page(params[:page])
end end
format.json do format.json do
render json: LabelSerializer.new.represent_appearance(available_labels) render json: LabelSerializer.new.represent_appearance(available_labels)
......
# frozen_string_literal: true
class GroupLabelsFinder
attr_reader :group, :params
def initialize(group, params = {})
@group = group
@params = params
end
def execute
group.labels
.optionally_search(params[:search])
.order_by(params[:sort])
.page(params[:page])
end
end
...@@ -5,6 +5,7 @@ module Notes ...@@ -5,6 +5,7 @@ module Notes
prepend ::EE::Notes::BuildService prepend ::EE::Notes::BuildService
def execute def execute
should_resolve = false
in_reply_to_discussion_id = params.delete(:in_reply_to_discussion_id) in_reply_to_discussion_id = params.delete(:in_reply_to_discussion_id)
if in_reply_to_discussion_id.present? if in_reply_to_discussion_id.present?
...@@ -17,12 +18,17 @@ module Notes ...@@ -17,12 +18,17 @@ module Notes
end end
params.merge!(discussion.reply_attributes) params.merge!(discussion.reply_attributes)
should_resolve = discussion.resolved?
end end
note = Note.new(params) note = Note.new(params)
note.project = project note.project = project
note.author = current_user note.author = current_user
if should_resolve
note.resolve_without_save(current_user)
end
note note
end end
......
- @hide_top_links = true - @hide_top_links = true
- breadcrumb_title "Snippets" - add_to_breadcrumbs "Snippets", dashboard_snippets_path
- breadcrumb_title "New"
- page_title "New Snippet" - page_title "New Snippet"
%h3.page-title %h3.page-title
New Snippet New Snippet
......
---
title: Fix resolved discussions being unresolved when commented on
merge_request: 21881
author:
type: fixed
---
title: Fix broken styling when issue board is collapsed
merge_request: 21868
author: Andrea Leone
type: fixed
---
title: Add link to User Snippets in breadcrumbs of New User Snippet page
merge_request:
author: J.D. Bean
type: add
...@@ -30,6 +30,7 @@ are very appreciative of the work done by translators and proofreaders! ...@@ -30,6 +30,7 @@ are very appreciative of the work done by translators and proofreaders!
- Korean - Korean
- Chang-Ho Cha - [GitLab](https://gitlab.com/changho-cha), [Crowdin](https://crowdin.com/profile/zzazang) - Chang-Ho Cha - [GitLab](https://gitlab.com/changho-cha), [Crowdin](https://crowdin.com/profile/zzazang)
- Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve)
- Ji Hun Oh - [GitLab](https://gitlab.com/Baw-Appie), [Crowdin](https://crowdin.com/profile/BawAppie)
- Polish - Polish
- Filip Mech - [GitLab](https://gitlab.com/mehenz), [Crowdin](https://crowdin.com/profile/mehenz) - Filip Mech - [GitLab](https://gitlab.com/mehenz), [Crowdin](https://crowdin.com/profile/mehenz)
- Portuguese, Brazilian - Portuguese, Brazilian
......
...@@ -71,11 +71,6 @@ For an overview on the creation of Auto DevOps, read the blog post [From 2/3 of ...@@ -71,11 +71,6 @@ For an overview on the creation of Auto DevOps, read the blog post [From 2/3 of
## Requirements ## Requirements
TIP: **Tip:**
For self-hosted installations, the easiest way to make use of Auto DevOps is to
install GitLab inside a Kubernetes cluster using the [GitLab Omnibus Helm Chart]
which automatically installs and configures everything you need!
To make full use of Auto DevOps, you will need: To make full use of Auto DevOps, you will need:
1. **GitLab Runner** (needed for all stages) - Your Runner needs to be 1. **GitLab Runner** (needed for all stages) - Your Runner needs to be
...@@ -101,10 +96,6 @@ To make full use of Auto DevOps, you will need: ...@@ -101,10 +96,6 @@ To make full use of Auto DevOps, you will need:
Kubernetes cluster using the Kubernetes cluster using the
[`nginx-ingress`](https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress) [`nginx-ingress`](https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress)
Helm chart. Helm chart.
1. **Wildcard TLS termination** - You can deploy the
[`kube-lego`](https://github.com/kubernetes/charts/tree/master/stable/kube-lego)
Helm chart to your Kubernetes cluster to automatically issue certificates
for your domains using Let's Encrypt.
1. **Prometheus** (needed for Auto Monitoring) - To enable Auto Monitoring, you 1. **Prometheus** (needed for Auto Monitoring) - To enable Auto Monitoring, you
will need Prometheus installed somewhere (inside or outside your cluster) and will need Prometheus installed somewhere (inside or outside your cluster) and
configured to scrape your Kubernetes cluster. To get response metrics configured to scrape your Kubernetes cluster. To get response metrics
...@@ -148,11 +139,6 @@ Auto DevOps base domain to `1.2.3.4.nip.io`. ...@@ -148,11 +139,6 @@ Auto DevOps base domain to `1.2.3.4.nip.io`.
Once set up, all requests will hit the load balancer, which in turn will route Once set up, all requests will hit the load balancer, which in turn will route
them to the Kubernetes pods that run your application(s). them to the Kubernetes pods that run your application(s).
NOTE: **Note:**
If GitLab is installed using the [GitLab Omnibus Helm Chart], there are two
options: provide a static IP, or have one assigned. For more information see the
relevant docs on the [network prerequisites](../../install/kubernetes/gitlab_omnibus.md#networking-prerequisites).
## Using multiple Kubernetes clusters **[PREMIUM]** ## Using multiple Kubernetes clusters **[PREMIUM]**
When using Auto DevOps, you may want to deploy different environments to When using Auto DevOps, you may want to deploy different environments to
...@@ -482,10 +468,7 @@ The metrics include: ...@@ -482,10 +468,7 @@ The metrics include:
- **Response Metrics:** latency, throughput, error rate - **Response Metrics:** latency, throughput, error rate
- **System Metrics:** CPU utilization, memory utilization - **System Metrics:** CPU utilization, memory utilization
If GitLab has been deployed using the [GitLab Omnibus Helm Chart], no In order to make use of monitoring you need to:
configuration is required.
If you have installed GitLab using a different method, you need to:
1. [Deploy Prometheus](../../user/project/integrations/prometheus.md#configuring-your-own-prometheus-server-within-kubernetes) into your Kubernetes cluster 1. [Deploy Prometheus](../../user/project/integrations/prometheus.md#configuring-your-own-prometheus-server-within-kubernetes) into your Kubernetes cluster
1. If you would like response metrics, ensure you are running at least version 1. If you would like response metrics, ensure you are running at least version
...@@ -850,6 +833,5 @@ curl --data "value=true" --header "PRIVATE-TOKEN: personal_access_token" https:/ ...@@ -850,6 +833,5 @@ curl --data "value=true" --header "PRIVATE-TOKEN: personal_access_token" https:/
[container-registry]: ../../user/project/container_registry.md [container-registry]: ../../user/project/container_registry.md
[postgresql]: https://www.postgresql.org/ [postgresql]: https://www.postgresql.org/
[Auto DevOps template]: https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml [Auto DevOps template]: https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml
[GitLab Omnibus Helm Chart]: ../../install/kubernetes/gitlab_omnibus.md
[ee]: https://about.gitlab.com/pricing/ [ee]: https://about.gitlab.com/pricing/
[ce-19507]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19507 [ce-19507]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19507
...@@ -139,29 +139,35 @@ describe 'Merge request > User resolves diff notes and discussions', :js do ...@@ -139,29 +139,35 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
expect(find('.diffs .diff-file .notes_holder')).to be_visible expect(find('.diffs .diff-file .notes_holder')).to be_visible
end end
end end
end
it 'allows user to resolve from reply form without a comment' do describe 'reply form' do
before do
click_button 'Toggle discussion'
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Reply...' click_button 'Reply...'
end
end
click_button 'Resolve discussion' it 'allows user to comment' do
page.within '.diff-content' do
find('.js-note-text').set 'testing'
click_button 'Comment'
wait_for_requests
end end
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('1/1 discussion resolved') expect(page).to have_content('1/1 discussion resolved')
expect(page).to have_selector('.line-resolve-btn.is-active')
end end
end end
it 'allows user to unresolve from reply form without a comment' do it 'allows user to unresolve from reply form without a comment' do
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Resolve discussion'
sleep 1
click_button 'Reply...'
click_button 'Unresolve discussion' click_button 'Unresolve discussion'
wait_for_requests
end end
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
...@@ -170,34 +176,47 @@ describe 'Merge request > User resolves diff notes and discussions', :js do ...@@ -170,34 +176,47 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
end end
end end
it 'allows user to comment & resolve discussion' do it 'allows user to comment & unresolve discussion' do
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Reply...'
find('.js-note-text').set 'testing' find('.js-note-text').set 'testing'
click_button 'Comment & resolve discussion' click_button 'Comment & unresolve discussion'
wait_for_requests
end end
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('1/1 discussion resolved') expect(page).to have_content('0/1 discussion resolved')
expect(page).to have_selector('.line-resolve-btn.is-active') end
end
end end
end end
it 'allows user to comment & unresolve discussion' do it 'allows user to resolve from reply form without a comment' do
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Reply...'
click_button 'Resolve discussion' click_button 'Resolve discussion'
end
page.within '.line-resolve-all-container' do
expect(page).to have_content('1/1 discussion resolved')
expect(page).to have_selector('.line-resolve-btn.is-active')
end
end
it 'allows user to comment & resolve discussion' do
page.within '.diff-content' do
click_button 'Reply...' click_button 'Reply...'
find('.js-note-text').set 'testing' find('.js-note-text').set 'testing'
click_button 'Comment & unresolve discussion' click_button 'Comment & resolve discussion'
end end
page.within '.line-resolve-all-container' do page.within '.line-resolve-all-container' do
expect(page).to have_content('0/1 discussion resolved') expect(page).to have_content('1/1 discussion resolved')
expect(page).to have_selector('.line-resolve-btn.is-active')
end end
end end
......
require 'rails_helper'
describe 'New user snippet breadcrumbs' do
let(:user) { create(:user) }
before do
sign_in(user)
visit new_snippet_path
end
it 'display a link to user snippets and new user snippet pages' do
page.within '.breadcrumbs' do
expect(find_link('Snippets')[:href]).to end_with(dashboard_snippets_path)
expect(find_link('New')[:href]).to end_with(new_snippet_path)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe GroupLabelsFinder, '#execute' do
let!(:group) { create(:group) }
let!(:label1) { create(:group_label, title: 'Foo', description: 'Lorem ipsum', group: group) }
let!(:label2) { create(:group_label, title: 'Bar', description: 'Fusce consequat', group: group) }
it 'returns all group labels sorted by name if no params' do
result = described_class.new(group).execute
expect(result.to_a).to match_array([label2, label1])
end
it 'returns all group labels sorted by name desc' do
result = described_class.new(group, sort: 'name_desc').execute
expect(result.to_a).to match_array([label2, label1])
end
it 'returns group labels that march search' do
result = described_class.new(group, search: 'Foo').execute
expect(result.to_a).to match_array([label1])
end
it 'returns second page of labels' do
result = described_class.new(group, page: '2').execute
expect(result.to_a).to match_array([])
end
end
...@@ -4,6 +4,8 @@ describe Notes::BuildService do ...@@ -4,6 +4,8 @@ describe Notes::BuildService do
let(:note) { create(:discussion_note_on_issue) } let(:note) { create(:discussion_note_on_issue) }
let(:project) { note.project } let(:project) { note.project }
let(:author) { note.author } let(:author) { note.author }
let(:merge_request) { create(:merge_request, source_project: project) }
let(:mr_note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project, author: author) }
describe '#execute' do describe '#execute' do
context 'when in_reply_to_discussion_id is specified' do context 'when in_reply_to_discussion_id is specified' do
...@@ -12,6 +14,19 @@ describe Notes::BuildService do ...@@ -12,6 +14,19 @@ describe Notes::BuildService do
new_note = described_class.new(project, author, note: 'Test', in_reply_to_discussion_id: note.discussion_id).execute new_note = described_class.new(project, author, note: 'Test', in_reply_to_discussion_id: note.discussion_id).execute
expect(new_note).to be_valid expect(new_note).to be_valid
expect(new_note.in_reply_to?(note)).to be_truthy expect(new_note.in_reply_to?(note)).to be_truthy
expect(new_note.resolved?).to be_falsey
end
context 'when discussion is resolved' do
before do
mr_note.resolve!(author)
end
it 'resolves the note' do
new_note = described_class.new(project, author, note: 'Test', in_reply_to_discussion_id: mr_note.discussion_id).execute
expect(new_note).to be_valid
expect(new_note.resolved?).to be_truthy
end
end end
end end
......
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