treat transferred issues as closed in discovery scoring#415
treat transferred issues as closed in discovery scoring#415anderdc merged 8 commits intoentrius:testfrom
Conversation
ReviewWhat works
IssuesNOT_PLANNED gap — GitHub
Boolean field limits future extensibility — Minor: no test for NOT_PLANNED — Even if NOT_PLANNED handling is deferred, a test documenting current behavior for VerdictThe PR properly solves what it claims (transferred issues). The NOT_PLANNED gap is a real scoring loophole that should be addressed — either in this PR or as a fast-follow. Storing |
|
thanks for the review pushed a follow-up commit covering all four points:
12/12 tests in the touched files pass, ruff clean. ready for another look |
|
pushed three style-only commits to clear the lint failure -just |
|
Why is it that having two issues in one PR? |
|
both issues come from the same bug. transferred issues weren't being excluded in two adjacent scoring paths (pr-linked and scan-merge). the fix is one coherent change across those paths, splitting into two PRs would just create merge conflicts between them |
|
No there won't be a conflict. You will see the PR size reasonable, this already became larger. |
|
Implementation looks good -- addresses both transferred and NOT_PLANNED correctly. Two things before this can merge:
|
fixes the anti-gaming gap where transferred issues counted as solved in the pr-linked path and were not flagged during repo scan. adds stateReason to the closingIssuesReferences graphql selection, populates is_transferred in both construction paths, and routes transferred issues to closed_count in _collect_issues_from_prs and _merge_scan_issues
replaces is_transferred: bool with state_reason: Optional[str] on Issue and keeps is_transferred as a convenience property. gates solved classification in _collect_issues_from_prs and _merge_scan_issues on state_reason == 'COMPLETED', so NOT_PLANNED and TRANSFERRED both route to closed_count. None is effectively unreachable inside the 35-day lookback since github auto-populates stateReason on close, but the strict gate is the safer default if that ever changes tests cover COMPLETED, TRANSFERRED, NOT_PLANNED, and None in both the pr-linked path and the scan path, plus the REST uppercase normalization
c15b5f9 to
116ebfd
Compare
|
rebased onto test, resolved the classes.py conflict with body_or_title_edited_at. ready for ci approval |
|
failing tests |
|
my new test was calling asyncio.run, which leaves the event loop as None and breaks the get_event_loop() helpers in test_pat_handler and test_repo_scan. ebdd683 switches it to the same pattern, passes locally |
anderdc
left a comment
There was a problem hiding this comment.
Thorough re-review complete. Both scoring paths correctly gate on state_reason == 'COMPLETED' -- NOT_PLANNED, TRANSFERRED, and None all route to closed_count as intended. GraphQL and REST data flows verified, no double counting, backward compat preserved via is_transferred property. 12 tests cover all four state_reason values across both paths. CI green. LGTM.
closes #404
closes #405
summary
transferred issues were being counted as solved in discovery scoring, so a miner could file an issue, have it transferred, and still collect emissions
repo_scan never populated is_transferred even though the rest response carries state_reason, and the pr-linked path never had the data because the graphql query didn't select stateReason
this adds stateReason to the closingIssuesReferences selection, sets is_transferred in both construction paths, and routes transferred issues to closed_count in _collect_issues_from_prs and _merge_scan_issues
test plan
pytest covers transferred vs non-transferred in the pr-linked scoring path, the scan merge path, and the repo_scan field population from state_reason transferred/completed. ruff and pyright pass