whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject [whimsy] branch master updated: WHIMSY-98 - Adding migration tool to convert podling status to yaml. Updating podlings script for generation including status, durations.
Date Sat, 10 Jun 2017 02:15:17 GMT
This is an automated email from the ASF dual-hosted git repository.

johndament pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new f8a14ea  WHIMSY-98 - Adding migration tool to convert podling status to yaml.  Updating
podlings script for generation including status, durations.
f8a14ea is described below

commit f8a14eac743e0f2fe197d29ace821cb37a09ec31
Author: John D. Ament <johndament@apache.org>
AuthorDate: Fri Jun 9 22:15:11 2017 -0400

    WHIMSY-98 - Adding migration tool to convert podling status to yaml.  Updating podlings
script for generation including status, durations.
---
 .gitignore                 |  1 +
 lib/whimsy/asf/podlings.rb | 24 +++++++++++++++++++++++-
 tools/migrate_podlings.rb  |  8 ++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 3bb67a4..5bd2103 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ pkg
 Gemfile.lock
 work
 .idea/
+.subversion
diff --git a/lib/whimsy/asf/podlings.rb b/lib/whimsy/asf/podlings.rb
index 1fe8358..e4b64b4 100644
--- a/lib/whimsy/asf/podlings.rb
+++ b/lib/whimsy/asf/podlings.rb
@@ -21,6 +21,7 @@ module ASF
     def initialize(node)
       @name = node['name']
       @resource = node['resource']
+      @sponsor = node['sponsor']
       # Needed for matching against mailing list names 
       @resourceAliases = []
       @resourceAliases = node['resourceAliases'].split(/,\s*/) if node['resourceAliases']
@@ -39,7 +40,6 @@ module ASF
       # - retiring/graduating
       # The following podling attributes are not processed:
       # - longname
-      # - sponsor
     end
 
     # map resource to name
@@ -250,10 +250,32 @@ module ASF
       hash[:resource] = resource
       hash[:resourceAliases] = resourceAliases
       hash[:namesearch] = namesearch if namesearch
+      hash[:sponsor] = @sponsor if @sponsor
+      enddate = Date.new()
+      enddate = Date.parse(@enddate) if @enddate
+
+      hash[:duration] = (enddate - Date.parse(@startdate)).to_i
       hash[:podlingStatus] = podlingStatus if podlingStatus
       hash
     end
 
+    def default_status
+      {
+          issueTracker: 'jira',
+          dateAccepted: nil,
+          wiki: self.resource.upcase,
+          jira: self.resource.upcase,
+          proposal: 'http://wiki.apache.org/incubator/'+self.resource.capitalize+"Proposal",
+          asfCopyright: nil,
+          distributionRights: nil,
+          ipClearance: nil,
+          sga: nil,
+          website: 'http://'+self.resource+'.incubator.apache.org',
+          graduationDate: nil,
+          resolution: nil
+      }
+    end
+
     # parse (and cache) names mentioned in podlingnamesearches
     def self.namesearch
       # cache JIRA response
diff --git a/tools/migrate_podlings.rb b/tools/migrate_podlings.rb
new file mode 100644
index 0000000..fca1059
--- /dev/null
+++ b/tools/migrate_podlings.rb
@@ -0,0 +1,8 @@
+require 'whimsy/asf'
+require 'yaml'
+
+incubator_content = ASF::SVN['asf/incubator/public/trunk/content']
+ASF::Podlings.list.select{ |p| p.status == 'current'}.each_entry{ |podling|
+  pod_status_yml = "#{incubator_content}/podlings/#{podling.resource}.yml"
+  File.open(pod_status_yml, 'a') {|f| f.write(podling.default_status.to_yaml) }
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message