Repository navigation
fix: preserve PR comments when Issues are disabled (#503) - #568
eelasyot-spec wants to merge 2 commits into
Conversation
Avoid gating small-repo message collection on has_issues alone, which dropped PR conversation comments. Catch 404 on /issues/comments instead. On the large-repo path, when Issues are off only fetch known PR comment URLs (shared issue/PR numberspace) to avoid burning API quota on 404/410s.
| (select pr_comments_url from pull_requests WHERE repo_id={repo_id} AND pr_comments_url IS NOT NULL AND pr_updated_at > timestamptz(timestamp '{since}') order by pr_created_at desc) | ||
| UNION | ||
| (select comments_url as comment_url from issues WHERE repo_id={repo_id} AND comments_url IS NOT NULL AND updated_at > timestamptz(timestamp '{since}') order by created_at desc); | ||
| pr_query = text(f""" |
| AND pr_updated_at > timestamptz(timestamp '{since}') | ||
| order by pr_created_at desc | ||
| """) | ||
| issue_query = text(f""" |
| (select pr_comments_url from pull_requests WHERE repo_id={repo_id} AND pr_comments_url IS NOT NULL order by pr_created_at desc) | ||
| UNION | ||
| (select comments_url as comment_url from issues WHERE repo_id={repo_id} AND comments_url IS NOT NULL order by created_at desc); | ||
| pr_query = text(f""" |
| WHERE repo_id={repo_id} AND pr_comments_url IS NOT NULL | ||
| order by pr_created_at desc | ||
| """) | ||
| issue_query = text(f""" |
This comment has been minimized.
This comment has been minimized.
Is there a particular way we are distinguishing small vs large repos? Edit: saw your comment in the issue and think I understand what you mean |
|
Also can you update the PR description to use the template? also your commits need to be signed off (see CONTRIBUTING.md) so the DCO check passes |
|
the small/large check is being done by it determines whether we run |
Summary
UrlNotFoundExceptionon/issues/comments) without dropping PR conversation comments when Issues are disabled./issues/commentsendpoint and return[](does not gate onhas_issuesalone).has_issuesis false, only fetch known PR comment URLs (GitHub shared issue/PR numberspace) to avoid burning API quota on predictable 404/410s for issue-only URLs.check_issues_enabledre-raises repo metadata 404s (do not treat missing repos as “issues disabled”).This differs from #554, which skipped all message collection on
has_issues=falseand dropped PR conversation comments (e.g.openshift/release).Test plan
pytest tests/test_github_resilience— 23 passedopenshift/release(has_issues=false) still returns PR comments on/issues/commentskubernetes/apiextensions-apiserver/issues/commentsreturns 404 (the Core:Collect_github_messages error: UrlNotFoundException #503 case)Made with Cursor