Skip to content

Commit

Permalink
report legacy admin teams
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Schneider committed Jan 31, 2018
1 parent 14da15e commit 91f5c02
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@
subnavigation:
- title: "Tokenless Authentication"
url: "/recommendations-tokenless-auth"
- title: "Legacy Teams"
url: "/recommendations-legacy-teams"
3 changes: 3 additions & 0 deletions docs/demo-data/teams-legacy-detailed.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
organization team members
gamma admins 15
epsilon great team 2
4 changes: 4 additions & 0 deletions docs/demo-data/teams-legacy.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
date legacy admin teams
2018-01-30 1
2018-01-29 4
2018-01-28 5
24 changes: 24 additions & 0 deletions docs/recommendations-legacy-teams.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: default
title: Teams
permalink: /recommendations-legacy-teams
---

<div class="chart-placeholder">
<h3>Legacy Admin Teams</h3>
<canvas
data-url="{{ site.dataURL }}/teams-legacy.tsv"
data-type="history"
></canvas>
<div class="info-box">
<p>
Organizations created before September 2015 might have legacy admin teams.
In order to get the best performance out of GitHub Enterprise, these teams
should be <a href="https://help.github.com/enterprise/2.11/user/articles/migrating-your-previous-admin-teams-to-the-improved-organization-permissions/">migrated to the improved permissions model</a>.
</p>
</div>
</div>

<div class="chart-placeholder">
<table data-url="{{ site.dataURL }}/teams-legacy-detailed.tsv"></table>
</div>
30 changes: 30 additions & 0 deletions updater/reports/ReportTeamsLegacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from .ReportDaily import *

# Organizations created before September 2015 might have legacy admin
# teams. In order to get the best performance out of GHE, these teams
# should be migrated to the improved permissions model.
# c.f. https://help.github.com/enterprise/2.11/user/articles/migrating-your-previous-admin-teams-to-the-improved-organization-permissions/
class ReportTeamsLegacy(ReportDaily):
def name(self):
return "teams-legacy"

def updateDailyData(self):
self.detailedHeader, self.detailedData = self.parseData(
self.executeGHEConsole('''
puts "organization\tteam\tmembers\n"
User.where(:type => "Organization")
.order("login")
.each do |o|
if o.teams && o.teams.legacy_admin.size > 0
o.teams.legacy_admin.order("name").each { |t|
puts "#{o.login}\t#{t.name}\t#{t.members.size}"
}
end
end
''')
)
if len(self.data) == 0:
self.header = ["date", "legacy admin teams"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
2 changes: 2 additions & 0 deletions updater/update-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from reports.ReportRepoActivity import *
from reports.ReportRepositoryHistory import *
from reports.ReportReposPersonalNonOwnerPushes import *
from reports.ReportTeamsLegacy import *
from reports.ReportTeamsTotal import *
from reports.ReportTokenlessAuth import *
from reports.ReportUsers import *
Expand Down Expand Up @@ -97,6 +98,7 @@ def main():
ReportRepoActivity(configuration, dataDirectory, metaStats).update()
ReportRepositoryHistory(configuration, dataDirectory, metaStats).update()
ReportReposPersonalNonOwnerPushes(configuration, dataDirectory, metaStats).update()
ReportTeamsLegacy(configuration, dataDirectory, metaStats).update()
ReportTeamsTotal(configuration, dataDirectory, metaStats).update()
ReportTokenlessAuth(configuration, dataDirectory, metaStats).update()
ReportUsers(configuration, dataDirectory, metaStats).update()
Expand Down

0 comments on commit 91f5c02

Please sign in to comment.