Normalize response shapes - #8
Conversation
anderdc
left a comment
There was a problem hiding this comment.
This PR normalizes response shapes but stops short of gating the MERGED-without-merged_at corruption shape. Consumers (gittensor #925, oss_contributions/mirror/scoring.py:192) are adding parallel defensive gates downstream that belong here instead.
Three additions:
miners.service.tssolving_pr subquery (~line 200): extendAND sp.author_github_id IS NOT NULLwithAND NOT (sp.state = 'MERGED' AND sp.merged_at IS NULL). Symmetric to the null-author gate already in this PR.packages/db/02_pull_requests.sql: addCHECK (state != 'MERGED' OR merged_at IS NOT NULL)so future writes can't persist the corrupted shape regardless of upstream payload.packages/das/src/webhook/handlers/pull-request.handler.ts:36-39: gatestate: 'MERGED'onpr.merged && pr.merged_attogether so the handler can't trip the new CHECK constraint on a partial GitHub payload.
Done. I'm unsure about editing P.S. May we afterwards re-open the underlying issue in gittensor? entrius/gittensor#915 |
|
PRs should target test branch |
|
@anderdc Rebased + squashed |
|
Thank you for the response hardening, but I still think 915 doesn't need to be opened, I'm perfectly fine with the current boilerplate/implementation instead of the switch |
Summary
This PR implements transformation logic which previously was hold in client.
After this PR lands, we can safely simplify entrius/gittensor#914 to make client contain only plain response models.
Related Issues
entrius/gittensor#915
Type of Change
Checklist