Skip to content

fix: hide stale reviews for missing commits#686

Merged
matt2e merged 6 commits intomainfrom
hide-code-reviews-without-commit
May 5, 2026
Merged

fix: hide stale reviews for missing commits#686
matt2e merged 6 commits intomainfrom
hide-code-reviews-without-commit

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented May 5, 2026

🤖 Summary

  • Hide reviews tied to commits that no longer appear in branch history.
  • Keep stale reviews visible when they contain active user-authored comments.
  • Add isolated temp git repo coverage for stale review timeline cases.

matt2e and others added 5 commits May 5, 2026 14:53
Filter branch timeline reviews to SHAs that are still visible in git history and cover reset-away commits with a unit test.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
- Allow reviews with empty commit_sha through the visibility filter so
  in-progress branch reviews (not yet associated with a commit) are not
  hidden from the timeline.
- Use 'git init --initial-branch=main' in test helper instead of
  separate init + checkout to be explicit about the default branch name
  regardless of system git configuration.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Move the TempGitRepo helper from timeline.rs tests into a dedicated
src/test_utils.rs module so it can be reused by future test modules
without duplication.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Allow branch timeline visibility to retain stale reviews when their loaded active comments include a user-authored comment.

Keep stale empty reviews, agent-only reviews, and reviews with only deleted user comments hidden, and cover those cases in timeline tests.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Test <test@example.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners May 5, 2026 04:57
Extract a shared helper that removes every inherited GIT_* variable before running git and use it from the CLI and test git helpers.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e merged commit 31b5f42 into main May 5, 2026
5 checks passed
@matt2e matt2e deleted the hide-code-reviews-without-commit branch May 5, 2026 05:25
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.

1 participant