Skip to content

Commit da73d87

Browse files
authored
fix: cicd bot correctly uses login (#1632)
1 parent 7a2f1e7 commit da73d87

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sqlmesh/integrations/github/cicd/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def __init__(
307307
self._reviews: t.Iterable[PullRequestReview] = self._pull_request.get_reviews()
308308
# TODO: The python module says that user names can be None and this is not currently handled
309309
self._approvers: t.Set[str] = {
310-
review.user.name or "UNKNOWN"
310+
review.user.login or "UNKNOWN"
311311
for review in self._reviews
312312
if review.state.lower() == "approved"
313313
}

tests/integrations/github/cicd/fixtures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def _make_function(username: str, state: str, **kwargs) -> PullRequestReview:
4444
"test", # type: ignore
4545
{},
4646
{
47-
"user": AttributeDict(name=username),
47+
# Name is whatever they provide in their GitHub profile or login as fallback. Always use login.
48+
"user": AttributeDict(name="Unrelated", login=username),
4849
"state": state,
4950
**kwargs,
5051
},

0 commit comments

Comments
 (0)