community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864318 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js
Date Sat, 03 Aug 2019 07:46:18 GMT
Author: humbedooh
Date: Sat Aug  3 07:46:18 2019
New Revision: 1864318

URL: http://svn.apache.org/viewvc?rev=1864318&view=rev
Log:
If kibble data exists, put it into the health help panel.

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864318&r1=1864317&r2=1864318&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Aug  3 07:46:18
2019
@@ -222,6 +222,64 @@ function health_tips(data) {
     let jira = data.jira[project];
     if (jira[0] || jira[1]) txt += "<li>%u JIRA tickets opened and %u closed in the
past quarter.</li>".format(jira[0], jira[1]);
     
+    // Commits and contributors
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.commits.change.commits
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u commits in the past quarter (%s)</li>".format(color,
data.kibble.commits.after.commits, ctxt);
+    }
+    
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.commits.change.authors
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u code contributors in the past quarter (%s)</li>".format(color,
data.kibble.commits.after.authors, ctxt);
+    }
+    
+    // GitHub: PRs
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.prs.change.opened
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u PRs opened on GitHub (%s)</li>".format(color,
data.kibble.prs.after.opened, ctxt);
+    }
+    
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.prs.change.closed
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u PRs closed on GitHub (%s)</li>".format(color,
data.kibble.prs.after.closed, ctxt);
+    }
+    
     // Append header IF there is data, otherwise nah.
     if (txt.length > 0) txt = "<h5>Potentially useful observations on community
health:</h5><ul>" + txt + "</ul>";
     return txt;

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864318&r1=1864317&r2=1864318&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sat Aug  3 07:46:18 2019
@@ -1391,6 +1391,64 @@ function health_tips(data) {
     let jira = data.jira[project];
     if (jira[0] || jira[1]) txt += "<li>%u JIRA tickets opened and %u closed in the
past quarter.</li>".format(jira[0], jira[1]);
     
+    // Commits and contributors
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.commits.change.commits
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u commits in the past quarter (%s)</li>".format(color,
data.kibble.commits.after.commits, ctxt);
+    }
+    
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.commits.change.authors
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u code contributors in the past quarter (%s)</li>".format(color,
data.kibble.commits.after.authors, ctxt);
+    }
+    
+    // GitHub: PRs
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.prs.change.opened
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u PRs opened on GitHub (%s)</li>".format(color,
data.kibble.prs.after.opened, ctxt);
+    }
+    
+    if (data.kibble) {
+      let color = 'black';
+      let ctxt = data.kibble.prs.change.closed
+      let pct = parseInt(ctxt);
+      if (pct > 0) {
+        if (pct > 10) color = 'green';
+        ctxt += ' increase';
+      } else if (pct < 0) {
+        if (pct < -10) color = 'maroon';
+        ctxt += ' decrease';
+      }
+      txt += "<li style='color: %s;'>%u PRs closed on GitHub (%s)</li>".format(color,
data.kibble.prs.after.closed, ctxt);
+    }
+    
     // Append header IF there is data, otherwise nah.
     if (txt.length > 0) txt = "<h5>Potentially useful observations on community
health:</h5><ul>" + txt + "</ul>";
     return txt;



Mime
View raw message