Commit b991537f authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-04-06

# Conflicts:
#	app/assets/javascripts/boards/filtered_search_boards.js

[ci skip]
parents 9e2184bd ca330f7e
......@@ -7,9 +7,13 @@ export default class FilteredSearchBoards extends FilteredSearchManager {
constructor(store, updateUrl = false, cantEdit = []) {
super({
page: 'boards',
<<<<<<< HEAD
isGroup: true,
isGroupDecendent: true,
filteredSearchTokenKeys: FilteredSearchTokenKeysIssues,
=======
isGroupDecendent: true,
>>>>>>> upstream/master
stateFiltersSelector: '.issues-state-filters',
});
......
......@@ -1068,11 +1068,6 @@ class User < ActiveRecord::Base
end
end
def update_cache_counts
assigned_open_merge_requests_count(force: true)
assigned_open_issues_count(force: true)
end
def update_todos_count_cache
todos_done_count(force: true)
todos_pending_count(force: true)
......
......@@ -4,6 +4,7 @@ module Issuable
TodoService.new.destroy_target(issuable) do |issuable|
if issuable.destroy
issuable.update_project_counter_caches
issuable.assignees.each(&:invalidate_cache_counts)
end
end
end
......
---
title: Include subgroup issues when searching for group issues using the API
merge_request:
author:
type: added
---
title: Deleting a MR you are assigned to should decrements counter
merge_request: 17951
author: m b
type: fixed
......@@ -62,7 +62,14 @@ To change the address/port that Prometheus listens on:
```
Replace `localhost:9090` with the address/port you want Prometheus to
listen on.
listen on. If you would like to allow access to Prometheus to hosts other
than `localhost`, leave out the host, or use `0.0.0.0` to allow public access:
```ruby
prometheus['listen_address'] = ':9090'
# or
prometheus['listen_address'] = '0.0.0.0:9090'
```
1. Save the file and [reconfigure GitLab][reconfigure] for the changes to
take effect
......
......@@ -102,7 +102,7 @@ module API
get ":id/issues" do
group = find_group!(params[:id])
issues = paginate(find_issues(group_id: group.id))
issues = paginate(find_issues(group_id: group.id, include_subgroups: true))
options = {
with: Entities::IssueBasic,
......
......@@ -388,6 +388,30 @@ describe API::Issues do
end
let(:base_url) { "/groups/#{group.id}/issues" }
context 'when group has subgroups', :nested_groups do
let(:subgroup_1) { create(:group, parent: group) }
let(:subgroup_2) { create(:group, parent: subgroup_1) }
let(:subgroup_1_project) { create(:project, namespace: subgroup_1) }
let(:subgroup_2_project) { create(:project, namespace: subgroup_2) }
let!(:issue_1) { create(:issue, project: subgroup_1_project) }
let!(:issue_2) { create(:issue, project: subgroup_2_project) }
before do
group.add_developer(user)
end
it 'also returns subgroups projects issues' do
get api(base_url, user)
issue_ids = json_response.map { |issue| issue['id'] }
expect_paginated_array_response(size: 5)
expect(issue_ids).to include(issue_1.id, issue_2.id)
end
end
it 'returns all group issues (including opened and closed)' do
get api(base_url, admin)
......
......@@ -8,7 +8,7 @@ describe Issuable::DestroyService do
describe '#execute' do
context 'when issuable is an issue' do
let!(:issue) { create(:issue, project: project, author: user) }
let!(:issue) { create(:issue, project: project, author: user, assignees: [user]) }
it 'destroys the issue' do
expect { service.execute(issue) }.to change { project.issues.count }.by(-1)
......@@ -26,10 +26,15 @@ describe Issuable::DestroyService do
expect { service.execute(issue) }
.to change { user.todos_pending_count }.from(1).to(0)
end
it 'invalidates the issues count cache for the assignees' do
expect_any_instance_of(User).to receive(:invalidate_cache_counts).once
service.execute(issue)
end
end
context 'when issuable is a merge request' do
let!(:merge_request) { create(:merge_request, target_project: project, source_project: project, author: user) }
let!(:merge_request) { create(:merge_request, target_project: project, source_project: project, author: user, assignee: user) }
it 'destroys the merge request' do
expect { service.execute(merge_request) }.to change { project.merge_requests.count }.by(-1)
......@@ -41,6 +46,11 @@ describe Issuable::DestroyService do
service.execute(merge_request)
end
it 'invalidates the merge request caches for the MR assignee' do
expect_any_instance_of(User).to receive(:invalidate_cache_counts).once
service.execute(merge_request)
end
it 'updates the todo caches for users with todos on the merge request' do
create(:todo, target: merge_request, user: user, author: user, project: project)
......
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