Skip to content

Commit c03c10c

Browse files
committed
fix: bugs in run
1 parent 8a993b9 commit c03c10c

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

src/pyosmeta/cli/process_reviews.py

-9
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,10 @@ def main():
4848
print("-" * 20)
4949

5050
# Update gh metrics via api for all packages
51-
<<<<<<< HEAD
52-
print("Getting GitHub metrics for all packages...")
53-
repo_endpoints = process_review.get_repo_endpoints(accepted_reviews)
54-
all_reviews = process_review.get_gh_metrics(
55-
repo_endpoints, accepted_reviews
56-
)
57-
58-
=======
5951
# BUG : contrib count isn't correct - great tables has some and is returning 0
6052
repo_paths = process_review.get_repo_paths(accepted_reviews)
6153
all_reviews = process_review.get_gh_metrics(repo_paths, accepted_reviews)
6254
print("almost there")
63-
>>>>>>> b54790f (Enh: move to graphql for metrics)
6455
with open("all_reviews.pickle", "wb") as f:
6556
pickle.dump(all_reviews, f)
6657

src/pyosmeta/github_api.py

+2
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ def return_response(self) -> list[dict[str, object]]:
186186

187187
return results
188188

189+
# TODO: failing here because pyPartMC has a trailing / that needs to be cleaned.
190+
# we can add that as a cleanup step to the method i fixed last night.
189191
def get_repo_meta(
190192
self, repo_info: dict[str, str]
191193
) -> dict[str, Any] | None:

src/pyosmeta/parse_issues.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ def get_repo_paths(
377377
"""
378378
Returns a dictionary of repository owner and names for each package.
379379
380+
Currently we don't have API access setup for gitlab. So skip if
381+
url contains gitlab
382+
380383
Parameters
381384
----------
382385
review_issues : dict
@@ -391,9 +394,13 @@ def get_repo_paths(
391394
all_repos = {}
392395
for a_package in review_issues.keys():
393396
repo_url = review_issues[a_package].repository_link
397+
# for now skip if it's a gitlab repo
398+
if "gitlab" in repo_url:
399+
continue
394400
owner, repo = (
395401
repo_url.replace("https://github.com/", "")
396402
.replace("https://www.github.com/", "")
403+
.rstrip("/")
397404
.split("/", 1)
398405
)
399406

@@ -421,14 +428,6 @@ def get_gh_metrics(
421428
dict
422429
Updated review data with GitHub metrics.
423430
"""
424-
<<<<<<< HEAD
425-
pkg_meta = {}
426-
# url is the api endpoint for a specific pyos-reviewed package repo
427-
for pkg_name, url in endpoints.items():
428-
print(f"Processing GitHub metrics {pkg_name}")
429-
pkg_meta[pkg_name] = self.process_repo_meta(url)
430-
=======
431-
>>>>>>> b54790f (Enh: move to graphql for metrics)
432431

433432
for pkg_name, owner_repo in endpoints.items():
434433
reviews[pkg_name].gh_meta = self.github_api.get_repo_meta(

0 commit comments

Comments
 (0)