mirror of https://github.com/zulip/zulip.git
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:
parent
17d935e9f0
commit
25e624eab1
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue