You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/09/12 12:27:58 UTC

[kibble] branch master updated (5647887 -> 07b3e81)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git.


    from 5647887  Merge pull request #18 from sharanf/patch-2
     new 51e3b8a  add a path filter to repo explorer
     new 7ba8a0d  regen JS
     new 1c89410  allow pathfilter arg in API
     new 65cdce0  regen openapi yaml
     new 2da57de  add path filter to API end points that make sense
     new 07b3e81  Merge branch 'master' of github.com:apache/kibble

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 api/pages/code/changes.py                          | 10 +++
 api/pages/code/commits.py                          | 10 +++
 api/pages/code/committers.py                       | 10 +++
 api/pages/code/top-commits.py                      | 10 +++
 api/pages/code/trends.py                           | 20 ++++++
 api/yaml/openapi.yaml                              |  3 +
 .../components/schemas/defaultWidgetArgs.yaml      |  3 +
 ui/js/coffee/explorer.coffee                       | 49 +++++++++++++
 ui/js/kibble.v1.js                                 | 81 +++++++++++++++++++++-
 9 files changed, 193 insertions(+), 3 deletions(-)


[kibble] 03/06: allow pathfilter arg in API

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1c894103494da366e641066ed0a3e9de666552af
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:26:21 2018 +0200

    allow pathfilter arg in API
---
 api/yaml/openapi/components/schemas/defaultWidgetArgs.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/api/yaml/openapi/components/schemas/defaultWidgetArgs.yaml b/api/yaml/openapi/components/schemas/defaultWidgetArgs.yaml
index 5facff9..433b926 100644
--- a/api/yaml/openapi/components/schemas/defaultWidgetArgs.yaml
+++ b/api/yaml/openapi/components/schemas/defaultWidgetArgs.yaml
@@ -51,6 +51,9 @@ properties:
     description: Quickly defined view by sub-filtering the existing view and matching
       on sourceURLs
     type: string
+  pathfilter:
+    description: Quickly defined view by sub-filtering commits by paths affected.
+    type: string
   to:
     description: If specified, only compile data up until here
     example: 1503483273


[kibble] 05/06: add path filter to API end points that make sense

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2da57de670f69fd3bca7d427f63bdb76948bd91d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:26:54 2018 +0200

    add path filter to API end points that make sense
---
 api/pages/code/changes.py     | 10 ++++++++++
 api/pages/code/commits.py     | 10 ++++++++++
 api/pages/code/committers.py  | 10 ++++++++++
 api/pages/code/top-commits.py | 10 ++++++++++
 api/pages/code/trends.py      | 20 ++++++++++++++++++++
 5 files changed, 60 insertions(+)

diff --git a/api/pages/code/changes.py b/api/pages/code/changes.py
index 313db8c..c6233d4 100644
--- a/api/pages/code/changes.py
+++ b/api/pages/code/changes.py
@@ -131,6 +131,16 @@ def run(API, environ, indata, session):
         query['query']['bool']['should'] = [{'term': {'committer_email': indata.get('email')}}, {'term': {'author_email': indata.get('email')}}]
         query['query']['bool']['minimum_should_match'] = 1
     
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
+    
     # Get timeseries for this period
     query['aggs'] = {
             'per_interval': {
diff --git a/api/pages/code/commits.py b/api/pages/code/commits.py
index a2fece3..2899f75 100644
--- a/api/pages/code/commits.py
+++ b/api/pages/code/commits.py
@@ -132,6 +132,16 @@ def run(API, environ, indata, session):
         query['query']['bool']['should'] = [{'term': {'committer_email': indata.get('email')}}, {'term': {'author_email': indata.get('email')}}]
         query['query']['bool']['minimum_should_match'] = 1
     
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
+    
     # Get number of committers, this period
     query['aggs'] = {
             'commits': {
diff --git a/api/pages/code/committers.py b/api/pages/code/committers.py
index 133a458..7b6d518 100644
--- a/api/pages/code/committers.py
+++ b/api/pages/code/committers.py
@@ -132,6 +132,16 @@ def run(API, environ, indata, session):
         query['query']['bool']['should'] = [{'term': {'committer_email': indata.get('email')}}, {'term': {'author_email': indata.get('email')}}]
         query['query']['bool']['minimum_should_match'] = 1
     
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
+    
     # Get top 25 committers this period
     query['aggs'] = {
             'committers': {
diff --git a/api/pages/code/top-commits.py b/api/pages/code/top-commits.py
index 5e3c52a..ce75268 100644
--- a/api/pages/code/top-commits.py
+++ b/api/pages/code/top-commits.py
@@ -123,6 +123,16 @@ def run(API, environ, indata, session):
         query['query']['bool']['should'] = [{'term': {'committer_email': indata.get('email')}}, {'term': {'author_email': indata.get('email')}}]
         query['query']['bool']['minimum_should_match'] = 1
     
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
+    
     
     # Get top 25 committers this period
     query['aggs'] = {
diff --git a/api/pages/code/trends.py b/api/pages/code/trends.py
index dba483e..69d9b13 100644
--- a/api/pages/code/trends.py
+++ b/api/pages/code/trends.py
@@ -129,6 +129,16 @@ def run(API, environ, indata, session):
     if indata.get('email'):
         query['query']['bool']['should'] = [{'term': {'committer_email': indata.get('email')}}, {'term': {'author_email': indata.get('email')}}]
         query['query']['bool']['minimum_should_match'] = 1
+        
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
     
     # Get number of commits, this period
     res = session.DB.ES.count(
@@ -226,6 +236,16 @@ def run(API, environ, indata, session):
         query['query']['bool']['must'].append({'term': {'sourceID': indata.get('source')}})
     elif viewList:
         query['query']['bool']['must'].append({'terms': {'sourceID': viewList}})
+        
+    # Path filter?
+    if indata.get('pathfilter'):
+        pf = indata.get('pathfilter')
+        if '!' in pf:
+            pf = pf.replace('!', '')
+            query['query']['bool']['must_not'] = query['query']['bool'].get('must_not', [])
+            query['query']['bool']['must_not'].append({'regexp': {'files_changed': pf}})
+        else:
+            query['query']['bool']['must'].append({'regexp': {'files_changed': pf}})
     
     
     # Get number of commits, this period


[kibble] 01/06: add a path filter to repo explorer

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 51e3b8aee49bbe46b497073eff0d032c4124c456
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:26:04 2018 +0200

    add a path filter to repo explorer
---
 ui/js/coffee/explorer.coffee | 49 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/ui/js/coffee/explorer.coffee b/ui/js/coffee/explorer.coffee
index e96ec2c..be9a7f9 100644
--- a/ui/js/coffee/explorer.coffee
+++ b/ui/js/coffee/explorer.coffee
@@ -103,6 +103,16 @@ explorer = (json, state) ->
         label.style.paddingLeft = '5px'
         label.appendChild(document.createTextNode('Show authors'))
         state.widget.inject(label)
+        br = new HTML('br')
+        p = new HTML('input', {id:'pathfilter', size: 32, type: 'text', value: globArgs.pathfilter, onChange: 'pathFilterGlob = this.value;',placeholder: 'optional path-filter'})
+        
+        state.widget.inject(br)
+        state.widget.inject(p)
+        
+        b = new HTML('input', {style: { marginLeft: '10px'}, class: 'btn btn-small btn-success', type: 'button', onClick: 'pathFilter();', value: "filter paths"})
+        rb = new HTML('input', {style: { marginLeft: '10px'}, class: 'btn btn-small btn-danger', type: 'button', onClick: 'get("pathfilter").value = ""; pathFilter();', value: "reset"})
+        state.widget.inject(b)
+        state.widget.inject(rb)
 
 
 sourceexplorer = (json, state) ->
@@ -591,6 +601,44 @@ subFilter = () ->
                     else
                             $(this).attr('href', "#{m[1]}#{m[2]}")
         )
+
+pathFilterGlob = null
+
+pathFilter = () ->
+        source = pathFilterGlob
+        if source == ""
+                source = null
+        tName = 'pathfilter'
+        globArgs[tName] = source
+        x = {}
+        x[tName] = source
+        updateWidgets('donut', null, x)
+        updateWidgets('gauge', null, x)
+        updateWidgets('line', null, x)
+        updateWidgets('contacts', null, x)
+        updateWidgets('top5', null, x)
+        updateWidgets('factors', null, x)
+        updateWidgets('trends', null, x)
+        updateWidgets('radar', null, x)
+        updateWidgets('widget', null, x)
+        updateWidgets('relationship', null, x)
+        updateWidgets('treemap', null, x)
+        updateWidgets('report', null, x)
+        updateWidgets('mvp', null, x)
+        updateWidgets('comstat', null, x)
+        updateWidgets('worldmap', null, x)
+        updateWidgets('jsondump', null, x)
+        
+        $( "a" ).each( () ->
+            url = $(this).attr('href')
+            if url
+                m = url.match(/^(.+\?page=[-a-z]+.*?)(?:&pathfilter=[^&]+)?(.*)$/)
+                if m
+                    if source
+                            $(this).attr('href', "#{m[1]}&pathfilter=#{source}#{m[2]}")
+                    else
+                            $(this).attr('href', "#{m[1]}#{m[2]}")
+        )
         
 
 viewexplorer = (json, state) ->
@@ -678,6 +726,7 @@ viewexplorer = (json, state) ->
         state.widget.inject(b)
         state.widget.inject(rb)
         
+        
         if globArgs.subfilter and globArgs.subfilter.length > 0
                 source = globArgs.subfilter
                 $( "a" ).each( () ->


[kibble] 02/06: regen JS

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7ba8a0d08c5cbcc6158afe8badca2f49fd6bc550
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:26:10 2018 +0200

    regen JS
---
 ui/js/kibble.v1.js | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 78 insertions(+), 3 deletions(-)

diff --git a/ui/js/kibble.v1.js b/ui/js/kibble.v1.js
index f20941e..32eb1a9 100644
--- a/ui/js/kibble.v1.js
+++ b/ui/js/kibble.v1.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.12.7
-var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource [...]
+var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource [...]
   indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
 signup = function(form) {
@@ -1587,7 +1587,7 @@ badModal = function(str) {
 };
 
 explorer = function(json, state) {
-  var ID, chk, ezURL, h, id, item, label, len, len1, list, m, opt, org, q, ref, ref1, ref2, ref3, slen, u;
+  var ID, b, br, chk, ezURL, h, id, item, label, len, len1, list, m, opt, org, p, q, rb, ref, ref1, ref2, ref3, slen, u;
   org = json.organisation;
   h = document.createElement('h2');
   if (json.tag) {
@@ -1734,7 +1734,38 @@ explorer = function(json, state) {
   chk.setAttribute("title", "Check this box to authorships instead of committerships");
   label.style.paddingLeft = '5px';
   label.appendChild(document.createTextNode('Show authors'));
-  return state.widget.inject(label);
+  state.widget.inject(label);
+  br = new HTML('br');
+  p = new HTML('input', {
+    id: 'pathfilter',
+    size: 32,
+    type: 'text',
+    value: globArgs.pathfilter,
+    onChange: 'pathFilterGlob = this.value;',
+    placeholder: 'optional path-filter'
+  });
+  state.widget.inject(br);
+  state.widget.inject(p);
+  b = new HTML('input', {
+    style: {
+      marginLeft: '10px'
+    },
+    "class": 'btn btn-small btn-success',
+    type: 'button',
+    onClick: 'pathFilter();',
+    value: "filter paths"
+  });
+  rb = new HTML('input', {
+    style: {
+      marginLeft: '10px'
+    },
+    "class": 'btn btn-small btn-danger',
+    type: 'button',
+    onClick: 'get("pathfilter").value = ""; pathFilter();',
+    value: "reset"
+  });
+  state.widget.inject(b);
+  return state.widget.inject(rb);
 };
 
 sourceexplorer = function(json, state) {
@@ -2491,6 +2522,50 @@ subFilter = function() {
   });
 };
 
+pathFilterGlob = null;
+
+pathFilter = function() {
+  var source, tName, x;
+  source = pathFilterGlob;
+  if (source === "") {
+    source = null;
+  }
+  tName = 'pathfilter';
+  globArgs[tName] = source;
+  x = {};
+  x[tName] = source;
+  updateWidgets('donut', null, x);
+  updateWidgets('gauge', null, x);
+  updateWidgets('line', null, x);
+  updateWidgets('contacts', null, x);
+  updateWidgets('top5', null, x);
+  updateWidgets('factors', null, x);
+  updateWidgets('trends', null, x);
+  updateWidgets('radar', null, x);
+  updateWidgets('widget', null, x);
+  updateWidgets('relationship', null, x);
+  updateWidgets('treemap', null, x);
+  updateWidgets('report', null, x);
+  updateWidgets('mvp', null, x);
+  updateWidgets('comstat', null, x);
+  updateWidgets('worldmap', null, x);
+  updateWidgets('jsondump', null, x);
+  return $("a").each(function() {
+    var m, url;
+    url = $(this).attr('href');
+    if (url) {
+      m = url.match(/^(.+\?page=[-a-z]+.*?)(?:&pathfilter=[^&]+)?(.*)$/);
+      if (m) {
+        if (source) {
+          return $(this).attr('href', m[1] + "&pathfilter=" + source + m[2]);
+        } else {
+          return $(this).attr('href', "" + m[1] + m[2]);
+        }
+      }
+    }
+  });
+};
+
 viewexplorer = function(json, state) {
   var ID, b, div, h, i, item, len, list, opt, org, q, rb, ref, source, tName;
   org = json.organisation;


[kibble] 04/06: regen openapi yaml

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 65cdce0ffbbd8f1b544dc0104a20483ebd7dc2f1
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:26:27 2018 +0200

    regen openapi yaml
---
 api/yaml/openapi.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/api/yaml/openapi.yaml b/api/yaml/openapi.yaml
index 03f0e4c..853543a 100644
--- a/api/yaml/openapi.yaml
+++ b/api/yaml/openapi.yaml
@@ -494,6 +494,9 @@ components:
           type: integer
         page:
           type: string
+        pathfilter:
+          description: Quickly defined view by sub-filtering commits by paths affected.
+          type: string
         quick:
           description: Turns on quick data for some endpoints, returning only sparse
             data (thus less traffic)


[kibble] 06/06: Merge branch 'master' of github.com:apache/kibble

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 07b3e8139c9e3133df04f57502290d6a9c7cb74c
Merge: 2da57de 5647887
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 12 14:27:44 2018 +0200

    Merge branch 'master' of github.com:apache/kibble

 docs/source/managing.rst | 12 ++++++++----
 docs/source/setup.rst    |  6 +++---
 2 files changed, 11 insertions(+), 7 deletions(-)