1- # Updating plugin for v1.0 from v0.12
1+ # Updating plugin for v1 from v0.12
22
33This guide is for plugin authors to show how to update
44input/output/filter plugins written for Fluentd v0.12 or earlier.
55
66There are something to be considered (see following "Updating Plugins
77Overview" section for details):
88
9- - Plugins which use v0.12 API will be supported between Fluentd v0.14
10- and v1 (will be obsoleted at v2).
11- - Users can use new features of Fluentd v1.0 only with plugins using
9+ - Plugins which use v0.12 API will be supported in Fluentd v1
10+ (will be obsoleted at v2).
11+ - Users can use new features of Fluentd v1 only with plugins using
1212 new API.
1313- Plugins which use new API don't work on Fluentd v0.12.x.
1414
15- Fluentd core team strongly recommend to use v1.0 API to make your
15+ Fluentd core team strongly recommend to use v1 API to make your
1616plugins stable, consistent and easy to test.
1717
1818
@@ -24,7 +24,7 @@ These are steps to update your plugins safely.
24242 . update dependency
25253 . update code and tests
26264 . update CI environments
27- 5 . release the newer version for Fluentd v0.14.x and later
27+ 5 . release the newer version for Fluentd v1 and later
2828
2929
3030### 1. release a latest version
@@ -46,23 +46,19 @@ newer versions for Fluentd v0.12 users without breaking anything.
4646### 2. update dependency
4747
4848Following updates are on master branch. You should update dependency in
49- gemspec at first to depend on Fluentd v0.14 .
49+ gemspec at first to depend on Fluentd v1 .
5050
51- - fix dependency about ` Fluentd ` to ` [">= 0.14.0 ", "< 2"] `
51+ - fix dependency about ` Fluentd ` to ` [">= 1 ", "< 2"] `
5252- execute ` bundle install `
5353
54- Is it correct to use ` >= 0.14.0 ` instead of ` ~> 0.14.0 ` ? Yes. Fluentd v1
55- will be compatible with v0.14.0 (especially for plugin APIs), so you
56- should use ` >= 0.14.0 ` . Let's think about v2 few years later.
57-
5854Recommended dependency in gemspec:
5955
6056```
6157# in gemspec
6258Gem::Specification.new do |gem|
6359 gem.name = "fluent-plugin-my_awesome"
6460 # ...
65- gem.add_runtime_dependency "fluentd", [">= 0.14.0 ", "< 2"]
61+ gem.add_runtime_dependency "fluentd", [">= 1 ", "< 2"]
6662end
6763```
6864
@@ -80,12 +76,10 @@ plugins.
8076### 4. update CI environments
8177
8278If you have CI configurations like ` .travis.yml ` and ` appvayor.yml ` ,
83- these should be updated to support Fluentd v0.14/v1.0. Fluentd
84- v0.14/v1.0 supports Ruby 2.1 or later. CI environments should not
85- include Ruby 2.0 or earlier. It's good idea to add latest Ruby (2.4 at
86- Nov 2017).
79+ these should be updated to support Fluentd v1. Fluentd v1 supports Ruby 2.4 or later.
80+ CI environments should not include Ruby 2.3 or earlier.
8781
88- - remove Ruby 2.0 or earlier from CI environments
82+ - remove Ruby 2.3 or earlier from CI environments
8983- add Ruby 2.4 (or other latest version) to CI environments
9084
9185
@@ -98,8 +92,8 @@ Add requirements section to `README.md` like following:
9892
9993| fluent-plugin-may_awesome | Fluentd | Ruby |
10094|:--------------------------|:-----------|:-------|
101- | >= 1.0.0 | >= v0.14.0 | >= 2.1 |
102- | < 1.0.0 | >= v0.12.0 | >= 1.9 |
95+ | >= 1.0.0 | >= v1 | >= 2.4 |
96+ | < 1.0.0 | >= v0.12.0 | >= 2.1 |
10397```
10498
10599This helps that plugin users can understand plugin requirements.
@@ -112,7 +106,7 @@ not patch version up. If the current major version of your gem is equal
112106or larger than 1, you should bump major version up (e.g., from 1 to 2).
113107If the current major version is 0, you should bump minor version up
114108(e.g., from ` 0.4.2 ` to ` 0.5.0 ` ). Then, you can publish a new release
115- which is available with Fluentd v0.14/v1.0 .
109+ which is available with Fluentd v1 .
116110
117111- bump the version up
118112- release it to rubygems.org
0 commit comments