Skip to content

Conversation

@frankharkins
Copy link
Member

The current PR expiration logic looks at the time PR files were last modified. This PR switches the check to look at the time the PR was last updated. This could be a better metric in cases where the PR is undergoing a long review.

Eric-Arellano
Eric-Arellano previously approved these changes Jan 7, 2026
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Feel free to push back, but I think this might be worth doing: the logic is fairly complex for get_pr_folders. Consider unit testing it. I'd recommend refactoring it so that the run_subprocess isn't part of the test, since that's non-deterministic.


parsed = json.loads(api_response, object_hook=parse_updated_at)
all_pr_numbers = (number for number in parsed)
all_pr_numbers = (pr["number"] for pr in parsed)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thing you suggested tests – this wasn't caught by the type checker because parsed is Unknown

@frankharkins frankharkins marked this pull request as ready for review January 12, 2026 12:11
Eric-Arellano
Eric-Arellano previously approved these changes Jan 12, 2026
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing tests!

@frankharkins frankharkins added this pull request to the merge queue Jan 12, 2026
Merged via the queue into main with commit 19831ab Jan 12, 2026
5 checks passed
@frankharkins frankharkins deleted the FH/expire-previews branch January 12, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants