diff --git a/app/gitea_client.py b/app/gitea_client.py index 8909784..f1f81b0 100644 --- a/app/gitea_client.py +++ b/app/gitea_client.py @@ -172,8 +172,10 @@ class GiteaClient: ) -> list[dict]: """Get issues for a repo (paginated, cached). - Note: Gitea's issues endpoint also returns pull requests; each - PR carries a "pull_request" key and callers filter on it. + Note: Gitea's issues endpoint also returns pull requests; a + PR carries a non-null "pull_request" object, a plain issue + carries "pull_request": null — callers filter on truthiness + (see app.main._is_issue). """ key = f"issues:{owner}/{repo}:{state}" cached = self._cache_get(key) diff --git a/app/main.py b/app/main.py index 8fb8676..4c4bc1a 100644 --- a/app/main.py +++ b/app/main.py @@ -323,8 +323,15 @@ def classify_repos( def _is_issue(item: dict) -> bool: - """Gitea's issues endpoint also returns PRs; they carry this key.""" - return "pull_request" not in item + """True for issues, False for pull requests. + + Gitea's issues endpoint also returns PRs. A PR carries a + ``pull_request`` *object*; a plain issue carries the same key + with value ``null`` (verified against Gitea 1.27.3). Testing key + presence therefore classifies every real issue as a PR and + empties the board — test the value's truthiness instead. + """ + return not item.get("pull_request") def _merge_issues_with_board(