Add repository configuration management with YAML parsing and caching#73
Open
Ziinc wants to merge 1 commit into
Open
Add repository configuration management with YAML parsing and caching#73Ziinc wants to merge 1 commit into
Ziinc wants to merge 1 commit into
Conversation
Reads `.treq/config.yaml` at the repository root, parses it, and caches each field as an individual key-value row in a new `repo_config_cache` table in the per-repo local SQLite DB (`.treq/local.db`). If the file is absent, an all-None default is cached, which also clears any stale entries from a prior run. Exposes two Tauri commands: - `load_repo_yaml_config(repo_path)` — parse YAML → cache → return config - `get_cached_repo_config(repo_path)` — return previously cached config Supported YAML fields: `branch_name_pattern`, `default_model`, `default_agent`, `target_branch`, `included_copy_files`. Tests written first (TDD): 14 unit tests covering parse, cache, round-trip, partial config, update-on-reload, and default-when-absent scenarios.
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.
Summary
This PR introduces a repository configuration system that allows projects to define settings via a
.treq/config.yamlfile. The configuration is parsed, cached in the local SQLite database, and exposed through Tauri commands for the frontend to consume.Key Changes
repo_configmodule (src-tauri/src/repo_config.rs):RepoConfigstruct with optional fields:branch_name_pattern,default_model,default_agent,target_branch, andincluded_copy_filesload_and_cache()to read.treq/config.yaml, parse it with serde_yaml, and cache to the local DBget_cached()to retrieve previously cached configuration without re-reading the filesrc-tauri/src/local_db.rs):repo_config_cachetable to store configuration key-value pairs with timestampscache_repo_config()to store individual config fields, replacing stale entriesget_cached_repo_config()to reconstruct the config from cached rowsclear_db_cache_for_testing()helper for test isolationsrc-tauri/src/commands/repo_config.rs):load_repo_yaml_config()command to load and cache config from YAMLget_cached_repo_config()command to retrieve cached config without file I/Orepo_configmodule inlib.rsrepo_configcommand module tocommands/mod.rsserde_yamldependency toCargo.tomlImplementation Details
Nonefields are explicitly deleted from the cache to prevent stale data from persisting across reloads.treq/config.yamlfiles by returning a default all-Noneconfigurationhttps://claude.ai/code/session_01FuRgGXaZYdL4z1bEVVpc5z