Conversation
A trashed folder keeps its path in the index, so a new folder can take the same one. The descendant lookup behind move, delete, restore and purge matched on space and path only: purging the trashed folder took the live folder and its descendants out of the index, and moving the live folder carried the trashed tree along. Both engines now also match the root's trash state; purge with onlyDeleted keeps matching the trashed ones only.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 63.16% diff coverage
Metric Results Coverage variation Report missing for 74462d31 Diff coverage ✅ 63.16% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (74462d3) Report Missing Report Missing Report Missing Head commit (ad4c8ad) 89040 21575 24.23% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3602) 19 12 63.16% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
dschmidt
left a comment
There was a problem hiding this comment.
Instead of adding the deleted / onlyDeleted bools to forEachResourceByPath and forSelfAndDescendants, should the caller pass the query into forEachResourceByPath? It would then only do the paging, and each caller adds the Deleted filter it needs.
Roughly, with three small new helpers:
treeQuery(root): the RootID + Path conjunction thatforEachResourceByPathbuilds inline todaydeletedQuery(deleted): theDeletedbool field queryb.pushing(fn): the currentapplyclosure fromforSelfAndDescendants, pulled out soPurgecan use it too
// forSelfAndDescendants(id, fn): back to the signature from main
q := treeQuery(root)
q.AddQuery(deletedQuery(root.Deleted))
forEachResourceByPath(q, b.index, fn)
// Purge(id, true): doesn't go through forSelfAndDescendants
q := treeQuery(root)
q.AddQuery(deletedQuery(true)) // also leaves out the live root, since the Path term matches the folder itself
forEachResourceByPath(q, b.index, b.pushing(purge))In forSelfAndDescendants the query has to be built before fn(root) runs, just like rootPath today.
Personally I really dislike boolean parameters as I think it's really hard to reason about what they are doing
A trashed folder keeps its path in the index, so a live folder can take the same path. Move/delete/restore/purge looked up descendants by path only. As a result, purging the trashed
./aremoved the live./atree, and moving the live./atook the trashed tree with it. Both engines now also match the root's trash state.