-
Notifications
You must be signed in to change notification settings - Fork 30
Pr metrics improvements #102
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
base: dev/mpg/pr-metrics
Are you sure you want to change the base?
Changes from 5 commits
55dc5e5
005d39e
1013e4b
7fbe1df
379d144
6c1897e
0fdcd8f
d6844ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,9 @@ | |
|
||
"""Get PR data from github and pickle it.""" | ||
|
||
import pickle | ||
import os | ||
import requests.exceptions | ||
import time | ||
|
||
from github import Github | ||
|
||
|
@@ -38,4 +39,13 @@ | |
p.update() | ||
|
||
with open("pr-data.p", "wb") as f: | ||
pickle.dump(prs, f) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put this comment here as it does not let me put it in unchanged lines of code: |
||
for i, p in enumerate(prs): | ||
for retry in range(0, 9): | ||
try: | ||
g.dump(p, f) | ||
break | ||
except requests.exceptions.ReadTimeout: | ||
delay = 2 ** retry | ||
print(f"timeout; sleeping {delay} s and retrying...") | ||
time.sleep(2 ** delay) | ||
print(f"saved {i+1}/{len(prs)}") | ||
tgonzalezorlandoarm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,18 @@ | |
|
||
"""PR data an misc common functions.""" | ||
|
||
import pickle | ||
import datetime | ||
import os | ||
from github import Github | ||
|
||
prs = [] | ||
with open("pr-data.p", "rb") as f: | ||
prs = pickle.load(f) | ||
|
||
g = Github() | ||
try: | ||
while True: | ||
prs.append(g.load(f)) | ||
tgonzalezorlandoarm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
except EOFError: | ||
pass | ||
|
||
# Current and past core contributors, alphabetical order (sort -f). | ||
# | ||
|
@@ -86,7 +91,7 @@ def is_community(pr): | |
def quarter(date): | ||
"""Return a string decribing this date's quarter, for example 19q3.""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this comment should be changed now? |
||
q = str(date.year % 100) | ||
q += "q" | ||
q += " Q" | ||
q += str((date.month + 2) // 3) | ||
return q | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
import shutil | ||
import sys | ||
import traceback | ||
import glob | ||
|
||
|
||
class VStestrun(object): | ||
|
@@ -581,9 +582,8 @@ def test_visual_studio_built_code(self, test_run, solution_type): | |
git_worktree_path, test_run, vs_logger | ||
) | ||
else: | ||
solution_dir = os.path.join( | ||
git_worktree_path, "visualc", "VS2010" | ||
) | ||
solution_dir = glob.glob(os.path.join( | ||
git_worktree_path, "visualc", "VS*"))[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just in case: we are not expecting it to have more than one VS* folder, right? Otherwise this would bring a problem I think |
||
build_result = self.build_code_using_visual_studio( | ||
solution_dir, test_run, solution_type, vs_logger, c89 | ||
) | ||
|
Uh oh!
There was an error while loading. Please reload this page.