From fb5e6f104b49c967f718ea9ea3ab8115fa7b8884 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Thu, 21 Nov 2024 13:34:31 -0700 Subject: [PATCH] fix: relase ReviewUser name to accept None, add docs (#232) --- CHANGELOG.md | 1 + src/pyosmeta/cli/update_review_teams.py | 4 +--- src/pyosmeta/models/base.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16fef83..f8106fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Fixed * Fix: Updated documentation throughout with a focus on how a user's name is accessed and updated (@lwasser) +* Fix: ReviewUser object name can be optional. There are times when we don't have the actual person's name only the GH username (@lwasser) ## [v0.3.7] - 2024-08-27 diff --git a/src/pyosmeta/cli/update_review_teams.py b/src/pyosmeta/cli/update_review_teams.py index f2ee037..afaebe2 100644 --- a/src/pyosmeta/cli/update_review_teams.py +++ b/src/pyosmeta/cli/update_review_teams.py @@ -144,8 +144,6 @@ def main(): contrib_types = process_contribs.contrib_types for pkg_name, review in packages.items(): - if pkg_name == "automata": - print("Let's check this data out") print("Processing review team for:", pkg_name) for role in contrib_types.keys(): user: list[ReviewUser] | ReviewUser = getattr(review, role) @@ -156,7 +154,7 @@ def main(): a_user, contribs = process_user( a_user, role, pkg_name, contribs, process_contribs ) - # update individual user in reference to issue list + # Update individual user within the user list user[i] = a_user elif isinstance(user, ReviewUser): user, contribs = process_user( diff --git a/src/pyosmeta/models/base.py b/src/pyosmeta/models/base.py index 07fb342..d9a1e9c 100644 --- a/src/pyosmeta/models/base.py +++ b/src/pyosmeta/models/base.py @@ -228,7 +228,7 @@ def clean_date(cls, a_date: Optional[str]) -> str: class ReviewUser(BaseModel): """Minimal model of a github user, used in several places in review parsing""" - name: str + name: str | None github_username: str @field_validator("github_username", mode="after")