dogapi 1.42.0 → 1.43.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.azure-pipelines/all.yml +36 -8
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -3
- data/Gemfile_1.9 +0 -3
- data/RELEASING.md +1 -1
- data/lib/dogapi/common.rb +11 -8
- data/lib/dogapi/version.rb +1 -1
- data/spec/spec_helper.rb +13 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee43257bd0dee8a6d716ec81374f9c9345037eadb1d64ae56948354058611d42
|
4
|
+
data.tar.gz: f09c94bb876b09cf12dcf2bbe473b30e55964a62d8a78bedad6fbc54a6352e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d69cb4d01bc6673e183f714899a2a21021114163a7f7d69d99a1ba73bd2badcb21f0795d6f78f3694ce24cee391ce1063566789ed3a85d7cbd19c25273b1ad5
|
7
|
+
data.tar.gz: 362e14cea14f234a3fe8649dc2c6044e245d903e255a0a78c61e0577e54e1046fbecdd7d3cb5277a374845d82bb1c5a9f45143d1eab9635656908a3c9b8cd63a
|
data/.azure-pipelines/all.yml
CHANGED
@@ -9,10 +9,36 @@ pr:
|
|
9
9
|
include:
|
10
10
|
- master
|
11
11
|
|
12
|
+
resources:
|
13
|
+
containers:
|
14
|
+
- container: datadog-agent
|
15
|
+
image: datadog/agent:7
|
16
|
+
options: --health-cmd="exit 0" --health-interval=1s
|
17
|
+
ports:
|
18
|
+
- 8125:8125
|
19
|
+
- 8126:8126/tcp
|
20
|
+
env:
|
21
|
+
DD_API_KEY: $(ddAPIKey)
|
22
|
+
DD_APM_ENABLED: "true"
|
23
|
+
DD_APM_NON_LOCAL_TRAFFIC: "true"
|
24
|
+
DD_LOGS_ENABLED: "true"
|
25
|
+
DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL: "true"
|
26
|
+
DD_AC_EXCLUDE: "name:datadog-agent"
|
27
|
+
volumes:
|
28
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
29
|
+
- /proc/:/host/proc/:ro
|
30
|
+
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
|
31
|
+
|
12
32
|
jobs:
|
13
33
|
- job: UnitTests
|
14
34
|
pool:
|
15
35
|
vmImage: "Ubuntu-16.04"
|
36
|
+
container:
|
37
|
+
image: ruby:$(RUBY_VERSION)
|
38
|
+
options: >-
|
39
|
+
-l com.datadoghq.ad.logs="[{\"source\": \"Azure Pipeline\", \"service\": \"dogapi-rb\"}]"
|
40
|
+
services:
|
41
|
+
datadog-agent: datadog-agent
|
16
42
|
strategy:
|
17
43
|
matrix:
|
18
44
|
Rb24:
|
@@ -31,17 +57,19 @@ jobs:
|
|
31
57
|
RUBY_VERSION: '2.6'
|
32
58
|
TASK: rubocop
|
33
59
|
steps:
|
34
|
-
-
|
35
|
-
displayName: Use Ruby $(RUBY_VERSION)
|
36
|
-
inputs:
|
37
|
-
versionSpec: $(RUBY_VERSION)
|
38
|
-
addToPath: true
|
39
|
-
- script: |
|
40
|
-
gem install bundler
|
41
|
-
bundle install --retry=3 --jobs=4
|
60
|
+
- script: bundle install --retry=3 --jobs=4
|
42
61
|
displayName: 'bundle install'
|
62
|
+
env:
|
63
|
+
GEM_HOME: '~/.gem'
|
43
64
|
- script: bundle exec rake $(TASK)
|
44
65
|
displayName: Run $(TASK) via bundle
|
66
|
+
env:
|
67
|
+
GEM_HOME: '~/.gem'
|
68
|
+
DD_AGENT_HOST: datadog-agent
|
69
|
+
DD_ENV: ci
|
70
|
+
DD_SERVICE: dogapi-rb
|
71
|
+
DD_TAGS: "team:integration-tools-and-libraries,runtime:ruby-$(RUBY_VERSION),ci.job.name:$(System.JobName),matrix:$(TASK)"
|
72
|
+
DD_TRACE_ANALYTICS_ENABLED: "true"
|
45
73
|
- job: TestRuby19
|
46
74
|
pool:
|
47
75
|
vmImage: "Ubuntu-16.04"
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 1.43.0 / 2020-12-07
|
4
|
+
|
5
|
+
* [Fixed] find_localhost: Try both `hostname` and `hostname -f` before raising. See [#242](https://github.com/DataDog/dogapi-rb/pull/242).
|
6
|
+
|
3
7
|
## 1.42.0 / 2020-09-17
|
4
8
|
|
5
9
|
* [Added] Allow dashboard creation / updates using Template Variable Presets. See [#238](https://github.com/DataDog/dogapi-rb/pull/238).
|
data/Gemfile
CHANGED
@@ -3,10 +3,8 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :test do
|
6
|
+
gem 'ddtrace', git: 'https://github.com/datadog/dd-trace-rb'
|
6
7
|
gem 'rubocop', "~> 0.49.0"
|
7
|
-
# NOTE: rake < 12.3.3 is vulnerable to CVE-2020-8130, but we only use it as a test dependency
|
8
|
-
# and neither our users nor our CI is vulnerable in any way
|
9
|
-
gem 'rake', '>= 2.4.2'
|
10
8
|
gem 'rspec'
|
11
9
|
gem 'simplecov'
|
12
10
|
gem 'webmock'
|
data/Gemfile_1.9
CHANGED
@@ -4,9 +4,6 @@ gemspec
|
|
4
4
|
|
5
5
|
group :test do
|
6
6
|
gem 'rubocop', "~> 0.41.0"
|
7
|
-
# NOTE: rake < 12.3.3 is vulnerable to CVE-2020-8130, but we only use it as a test dependency
|
8
|
-
# and neither our users nor our CI is vulnerable in any way
|
9
|
-
gem 'rake', '>= 2.4.2'
|
10
7
|
gem 'rspec'
|
11
8
|
gem 'simplecov', "~> 0.11.2"
|
12
9
|
gem 'webmock'
|
data/RELEASING.md
CHANGED
@@ -43,4 +43,4 @@ Install [bundler](https://bundler.io/) and setup your RubyGems credentials:
|
|
43
43
|
1. Build the gem: `bundle exec gem build dogapi.gemspec`.
|
44
44
|
1. Push the gem: `bundle exec gem push dogapi-x.x.x.gem`.
|
45
45
|
1. Check that the [Ruby Gem is published](https://rubygems.org/gems/dogapi).
|
46
|
-
1. Bump the version again in `lib/dogapi/version.rb` to a dev version (e.g. `1.
|
46
|
+
1. Bump the version again in `lib/dogapi/version.rb` to a dev version (e.g. `1.42.0` -> `1.42.1.dev`), open a PR and merge it to master.
|
data/lib/dogapi/common.rb
CHANGED
@@ -210,14 +210,17 @@ module Dogapi
|
|
210
210
|
@@hostname = nil
|
211
211
|
|
212
212
|
def Dogapi.find_localhost
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
213
|
+
return @@hostname if @@hostname
|
214
|
+
out, status = Open3.capture2('hostname', '-f', err: File::NULL)
|
215
|
+
unless status.exitstatus.zero?
|
216
|
+
begin
|
217
|
+
out = Addrinfo.getaddrinfo(Socket.gethostname, nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname
|
218
|
+
rescue SocketError
|
219
|
+
out, status = Open3.capture2('hostname', err: File::NULL)
|
220
|
+
raise SystemCallError, 'Both `hostname` and `hostname -f` failed.' unless status.exitstatus.zero?
|
221
|
+
end
|
222
|
+
end
|
223
|
+
@@hostname = out.strip
|
221
224
|
end
|
222
225
|
|
223
226
|
def Dogapi.find_proxy
|
data/lib/dogapi/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,19 @@ SimpleCov.start do
|
|
10
10
|
add_filter 'spec'
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
webmock_allow = []
|
14
|
+
|
15
|
+
begin
|
16
|
+
require 'ddtrace'
|
17
|
+
Datadog.configure do |c|
|
18
|
+
c.use :rspec, service_name: 'dogapi-rb'
|
19
|
+
end
|
20
|
+
webmock_allow << "#{Datadog::Transport::HTTP.default_hostname}:#{Datadog::Transport::HTTP.default_port}"
|
21
|
+
rescue LoadError
|
22
|
+
puts 'ddtrace gem not found'
|
23
|
+
end
|
24
|
+
|
25
|
+
WebMock.disable_net_connect!(allow_localhost: false, allow: webmock_allow)
|
14
26
|
|
15
27
|
# include our code and methods
|
16
28
|
require 'dogapi'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
- !ruby/object:Gem::Version
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
201
|
+
rubygems_version: 3.0.6
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Ruby bindings for Datadog's API
|