Skip to content

Commit

Permalink
- make plugin statuses milestones instead. (LOGSTASH-1137)
Browse files Browse the repository at this point in the history
  The previous taxonomy confused users due to overloaded meanings of
  'beta' and 'experimental'.
  • Loading branch information
jordansissel committed Jun 17, 2013
1 parent dd8f6e1 commit 43a519a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
19 changes: 13 additions & 6 deletions lib/logstash/config/mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,20 @@ def validate_plugin_status
return true if @@status_notice_given
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
log_data = { :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION }
case @plugin_status
when "unsupported"; @logger.warn(I18n.t("logstash.plugin.unsupported", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION))
when "experimental"; @logger.warn(I18n.t("logstash.plugin.experimental", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION))
when "beta"; @logger.warn(I18n.t("logstash.plugin.beta", :type => plugin_type, :name => @config_name, :LOGSTASH_VERSION => LOGSTASH_VERSION))
when "stable"; # This is cool. Nothing worth logging.
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}"
when LogStash::Plugin::MILESTONE_0
@logger.warn(I18n.t("logstash.plugin.milestone.0", log_data)
when LogStash::PLugin::MILESTONE_1
@logger.warn(I18n.t("logstash.plugin.milestone.1", log_data)
when LogStash::PLugin::MILESTONE_2
@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
@@status_notice_given = true
return true
Expand Down
5 changes: 5 additions & 0 deletions lib/logstash/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class LogStash::Plugin
attr_accessor :params
attr_accessor :logger

MILESTONE_0 = "milestone 0"
MILESTONE_1 = "milestone 1"
MILESTONE_2 = "milestone 2"
MILESTONE_3 = "milestone 3"

public
def hash
params.hash ^
Expand Down
32 changes: 17 additions & 15 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ en:
Could not find any plugin type named '%{type}'. Check for typos.
Valid plugin types are 'input' 'filter' and 'output'
plugin:
unsupported: >-
Using unsupported %{type} plugin '%{name}'. This plugin isn't well
supported by the commnity and likely has no maintainer.
For more information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
experimental: >-
Using experimental %{type} plugin '%{name}'. This plugin should work,
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
information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
beta: >-
Using beta %{type} plugin '%{name}'.
For more information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
milestone:
0: >-
Using milestone 0 %{type} plugin '%{name}'. This plugin isn't well
supported by the commnity and likely has no maintainer. For more
information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
1: >-
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
find bugs or have suggestions on how to improve this plugin. For more
information on plugin statuses, see
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
2: >-
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
http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status
agent:
sighup: >-
SIGHUP received.
Expand Down

0 comments on commit 43a519a

Please sign in to comment.