Skip to content

Commit 3818ab9

Browse files
authored
Merge pull request #246 from creativecommons/error-handling-and-cleanup
Improve error handling and minor clean-up
2 parents e0c86b8 + c7ca71a commit 3818ab9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ in a GitHub project:
114114
[manage_issues]: .github/workflows/manage_issues.yml
115115
[manage_new_issues]: manage_new_issues_and_pull_requests.py
116116
[proj_possumbilities]: https://github.com/orgs/creativecommons/projects/23/views/1
117-
[proj-shafiya-heena]: https://github.com/orgs/creativecommons/projects/22/views/1
118117
[proj_timidrobot]: https://github.com/orgs/creativecommons/projects/15/views/1
119118

120119

_ARCHIVE/move_issues.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ def get_shafiya_items(github_gql_client):
185185
labels = []
186186
for label_edge in node["labels"]["edges"]:
187187
labels.append(label_edge["node"]["name"])
188-
items["issues"].append(
189-
[repo, number, created, item_id]
190-
)
188+
items["issues"].append([repo, number, created, item_id])
191189
elif type_ == "PullRequest":
192190
items["prs"].append([repo, number, created, item_id])
193191
items["issues"].sort()

ccos/teams/set_codeowners.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Third-party
99
import git
10+
from github.GithubException import UnknownObjectException
1011

1112
# First-party/Local
1213
from ccos.gh_utils import (
@@ -108,7 +109,11 @@ def check_and_fix_repo(args, organization, repo_name, teams, temp_dir):
108109

109110
LOG.info(f"Checking and fixing {repo_name}...")
110111
repo_dir = os.path.join(temp_dir, repo_name)
111-
gh_repo = organization.get_repo(repo_name)
112+
try:
113+
gh_repo = organization.get_repo(repo_name)
114+
except UnknownObjectException:
115+
LOG.error(f"Repository not found: {repo_name}")
116+
raise
112117
clone_url = get_github_repo_url_with_credentials(repo_name)
113118
local_repo = set_up_repo(clone_url, repo_dir)
114119
codeowners_path = Path(os.path.join(repo_dir, ".github", "CODEOWNERS"))

sync_community_teams.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def setup():
3838
"-d",
3939
"--debug",
4040
action="store_true",
41-
help="Debug mode: show differences instead of pushing commits and"
42-
" creating pull requests",
41+
help="Debug mode: show differences instead of making changes",
4342
)
4443
args = ap.parse_args()
4544
return args

0 commit comments

Comments
 (0)