Skip to content

Commit 2dd9a1b

Browse files
authored
Fix CI: update tested Ruby versions, remove deprecated set-output (#44)
* update versions, set-output * update ruby version in readme / gemspec / rubocop * apply rubocop * log requireMFA at info level to pass CI
1 parent 9e7b4c8 commit 2dd9a1b

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

.github/workflows/checks.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# 3.0 in quotes for https://github.com/actions/runner/issues/849
11-
SUPPORTED_VERSIONS: '["3.0", 2.7, 2.6, 2.5]'
11+
SUPPORTED_VERSIONS: "[ 2.7, '3.0', 3.1, 3.2]"
1212

1313
jobs:
1414
supported-versions:
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- id: set-matrix
2020
run: |
21-
echo "::set-output name=matrix::${{env.SUPPORTED_VERSIONS}}"
21+
echo "matrix=${{env.SUPPORTED_VERSIONS}}" >> $GITHUB_OUTPUT
2222
unit-test:
2323
needs: supported-versions
2424
runs-on: ubuntu-latest

.rubocop.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
require: rubocop-rake
22

33
AllCops:
4-
TargetRubyVersion: 2.4
4+
TargetRubyVersion: 2.7
55
NewCops: enable
66

7+
Gemspec/DevelopmentDependencies:
8+
EnforcedStyle: gemspec
9+
10+
Gemspec/RequireMFA:
11+
Severity: info
12+
713
Naming/MethodParameterName:
814
Enabled: false
915

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A fluentd output plugin for sending logs to the Dynatrace [Generic log ingest AP
77
## Requirements
88

99
- An instance of fluentd >= v1.0 from which logs should be exported
10-
- Ruby version >= 2.4.0
10+
- Ruby version >= 2.7.0
1111
- An ActiveGate with the Generic log ingest API v2 enabled as described in the [Dynatrace documentation](https://www.dynatrace.com/support/help/shortlink/log-monitoring-log-data-ingestion)
1212
- A [Dynatrace API token](https://www.dynatrace.com/support/help/shortlink/api-authentication) with the `logs.ingest` (Ingest Logs) scope
1313

@@ -88,7 +88,7 @@ An full example demonstrating how to set up Fluentd on Kubernetes and export log
8888

8989
## Development
9090

91-
`fluent-plugin-dynatrace` supports Ruby versions `>= 2.4.0` but it is recommended that at least `2.7.2` is used for development. Ruby versions can be managed with tools like [chruby](https://github.com/postmodern/chruby) or [rbenv](https://github.com/rbenv/rbenv).
91+
`fluent-plugin-dynatrace` supports Ruby versions `>= 2.7.0` but it is recommended that at least `2.7.2` is used for development. Ruby versions can be managed with tools like [chruby](https://github.com/postmodern/chruby) or [rbenv](https://github.com/rbenv/rbenv).
9292

9393
### Install Dependencies
9494

fluent-plugin-dynatrace.gemspec

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ Gem::Specification.new do |gem|
2222

2323
gem.require_paths = ['lib']
2424

25-
gem.required_ruby_version = '>= 2.4.0'
25+
gem.required_ruby_version = '>= 2.7.0'
2626

2727
gem.add_runtime_dependency 'fluentd', ['>= 0.14.22', '< 2']
2828
gem.add_development_dependency 'bundler', ['>= 2', '<3']
29-
gem.add_development_dependency 'rake', '13.0.3'
30-
gem.add_development_dependency 'rubocop', '1.9.1'
31-
gem.add_development_dependency 'rubocop-rake', '0.5.1'
29+
gem.add_development_dependency 'rake', '13.1.0'
30+
gem.add_development_dependency 'rubocop', '1.59.0'
31+
gem.add_development_dependency 'rubocop-rake', '0.6.0'
32+
gem.add_development_dependency 'test-unit', '3.6.1'
3233
end

lib/fluent/plugin/out_dynatrace.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class DynatraceOutput < Output
3131
# Configurations
3232
desc 'The full URL of the Dynatrace log ingestion endpoint, e.g. https://my-active-gate.example.com/api/logs/ingest'
3333
config_param :active_gate_url, :string
34-
desc 'The API token to use to authenticate requests to the log ingestion endpoint. '\
35-
'Must have logs.ingest (Ingest Logs) scope. '\
34+
desc 'The API token to use to authenticate requests to the log ingestion endpoint. ' \
35+
'Must have logs.ingest (Ingest Logs) scope. ' \
3636
'It is recommended to limit scope to only this one.'
3737
config_param :api_token, :string, secret: true
3838

test/integration_dtcluster/plugin_dt_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class TestPluginDynatraceIntegration < Test::Unit::TestCase
2828

2929
def active_gate_url
3030
# Expect an active gate url in the format https://127.0.0.1:9999/e/abc12345
31-
url = ENV['ACTIVE_GATE_URL']
31+
url = ENV.fetch('ACTIVE_GATE_URL', nil)
3232
raise 'expected environment variable ACTIVE_GATE_URL' if url.nil?
3333

3434
url
3535
end
3636

3737
def api_token
3838
# Expect an API token with `logs.ingest` (Ingest Logs) and `logs.read` (Read Logs) scope
39-
token = ENV['API_TOKEN']
39+
token = ENV.fetch('API_TOKEN', nil)
4040
raise 'expected environment variable API_TOKEN' if token.nil?
4141

4242
token
@@ -97,7 +97,7 @@ def try_get_log(nonce)
9797
body = JSON.parse(res.body)
9898
results = body['results']
9999

100-
return false if results.length.zero?
100+
return false if results.empty?
101101

102102
assert_equal(results[0]['content'], nonce)
103103
true

0 commit comments

Comments
 (0)