Commit 22aeff30 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-14

parents 1b02dec0 91002b12
...@@ -33,9 +33,6 @@ import flash from '../flash'; ...@@ -33,9 +33,6 @@ import flash from '../flash';
$('input[name="user[multi_file]"]').on('change', this.setNewRepoCookie); $('input[name="user[multi_file]"]').on('change', this.setNewRepoCookie);
$('#user_notification_email').on('change', this.submitForm); $('#user_notification_email').on('change', this.submitForm);
$('#user_notified_of_own_activity').on('change', this.submitForm); $('#user_notified_of_own_activity').on('change', this.submitForm);
$('.update-username').on('ajax:before', this.beforeUpdateUsername);
$('.update-username').on('ajax:complete', this.afterUpdateUsername);
$('.update-notifications').on('ajax:success', this.onUpdateNotifs);
this.form.on('submit', this.onSubmitForm); this.form.on('submit', this.onSubmitForm);
} }
...@@ -48,21 +45,6 @@ import flash from '../flash'; ...@@ -48,21 +45,6 @@ import flash from '../flash';
return this.saveForm(); return this.saveForm();
} }
beforeUpdateUsername() {
$('.loading-username', this).removeClass('hidden');
}
afterUpdateUsername() {
$('.loading-username', this).addClass('hidden');
$('button[type=submit]', this).enable();
}
onUpdateNotifs(e, data) {
return data.saved ?
flash(__('Notification settings saved'), 'notice') :
flash(__('Failed to save new settings'));
}
saveForm() { saveForm() {
const self = this; const self = this;
const formData = new FormData(this.form[0]); const formData = new FormData(this.form[0]);
......
...@@ -42,7 +42,7 @@ export default function initSettingsPanels() { ...@@ -42,7 +42,7 @@ export default function initSettingsPanels() {
if (location.hash) { if (location.hash) {
const $target = $(location.hash); const $target = $(location.hash);
if ($target.length && $target.hasClass('.settings')) { if ($target.length && $target.hasClass('settings')) {
expandSection($target); expandSection($target);
} }
} }
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
{{ sprintf(__('Lock %{issuableDisplayName}'), { issuableDisplayName: issuableDisplayName }) }} {{ sprintf(__('Lock %{issuableDisplayName}'), { issuableDisplayName: issuableDisplayName }) }}
<button <button
v-if="isEditable" v-if="isEditable"
class="pull-right lock-edit btn btn-blank" class="pull-right lock-edit"
type="button" type="button"
@click.prevent="toggleForm" @click.prevent="toggleForm"
> >
......
...@@ -197,11 +197,18 @@ ...@@ -197,11 +197,18 @@
margin-left: 0; margin-left: 0;
} }
a.edit-link:not([href]):hover {
color: rgba($avatar-border, .2);
}
.lock-edit, // uses same style, different js behaviour
.edit-link { .edit-link {
@extend .btn-blank;
color: $gl-text-color; color: $gl-text-color;
&:not([href]):hover { &:hover {
color: rgba($avatar-border, .2); text-decoration: underline;
color: $md-link-color;
} }
} }
} }
......
...@@ -61,11 +61,8 @@ module Network ...@@ -61,11 +61,8 @@ module Network
@reserved[i] = [] @reserved[i] = []
end end
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37436 commits_sort_by_ref.each do |commit|
Gitlab::GitalyClient.allow_n_plus_1_calls do place_chain(commit)
commits_sort_by_ref.each do |commit|
place_chain(commit)
end
end end
# find parent spaces for not overlap lines # find parent spaces for not overlap lines
......
...@@ -6,18 +6,14 @@ class DeleteMergedBranchesService < BaseService ...@@ -6,18 +6,14 @@ class DeleteMergedBranchesService < BaseService
def execute def execute
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :push_code, project) raise Gitlab::Access::AccessDeniedError unless can?(current_user, :push_code, project)
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37438 branches = project.repository.merged_branch_names
Gitlab::GitalyClient.allow_n_plus_1_calls do # Prevent deletion of branches relevant to open merge requests
branches = project.repository.branch_names branches -= merge_request_branch_names
branches = branches.select { |branch| project.repository.merged_to_root_ref?(branch) } # Prevent deletion of protected branches
# Prevent deletion of branches relevant to open merge requests branches = branches.reject { |branch| ProtectedBranch.protected?(project, branch) }
branches -= merge_request_branch_names
# Prevent deletion of protected branches
branches = branches.reject { |branch| ProtectedBranch.protected?(project, branch) }
branches.each do |branch| branches.each do |branch|
DeleteBranchService.new(project, current_user).execute(branch) DeleteBranchService.new(project, current_user).execute(branch)
end
end end
end end
......
---
title: Fix settings panels not expanding when fragment hash linked
merge_request: 17074
author:
type: fixed
---
title: LDAP Person no longer throws exception on invalid entry
merge_request:
author:
type: fixed
# Query Count Limits # Query Count Limits
Each controller or API endpoint is allowed to execute up to 100 SQL queries. In Each controller or API endpoint is allowed to execute up to 100 SQL queries and
a production environment we'll only log an error in case this threshold is in test environments we'll raise an error when this threshold is exceeded.
exceeded, but in a test environment we'll raise an error instead.
## Solving Failing Tests ## Solving Failing Tests
......
...@@ -17,6 +17,9 @@ would be `process_something`. If you're not sure what queue a worker uses, ...@@ -17,6 +17,9 @@ would be `process_something`. If you're not sure what queue a worker uses,
you can find it using `SomeWorker.queue`. There is almost never a reason to you can find it using `SomeWorker.queue`. There is almost never a reason to
manually override the queue name using `sidekiq_options queue: :some_queue`. manually override the queue name using `sidekiq_options queue: :some_queue`.
You must always add any new queues to `app/workers/all_queues.yml` otherwise
your worker will not run.
## Queue Namespaces ## Queue Namespaces
While different workers cannot share a queue, they can share a queue namespace. While different workers cannot share a queue, they can share a queue namespace.
......
...@@ -67,8 +67,6 @@ module Gitlab ...@@ -67,8 +67,6 @@ module Gitlab
Rails.logger.debug { "Instantiating #{self.class.name} with LDIF:\n#{entry.to_ldif}" } Rails.logger.debug { "Instantiating #{self.class.name} with LDIF:\n#{entry.to_ldif}" }
@entry = entry @entry = entry
@provider = provider @provider = provider
validate_entry
end end
def name def name
...@@ -121,19 +119,6 @@ module Gitlab ...@@ -121,19 +119,6 @@ module Gitlab
entry.public_send(selected_attr) # rubocop:disable GitlabSecurity/PublicSend entry.public_send(selected_attr) # rubocop:disable GitlabSecurity/PublicSend
end end
def validate_entry
allowed_attrs = self.class.ldap_attributes(config).map(&:downcase)
# Net::LDAP::Entry transforms keys to symbols. Change to strings to compare.
entry_attrs = entry.attribute_names.map { |n| n.to_s.downcase }
invalid_attrs = entry_attrs - allowed_attrs
if invalid_attrs.any?
raise InvalidEntryError,
"#{self.class.name} initialized with Net::LDAP::Entry containing invalid attributes(s): #{invalid_attrs}"
end
end
end end
end end
end end
...@@ -51,13 +51,7 @@ module Gitlab ...@@ -51,13 +51,7 @@ module Gitlab
error = ThresholdExceededError.new(error_message) error = ThresholdExceededError.new(error_message)
if raise_error? raise(error) if raise_error?
raise(error)
else
# Raven automatically logs to the Rails log if disabled, thus we don't
# need to manually log anything in case Sentry support is not enabled.
Raven.capture_exception(error)
end
end end
def increment def increment
......
import initSettingsPanels from '~/settings_panels';
describe('Settings Panels', () => {
preloadFixtures('projects/ci_cd_settings.html.raw');
beforeEach(() => {
loadFixtures('projects/ci_cd_settings.html.raw');
});
describe('initSettingsPane', () => {
afterEach(() => {
location.hash = '';
});
it('should expand linked hash fragment panel', () => {
location.hash = '#js-general-pipeline-settings';
const pipelineSettingsPanel = document.querySelector('#js-general-pipeline-settings');
// Our test environment automatically expands everything so we need to clear that out first
pipelineSettingsPanel.classList.remove('expanded');
expect(pipelineSettingsPanel.classList.contains('expanded')).toBe(false);
initSettingsPanels();
expect(pipelineSettingsPanel.classList.contains('expanded')).toBe(true);
});
});
});
...@@ -66,15 +66,6 @@ describe Gitlab::LDAP::Person do ...@@ -66,15 +66,6 @@ describe Gitlab::LDAP::Person do
end end
end end
describe '.validate_entry' do
it 'raises InvalidEntryError' do
entry['foo'] = 'bar'
expect { described_class.new(entry, 'ldapmain') }
.to raise_error(Gitlab::LDAP::Person::InvalidEntryError)
end
end
describe '#name' do describe '#name' do
it 'uses the configured name attribute and handles values as an array' do it 'uses the configured name attribute and handles values as an array' do
name = 'John Doe' name = 'John Doe'
......
...@@ -59,18 +59,6 @@ describe Gitlab::QueryLimiting::Transaction do ...@@ -59,18 +59,6 @@ describe Gitlab::QueryLimiting::Transaction do
expect { transaction.act_upon_results } expect { transaction.act_upon_results }
.to raise_error(described_class::ThresholdExceededError) .to raise_error(described_class::ThresholdExceededError)
end end
it 'reports the error in Sentry if raising an error is disabled' do
expect(transaction)
.to receive(:raise_error?)
.and_return(false)
expect(Raven)
.to receive(:capture_exception)
.with(an_instance_of(described_class::ThresholdExceededError))
transaction.act_upon_results
end
end end
end end
......
...@@ -2,7 +2,8 @@ controller: ...@@ -2,7 +2,8 @@ controller:
image: image:
tag: "0.10.2" tag: "0.10.2"
repository: "quay.io/kubernetes-ingress-controller/nginx-ingress-controller" repository: "quay.io/kubernetes-ingress-controller/nginx-ingress-controller"
stats.enabled: true stats:
enabled: true
podAnnotations: podAnnotations:
prometheus.io/scrape: "true" prometheus.io/scrape: "true"
prometheus.io/port: "10254" prometheus.io/port: "10254"
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