Skip to content

fix(webhook): fail missing PR file content blobs#148

Open
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/hc05-required-blob-guard
Open

fix(webhook): fail missing PR file content blobs#148
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/hc05-required-blob-guard

Conversation

@JSONbored
Copy link
Copy Markdown
Contributor

@JSONbored JSONbored commented May 29, 2026

Summary

  • Add typed GraphQL blob handling for PR file-content fetches.
  • Fail the current content batch when a required base/head blob alias is missing from a successful GraphQL response.
  • Keep expected nullable content behavior for added files, removed files, binary blobs, and oversized blobs.

Why

GitHub GraphQL can return null for object(expression: ...) without top-level errors. A live probe against this repo confirms that a missing object expression returns:

{"data":{"repository":{"missingObject":null}}}

Before this change, a modified text file could be stored with a missing required head or base blob as trusted null content. That lets the file fetch complete even though a required file-content input was absent.

This keeps the existing retry/failure path responsible for incomplete PR file content instead of persisting an incomplete row as if it were valid.

Prior context

No existing issue or PR was found for this exact per-alias GraphQL null-object case.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • npm run format:check
  • npm run lint
  • npm run build
  • git diff --check
  • Local missing-blob harness verified a required head blob returning null throws before any content upsert
  • Live GraphQL probe verified missing object(expression: ...) returns null without top-level errors
  • Codex Security diff scan: 0 reportable findings
  • CodeRabbit CLI review: 0 issues

Checklist

  • I have read the Contributing Guide
  • Code builds without errors
  • New and existing tests pass (if applicable)
  • Documentation updated (if applicable)
  • No unnecessary dependencies added

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 29, 2026
@JSONbored JSONbored marked this pull request as ready for review May 29, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant