Skip to content

Commit

Permalink
team: Include contributions from legacy repositories in the total.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marco authored and timabbott committed Aug 28, 2018
1 parent 17d935e commit 25e624e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions static/js/portico/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions tools/update-authors-json
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down

0 comments on commit 25e624e

Please sign in to comment.