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

Add list of abandoned organizations #95

Merged
merged 1 commit into from
Jan 29, 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
2 changes: 2 additions & 0 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
url: "/housekeeping-git-requests"
- title: "API Requests"
url: "/housekeeping-api-requests"
- title: "Abandoned Organizations"
url: "/housekeeping-abandoned-orgs"
- title: "Forks"
url: "/housekeeping-forks"
- title: "Recommendations"
Expand Down
4 changes: 4 additions & 0 deletions docs/demo-data/organizations-abandoned-detailed.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
organization last push
old-org 2015-03-31
very-old-org 2015-08-19
granpa-org 2016-01-08
4 changes: 4 additions & 0 deletions docs/demo-data/organizations-abandoned.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
date abandoned organizations
2018-01-25 84
2018-01-24 90
2018-01-23 92
26 changes: 26 additions & 0 deletions docs/housekeeping-abandoned-orgs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: default
title: Forks
permalink: /housekeeping-abandoned-orgs
---

<div class="chart-placeholder">
<h3>Abandoned Organizations</h3>
<canvas
data-url="{{ site.dataURL }}/organizations-abandoned.tsv"
data-type="history"
></canvas>
<div class="info-box">
<p>
An organizations is considered <em>abandoned</em> if none of its repositories has received a push in the last year (ignoring <a href="https://help.github.com/articles/archiving-repositories/">archived</a> repositories).
</p>
<p>
If the content still has value, then you could <a href="https://help.github.com/articles/archiving-repositories/">archive</a> all repositories in these organizations to emphasize the fact that they are not maintained anymore.
If the content is not valuable anymore, then you could <a href="https://help.github.com/articles/deleting-an-organization-account/">delete the organization</a> to reduce clutter on your GitHub Enterprise appliance.
</p>
</div>
</div>

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

# Find the organizations that have not received a push for the longest time.
# Only look at organizations that have not received a push for at least one
# year. Only look at repositories that are still maintained (not archived!).
class ReportOrgsAbandoned(ReportDaily):
def name(self):
return "organizations-abandoned"

def updateDailyData(self):
self.detailedHeader, self.detailedData = self.parseData(self.executeQuery(self.query()))
if len(self.data) == 0:
self.header = ["date", "abandoned organizations"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()

def query(self):
query = '''
SELECT
users.login AS "organization",
DATE(MAX(pushes.created_at)) AS "last push"
FROM
repositories
JOIN users ON repositories.owner_id = users.id
JOIN pushes ON pushes.repository_id = repositories.id
WHERE
users.type = "organization"
AND repositories.maintained = 1 ''' + \
self.andExcludedEntities("users.login") + '''
GROUP BY
users.id
HAVING
CAST(MAX(pushes.created_at) AS DATE) < "''' + str(self.daysAgo(365)) + '''"
ORDER BY
MAX(pushes.created_at)
'''
return query
2 changes: 2 additions & 0 deletions updater/update-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from reports.ReportOrgActivity import *
from reports.ReportOrgCollaboration import *
from reports.ReportOrgOwners import *
from reports.ReportOrgsAbandoned import *
from reports.ReportOrgsTotal import *
from reports.ReportPRByOrg import *
from reports.ReportPRByRepo import *
Expand Down Expand Up @@ -86,6 +87,7 @@ def main():
ReportOrgActivity(configuration, dataDirectory, metaStats).update()
ReportOrgCollaboration(configuration, dataDirectory, metaStats).update()
ReportOrgOwners(configuration, dataDirectory, metaStats).update()
ReportOrgsAbandoned(configuration, dataDirectory, metaStats).update()
ReportOrgsTotal(configuration, dataDirectory, metaStats).update()
ReportPRByOrg(configuration, dataDirectory, metaStats).update()
ReportPRByRepo(configuration, dataDirectory, metaStats).update()
Expand Down