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

Rewrite headers on every update #138

Merged
merged 1 commit into from
Mar 20, 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
3 changes: 1 addition & 2 deletions updater/reports/ReportAPIRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def name(self):
def updateDailyData(self):
self.detailedHeader, newData = self.parseData(
self.executeScript(self.scriptPath("api-requests.sh")))
if len(self.data) == 0:
self.header = ["date", "API requests"]
self.header = ["date", "API requests"]
self.data.append(
[
str(self.yesterday()),
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportForksToOrgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def name(self):

def updateDailyData(self):
self.detailedHeader, self.detailedData = self.parseData(self.executeQuery(self.query()))
if len(self.data) == 0:
self.header = ["date", "forks to organizations"]
self.header = ["date", "forks to organizations"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
17 changes: 8 additions & 9 deletions updater/reports/ReportGitDownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ def name(self):
def updateDailyData(self):
self.detailedHeader, newData = self.parseData(
self.executeScript(self.scriptPath("git-download.sh")))
if len(self.data) == 0:
self.header = \
[
"date",
"clones",
"fetches",
"clone traffic [GB]",
"fetch traffic [GB]",
]
self.header = \
[
"date",
"clones",
"fetches",
"clone traffic [GB]",
"fetch traffic [GB]",
]
self.data.append(
[
str(self.yesterday()),
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportGitRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def name(self):
def updateDailyData(self):
self.detailedHeader, newData = self.parseData(
self.executeScript(self.scriptPath("git-requests.sh")))
if len(self.data) == 0:
self.header = ["date", "Git requests"]
self.header = ["date", "Git requests"]
self.data.append(
[
str(self.yesterday()),
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportOrgsAbandoned.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def name(self):

def updateDailyData(self):
self.detailedHeader, self.detailedData = self.parseData(self.executeQuery(self.query()))
if len(self.data) == 0:
self.header = ["date", "abandoned organizations"]
self.header = ["date", "abandoned organizations"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportOrgsTotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def name(self):
return "orgs-total"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query()))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query()))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportPRHistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ def name(self):

def updateDailyData(self):
# Collect the missing data that should be added with this update
newHeader, newData = self.parseData(
self.header, newData = self.parseData(
self.executeQuery(self.query(self.timeRangeToUpdate())))
self.header = newHeader if newHeader else self.header
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportPRUsage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def updateDailyData(self):
date += datetime.timedelta(days_in_month)
_, newData = self.parseData(self.executeQuery(self.query(date)))
self.data.extend(newData)
newHeader, newData = self.parseData(self.executeQuery(self.query(self.yesterday())))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query(self.yesterday())))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportRepoActivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def name(self):
return "repository-activity"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query()))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query()))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportRepoUsage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def name(self):
return "repository-usage"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query()))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query()))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportReposPersonalNonOwnerPushes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def name(self):

def updateDailyData(self):
self.detailedHeader, self.detailedData = self.parseData(self.executeQuery(self.query()))
if len(self.data) == 0:
self.header = ["date", "personal repositories with nonowner pushes"]
self.header = ["date", "personal repositories with nonowner pushes"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportRepositoryHistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def name(self):
return "repository-history"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query()))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query()))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportTeamsLegacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def updateDailyData(self):
}
end
end'''))
if len(self.data) == 0:
self.header = ["date", "legacy admin teams"]
self.header = ["date", "legacy admin teams"]
self.data.append([str(self.yesterday()), len(self.detailedData)])
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
3 changes: 1 addition & 2 deletions updater/reports/ReportTeamsTotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def name(self):
return "teams-total"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query()))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query()))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportTokenlessAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def name(self):
def updateDailyData(self):
self.detailedHeader, newData = self.parseData(
self.executeScript(self.scriptPath("tokenless-auth.sh")))
if len(self.data) == 0:
self.header = ["date", "tokenless authentications"]
self.header = ["date", "tokenless authentications"]
self.data.append(
[
str(self.yesterday()),
Expand Down
3 changes: 1 addition & 2 deletions updater/reports/ReportUsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def name(self):
return "users"

def updateDailyData(self):
newHeader, newData = self.parseData(self.executeQuery(self.query(self.yesterday())))
self.header = newHeader if newHeader else self.header
self.header, newData = self.parseData(self.executeQuery(self.query(self.yesterday())))
self.data.extend(newData)
self.truncateData(self.timeRangeTotal())
self.sortDataByDate()
Expand Down