fluent-plugin-formatter-protobuf 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/build-and-test.yml +24 -7
- data/.github/workflows/release-please.yml +49 -0
- data/.release-please-manifest.json +3 -0
- data/.rubocop.yml +5 -1
- data/CHANGELOG.md +22 -0
- data/README.md +8 -6
- data/RELEASE.md +2 -7
- data/fluent-plugin-formatter-protobuf.gemspec +1 -1
- data/lib/fluent/plugin/formatter_protobuf.rb +28 -1
- data/lib/fluent/plugin/version.rb +1 -1
- data/release-please-config.json +13 -0
- data/renovate.json5 +35 -0
- data/test/integration/Gemfile +2 -2
- data/test/integration/Gemfile.lock +17 -15
- data/test/integration/run.sh +1 -1
- data/test/plugin/test_formatter_protobuf.rb +55 -11
- metadata +11 -6
- data/.github/workflows/publish.yml +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '084a41df7e74930e6f492a29c918e463f3dcb879634928129022d3112c6882ec'
|
4
|
+
data.tar.gz: f4c257fb2fc700bcb536b5e95ede0792514cb9c4cfb4052127da65c998c49a7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9950e7d8b44e8e97ec723f70d6699789f9cc37c825fa7e52dcc68e88b0006dd9551920496b3e71a1076cb0554b2654c381a38cf1b8a64453be2d8d2cf530ab
|
7
|
+
data.tar.gz: c254887ad3a6a3236f8183bf4664996be4bbc92f4d7167f7e6399d3ce3f3ed48352353435a0a7dd8a4159e91f2ccf93b62ca89a8f8062594776e44f90b225863
|
@@ -18,37 +18,54 @@ jobs:
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
19
19
|
with:
|
20
20
|
bundler-cache: true
|
21
|
-
- name: "
|
21
|
+
- name: "Linting"
|
22
22
|
run: "bundle exec rake lint:check"
|
23
23
|
|
24
24
|
test:
|
25
|
-
name: Unit
|
25
|
+
name: Unit testing with Ruby version ${{ matrix.ruby-version }}
|
26
26
|
runs-on: ubuntu-latest
|
27
27
|
permissions:
|
28
28
|
packages: write
|
29
29
|
contents: read
|
30
|
-
|
30
|
+
strategy:
|
31
|
+
matrix:
|
32
|
+
ruby-version:
|
33
|
+
- '3.1'
|
34
|
+
- '3.0'
|
35
|
+
- '2.7'
|
36
|
+
- '2.6'
|
37
|
+
- '2.5'
|
31
38
|
steps:
|
32
39
|
- uses: actions/checkout@v2
|
33
|
-
- name: Set up Ruby
|
40
|
+
- name: Set up Ruby
|
34
41
|
uses: ruby/setup-ruby@v1
|
35
42
|
with:
|
36
43
|
bundler-cache: true
|
44
|
+
ruby-version: ${{ matrix.ruby-version }}
|
37
45
|
- name: "Unit test"
|
38
46
|
run: "bundle exec rake test:unit"
|
39
47
|
|
40
48
|
build:
|
41
|
-
name:
|
49
|
+
name: Building gem with Ruby version ${{ matrix.ruby-version }}
|
42
50
|
runs-on: ubuntu-latest
|
43
51
|
permissions:
|
44
52
|
packages: write
|
45
53
|
contents: read
|
54
|
+
strategy:
|
55
|
+
matrix:
|
56
|
+
ruby-version:
|
57
|
+
- '3.1'
|
58
|
+
- '3.0'
|
59
|
+
- '2.7'
|
60
|
+
- '2.6'
|
61
|
+
- '2.5'
|
46
62
|
|
47
63
|
steps:
|
48
64
|
- uses: actions/checkout@v2
|
49
|
-
- name: Set up Ruby
|
65
|
+
- name: Set up Ruby
|
50
66
|
uses: ruby/setup-ruby@v1
|
51
67
|
with:
|
52
68
|
bundler-cache: true
|
53
|
-
|
69
|
+
ruby-version: ${{ matrix.ruby-version }}
|
70
|
+
- name: "Building gem"
|
54
71
|
run: "bundle exec rake build"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
on:
|
2
|
+
push:
|
3
|
+
branches:
|
4
|
+
- main
|
5
|
+
name: release-please
|
6
|
+
jobs:
|
7
|
+
release-please:
|
8
|
+
environment: main
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: google-github-actions/release-please-action@v2
|
12
|
+
id: release
|
13
|
+
with:
|
14
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
15
|
+
release-type: ruby
|
16
|
+
version-file: "lib/fluent/plugin/version.rb"
|
17
|
+
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
bundler-cache: true
|
24
|
+
ruby-version: '2.5'
|
25
|
+
|
26
|
+
- name: Publish to GPR
|
27
|
+
run: |
|
28
|
+
mkdir -p $HOME/.gem
|
29
|
+
touch $HOME/.gem/credentials
|
30
|
+
chmod 0600 $HOME/.gem/credentials
|
31
|
+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
32
|
+
gem build *.gemspec
|
33
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
34
|
+
env:
|
35
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
36
|
+
OWNER: ${{ github.repository_owner }}
|
37
|
+
if: ${{ steps.release.outputs.release_created }}
|
38
|
+
|
39
|
+
- name: Publish to RubyGems
|
40
|
+
run: |
|
41
|
+
mkdir -p $HOME/.gem
|
42
|
+
touch $HOME/.gem/credentials
|
43
|
+
chmod 0600 $HOME/.gem/credentials
|
44
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
45
|
+
gem build *.gemspec
|
46
|
+
gem push *.gem
|
47
|
+
env:
|
48
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
49
|
+
if: ${{ steps.release.outputs.release_created }}
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.5.0](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/compare/v0.4.0...v0.5.0) (2022-08-01)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* **deps:** Bump google-protobuf to 3.21 for Ruby 3.1 projects ([b2ea32d](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/commit/b2ea32d60a0b4c32d59e295acbf8612fba64d4a7))
|
9
|
+
|
10
|
+
## [0.4.0](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/compare/v0.3.0...v0.4.0) (2022-04-11)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* Add configuration `ignore_unknown_fields` when decoding JSON ([734c638](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/commit/734c638cd2e2405c52def5babbd61fa4d69b8c08))
|
16
|
+
|
17
|
+
## [0.3.0](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/compare/v0.2.0...v0.3.0) (2022-01-13)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* Add new configuration - `format_field` ([797789b](https://www.github.com/fluent-plugins-nursery/fluent-plugin-formatter-protobuf/commit/797789b38d5a599c2c107979beb7edf66e384bd5))
|
data/README.md
CHANGED
@@ -88,12 +88,14 @@ This plugin only supports Protobuf v3.
|
|
88
88
|
|
89
89
|
## Configuration
|
90
90
|
|
91
|
-
|parameter| type | description
|
92
|
-
|
93
|
-
|class_name| string (required) | Ruby Protobuf class name. Used to encode into Protobuf binary
|
94
|
-
|decode_json| boolean (optional) | Serializes record from canonical proto3 JSON mapping (https://developers.google.com/protocol-buffers/docs/proto3#json) into binary
|
95
|
-
|
|
96
|
-
|
|
91
|
+
| parameter | type | description | default |
|
92
|
+
|-----------------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
|
93
|
+
| class_name | string (required) | Ruby Protobuf class name. Used to encode into Protobuf binary ||
|
94
|
+
| decode_json | boolean (optional) | Serializes record from canonical proto3 JSON mapping (https://developers.google.com/protocol-buffers/docs/proto3#json) into binary | `false` |
|
95
|
+
| ignore_unknown_fields | boolean (optional) | Ignore unknown fields when decoding JSON. This parameter is only used if `decode_json` is `true` | `true` |
|
96
|
+
| format_field | string (optional) | When defined, the plugin will only serialise the record in the given field rather than the whole record. This is potentially useful if you intend to use this formatter with the Kafka output plugin (https://github.com/fluent/fluent-plugin-kafka#output-plugin) for example, where your record contains a field to determine which Kafka topic to write to, or the Kafka headers to include, but you do not wish to include those data in the resulting proto3 binary. Defaults to serialising the entire record. | `''` |
|
97
|
+
| include_paths | array (required) | Generated Ruby Protobuf class files path | `[]` |
|
98
|
+
| require_method | string (optional) | Determine how to bring the generated Ruby Protobuf class files into scope. If your generated Ruby Protobuf class files are provided by a Ruby Gem, you may want to use 'require'. If you are providing the generated files as files, you may want to use 'require_relative' | `require` |
|
97
99
|
|
98
100
|
## Tips
|
99
101
|
|
data/RELEASE.md
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
# Release
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
1. Update `lib/fluent/plugin/version.rb`
|
7
|
-
2. Create a pull request and merge it into `main`
|
8
|
-
3. Manually creating a release on Github with a tag indicating the new version number e.g. `vMAJOR.MINOR.PATCH`
|
9
|
-
4. GitHub Actions will automatically run and publish to RubyGems and GitHub repository
|
3
|
+
This repository follow conventional commit and semantic versioning, and the release to RubyGems.org and GitHub Ruby
|
4
|
+
Repository is managed by [release-please](https://github.com/google-github-actions/release-please-action).
|
@@ -35,6 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency 'rubocop-rake', '~> 0.6'
|
36
36
|
spec.add_development_dependency 'test-unit', '~> 3.3'
|
37
37
|
spec.add_runtime_dependency 'fluentd', ['>= 1.0', '< 2']
|
38
|
-
spec.add_runtime_dependency 'google-protobuf', ['~> 3.
|
38
|
+
spec.add_runtime_dependency 'google-protobuf', ['~> 3.21']
|
39
39
|
spec.add_runtime_dependency 'oj', '~> 3.13'
|
40
40
|
end
|
@@ -41,6 +41,26 @@ module Fluent
|
|
41
41
|
Serializes record from canonical proto3 JSON mapping (https://developers.google.com/protocol-buffers/docs/proto3#json) into binary'
|
42
42
|
DESC
|
43
43
|
|
44
|
+
config_param :ignore_unknown_fields,
|
45
|
+
:bool,
|
46
|
+
default: true,
|
47
|
+
desc: <<~DESC
|
48
|
+
Ignore unknown fields when decoding JSON. This parameter is only used if `decode_json` is `true`
|
49
|
+
DESC
|
50
|
+
|
51
|
+
config_param :format_field,
|
52
|
+
:string,
|
53
|
+
default: '',
|
54
|
+
desc: <<~DESC
|
55
|
+
When defined, the plugin will only serialise the record in the given field rather than the whole record.
|
56
|
+
This is potentially useful if you intend to use this formatter with the Kafka output plugin
|
57
|
+
(https://github.com/fluent/fluent-plugin-kafka#output-plugin) for example, where your record contains
|
58
|
+
a field to determine which Kafka topic to write to, or the Kafka headers to include, but you do not
|
59
|
+
wish to include those data in the resulting proto3 binary.
|
60
|
+
|
61
|
+
Defaults to serialising the whole record.
|
62
|
+
DESC
|
63
|
+
|
44
64
|
config_param :include_paths,
|
45
65
|
:array,
|
46
66
|
default: [],
|
@@ -73,7 +93,14 @@ module Fluent
|
|
73
93
|
end
|
74
94
|
|
75
95
|
def format(_tag, _time, record)
|
76
|
-
|
96
|
+
format_record = @format_field == '' ? record : record[@format_field]
|
97
|
+
|
98
|
+
protobuf_msg = if @decode_json
|
99
|
+
@protobuf_class.decode_json(Oj.dump(format_record),
|
100
|
+
{ ignore_unknown_fields: @ignore_unknown_fields })
|
101
|
+
else
|
102
|
+
@protobuf_class.new(format_record)
|
103
|
+
end
|
77
104
|
@protobuf_class.encode(protobuf_msg)
|
78
105
|
end
|
79
106
|
|
data/renovate.json5
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
extends: [
|
3
|
+
"config:base",
|
4
|
+
":semanticCommits",
|
5
|
+
":semanticCommitTypeAll(chore)",
|
6
|
+
"schedule:monthly"
|
7
|
+
],
|
8
|
+
labels: [
|
9
|
+
"dependencies"
|
10
|
+
],
|
11
|
+
vulnerabilityAlerts: {
|
12
|
+
enabled: true,
|
13
|
+
automerge: true,
|
14
|
+
},
|
15
|
+
packageRules: [
|
16
|
+
{
|
17
|
+
matchManagers: [
|
18
|
+
"bundler",
|
19
|
+
"dockerfile",
|
20
|
+
"docker-compose",
|
21
|
+
],
|
22
|
+
groupName: "dependencies"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
matchManagers: [
|
26
|
+
"ruby-version",
|
27
|
+
],
|
28
|
+
commitBody: "BREAKING CHANGE: Updating ruby runtime versions",
|
29
|
+
commitMessagePrefix: 'chore(deps)!:',
|
30
|
+
matchUpdateTypes: [
|
31
|
+
"major"
|
32
|
+
],
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
data/test/integration/Gemfile
CHANGED
@@ -1,45 +1,47 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
concurrent-ruby (1.1.
|
4
|
+
concurrent-ruby (1.1.10)
|
5
5
|
cool.io (1.7.1)
|
6
|
-
fluent-plugin-formatter-protobuf (0.
|
6
|
+
fluent-plugin-formatter-protobuf (0.4.0)
|
7
7
|
fluentd (>= 1.0, < 2)
|
8
8
|
google-protobuf (~> 3.18)
|
9
|
-
|
9
|
+
oj (~> 3.13)
|
10
|
+
fluentd (1.15.1)
|
10
11
|
bundler
|
11
12
|
cool.io (>= 1.4.5, < 2.0.0)
|
12
|
-
http_parser.rb (>= 0.5.1, < 0.
|
13
|
+
http_parser.rb (>= 0.5.1, < 0.9.0)
|
13
14
|
msgpack (>= 1.3.1, < 2.0.0)
|
14
|
-
serverengine (>= 2.
|
15
|
+
serverengine (>= 2.3.0, < 3.0.0)
|
15
16
|
sigdump (~> 0.2.2)
|
16
17
|
strptime (>= 0.2.4, < 1.0.0)
|
17
18
|
tzinfo (>= 1.0, < 3.0)
|
18
19
|
tzinfo-data (~> 1.0)
|
19
20
|
webrick (>= 1.4.2, < 1.8.0)
|
20
21
|
yajl-ruby (~> 1.0)
|
21
|
-
google-protobuf (3.
|
22
|
-
google-protobuf (3.
|
23
|
-
http_parser.rb (0.
|
24
|
-
msgpack (1.4
|
25
|
-
|
22
|
+
google-protobuf (3.21.4)
|
23
|
+
google-protobuf (3.21.4-x86_64-linux)
|
24
|
+
http_parser.rb (0.8.0)
|
25
|
+
msgpack (1.5.4)
|
26
|
+
oj (3.13.19)
|
27
|
+
serverengine (2.3.0)
|
26
28
|
sigdump (~> 0.2.2)
|
27
29
|
sigdump (0.2.4)
|
28
30
|
strptime (0.2.5)
|
29
|
-
tzinfo (2.0.
|
31
|
+
tzinfo (2.0.5)
|
30
32
|
concurrent-ruby (~> 1.0)
|
31
|
-
tzinfo-data (1.
|
33
|
+
tzinfo-data (1.2022.1)
|
32
34
|
tzinfo (>= 1.0.0)
|
33
35
|
webrick (1.7.0)
|
34
|
-
yajl-ruby (1.4.
|
36
|
+
yajl-ruby (1.4.3)
|
35
37
|
|
36
38
|
PLATFORMS
|
37
39
|
ruby
|
38
40
|
x86_64-linux
|
39
41
|
|
40
42
|
DEPENDENCIES
|
41
|
-
fluent-plugin-formatter-protobuf (= 0.
|
42
|
-
fluentd (= 1.
|
43
|
+
fluent-plugin-formatter-protobuf (= 0.4.0)
|
44
|
+
fluentd (= 1.15.1)
|
43
45
|
|
44
46
|
BUNDLED WITH
|
45
47
|
2.2.29
|
data/test/integration/run.sh
CHANGED
@@ -9,4 +9,4 @@ docker run -it --rm \
|
|
9
9
|
-w '/opt/fluent-plugin-formatter-protobuf/' \
|
10
10
|
-e OUT_FILE="./out" \
|
11
11
|
-p 5170:5170 \
|
12
|
-
ruby:
|
12
|
+
ruby:3.0.1 sh -c 'bundle install && fluentd -c /opt/fluent-plugin-formatter-protobuf/fluent.conf'
|
@@ -51,38 +51,82 @@ class ProtobufFormatterTest < Test::Unit::TestCase
|
|
51
51
|
end
|
52
52
|
# rubocop:enable Metrics/BlockLength
|
53
53
|
|
54
|
-
stub_ruby_hash = { people
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
stub_ruby_hash = { 'people' => [{ 'name' => 'Masahiro', 'id' => 1337,
|
55
|
+
'email' => 'repeatedly _at_ gmail.com',
|
56
|
+
'last_updated' => {
|
57
|
+
'seconds' => 1_638_489_505,
|
58
|
+
'nanos' => 318_000_000
|
59
|
+
} }] }
|
60
60
|
# rubocop:disable Metrics/BlockLength
|
61
61
|
sub_test_case 'format' do
|
62
62
|
test 'encodes into Protobuf binary' do
|
63
63
|
formatter = create_formatter({ class_name: 'tutorial.AddressBook',
|
64
64
|
include_paths: VALID_INCLUDE_PATHS_ABSOLUTE })
|
65
65
|
|
66
|
+
formatted = formatter.format('some-tag', 1234, stub_ruby_hash)
|
67
|
+
address_book = Tutorial::AddressBook.new(stub_ruby_hash)
|
68
|
+
assert_equal(Tutorial::AddressBook.encode(address_book), formatted)
|
69
|
+
end
|
70
|
+
|
71
|
+
test 'encodes a particular field instead of the entire record if format_field is defined' do
|
72
|
+
formatter = create_formatter({ class_name: 'tutorial.AddressBook',
|
73
|
+
include_paths: VALID_INCLUDE_PATHS_ABSOLUTE,
|
74
|
+
format_field: 'data' })
|
75
|
+
|
66
76
|
formatted = formatter.format('some-tag', 1234,
|
67
|
-
{
|
68
|
-
|
77
|
+
{
|
78
|
+
'topic' => 'some-kafka-topic',
|
79
|
+
'headers' => {},
|
80
|
+
'data' => stub_ruby_hash
|
81
|
+
})
|
69
82
|
address_book = Tutorial::AddressBook.new(stub_ruby_hash)
|
70
83
|
assert_equal(Tutorial::AddressBook.encode(address_book), formatted)
|
71
84
|
end
|
72
85
|
|
73
|
-
test 'encodes Protobuf JSON format into Protobuf binary if config_param decode_json is true' do
|
86
|
+
test 'encodes Protobuf JSON format into Protobuf binary if config_param decode_json is true and if incoming JSON contains unknown fields' do
|
74
87
|
formatter = create_formatter({ class_name: 'tutorial.AddressBook',
|
75
88
|
decode_json: true,
|
76
89
|
include_paths: VALID_INCLUDE_PATHS_ABSOLUTE })
|
77
90
|
|
78
91
|
formatted = formatter.format('some-tag', 1234,
|
79
|
-
{
|
80
|
-
|
92
|
+
{
|
93
|
+
'people' => [
|
94
|
+
{
|
95
|
+
'name' => 'Masahiro',
|
96
|
+
'id' => 1337,
|
97
|
+
'email' => 'repeatedly _at_ gmail.com',
|
98
|
+
'last_updated' => '2021-12-02T23:58:25.318Z',
|
99
|
+
'some-unknown-fields' => 'this field is not specified in the .proto message'
|
100
|
+
}
|
101
|
+
]
|
102
|
+
})
|
81
103
|
|
82
104
|
address_book = Tutorial::AddressBook.new(stub_ruby_hash)
|
83
105
|
assert_equal(Tutorial::AddressBook.encode(address_book), formatted)
|
84
106
|
end
|
85
107
|
|
108
|
+
test 'throws exception when formatting JSON with unknown fields and ignore_unknown_fields is `false`' do
|
109
|
+
formatter = create_formatter({ class_name: 'tutorial.AddressBook',
|
110
|
+
decode_json: true,
|
111
|
+
ignore_unknown_fields: false,
|
112
|
+
include_paths: VALID_INCLUDE_PATHS_ABSOLUTE })
|
113
|
+
|
114
|
+
assert_raise(Google::Protobuf::ParseError) do
|
115
|
+
formatter.format('some-tag', 1234,
|
116
|
+
{
|
117
|
+
'people' => [
|
118
|
+
{
|
119
|
+
'name' => 'Masahiro',
|
120
|
+
'id' => 1337,
|
121
|
+
'email' => 'repeatedly _at_ gmail.com',
|
122
|
+
'last_updated' => '2021-12-02T23:58:25.318Z',
|
123
|
+
'some-unknown-fields' => 'this field is not specified in the .proto message'
|
124
|
+
}
|
125
|
+
]
|
126
|
+
})
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
86
130
|
test 'encodes Ruby hash into Protobuf binary if generated files are provided by a Gem' do
|
87
131
|
formatter = create_formatter({
|
88
132
|
class_name: 'google.protobuf.Duration',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-formatter-protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Tung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '3.
|
109
|
+
version: '3.21'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
116
|
+
version: '3.21'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: oj
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,12 +136,15 @@ executables: []
|
|
136
136
|
extensions: []
|
137
137
|
extra_rdoc_files: []
|
138
138
|
files:
|
139
|
+
- ".github/dependabot.yml"
|
139
140
|
- ".github/workflows/build-and-test.yml"
|
140
141
|
- ".github/workflows/codeql-analysis.yml"
|
141
|
-
- ".github/workflows/
|
142
|
+
- ".github/workflows/release-please.yml"
|
142
143
|
- ".gitignore"
|
144
|
+
- ".release-please-manifest.json"
|
143
145
|
- ".rubocop.yml"
|
144
146
|
- ".ruby-version"
|
147
|
+
- CHANGELOG.md
|
145
148
|
- Gemfile
|
146
149
|
- LICENSE
|
147
150
|
- README.md
|
@@ -152,6 +155,8 @@ files:
|
|
152
155
|
- fluent-plugin-formatter-protobuf.gemspec
|
153
156
|
- lib/fluent/plugin/formatter_protobuf.rb
|
154
157
|
- lib/fluent/plugin/version.rb
|
158
|
+
- release-please-config.json
|
159
|
+
- renovate.json5
|
155
160
|
- test/helper.rb
|
156
161
|
- test/integration/Gemfile
|
157
162
|
- test/integration/Gemfile.lock
|
@@ -188,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
193
|
version: '0'
|
189
194
|
requirements: []
|
190
195
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.7.3
|
196
|
+
rubygems_version: 2.7.6.3
|
192
197
|
signing_key:
|
193
198
|
specification_version: 4
|
194
199
|
summary: Protobuf formatter for Fluentd
|
@@ -1,96 +0,0 @@
|
|
1
|
-
name: Publish
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- v0.*
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
lint:
|
10
|
-
name: Lint
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
permissions:
|
13
|
-
packages: write
|
14
|
-
contents: read
|
15
|
-
|
16
|
-
steps:
|
17
|
-
- uses: actions/checkout@v2
|
18
|
-
- name: Set up Ruby 2.5
|
19
|
-
uses: ruby/setup-ruby@v1
|
20
|
-
with:
|
21
|
-
bundler-cache: true
|
22
|
-
- name: "Unit test"
|
23
|
-
run: "bundle exec rake lint:check"
|
24
|
-
|
25
|
-
test:
|
26
|
-
name: Unit test
|
27
|
-
runs-on: ubuntu-latest
|
28
|
-
permissions:
|
29
|
-
packages: write
|
30
|
-
contents: read
|
31
|
-
|
32
|
-
steps:
|
33
|
-
- uses: actions/checkout@v2
|
34
|
-
- name: Set up Ruby 2.5
|
35
|
-
uses: ruby/setup-ruby@v1
|
36
|
-
with:
|
37
|
-
bundler-cache: true
|
38
|
-
- name: "Unit test"
|
39
|
-
run: "bundle exec rake test:unit"
|
40
|
-
|
41
|
-
publish-to-gpr:
|
42
|
-
needs:
|
43
|
-
- lint
|
44
|
-
- test
|
45
|
-
name: Build + Publish to GPR
|
46
|
-
runs-on: ubuntu-latest
|
47
|
-
permissions:
|
48
|
-
packages: write
|
49
|
-
contents: read
|
50
|
-
|
51
|
-
steps:
|
52
|
-
- uses: actions/checkout@v2
|
53
|
-
- name: Set up Ruby 2.5
|
54
|
-
uses: ruby/setup-ruby@v1
|
55
|
-
with:
|
56
|
-
bundler-cache: true
|
57
|
-
|
58
|
-
- name: Publish to GPR
|
59
|
-
run: |
|
60
|
-
mkdir -p $HOME/.gem
|
61
|
-
touch $HOME/.gem/credentials
|
62
|
-
chmod 0600 $HOME/.gem/credentials
|
63
|
-
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
64
|
-
gem build *.gemspec
|
65
|
-
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
66
|
-
env:
|
67
|
-
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
68
|
-
OWNER: ${{ github.repository_owner }}
|
69
|
-
|
70
|
-
publish-to-ruby-gems:
|
71
|
-
needs:
|
72
|
-
- lint
|
73
|
-
- test
|
74
|
-
name: Build + Publish to RubyGems
|
75
|
-
runs-on: ubuntu-latest
|
76
|
-
permissions:
|
77
|
-
packages: write
|
78
|
-
contents: read
|
79
|
-
|
80
|
-
steps:
|
81
|
-
- uses: actions/checkout@v2
|
82
|
-
- name: Set up Ruby 2.5
|
83
|
-
uses: ruby/setup-ruby@v1
|
84
|
-
with:
|
85
|
-
bundler-cache: true
|
86
|
-
|
87
|
-
- name: Publish to RubyGems
|
88
|
-
run: |
|
89
|
-
mkdir -p $HOME/.gem
|
90
|
-
touch $HOME/.gem/credentials
|
91
|
-
chmod 0600 $HOME/.gem/credentials
|
92
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
93
|
-
gem build *.gemspec
|
94
|
-
gem push *.gem
|
95
|
-
env:
|
96
|
-
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|