diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-25 15:04:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-25 15:04:30 +0300 |
commit | 67370c8b72013a75705265605517a40daf69fc33 (patch) | |
tree | 5a54d854073bd1e413f21d76141e09a0a41f7630 /lib/gitlab | |
parent | 185d9acf520cc806840e8ba6c83deb1ec4817e0f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/background_migration/populate_resolved_on_default_branch_column.rb | 12 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/artifact/code_coverage.rb | 27 | ||||
-rw-r--r-- | lib/gitlab/danger/teammate.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/regex.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/hll_redis_counter.rb | 2 |
5 files changed, 46 insertions, 5 deletions
diff --git a/lib/gitlab/background_migration/populate_resolved_on_default_branch_column.rb b/lib/gitlab/background_migration/populate_resolved_on_default_branch_column.rb new file mode 100644 index 00000000000..eb72ef1de33 --- /dev/null +++ b/lib/gitlab/background_migration/populate_resolved_on_default_branch_column.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # rubocop:disable Style/Documentation + class PopulateResolvedOnDefaultBranchColumn + def perform(*); end + end + end +end + +Gitlab::BackgroundMigration::PopulateResolvedOnDefaultBranchColumn.prepend_if_ee('EE::Gitlab::BackgroundMigration::PopulateResolvedOnDefaultBranchColumn') diff --git a/lib/gitlab/ci/pipeline/artifact/code_coverage.rb b/lib/gitlab/ci/pipeline/artifact/code_coverage.rb new file mode 100644 index 00000000000..f8a004e8512 --- /dev/null +++ b/lib/gitlab/ci/pipeline/artifact/code_coverage.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Pipeline + module Artifact + class CodeCoverage + def initialize(pipeline_artifact) + @pipeline_artifact = pipeline_artifact + end + + def for_files(filenames) + coverage_files = raw_report["files"].select { |key| filenames.include?(key) } + + { files: coverage_files } + end + + private + + def raw_report + @raw_report ||= Gitlab::Json.parse(@pipeline_artifact.file.read) + end + end + end + end + end +end diff --git a/lib/gitlab/danger/teammate.rb b/lib/gitlab/danger/teammate.rb index 9b389907090..ebd96be40d7 100644 --- a/lib/gitlab/danger/teammate.rb +++ b/lib/gitlab/danger/teammate.rb @@ -45,9 +45,7 @@ module Gitlab has_capability?(project, category, :maintainer, labels) end - def markdown_name(timezone_experiment: false, author: nil) - return @markdown_name unless timezone_experiment - + def markdown_name(author: nil) "#{@markdown_name} (#{utc_offset_text(author)})" end diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index e070c2d2e84..2702dfc85ae 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -122,7 +122,11 @@ module Gitlab end def group_name_regex - @group_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_()\. ]*\z/.freeze + @group_name_regex ||= /\A#{group_name_regex_chars}\z/.freeze + end + + def group_name_regex_chars + @group_name_regex_chars ||= /[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_()\. ]*/.freeze end def group_name_regex_message diff --git a/lib/gitlab/usage_data_counters/hll_redis_counter.rb b/lib/gitlab/usage_data_counters/hll_redis_counter.rb index c9c39225068..f68128c25a9 100644 --- a/lib/gitlab/usage_data_counters/hll_redis_counter.rb +++ b/lib/gitlab/usage_data_counters/hll_redis_counter.rb @@ -91,7 +91,7 @@ module Gitlab end def expiry(event) - return event[:expiry] if event[:expiry].present? + return event[:expiry].days if event[:expiry].present? event[:aggregation].to_sym == :daily ? DEFAULT_DAILY_KEY_EXPIRY_LENGTH : DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH end |