diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index da33bb4c..710783f6 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -54,3 +54,5 @@ subnavigation: - title: "Tokenless Authentication" url: "/recommendations-tokenless-auth" + - title: "Legacy Teams" + url: "/recommendations-legacy-teams" diff --git a/docs/demo-data/teams-legacy-detailed.tsv b/docs/demo-data/teams-legacy-detailed.tsv new file mode 100644 index 00000000..f919d5f7 --- /dev/null +++ b/docs/demo-data/teams-legacy-detailed.tsv @@ -0,0 +1,3 @@ +organization team members +gamma admins 15 +epsilon great team 2 diff --git a/docs/demo-data/teams-legacy.tsv b/docs/demo-data/teams-legacy.tsv new file mode 100644 index 00000000..a9453e94 --- /dev/null +++ b/docs/demo-data/teams-legacy.tsv @@ -0,0 +1,4 @@ +date legacy admin teams +2018-01-30 1 +2018-01-29 4 +2018-01-28 5 diff --git a/docs/recommendations-legacy-teams.html b/docs/recommendations-legacy-teams.html new file mode 100644 index 00000000..1c8e3f6d --- /dev/null +++ b/docs/recommendations-legacy-teams.html @@ -0,0 +1,24 @@ +--- +layout: default +title: Teams +permalink: /recommendations-legacy-teams +--- + +
+

Legacy Admin Teams

+ +
+

+ 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 migrated to the improved permissions model. +

+
+
+ +
+
+
diff --git a/updater/reports/ReportTeamsLegacy.py b/updater/reports/ReportTeamsLegacy.py new file mode 100644 index 00000000..a2980a0f --- /dev/null +++ b/updater/reports/ReportTeamsLegacy.py @@ -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() diff --git a/updater/update-stats.py b/updater/update-stats.py index 73fd9d08..33412875 100755 --- a/updater/update-stats.py +++ b/updater/update-stats.py @@ -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 * @@ -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()