Skip to content

Only publish integration plugins that are marked as default #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

robbavey
Copy link
Member

In order to avoid overwriting individual plugins for releases that
are capable of running integration plugins, only write doc
entries for integration plugins that are marked as default.

In order to avoid overwriting individual plugins for releases that
 are capable of running integration plugins, only write doc
 entries for integration plugins that are marked as default.
Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that skipping non-default integration plugins makes the most sense of our options.

I've included an alternate approach that includes a log message to stdout, which should help us when we eventually have to debug to figure out why it is getting skipped.

plugindocs.rb Outdated
@@ -71,7 +71,7 @@ def execute
# write the doc
File.write(output_asciidoc, content)
puts "#{plugin.canonical_name}@#{plugin.tag}: #{release_date}\n"
end
end unless released_plugin.only_publish_default? && !is_default_plugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to do this skipping early instead of hiding it in a tailing unless clause.

diff --git a/plugindocs.rb b/plugindocs.rb
index 819b287..7074fb7 100644
--- a/plugindocs.rb
+++ b/plugindocs.rb
@@ -44,6 +44,11 @@ class PluginDocs < Clamp::Command
                          "unreleased"
       changelog_url = released_plugin.changelog_url
 
+      if released_plugin.type == 'integration' && !is_default_plugin
+        $stderr.puts("[repository:#{repository_name}]: Skipping non-default Integration Plugin\n")
+        next
+      end
+
       released_plugin.with_embedded_plugins.each do |plugin|
         $stderr.puts("#{plugin.desc}: fetching documentation\n")
         content = plugin.documentation

@robbavey
Copy link
Member Author

@yaauie Thanks for the comment, and the suggestion. I've updated the PR to include your suggestion

@robbavey robbavey requested a review from karenzone January 10, 2020 19:38
Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense for now.

There is definitely nuance here as we allow non-integration plugins to get updated docs even if the versions aren't installed, which can be a bug or a feature depending on how we look at it (e.g., fubar input 1.2 ships in Logstash 7.5, fubar 1.3 with new features is released at a later date but never bundled with Logstash 7.5, but the docs will include the new features)

Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robbavey
Copy link
Member Author

@yaauie Thanks for the LGTM, and I agree there are some interesting nuances that could cause confusion for users

@robbavey robbavey merged commit dd6cfb8 into elastic:master Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants