feat: persist closed_at timestamp for pull requests (#396)#400
Open
EternalVision-AI wants to merge 1 commit intoentrius:testfrom
Open
feat: persist closed_at timestamp for pull requests (#396)#400EternalVision-AI wants to merge 1 commit intoentrius:testfrom
EternalVision-AI wants to merge 1 commit intoentrius:testfrom
Conversation
The GraphQL query already fetches closedAt from GitHub but it was only used for validation filtering and never stored. This pipes the existing value through the PullRequest dataclass into the database so the API can expose it to the frontend for 35-day evaluation window filtering. Requires: ALTER TABLE pull_requests ADD COLUMN IF NOT EXISTS closed_at TIMESTAMPTZ; Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
closed_atfield to thePullRequestdataclass and persist it to the database so the API can expose it to the frontend for 35-day evaluation window filtering.The GraphQL query already fetches
closedAtfrom GitHub, but it was only used during validation filtering intry_add_open_or_closed_pr()and never stored. This pipes the existing value through the dataclass into the bulk upsert query.Changes:
closed_at: Optional[datetime]field toPullRequestdataclassclosedAtfrom GraphQL response infrom_graphql_response()closed_atcolumn toBULK_UPSERT_PULL_REQUESTSINSERT and ON CONFLICT UPDATEpr.closed_atto the values tuple inrepository.pyMigration required:
Note: GitHub sets
closedAtfor both CLOSED and MERGED PRs (merging closes a PR), so the field is populated for both states andNoneonly for OPEN PRs.Related Issues
Fixes #396
Type of Change
Testing
Checklist