Skip to content
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
6 changes: 3 additions & 3 deletions src/lf_workflow_dash/lsdb_interrupts/external_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
)


def get_open_issues(org: str, repos: List[str], org_members: Set[str], token: str) -> List[Dict]:
def get_open_issues(repos: List[str], org_members: Set[str], token: str) -> List[Dict]:
"""Find all OPEN issues that were either CREATED or COMMENTED on by folks
NOT in the core team."""
print("Fetching open issues for all repositories...")
session = create_github_session(token)
all_issues = []
for repo in repos:
for org, repo in repos:
print(f" {repo}...")
try:
## First, find all issues with some external interest, in the form of comments.
Expand Down Expand Up @@ -106,7 +106,7 @@ def write_html_issues(external_issues: List[Dict], html_file: str):
def main(token, out_file):
"""Convenience method to do the work."""
repos = get_lsdb_repos(token)
external_issues = get_open_issues("astronomy-commons", repos, TEAM_MEMBERS, token)
external_issues = get_open_issues(repos, TEAM_MEMBERS, token)
# Sort by most recent activity
external_issues.sort(key=lambda x: x["updatedAt"], reverse=True)

Expand Down
5 changes: 3 additions & 2 deletions src/lf_workflow_dash/lsdb_interrupts/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_org_repos(org: str, token: str) -> List[str]:
session = create_github_session(token)
url = f"{GITHUB_API_BASE}/orgs/{org}/repos?per_page=100"
repos_data = paginate_github_api(session, url)
repos = [repo["name"] for repo in repos_data if not repo["archived"]]
repos = [(org, repo["name"]) for repo in repos_data if not repo["archived"]]
print(f" Found {len(repos)} repositories.")
return repos

Expand All @@ -82,7 +82,8 @@ def get_lsdb_repos(token: str) -> List[str]:
url = f"{GITHUB_API_BASE}/orgs/astronomy-commons/repos?per_page=100"
repos_data = paginate_github_api(session, url)
repos = [repo["name"] for repo in repos_data]
repos = [repo for repo in repos if "hats" in repo or "lsdb" in repo]
repos = [("astronomy-commons", repo) for repo in repos if "hats" in repo or "lsdb" in repo]
repos.append(("lincc-frameworks", "nested-pandas"))
print(f" Found {len(repos)} repositories.")
return repos

Expand Down
8 changes: 4 additions & 4 deletions src/lf_workflow_dash/lsdb_interrupts/open_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
)


def get_open_prs(org: str, repos: List[str], token: str) -> List[Dict]:
def get_open_prs(repos: List[str], token: str) -> List[Dict]:
"""Find all OPEN PRs."""
print("Fetching open PRs for all repositories...")
session = create_github_session(token)
all_prs = []
for repo in repos:
for org, repo in repos:
print(f" {repo}...")
try:
url = f"{GITHUB_API_BASE}/repos/{org}/{repo}/pulls?state=open&per_page=100"
Expand Down Expand Up @@ -119,11 +119,11 @@ def write_html_prs(prs: List[Dict], html_file: str, page_title: str = "Pull Requ
def main(token):
"""Convenience method to do the work."""
repos = get_lsdb_repos(token)
prs = get_open_prs("astronomy-commons", repos, token)
prs = get_open_prs(repos, token)
write_html_prs(prs, "html/lsdb_prs.html", "LSDB PRs")

repos = get_org_repos("lincc-frameworks", token)
prs = get_open_prs("lincc-frameworks", repos, token)
prs = get_open_prs(repos, token)
write_html_prs(prs, "html/lincc_prs.html", "lincc-frameworks PRs")


Expand Down