Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

(SDI-2052) add task for metadata generation for plugins #26

Merged
merged 4 commits into from
Oct 21, 2016

Conversation

nanliu
Copy link
Contributor

@nanliu nanliu commented Sep 30, 2016

Add PLUGINS_CATALOG to the template.

  • Use github api to fetch plugins.yml
  • Retrieve each repo github metadata
  • Retrieve each repo .sync.yml and metadata.yml
  • Fetch github issues tagged wish-list
  • Generate PLUGINS_CATALOG from template

def self.org_capitalize(word)
{
'intelsdi-x': 'Intel',
'raintank': 'Raintank',
Copy link
Contributor

Choose a reason for hiding this comment

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

raintank as a company is lowercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed them from this list.

@@ -3,3 +3,6 @@ git_base: 'git@github.com:'
namespace: intelsdi-x
branch: pluginsync
message: "Updates to repository from pluginsync utility"
plugins.yml:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is super cool 👌

@@ -0,0 +1,37 @@
# Plugin Catalog
Copy link
Contributor

Choose a reason for hiding this comment

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

The resulting file in the Snap repo is PLUGIN_CATALOG.md. Would make more sense for this name to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

downloads += ["[release](#{p['github_release']})"] if p.include? "github_release"
downloads += p["download"]["s3_latest"].collect{|h| "[#{h.keys.first}](#{h[h.keys.first]})" } if p["download"] and p["download"]["s3_latest"]
-%>
| [<%= p["name"] %>](<%= p['repo_url'] %>) | <%= maintainer %> | <%= p["description"] %> | <%= Pluginsync::Util.html_list(p["badge"]) -%> | <%= Pluginsync::Util.html_list(downloads) %> |
Copy link
Contributor

Choose a reason for hiding this comment

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

When working on intelsdi-x/snap#1231, I liked @IRCody's idea to link to the maintainer. Could we swap that in? Thinking:

<%= maintainer %>](<%= p['html_url'] %> << I think it's html_url here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

@mbbroberg mbbroberg left a comment

Choose a reason for hiding this comment

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

A few minor edits but overall awesome. I've run through the plugin methods.

Add PLUGINS_CATALOG to the template.
* Use github api to fetch plugins.yml
* Retrieve each repo github metadata
* Retrieve each repo .sync.yml and metadata.yml
* Fetch github issues tagged wish-list
* Generate PLUGINS_CATALOG from template
@nanliu nanliu changed the title Add task for metadata generation for plugins (SDI-2052) add task for metadata generation for plugins Oct 6, 2016
@nanliu nanliu force-pushed the metadata branch 2 times, most recently from bba77a4 to 78a71ca Compare October 7, 2016 00:17
This creates a fork and updates documentation, and generates a pr
against the upstream repository.
@IRCody
Copy link

IRCody commented Oct 13, 2016

@mjbrender: Can you review @nanliu's updates and see if they're good?

Copy link
Contributor

@kindermoumoute kindermoumoute left a comment

Choose a reason for hiding this comment

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

From a global point of view, code looks good. As I'm not super familiar with Ruby I there are low level syntax mistakes.

namespace :notify do
desc "send a slack notification"
task :slack do
Pluginsync::Notify::Slack.message "#build-snap", "Snap packages version <https://packagecloud.io/nanliu/snap|#{@snap.pkgversion} now available.>"
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is {@snap.pkgversion} defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks related to the bottom of deps.sh, but I have no freaking clue how yet 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, this needs to be fixed, since it's originally for package releases.

end

def plugin_name
@name.match(/snap-plugin-(collector|processor|publisher)-(.*)$/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this to work with kubesnap plugins?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kindermoumoute nope - kubesnap project will merge into snap plugins in the longer run.

@mbbroberg
Copy link
Contributor

mbbroberg commented Oct 14, 2016

@nanliu so, I broke this by changing the labeling strategy for the wish list. They're now three separate ones:

  • plugin-wishlist/collector
  • plugin-wishlist/processor
  • plugin-wishlist/publisher

The bad is it breaks plugins.rb behavior at the moment. The benefit is you can tag the plugin type in the resulting JSON.

I tested all plugin:* commands other than the pull_request one for now.

@IRCody code review is 👎 because of that.

@nanliu
Copy link
Contributor Author

nanliu commented Oct 14, 2016

@mjbrender, I added plugin type support for wishlist to the PR.

@snapbot
Copy link

snapbot commented Oct 14, 2016

LGTM @nanliu 👌! Thanks.

@nanliu nanliu merged commit 27677d0 into intelsdi-x:master Oct 21, 2016
@nanliu nanliu deleted the metadata branch January 19, 2017 18:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants