Repository navigation
Remove the code duplication flagged by cargo-echoes - #159
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The reverse translator reads INSERT target columns through the forward insert_column_names, table function settings go through translate_query_settings, the rebind planner lists FROM items through one list_from, RLS argument lists transform through one closure, interval arithmetic builds its datetime call through shifted_datetime, and the statement benchmarks share one bench_statements loop.
Test files that carried their own copies of the translate, apply, reverse and execution helpers now call shared ones in tests/helpers, the gauntlet shares its PostgreSQL session switch, seed insert and row loader, and an exact copy of maintenance_trigger_fires_on_update_to_maintenance_column is gone.
LucaCappelletti94
force-pushed
the
echoes-dedup
branch
from
October 25, 2026 22:08
85e83ca to
d36cbdd
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
cargo-echoes flagged 46 duplicate groups, 5 of them in library code and 2 in the benches. The reverse translator now reads INSERT target columns through the forward
insert_column_names, table function settings go throughtranslate_query_settings, the rebind planner lists FROM items through onelist_from, RLS function argument lists transform through one closure, and interval arithmetic builds itsdatetimecall throughshifted_datetime. The statement benchmarks share onebench_statementsloop with unchanged benchmark ids.The other 39 groups were helpers that test files carried their own copies of. Those tests now call shared helpers in
tests/helpers, and the gauntlet shares its PostgreSQL session switch, tenant seed insert and row loader. One test,maintenance_trigger_does_not_recurse_with_recursive_triggers_enabled, was an exact copy ofmaintenance_trigger_fires_on_update_to_maintenance_columnand is gone. The kept test's comment now states the recursion it guards.