Return-Path: X-Original-To: apmail-community-commits-archive@minotaur.apache.org Delivered-To: apmail-community-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4D8617611 for ; Thu, 1 Oct 2015 13:39:13 +0000 (UTC) Received: (qmail 6919 invoked by uid 500); 1 Oct 2015 13:39:13 -0000 Delivered-To: apmail-community-commits-archive@community.apache.org Received: (qmail 6894 invoked by uid 500); 1 Oct 2015 13:39:13 -0000 Mailing-List: contact commits-help@community.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@community.apache.org Delivered-To: mailing list commits@community.apache.org Received: (qmail 6885 invoked by uid 99); 1 Oct 2015 13:39:13 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 13:39:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 626901A34B7 for ; Thu, 1 Oct 2015 13:39:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.802 X-Spam-Level: * X-Spam-Status: No, score=1.802 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id EH35zhSYV9o0 for ; Thu, 1 Oct 2015 13:39:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 9FA92202AF for ; Thu, 1 Oct 2015 13:39:05 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4B47EE0428 for ; Thu, 1 Oct 2015 13:39:05 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0F7983A01DC for ; Thu, 1 Oct 2015 13:39:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1706250 - in /comdev/reporter.apache.org/trunk/site: getjson.py render.js Date: Thu, 01 Oct 2015 13:39:04 -0000 To: commits@community.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151001133905.0F7983A01DC@svn01-us-west.apache.org> Author: sebb Date: Thu Oct 1 13:39:04 2015 New Revision: 1706250 URL: http://svn.apache.org/viewvc?rev=1706250&view=rev Log: COMDEV-141 wrong joining date shown for PMC membership Modified: comdev/reporter.apache.org/trunk/site/getjson.py comdev/reporter.apache.org/trunk/site/render.js Modified: comdev/reporter.apache.org/trunk/site/getjson.py URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/getjson.py?rev=1706250&r1=1706249&r2=1706250&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/getjson.py (original) +++ comdev/reporter.apache.org/trunk/site/getjson.py Thu Oct 1 13:39:04 2015 @@ -279,6 +279,10 @@ if m: if tlp in groups: emails[tlp] = emails[tlp] if tlp in emails else {} emails[tlp][nentry] = mld[entry] + with open("/var/www/reporter.apache.org/data/pmcdates.json", "r") as f: + pmcdates = json.loads(f.read()) + f.close() + dates = {} jdata = {} cdata = {} ddata = {} @@ -333,6 +337,7 @@ if m: for member in cchanges[pmc]: if cchanges[pmc][member][1] > 0: cdata[group]['committer'][member] = cchanges[pmc][member] + dates[group] = pmcdates[group] # only send the groups we want if not isMember(uid): allpmcs = [] output = { @@ -343,6 +348,7 @@ if m: 'delivery': emails, 'jira': jdata, 'changes': cdata, + 'dates': dates, 'pdata': ddata, 'releases': rdata, 'keys': keys, Modified: comdev/reporter.apache.org/trunk/site/render.js URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/render.js?rev=1706250&r1=1706249&r2=1706250&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/render.js (original) +++ comdev/reporter.apache.org/trunk/site/render.js Thu Oct 1 13:39:04 2015 @@ -211,6 +211,61 @@ function addLine(pmc, line) { } } +function PMCchanges(json, pmc, after) { + var changes = buildPanel(pmc, "PMC changes"); + + var roster = json.dates[pmc].roster + var nc = 0; + var np = 0; + var ncn = null; + var npn = null; + addLine(pmc, "## PMC changes:") + addLine(pmc) + changes.innerHTML += "
Changes within the last 3 months:
" + var l = 0; + + // pre-flight check + var c = 0; + var npmc = 0; + for (i in roster) { + c++ + var entry = roster[i]; + if (entry[1] > after.getTime() / 1000) { + npmc++; + } + } + addLine(pmc, " - Currently " + c + " PMC group members.") + if (npmc > 1) { + addLine(pmc, " - New PMC group members:") + } + + for (i in roster) { + var entry = roster[i]; + if (entry[1] > np) { + np = entry[1] + npn = entry[0]; + } + if (entry[1] > after.getTime() / 1000) { + l++; + changes.innerHTML += "→ " + entry[0] + " was added to the PMC group on " + new Date(entry[1] * 1000).toDateString() + "
"; + addLine(pmc, (npmc > 1 ? " " : "") + " - " + entry[0] + " was added to the PMC group on " + new Date(entry[1] * 1000).toDateString()) + } + } + if (l == 0) { + addLine(pmc, " - No new PMC group members added in the last 3 months") + changes.innerHTML += "→ No new PMC group members in the last 3 months.
"; + } + if (npn) { + if (np < after.getTime() / 1000) { + addLine(pmc, " - Last PMC group addition was " + npn + " at " + new Date(np * 1000).toDateString()) + } + changes.innerHTML += "→ " + "Latest PMC group addition: " + new Date(np * 1000).toDateString() + " (" + npn + ")
" + } + changes.innerHTML += "→ " + "Currently " + c + " PMC group members.
" + changes.innerHTML += "
PMC established: " + json.dates[pmc].pmc[0] + addLine(pmc) +} + function renderFrontPage(json) { jsdata = json var container = document.getElementById('contents') @@ -296,7 +351,9 @@ function renderFrontPage(json) { var after = new Date(); after.setMonth(mo); - var changes = buildPanel(pmc, "LDAP committee group/Committership changes"); + PMCchanges(json, pmc, after) + + var changes = buildPanel(pmc, "LDAP changes"); var c = 0; for (i in json.changes[pmc].committer) c++; @@ -305,12 +362,12 @@ function renderFrontPage(json) { var np = 0; var ncn = null; var npn = null; - addLine(pmc, "## LDAP committee group/Committership changes:") + addLine(pmc, "## LDAP changes:") addLine(pmc) - addLine(pmc, " - Currently " + json.count[pmc][1] + " committers and " + json.count[pmc][0] + " LDAP committee group members.") + addLine(pmc, " - Currently " + json.count[pmc][1] + " committers and " + json.count[pmc][0] + " committee group members.") if (c == 0) { - changes.innerHTML += "No new changes to the LDAP committee group or committer base detected - (LDAP error or no changes for >2 years)" - addLine(pmc, " - No new changes to the LDAP committee group or committership since last report.") + changes.innerHTML += "No new changes to the committee group or committer base detected - (LDAP error or no changes for >2 years)" + addLine(pmc, " - No new changes to the committee group or committership since last report.") addLine(pmc) } else { changes.innerHTML += "
Changes within the last 3 months:
" @@ -325,10 +382,9 @@ function renderFrontPage(json) { } } if (npmc > 1) { - addLine(pmc, " - New LDAP committee group members:") + addLine(pmc, " - New committee group members:") } - for (i in json.changes[pmc].pmc) { var entry = json.changes[pmc].pmc[i]; if (entry[1] > np) { @@ -337,19 +393,19 @@ function renderFrontPage(json) { } if (entry[1] > after.getTime() / 1000) { l++; - changes.innerHTML += "→ " + entry[0] + " was added to the LDAP committee group on " + new Date(entry[1] * 1000).toDateString() + "
"; - addLine(pmc, (npmc > 1 ? " " : "") + " - " + entry[0] + " was added to the LDAP committee group on " + new Date(entry[1] * 1000).toDateString()) + changes.innerHTML += "→ " + entry[0] + " was added to the committee group on " + new Date(entry[1] * 1000).toDateString() + "
"; + addLine(pmc, (npmc > 1 ? " " : "") + " - " + entry[0] + " was added to the committee group on " + new Date(entry[1] * 1000).toDateString()) } } if (l == 0) { - addLine(pmc, " - No new LDAP committee group members added in the last 3 months") - changes.innerHTML += "→ No new LDAP committee group members in the last 3 months.
"; + addLine(pmc, " - No new committee group members added in the last 3 months") + changes.innerHTML += "→ No new committee group members in the last 3 months.
"; } if (npn) { if (np < after.getTime() / 1000) { - addLine(pmc, " - Last LDAP committee group addition was " + npn + " at " + new Date(np * 1000).toDateString()) + addLine(pmc, " - Last committee group addition was " + npn + " at " + new Date(np * 1000).toDateString()) } - changes.innerHTML += "→ " + "Latest LDAP committee group addition: " + new Date(np * 1000).toDateString() + " (" + npn + ")
" + changes.innerHTML += "→ " + "Latest committee group addition: " + new Date(np * 1000).toDateString() + " (" + npn + ")
" } @@ -390,7 +446,7 @@ function renderFrontPage(json) { addLine(pmc, " - Last committer addition was more than 2 years ago") changes.innerHTML += "→ " + "Latest committer addition: more than two years ago (not in the archive!)
" } - changes.innerHTML += "→ " + "Currently " + json.count[pmc][1] + " committers and " + json.count[pmc][0] + " LDAP committee members." + changes.innerHTML += "→ " + "Currently " + json.count[pmc][1] + " committers and " + json.count[pmc][0] + " committee members." addLine(pmc) } @@ -663,7 +719,7 @@ function mergeData(json, pmc) { } } - var todo = new Array('count', 'mail', 'delivery', 'jira', 'changes', 'pdata', 'releases', 'keys', 'health') + var todo = new Array('count', 'mail', 'delivery', 'jira', 'changes', 'dates', 'pdata', 'releases', 'keys', 'health') for (i in todo) { var key = todo[i] jsdata[key][pmc] = json[key][pmc];