Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report legacy admin teams #104

Merged
merged 3 commits into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@
- title: "Forks"
url: "/housekeeping-forks"
- title: "Recommendations"
url: "/recommendations"
url: "/recommendations-tokenless-auth"
subnavigation:
- title: "Tokenless Authentication"
url: "/recommendations-tokenless-auth"
- title: "Legacy Teams"
url: "/recommendations-legacy-teams"
2 changes: 1 addition & 1 deletion docs/assets/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ function createTable(table)

break;
default:
cell.text(entry);
cell.text(d);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, thanks for fixing this!

}
}
});
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Recommendations
permalink: /recommendations
permalink: /recommendations-tokenless-auth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note not to forget renaming the permalink should we change it above 🙂.

---

<div class="chart-placeholder">
Expand Down
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