Skip to content

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

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

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

@JSONbored JSONbored commented May 29, 2026

Copy link
Copy Markdown
Contributor

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
@anderdc

anderdc commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

fix conflicts

@JSONbored
JSONbored force-pushed the codex/hc05-required-blob-guard branch from 20b49cb to f4dd187 Compare June 8, 2026 19:01
@JSONbored

Copy link
Copy Markdown
Contributor Author

fix conflicts

Fixed.

@anderdc anderdc added enhancement New feature or request and removed bug Something isn't working labels Jun 15, 2026
@anderdc

anderdc commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

The only evidence that a required blob returns null on a successful GraphQL response is a synthetic missing-object probe — there's no demonstrated production path where a real changed file's required head/base blob resolves to null without top-level errors. This guards a state that isn't shown to occur, and in the one realistic trigger (a force-pushed or GC'd head) it stores no content row instead of the current null row, with no added recovery. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants