- make plugin statuses milestones instead. (LOGSTASH-1137)

The previous taxonomy confused users due to overloaded meanings of
  'beta' and 'experimental'.
This commit is contained in:
Jordan Sissel 2013-06-17 09:37:41 -07:00
parent dd8f6e147a
commit 43a519a7f6
3 changed files with 35 additions and 21 deletions

View file

@ -172,13 +172,20 @@ module LogStash::Config::Mixin
return true if @@status_notice_given return true if @@status_notice_given
docmsg = "For more information about plugin statuses, see http://logstash.net/docs/#{LOGSTASH_VERSION}/plugin-status " docmsg = "For more information about plugin statuses, see http://logstash.net/docs/#{LOGSTASH_VERSION}/plugin-status "
plugin_type = ancestors.find { |a| a.name =~ /::Base$/ }.config_name plugin_type = ancestors.find { |a| a.name =~ /::Base$/ }.config_name
log_data = { :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION }
case @plugin_status case @plugin_status
when "unsupported"; @logger.warn(I18n.t("logstash.plugin.unsupported", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION)) when LogStash::Plugin::MILESTONE_0
when "experimental"; @logger.warn(I18n.t("logstash.plugin.experimental", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION)) @logger.warn(I18n.t("logstash.plugin.milestone.0", log_data)
when "beta"; @logger.warn(I18n.t("logstash.plugin.beta", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION)) when LogStash::PLugin::MILESTONE_1
when "stable"; # This is cool. Nothing worth logging. @logger.warn(I18n.t("logstash.plugin.milestone.1", log_data)
when nil; raise "#{@config_name} must set a plugin_status. #{docmsg}" when LogStash::PLugin::MILESTONE_2
else; raise "#{@config_name} set an invalid plugin status #{@plugin_status}. Valid values are unsupported, experimental, beta and stable. #{docmsg}" @logger.warn(I18n.t("logstash.plugin.milestone.2", log_data)
when LogStash::PLugin::MILESTONE_3
# No message to log, this plugin is of good quality with tests, etc.
when nil
raise "#{@config_name} must set a plugin_status. #{docmsg}"
else
raise "#{@config_name} set an invalid plugin status #{@plugin_status}. Valid values are unsupported, experimental, beta and stable. #{docmsg}"
end end
@@status_notice_given = true @@status_notice_given = true
return true return true

View file

@ -7,6 +7,11 @@ class LogStash::Plugin
attr_accessor :params attr_accessor :params
attr_accessor :logger attr_accessor :logger
MILESTONE_0 = "milestone 0"
MILESTONE_1 = "milestone 1"
MILESTONE_2 = "milestone 2"
MILESTONE_3 = "milestone 3"
public public
def hash def hash
params.hash ^ params.hash ^

View file

@ -34,19 +34,21 @@ en:
Could not find any plugin type named '%{type}'. Check for typos. Could not find any plugin type named '%{type}'. Check for typos.
Valid plugin types are 'input' 'filter' and 'output' Valid plugin types are 'input' 'filter' and 'output'
plugin: plugin:
unsupported: >- milestone:
Using unsupported %{type} plugin '%{name}'. This plugin isn't well 0: >-
supported by the commnity and likely has no maintainer. Using milestone 0 %{type} plugin '%{name}'. This plugin isn't well
For more information on plugin statuses, see supported by the commnity and likely has no maintainer. For more
information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
experimental: >- 1: >-
Using experimental %{type} plugin '%{name}'. This plugin should work, Using milestone 1 %{type} plugin '%{name}'. This plugin should work,
but would benefit from use by folks like you. Please let us know if you but would benefit from use by folks like you. Please let us know if you
find bugs or have suggestions on how to improve this plugin. For more find bugs or have suggestions on how to improve this plugin. For more
information on plugin statuses, see information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
beta: >- 2: >-
Using beta %{type} plugin '%{name}'. Using milestone 2 %{type} plugin '%{name}'. This plugin should be
stable, but if you see strange behavior, please let us know!
For more information on plugin statuses, see For more information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
agent: agent: