Commit overview section data is fixed
* Fixed commit counter shown in overview section * Added company break-down in engineer details * Garbage collector for old updates is fixed Fixes bug 1202184 Change-Id: I91752671460a2b18f8c0cab3b1aed65d0c62641d
This commit is contained in:
parent
31101fa618
commit
2aaf873b38
28
dashboard/templates/commits_overview.html
Normal file
28
dashboard/templates/commits_overview.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<h3>Commit overview</h3>
|
||||||
|
{% if blueprints %}
|
||||||
|
<div>Blueprints:
|
||||||
|
<ol>
|
||||||
|
{% for rec in blueprints %}
|
||||||
|
<li>
|
||||||
|
<a href="https://blueprints.launchpad.net/{{ rec['module'] }}/+spec/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
||||||
|
<small>{{ rec['module'] }}</small>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if bugs %}
|
||||||
|
<div>Bugs:
|
||||||
|
<ol>
|
||||||
|
{% for rec in bugs %}
|
||||||
|
<li>
|
||||||
|
<a href="https://bugs.launchpad.net/bugs/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div>Total commits: <b>{{ commit_count }}</b></div>
|
||||||
|
<div>Total LOC: <b>{{ loc }}</b></div>
|
@ -53,33 +53,6 @@
|
|||||||
</table>
|
</table>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
|
||||||
<h3>Commit overview</h3>
|
{% include "commits_overview.html" %}
|
||||||
{% if blueprints %}
|
|
||||||
<div>Blueprints:
|
|
||||||
<ol>
|
|
||||||
{% for rec in blueprints %}
|
|
||||||
<li>
|
|
||||||
<a href="https://blueprints.launchpad.net/{{ rec['module'] }}/+spec/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
|
||||||
<small>{{ rec['module'] }}</small>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if bugs %}
|
|
||||||
<div>Bugs:
|
|
||||||
<ol>
|
|
||||||
{% for rec in bugs %}
|
|
||||||
<li>
|
|
||||||
<a href="https://bugs.launchpad.net/bugs/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div>Total commits: <b>{{ commits|length }}</b></div>
|
|
||||||
<div>Total LOC: <b>{{ loc }}</b></div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -32,6 +32,11 @@
|
|||||||
{% for rec in commits %}
|
{% for rec in commits %}
|
||||||
<div>
|
<div>
|
||||||
<h4>{{ rec.date|datetimeformat }} to <a href="https://launchpad.net/{{ rec.module }}">{{ rec.module }}</a>
|
<h4>{{ rec.date|datetimeformat }} to <a href="https://launchpad.net/{{ rec.module }}">{{ rec.module }}</a>
|
||||||
|
{% if user.companies[-1].company_name != rec.company_name %}
|
||||||
|
(
|
||||||
|
{{ rec.company_name|link('/companies/' + rec.company_name)|safe }}
|
||||||
|
)
|
||||||
|
{% endif %}
|
||||||
</h4>
|
</h4>
|
||||||
{% if rec.correction_comment %}
|
{% if rec.correction_comment %}
|
||||||
<div style='font-weight: bold; color: red; padding-left: 2em;'>Commit corrected: {{ rec.correction_comment }}</div>
|
<div style='font-weight: bold; color: red; padding-left: 2em;'>Commit corrected: {{ rec.correction_comment }}</div>
|
||||||
@ -65,34 +70,18 @@
|
|||||||
</table>
|
</table>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
|
||||||
<h3>Commit overview</h3>
|
{% include "commits_overview.html" %}
|
||||||
{% if blueprints %}
|
|
||||||
<div>Blueprints:
|
|
||||||
<ol>
|
|
||||||
{% for rec in blueprints %}
|
|
||||||
<li>
|
|
||||||
<a href="https://blueprints.launchpad.net/{{ rec['module'] }}/+spec/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
|
||||||
<small>{{ rec['module'] }}</small>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if bugs %}
|
<h4>Contribution per companies:</h4>
|
||||||
<div>Bugs:
|
{% for company_info in user.companies %}
|
||||||
<ol>
|
<div>
|
||||||
{% for rec in bugs %}
|
{% set company_name = company_info.company_name %}
|
||||||
<li>
|
{{ company_name|link('/companies/' + company_name)|safe }}:
|
||||||
<a href="https://bugs.launchpad.net/bugs/{{ rec['id'] }}">{{ rec['id'] }}</a>
|
<b>{{ companies[company_name].commits }}</b> commits and
|
||||||
</li>
|
<b>{{ companies[company_name].loc }}</b> LOC
|
||||||
{% endfor %}
|
</div>
|
||||||
</ol>
|
{% endfor %}
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div>Total commits: <b>{{ commits|length }}</b></div>
|
|
||||||
<div>Total LOC: <b>{{ loc }}</b></div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -223,7 +223,7 @@ def exception_handler():
|
|||||||
try:
|
try:
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.debug(e)
|
LOG.error(e)
|
||||||
flask.abort(404)
|
flask.abort(404)
|
||||||
|
|
||||||
return exception_handler_decorated_function
|
return exception_handler_decorated_function
|
||||||
@ -291,6 +291,7 @@ def page_not_found(e):
|
|||||||
def contribution_details(records, limit=DEFAULT_RECORDS_LIMIT):
|
def contribution_details(records, limit=DEFAULT_RECORDS_LIMIT):
|
||||||
blueprints_map = {}
|
blueprints_map = {}
|
||||||
bugs_map = {}
|
bugs_map = {}
|
||||||
|
companies_map = {}
|
||||||
commits = []
|
commits = []
|
||||||
loc = 0
|
loc = 0
|
||||||
|
|
||||||
@ -311,6 +312,14 @@ def contribution_details(records, limit=DEFAULT_RECORDS_LIMIT):
|
|||||||
else:
|
else:
|
||||||
bugs_map[bug] = [record]
|
bugs_map[bug] = [record]
|
||||||
|
|
||||||
|
company = record['company_name']
|
||||||
|
if company:
|
||||||
|
if company in companies_map:
|
||||||
|
companies_map[company]['loc'] += record['loc']
|
||||||
|
companies_map[company]['commits'] += 1
|
||||||
|
else:
|
||||||
|
companies_map[company] = {'loc': record['loc'], 'commits': 1}
|
||||||
|
|
||||||
blueprints = sorted([{'id': key,
|
blueprints = sorted([{'id': key,
|
||||||
'module': value[0]['module'],
|
'module': value[0]['module'],
|
||||||
'records': value}
|
'records': value}
|
||||||
@ -325,6 +334,8 @@ def contribution_details(records, limit=DEFAULT_RECORDS_LIMIT):
|
|||||||
'blueprints': blueprints,
|
'blueprints': blueprints,
|
||||||
'bugs': bugs,
|
'bugs': bugs,
|
||||||
'commits': commits[0:limit],
|
'commits': commits[0:limit],
|
||||||
|
'commit_count': len(commits),
|
||||||
|
'companies': companies_map,
|
||||||
'loc': loc,
|
'loc': loc,
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
@ -35,7 +35,7 @@ def get_pids():
|
|||||||
for pid in psutil.get_pid_list():
|
for pid in psutil.get_pid_list():
|
||||||
try:
|
try:
|
||||||
p = psutil.Process(pid)
|
p = psutil.Process(pid)
|
||||||
if p.cmdline and p.cmdline[0].find('/uwsgi '):
|
if p.cmdline and p.cmdline[0].find('/uwsgi'):
|
||||||
uwsgi_dict[p.pid] = p.parent
|
uwsgi_dict[p.pid] = p.parent
|
||||||
except _error.NoSuchProcess:
|
except _error.NoSuchProcess:
|
||||||
# the process may disappear after get_pid_list call, ignore it
|
# the process may disappear after get_pid_list call, ignore it
|
||||||
|
@ -143,14 +143,10 @@ class MemcachedStorage(RuntimeStorage):
|
|||||||
if n < min_update:
|
if n < min_update:
|
||||||
min_update = n
|
min_update = n
|
||||||
|
|
||||||
first_valid_update_id = self.memcached.get('first_valid_update_id')
|
first_valid_update = self.memcached.get('first_valid_update') or 0
|
||||||
if not first_valid_update_id:
|
self.memcached.delete_multi(range(first_valid_update, min_update),
|
||||||
first_valid_update_id = 0
|
key_prefix=UPDATE_ID_PREFIX)
|
||||||
|
self.memcached.set('first_valid_update', min_update)
|
||||||
for i in range(first_valid_update_id, min_update):
|
|
||||||
self.memcached.delete(UPDATE_ID_PREFIX + str(i))
|
|
||||||
|
|
||||||
self.memcached.set('first_valid_update_id', min_update)
|
|
||||||
|
|
||||||
def _get_update_count(self):
|
def _get_update_count(self):
|
||||||
return self.memcached.get('update:count') or 0
|
return self.memcached.get('update:count') or 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user