Skip to content

Fix PR metadata cache overwrite with incomplete review data#72

Open
C-Hipple wants to merge 1 commit intomainfrom
claude/review-pr-67-IhqnC
Open

Fix PR metadata cache overwrite with incomplete review data#72
C-Hipple wants to merge 1 commit intomainfrom
claude/review-pr-67-IhqnC

Conversation

@C-Hipple
Copy link
Owner

@C-Hipple C-Hipple commented Mar 5, 2026

Summary

Fix a bug where PR metadata cache entries were being overwritten with incomplete review data when workflows didn't request review information. This caused previously-cached review state (approved_by, changes_requested_by) to be lost.

Changes

  • Add Reviews and Commits fields to the auxiliary data merge logic in prefetchAuxData to properly track which data was fetched
  • Pass req.Reviews flag to persistPRCacheData to indicate whether reviews were actually requested
  • Conditionally write PR metadata cache only when reviews were fetched, preventing empty review slices from overwriting previously-cached review state
  • Update function documentation to clarify the new reviewsFetched parameter and its purpose

Test Plan

  • go build ./... passes
  • go test ./... passes

https://claude.ai/code/session_01D3cDggRWmeTdA1vZsgZNVs

1. Merge Reviews and Commits fields in prefetchAuxData requirement
   accumulation. Previously only Comments, CIStatus, and Diff were
   ORed together across workflows for the same PR; Reviews and Commits
   were silently ignored, so whether they got fetched depended on map
   iteration order.

2. Guard buildAndCacheMetadata on reviewsFetched. When reviews were not
   requested, ghReviews is nil and the metadata cache was being written
   with empty approved_by/changes_requested_by/commented_by fields,
   overwriting any previously-cached review state. Now the metadata
   write is skipped unless reviews were actually fetched.

https://claude.ai/code/session_01D3cDggRWmeTdA1vZsgZNVs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants