Skip to content
Snippets Groups Projects
Commit 38149afc authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent be660fe1
No related branches found
No related tags found
No related merge requests found
Showing
with 240 additions and 110 deletions
---
title: Update GitLab Runner Helm Chart to 0.14.0
merge_request: 25749
author:
type: other
Loading
Loading
@@ -10,7 +10,7 @@ Gitlab.ee do
end
 
# Needed to run migration
if Gitlab::Database.cached_table_exists?('licenses')
if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses')
message = LicenseHelper.license_message(signed_in: true, is_admin: true, in_html: false)
if ::License.block_changes? && message.present?
warn "WARNING: #{message}"
Loading
Loading
Loading
Loading
@@ -16,3 +16,7 @@ OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_s
OmniAuth.config.before_request_phase do |env|
Gitlab::RequestForgeryProtection.call(env)
end
# Use json formatter
OmniAuth.config.logger.formatter = Gitlab::OmniauthLogging::JSONFormatter.new
OmniAuth.config.logger.level = Logger::ERROR if Rails.env.production?
---
# `extends` indicates the Vale extension point being used.
# Full list of styles: https://errata-ai.github.io/vale/styles/
# Checks for use of common and uncommon contractions.
#
# For a list of all options, see https://errata-ai.github.io/vale/styles/
extends: substitution
# Substitution rules can display the matched and suggested strings in the
# message shown to the user. The first use of %s prints the suggested option,
# and the second use of %s displays what was found in the text.
message: Use "%s" instead of "%s" in most cases.
# Should a result be flagged as a suggestion, warning, or error?
# Results that fall below the MinAlertLevel set in
# https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini won't be shown.
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language
level: suggestion
# Should a match be case-insensitive or case-sensitive?
# Acceptable values are 'true' or 'false'
ignorecase: true
# Should this rule be limited to a specific scope? If yes, uncomment the line.
# Possible scopes: https://errata-ai.github.io/vale/formats/#available-scopes
# scope: heading
# Should this rule ignore normal word boundaries, such as \b ?
# Acceptable values are 'true' or 'false'
nonword: false
# What is the source for this rule?
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language
# The 'swap' section provides a list of values, one per line, in the form of
# $bad: $good
ignorecase: true
swap:
 
# Common contractions are ok
Loading
Loading
@@ -73,4 +51,3 @@ swap:
who'll: who will
why's: why is
why'll: why will
---
# `extends` indicates the Vale extension point being used.
# Full list of styles: https://errata-ai.github.io/vale/styles/
# Checks for use of latin terms..
#
# For a list of all options, see https://errata-ai.github.io/vale/styles/
extends: substitution
# Substitution rules can display the matched and suggested strings in the
# message shown to the user. The first use of %s prints the suggested option,
# and the second use of %s displays what was found in the text.
message: Use "%s" instead of "%s," but consider rewriting the sentence.
# Should a result be flagged as a suggestion, warning, or error?
# Results that fall below the MinAlertLevel set in
# https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini won't be shown.
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language
level: warning
# Should a match be case-insensitive or case-sensitive?
# Acceptable values are 'true' or 'false'
ignorecase: true
# Should this rule be limited to a specific scope? If yes, uncomment the line.
# Possible scopes: https://errata-ai.github.io/vale/formats/#available-scopes
# scope: heading
# Should this rule ignore normal word boundaries, such as \b ?
# Acceptable values are 'true' or 'false'
nonword: true
# What is the source for this rule?
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#language
# The 'swap' section provides a list of values, one per line, in the form of
# $bad: $good
ignorecase: true
swap:
e\.g\.: for example
e\. g\.: for example
Loading
Loading
---
# `extends` indicates the Vale extension point being used.
# Full list of styles: https://errata-ai.github.io/vale/styles/
# Checks for use of top misused terms at GitLab.
#
# For a list of all options, see https://errata-ai.github.io/vale/styles/
extends: substitution
# Substitution rules can display the matched and suggested strings in the
# message shown to the user. The first use of %s prints the suggested option,
# and the second use of %s displays what was found in the text.
message: Use "%s" instead of "%s."
# Should a result be flagged as a suggestion, warning, or error?
# Results that fall below the MinAlertLevel set in
# https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini won't be shown.
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
level: warning
# Should a match be case-insensitive or case-sensitive?
# Acceptable values are 'true' or 'false'
ignorecase: true
# Should this rule be limited to a specific scope? If yes, uncomment the line.
# Possible scopes: https://errata-ai.github.io/vale/formats/#available-scopes
# scope: heading
# Should this rule ignore normal word boundaries, such as \b ?
# Acceptable values are 'true' or 'false'
nonword: true
# What is the source for this rule?
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
# The 'swap' section provides a list of values, one per line, in the form of
# $bad: $good
ignorecase: true
swap:
GitLabber: GitLab team member
self hosted: self-managed
Loading
Loading
Loading
Loading
@@ -104,7 +104,7 @@ And if needed within the template, you can use the `track` method directly as we
Custom event tracking and instrumentation can be added by directly calling the `Tracking.event` static function. The following example demonstrates tracking a click on a button by calling `Tracking.event` manually.
 
```javascript
import Tracking from `~/tracking`;
import Tracking from '~/tracking';
 
const button = document.getElementById('create_from_template_button');
button.addEventListener('click', () => {
Loading
Loading
# frozen_string_literal: true
require 'json'
module Gitlab
module OmniauthLogging
class JSONFormatter
def call(severity, datetime, progname, msg)
{ severity: severity, timestamp: datetime.utc.iso8601(3), pid: $$, progname: progname, message: msg }.to_json << "\n"
end
end
end
end
# frozen_string_literal: true
# Interface to the Redis-backed cache store to keep track of complete cache keys
# for a ReactiveCache resource.
module Gitlab
class ReactiveCacheSetCache < Gitlab::SetCache
attr_reader :expires_in
def initialize(expires_in: 10.minutes)
@expires_in = expires_in
end
def clear_cache!(key)
with do |redis|
keys = read(key).map { |value| "#{cache_type}#{value}" }
keys << cache_key(key)
redis.pipelined do
keys.each_slice(1000) { |subset| redis.del(*subset) }
end
end
end
private
def cache_type
"#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:"
end
end
end
Loading
Loading
@@ -2,7 +2,7 @@
 
# Interface to the Redis-backed cache store for keys that use a Redis set
module Gitlab
class RepositorySetCache
class RepositorySetCache < Gitlab::SetCache
attr_reader :repository, :namespace, :expires_in
 
def initialize(repository, extra_namespace: nil, expires_in: 2.weeks)
Loading
Loading
@@ -17,18 +17,6 @@ module Gitlab
"#{type}:#{namespace}:set"
end
 
def expire(key)
with { |redis| redis.del(cache_key(key)) }
end
def exist?(key)
with { |redis| redis.exists(cache_key(key)) }
end
def read(key)
with { |redis| redis.smembers(cache_key(key)) }
end
def write(key, value)
full_key = cache_key(key)
 
Loading
Loading
@@ -54,15 +42,5 @@ module Gitlab
write(key, yield)
end
end
def include?(key, value)
with { |redis| redis.sismember(cache_key(key), value) }
end
private
def with(&blk)
Gitlab::Redis::Cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord
end
end
end
# frozen_string_literal: true
# Interface to the Redis-backed cache store to keep track of complete cache keys
# for a ReactiveCache resource.
module Gitlab
class SetCache
attr_reader :expires_in
def initialize(expires_in: 2.weeks)
@expires_in = expires_in
end
def cache_key(key)
"#{key}:set"
end
def expire(key)
with { |redis| redis.del(cache_key(key)) }
end
def exist?(key)
with { |redis| redis.exists(cache_key(key)) }
end
def write(key, value)
with do |redis|
redis.pipelined do
redis.sadd(cache_key(key), value)
redis.expire(cache_key(key), expires_in)
end
end
value
end
def read(key)
with { |redis| redis.smembers(cache_key(key)) }
end
def include?(key, value)
with { |redis| redis.sismember(cache_key(key), value) }
end
def ttl(key)
with { |redis| redis.ttl(cache_key(key)) }
end
private
def with(&blk)
Gitlab::Redis::Cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord
end
end
end
Loading
Loading
@@ -7951,6 +7951,9 @@ msgstr ""
msgid "Except policy:"
msgstr ""
 
msgid "Excluding merge commits. Limited to %{limit} commits."
msgstr ""
msgid "Excluding merge commits. Limited to 6,000 commits."
msgstr ""
 
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@
"iid": { "type": "integer" },
"title": { "type": "string" },
"confidential": { "type": "boolean" },
"closed": { "type": "boolean" },
"due_date": { "type": "date" },
"project_id": { "type": "integer" },
"relative_position": { "type": ["integer", "null"] },
Loading
Loading
Loading
Loading
@@ -7,8 +7,8 @@ describe('Issue Due Date component', () => {
let vm;
let date;
const Component = Vue.extend(IssueDueDate);
const createComponent = (dueDate = new Date()) =>
mountComponent(Component, { date: dateFormat(dueDate, 'yyyy-mm-dd', true) });
const createComponent = (dueDate = new Date(), closed = false) =>
mountComponent(Component, { closed, date: dateFormat(dueDate, 'yyyy-mm-dd', true) });
 
beforeEach(() => {
date = new Date();
Loading
Loading
@@ -56,10 +56,17 @@ describe('Issue Due Date component', () => {
expect(vm.$el.querySelector('time').textContent.trim()).toEqual(dateFormat(date, format));
});
 
it('should contain the correct `.text-danger` css class for overdue issue', () => {
it('should contain the correct `.text-danger` css class for overdue issue that is open', () => {
date.setDate(date.getDate() - 17);
vm = createComponent(date);
 
expect(vm.$el.querySelector('time').classList.contains('text-danger')).toEqual(true);
});
it('should not contain the `.text-danger` css class for overdue issue that is closed', () => {
date.setDate(date.getDate() - 17);
vm = createComponent(date, true);
expect(vm.$el.querySelector('time').classList.contains('text-danger')).toEqual(false);
});
});
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::OmniauthLogging::JSONFormatter do
it "generates log in json format" do
Timecop.freeze(Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do
expect(subject.call(:info, Time.now, 'omniauth', 'log message'))
.to eq %Q({"severity":"info","timestamp":"2019-12-04T09:10:11.123Z","pid":#{Process.pid},"progname":"omniauth","message":"log message"}\n)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::ReactiveCacheSetCache, :clean_gitlab_redis_cache do
let_it_be(:project) { create(:project) }
let(:cache_prefix) { 'cache_prefix' }
let(:expires_in) { 10.minutes }
let(:cache) { described_class.new(expires_in: expires_in) }
describe '#cache_key' do
subject { cache.cache_key(cache_prefix) }
it 'includes the suffix' do
expect(subject).to eq "#{cache_prefix}:set"
end
end
describe '#read' do
subject { cache.read(cache_prefix) }
it { is_expected.to be_empty }
context 'after item added' do
before do
cache.write(cache_prefix, 'test_item')
end
it { is_expected.to contain_exactly('test_item') }
end
end
describe '#write' do
it 'writes the value to the cache' do
cache.write(cache_prefix, 'test_item')
expect(cache.read(cache_prefix)).to contain_exactly('test_item')
end
it 'sets the expiry of the set' do
cache.write(cache_prefix, 'test_item')
expect(cache.ttl(cache_prefix)).to be_within(1).of(expires_in.seconds)
end
end
describe '#clear_cache!', :use_clean_rails_redis_caching do
it 'deletes the cached items' do
# Cached key and value
Rails.cache.write('test_item', 'test_value')
# Add key to set
cache.write(cache_prefix, 'test_item')
expect(cache.read(cache_prefix)).to contain_exactly('test_item')
cache.clear_cache!(cache_prefix)
expect(cache.read(cache_prefix)).to be_empty
end
end
describe '#include?' do
subject { cache.include?(cache_prefix, 'test_item') }
it { is_expected.to be(false) }
context 'item added' do
before do
cache.write(cache_prefix, 'test_item')
end
it { is_expected.to be(true) }
end
end
end
Loading
Loading
@@ -21,6 +21,21 @@ RSpec.configure do |config|
ActionController::Base.cache_store = caching_store
end
 
config.around(:each, :use_clean_rails_redis_caching) do |example|
original_null_store = Rails.cache
caching_config_hash = Gitlab::Redis::Cache.params
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
Rails.cache = ActiveSupport::Cache::RedisCacheStore.new(caching_config_hash)
redis_cache_cleanup!
example.run
redis_cache_cleanup!
Rails.cache = original_null_store
end
config.around(:each, :use_sql_query_cache) do |example|
ActiveRecord::Base.cache do
example.run
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment