Skip to content

Commit

Permalink
more fixes and ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jun 3, 2024
1 parent 7446849 commit 69b7fdb
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/ci/codeowners/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def expand_pattern(pattern)
return pattern if pattern == "*"

# if pattern ends with a slash then it matches everything deeply nested in this directory
pattern += "**" if pattern.end_with?(::File::SEPARATOR)
pattern << "**" if pattern.end_with?(::File::SEPARATOR)

# if pattern doesn't start with a slash then it matches anywhere in the repository
if !pattern.start_with?(::File::SEPARATOR, "**#{::File::SEPARATOR}", "*#{::File::SEPARATOR}")
Expand Down
10 changes: 5 additions & 5 deletions lib/datadog/ci/codeowners/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module Codeowners
# Responsible for parsing a CODEOWNERS file
class Parser
DEFAULT_LOCATION = "CODEOWNERS"
POSSIBLE_CODEOWNERS_LOCATIONS = [
"CODEOWNERS",
".github/CODEOWNERS",
".gitlab/CODEOWNERS",
"docs/CODEOWNERS"
POSSIBLE_CODEOWNERS_LOCATIONS = %w[
CODEOWNERS
.github/CODEOWNERS
.gitlab/CODEOWNERS
docs/CODEOWNERS
].freeze

def initialize(root_file_path)
Expand Down
5 changes: 1 addition & 4 deletions lib/datadog/ci/ext/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ module Environment
TAG_NODE_NAME = "ci.node.name"
TAG_CI_ENV_VARS = "_dd.ci.env_vars"

POSSIBLE_BUNDLE_LOCATIONS = [
"vendor/bundle",
".bundle"
].freeze
POSSIBLE_BUNDLE_LOCATIONS = %w[vendor/bundle .bundle].freeze

module_function

Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/ci/ext/environment/providers/gitlab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def git_tag
end

def git_commit_author_name
name, _ = extract_name_email
name, _email = extract_name_email
name
end

def git_commit_author_email
_, email = extract_name_email
_name, email = extract_name_email
email
end

Expand Down
14 changes: 7 additions & 7 deletions lib/datadog/ci/ext/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ module Settings
ENV_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH = "DD_CIVISIBILITY_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH"

# Source: https://docs.datadoghq.com/getting_started/site/
DD_SITE_ALLOWLIST = [
"datadoghq.com",
"us3.datadoghq.com",
"us5.datadoghq.com",
"datadoghq.eu",
"ddog-gov.com",
"ap1.datadoghq.com"
DD_SITE_ALLOWLIST = %w[
datadoghq.com
us3.datadoghq.com
us5.datadoghq.com
datadoghq.eu
ddog-gov.com
ap1.datadoghq.com
].freeze
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/ci/itr/coverage/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(test_id:, test_suite_id:, test_session_id:, coverage:)
def valid?
valid = true

[:test_id, :test_suite_id, :test_session_id, :coverage].each do |key|
%i[test_id test_suite_id test_session_id coverage].each do |key|
next unless send(key).nil?

Datadog.logger.warn("citestcov event is invalid: [#{key}] is nil. Event: #{self}")
Expand Down
1 change: 1 addition & 0 deletions lib/datadog/ci/transport/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def trace_count
def gzipped?(payload)
return false if payload.nil? || payload.empty?

# no-dd-sa
first_bytes = payload[0, 2]
return false if first_bytes.nil? || first_bytes.empty?

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/codeowners/parser.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Datadog

DEFAULT_LOCATION: "CODEOWNERS"

POSSIBLE_CODEOWNERS_LOCATIONS: ::Array["CODEOWNERS" | ".github/CODEOWNERS" | ".gitlab/CODEOWNERS" | "docs/CODEOWNERS"]
POSSIBLE_CODEOWNERS_LOCATIONS: Array[String]

def initialize: (String? root_file_path) -> void

Expand Down
1 change: 1 addition & 0 deletions yard/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class DatadogConfigurationOptionHandler < YARD::Handlers::Ruby::Base
end
end

# no-dd-sa
def camelize(str)
str.split("_").collect(&:capitalize).join
end
1 change: 1 addition & 0 deletions yard/templates/default/docstring/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# sections :index, [:private, :deprecated, :abstract, :todo, :note, :returns_void, :text], T('tags')
# end

# no-dd-sa
def deprecated
return unless object.has_tag?(:deprecated)

Expand Down

0 comments on commit 69b7fdb

Please sign in to comment.