team: Include contributions from legacy repositories in the total.

These repositories (`zulip-ios-legacy` and `zulip-android`) are
deprecated, and as such should not have their own tabs, but still
should be included in the total contributions count.
This commit is contained in:
Marco Burstein 2018-08-25 10:16:33 -07:00 committed by Tim Abbott
parent 17d935e9f0
commit 25e624eab1
2 changed files with 10 additions and 3 deletions

View File

@ -2,19 +2,20 @@
// eslint's error.
/* global contributors_list */
// `repos` are repositories to be shown as tabs, whereas `hidden_repos` are
// repositories that should count towards the total but not have tabs.
var repos = ['server', 'desktop', 'mobile', 'python-zulip-api', 'zulip-js', 'zulipbot', 'terminal'];
var hidden_repos = ['zulip-android', 'zulip-ios-legacy'];
function contrib_total_commits(contrib) {
var commits = 0;
repos.forEach(function (repo) {
repos.concat(hidden_repos).forEach(function (repo) {
commits += contrib[repo] || 0;
});
return commits;
}
// TODO (for v2 of /team contributors):
// - Freeze contributions data for legacy repo (ios, android) and include them
// in totals tab.
// - Lazy-render all but the total tab.
// - Make tab header responsive.
// - Display full name instead of github username.

View File

@ -67,6 +67,10 @@ def run_production() -> None:
dictionary. Retry fetching each repository if responded with non HTTP 200
status.
"""
# This dictionary should hold all repositories that should be included in
# the total count, including those that should *not* have tabs on the team
# page (e.g. if they are deprecated).
repositories = {
'server': 'https://api.github.com/repos/zulip/zulip/stats/contributors',
'desktop': 'https://api.github.com/repos/zulip/zulip-electron/stats/contributors',
@ -75,6 +79,8 @@ def run_production() -> None:
'zulip-js': 'https://api.github.com/repos/zulip/zulip-js/stats/contributors',
'zulipbot': 'https://api.github.com/repos/zulip/zulipbot/stats/contributors',
'terminal': 'https://api.github.com/repos/zulip/zulip-terminal/stats/contributors',
'zulip-ios-legacy': 'https://api.github.com/repos/zulip/zulip-ios-legacy/stats/contributors',
'zulip-android': 'https://api.github.com/repos/zulip/zulip-android/stats/contributors',
}
data = dict(date=str(date.today()), contrib=[]) # type: ContributorsJSON