This repository was archived by the owner on Jun 28, 2026. It is now read-only.
Closed
Refactor duplicated test utilities and establish proc macro foundation for SQL deduplication#111
Conversation
Co-authored-by: 7086cmd <54303040+7086cmd@users.noreply.github.com>
Co-authored-by: 7086cmd <54303040+7086cmd@users.noreply.github.com>
…n for SQL deduplication Co-authored-by: 7086cmd <54303040+7086cmd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor duplicated code for better maintainability
Refactor duplicated test utilities and establish proc macro foundation for SQL deduplication
Dec 24, 2025
Owner
Implement it RIGHT AWAY. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Identified and began refactoring ~940 lines of duplicated code across test helpers and database repository implementations.
Changes
Test Utilities Consolidation ✅
create_test_task()andcreate_test_robot()intoadmin/orchestrator/src/test_utils.rsSQL Repository Deduplication Foundation 🚧
Created
proc_macros/crate to generate repository implementations via derive macros instead of manual duplication across 5 schemas × 2 backends.Target: ~850 lines of near-identical
search(),count(), andlist()implementations in:shared/src/schema/{entity,area,beacon,merchant,connection}.rsApproach:
Generates both PostgreSQL (ILIKE, $N) and SQLite (COLLATE NOCASE, ?N) implementations at compile-time.
Status: Skeleton implemented, attribute parsing and code generation logic remains.
Stats
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.