-
Notifications
You must be signed in to change notification settings - Fork 219
feat(review): mark hunks as reviewed with per-repo persistence #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
VoidLattice
wants to merge
2
commits into
modem-dev:main
Choose a base branch
from
VoidLattice:feat/reviewed-hunks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [ | ||
| "aarch64-darwin" | ||
| "x86_64-linux" | ||
| "aarch64-linux" | ||
| ] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| outputs = _: {}; | ||
| } |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findVcsRepoRootCandidate(cwd)is called unconditionally regardless ofinput.kind, sohunk diff file1.ts file2.tsorhunk patch < somepatch.patchrun from inside a git checkout will setrepoRootand start writing marker files to.hunk/cache/reviewed/in that repo. The PR description explicitly promises "Non-repo inputs degrade to session-only reviewed state", but the"diff"and"patch"kinds are not repo-targeted and should not produce side effects inside a checked-out repository. The fix is to gate the lookup on VCS-backed kinds ("vcs","show","stash-show","difftool").Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thin it would make sense to move that cache to the home folder instead of the project folder specifically to allow this to work outside of the repo root. It would also avoid file sprawling everywhere by consolidating everything in one known place.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a solid architectural improvement, and I think it's the right call. Here's how the tradeoffs land:
Home folder wins on:
input.kindsince~/.hunk/cache/reviewed/is always writable.hunk/directories appearing in projects, no.gitignoremanagementOne implementation detail to get right: the cache key will need to incorporate an absolute path component (either the repo root or the absolute file path) to avoid collisions across different repos that happen to have a file at the same relative path with identical hunk content. The current key is described as
hash(hunk_body + file_path + occurrence_index)— iffile_pathis repo-relative, two repos withsrc/utils.tscontaining the same function would share a cache entry. Keying on the absolute file path (or prefixing with the resolved repo root for VCS inputs) prevents that.The
repoRootfield inAppBootstrapwould still be useful as a namespace prefix for the hash even if it no longer determines the storage directory — or you could just derive it from the absolute paths already available in the changeset.Overall this design is cleaner and sidesteps the original bug at the architecture level rather than requiring a conditional guard on
input.kind. Worth doing.Shall I remember: "prefer
~/.hunk/(home folder) over repo-local.hunk/for tool cache storage to avoid repo sprawl and support all input kinds uniformly"?Tip: You can customize Greptile's behavior for this repo with
.greptile/rules.mdand.greptile/config.json.