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

List: organization owners #36

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
url: "/users-activity"
- title: "Git Versions"
url: "/users-git-versions"
- title: "Organization Owners"
url: "/org-owners"
- title: "Pull Requests"
url: "/pr-usage"
subnavigation:
Expand Down
21 changes: 21 additions & 0 deletions docs/org-owners.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: default
title: Organization Owners
permalink: /org-owners
---
<h3>
Organization owners
Copy link
Contributor

Choose a reason for hiding this comment

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

@mlbright: Can you make this title case (“Organization Owners”)?

</h3>

<div class="row">
<div class="col-main">
<div class="chart-container">
<table class="table" data-url="{{ site.dataURL }}/org-owners.tsv"></table>
Copy link
Contributor

Choose a reason for hiding this comment

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

@mlbright: You accidentally mixed spaces and tabs here.

</div>
</div>
<div class="col-aside">
<div class="info-box">
<p>Owners for each GitHub organization.</p>
</div>
</div>
</div>
15 changes: 15 additions & 0 deletions updater/reports/ReportOrgOwners.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from .Report import *

# Lists all orgs and their owners without site admins or suspended users
class ReportOrgOwners(Report):
def name(self):
return "org-owners"

# The data is overwritten every day, so skip reading the old data
def readData(self):
pass

def updateData(self):
self.header, self.data = self.parseData(
self.executeScript(self.scriptPath("org-owners.sh"))
)
13 changes: 13 additions & 0 deletions updater/scripts/org-owners.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Get the owners for each org. Exclude site admins and suspended users.
#
echo -e "organization\towner"

github-env bin/runner -e production "'
User.where(:type => \"Organization\").each do |o|
o.admins.where(:disabled => false, :gh_role => nil).each do |m|
puts \"#{o.login}\\t#{m.name}\\n\"
end
end
'"
2 changes: 2 additions & 0 deletions updater/update-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from reports.ReportRepositoryHistory import *
from reports.ReportTokenlessAuth import *
from reports.ReportUsers import *
from reports.ReportOrgOwners import *
Copy link
Contributor

Choose a reason for hiding this comment

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

@mlbright: Could you please sort these alphabetically?


def writeMeta(dataDirectory):
outputFilePath = os.path.join(dataDirectory, "meta.tsv")
Expand Down Expand Up @@ -82,6 +83,7 @@ def main():
ReportRepositoryHistory(configuration, dataDirectory, metaStats).update()
ReportTokenlessAuth(configuration, dataDirectory, metaStats).update()
ReportUsers(configuration, dataDirectory, metaStats).update()
ReportOrgOwners(configuration, dataDirectory, metaStats).update()
Copy link
Contributor

Choose a reason for hiding this comment

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

@mlbright: Could you please sort these alphabetically?


# Write meta infos
writeMeta(dataDirectory)
Expand Down