Skip to content

Add closed_at field to pull request storage for 35-day window filtering #396

@bittoby

Description

@bittoby

Summary

Add closed_at field to the PullRequest data model and persist it to the database so the API can expose it to the frontend.

The GraphQL query already fetches closedAt from GitHub, but it's only used during validation filtering and never stored. This means the UI has no way to know when a closed PR was actually closed.

Motivation

This is needed to fully resolve entrius/gittensor-ui#142, which adds a 35-day evaluation window filter on the miner details page. Most of that work is frontend-only, but closed PRs need to be filtered by their actual close date - the same way the validator does it internally.

Right now the pull_requests table stores merged_at and pr_created_at, but not closed_at. The only updated_at on the table is a DB-level timestamp that tracks when the validator last touched the row, which is not the same thing and can't be used as a substitute.

The fix is small - pipe the existing closedAt value through the PullRequest dataclass into the database, so the API can include it in responses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions