datadog-ci 0.8.2 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -1
  3. data/LICENSE-3rdparty.csv +1 -1
  4. data/README.md +22 -9
  5. data/ext/datadog_cov/datadog_cov.c +192 -0
  6. data/ext/datadog_cov/extconf.rb +18 -0
  7. data/lib/datadog/ci/configuration/settings.rb +1 -1
  8. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +0 -15
  9. data/lib/datadog/ci/contrib/cucumber/ext.rb +1 -5
  10. data/lib/datadog/ci/contrib/cucumber/formatter.rb +17 -14
  11. data/lib/datadog/ci/contrib/cucumber/integration.rb +1 -2
  12. data/lib/datadog/ci/contrib/minitest/configuration/settings.rb +0 -15
  13. data/lib/datadog/ci/contrib/minitest/ext.rb +1 -5
  14. data/lib/datadog/ci/contrib/minitest/helpers.rb +1 -2
  15. data/lib/datadog/ci/contrib/minitest/integration.rb +1 -1
  16. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +0 -15
  17. data/lib/datadog/ci/contrib/rspec/example.rb +18 -20
  18. data/lib/datadog/ci/contrib/rspec/ext.rb +0 -4
  19. data/lib/datadog/ci/contrib/rspec/integration.rb +1 -2
  20. data/lib/datadog/ci/contrib/settings.rb +0 -3
  21. data/lib/datadog/ci/ext/environment/extractor.rb +3 -2
  22. data/lib/datadog/ci/ext/environment/providers/base.rb +1 -1
  23. data/lib/datadog/ci/ext/environment/providers/bitbucket.rb +1 -1
  24. data/lib/datadog/ci/ext/environment/providers/github_actions.rb +3 -2
  25. data/lib/datadog/ci/ext/environment.rb +1 -1
  26. data/lib/datadog/ci/ext/transport.rb +4 -0
  27. data/lib/datadog/ci/itr/coverage/ddcov.rb +14 -0
  28. data/lib/datadog/ci/itr/coverage/event.rb +64 -0
  29. data/lib/datadog/ci/itr/coverage/transport.rb +42 -0
  30. data/lib/datadog/ci/itr/runner.rb +28 -0
  31. data/lib/datadog/ci/test.rb +1 -2
  32. data/lib/datadog/ci/test_visibility/context/global.rb +1 -3
  33. data/lib/datadog/ci/test_visibility/null_recorder.rb +1 -1
  34. data/lib/datadog/ci/test_visibility/recorder.rb +20 -3
  35. data/lib/datadog/ci/test_visibility/serializers/base.rb +1 -1
  36. data/lib/datadog/ci/test_visibility/serializers/factories/test_level.rb +1 -1
  37. data/lib/datadog/ci/test_visibility/serializers/factories/test_suite_level.rb +1 -1
  38. data/lib/datadog/ci/test_visibility/transport.rb +10 -53
  39. data/lib/datadog/ci/transport/api/agentless.rb +8 -1
  40. data/lib/datadog/ci/transport/api/base.rb +23 -0
  41. data/lib/datadog/ci/transport/api/builder.rb +14 -5
  42. data/lib/datadog/ci/transport/api/evp_proxy.rb +8 -0
  43. data/lib/datadog/ci/transport/event_platform_transport.rb +88 -0
  44. data/lib/datadog/ci/transport/http.rb +19 -2
  45. data/lib/datadog/ci/utils/git.rb +2 -2
  46. data/lib/datadog/ci/version.rb +5 -5
  47. metadata +25 -5
  48. data/lib/datadog/ci/utils/url.rb +0 -15
@@ -67,16 +67,33 @@ module Datadog
67
67
  end
68
68
 
69
69
  def adapter
70
- @adapter ||= Datadog::Core::Transport::HTTP::Adapters::Net.new(host, port, timeout: timeout, ssl: ssl)
70
+ settings = AdapterSettings.new(hostname: host, port: port, ssl: ssl, timeout_seconds: timeout)
71
+ @adapter ||= Datadog::Core::Transport::HTTP::Adapters::Net.new(settings)
71
72
  end
72
73
 
73
74
  # this is needed because Datadog::Tracing::Writer is not fully compatiple with Datadog::Core::Transport
74
- # TODO: remove before 1.0 when CI implements its own worker
75
+ # TODO: remove when CI implements its own worker
75
76
  class ResponseDecorator < ::SimpleDelegator
76
77
  def trace_count
77
78
  0
78
79
  end
79
80
  end
81
+
82
+ class AdapterSettings
83
+ attr_reader :hostname, :port, :ssl, :timeout_seconds
84
+
85
+ def initialize(hostname:, port: nil, ssl: true, timeout_seconds: nil)
86
+ @hostname = hostname
87
+ @port = port
88
+ @ssl = ssl
89
+ @timeout_seconds = timeout_seconds
90
+ end
91
+
92
+ def ==(other)
93
+ hostname == other.hostname && port == other.port && ssl == other.ssl &&
94
+ timeout_seconds == other.timeout_seconds
95
+ end
96
+ end
80
97
  end
81
98
  end
82
99
  end
@@ -23,12 +23,12 @@ module Datadog
23
23
  def self.root
24
24
  return @root if defined?(@root)
25
25
 
26
- @root = exec_git_command("git rev-parse --show-toplevel")
26
+ @root = exec_git_command("git rev-parse --show-toplevel") || Dir.pwd
27
27
  rescue => e
28
28
  Datadog.logger.debug(
29
29
  "Unable to read git root: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
30
30
  )
31
- @root = nil
31
+ @root = Dir.pwd
32
32
  end
33
33
 
34
34
  def self.relative_to_root(path)
@@ -3,16 +3,16 @@
3
3
  module Datadog
4
4
  module CI
5
5
  module VERSION
6
- MAJOR = "0"
7
- MINOR = "8"
8
- PATCH = "2"
9
- PRE = nil
6
+ MAJOR = "1"
7
+ MINOR = "0"
8
+ PATCH = "0"
9
+ PRE = "beta1"
10
10
  BUILD = nil
11
11
  # PRE and BUILD above are modified for dev gems during gem build GHA workflow
12
12
 
13
13
  STRING = [MAJOR, MINOR, PATCH, PRE, BUILD].compact.join(".")
14
14
 
15
- MINIMUM_RUBY_VERSION = "2.1.0"
15
+ MINIMUM_RUBY_VERSION = "2.7.0"
16
16
 
17
17
  # Restrict the installation of this gem with untested future versions of Ruby.
18
18
  #
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-19 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: datadog
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.beta1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0.beta1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: msgpack
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -31,7 +45,8 @@ description: |2
31
45
  email:
32
46
  - dev@datadoghq.com
33
47
  executables: []
34
- extensions: []
48
+ extensions:
49
+ - ext/datadog_cov/extconf.rb
35
50
  extra_rdoc_files: []
36
51
  files:
37
52
  - CHANGELOG.md
@@ -41,6 +56,8 @@ files:
41
56
  - LICENSE.BSD3
42
57
  - NOTICE
43
58
  - README.md
59
+ - ext/datadog_cov/datadog_cov.c
60
+ - ext/datadog_cov/extconf.rb
44
61
  - lib/datadog/ci.rb
45
62
  - lib/datadog/ci/codeowners/matcher.rb
46
63
  - lib/datadog/ci/codeowners/parser.rb
@@ -98,6 +115,9 @@ files:
98
115
  - lib/datadog/ci/ext/settings.rb
99
116
  - lib/datadog/ci/ext/test.rb
100
117
  - lib/datadog/ci/ext/transport.rb
118
+ - lib/datadog/ci/itr/coverage/ddcov.rb
119
+ - lib/datadog/ci/itr/coverage/event.rb
120
+ - lib/datadog/ci/itr/coverage/transport.rb
101
121
  - lib/datadog/ci/itr/runner.rb
102
122
  - lib/datadog/ci/span.rb
103
123
  - lib/datadog/ci/test.rb
@@ -123,13 +143,13 @@ files:
123
143
  - lib/datadog/ci/transport/api/base.rb
124
144
  - lib/datadog/ci/transport/api/builder.rb
125
145
  - lib/datadog/ci/transport/api/evp_proxy.rb
146
+ - lib/datadog/ci/transport/event_platform_transport.rb
126
147
  - lib/datadog/ci/transport/gzip.rb
127
148
  - lib/datadog/ci/transport/http.rb
128
149
  - lib/datadog/ci/transport/remote_settings_api.rb
129
150
  - lib/datadog/ci/utils/configuration.rb
130
151
  - lib/datadog/ci/utils/git.rb
131
152
  - lib/datadog/ci/utils/test_run.rb
132
- - lib/datadog/ci/utils/url.rb
133
153
  - lib/datadog/ci/version.rb
134
154
  homepage: https://github.com/DataDog/datadog-ci-rb
135
155
  licenses:
@@ -147,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
147
167
  requirements:
148
168
  - - ">="
149
169
  - !ruby/object:Gem::Version
150
- version: 2.1.0
170
+ version: 2.7.0
151
171
  - - "<"
152
172
  - !ruby/object:Gem::Version
153
173
  version: '3.4'
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Datadog
4
- module CI
5
- module Utils
6
- module Url
7
- def self.filter_sensitive_info(url)
8
- return nil if url.nil?
9
-
10
- url.gsub(%r{((https?|ssh)://)[^/]*@}, '\1')
11
- end
12
- end
13
- end
14
- end
15
- end