Fix: Serialization/Deserialization bug; significantly expand testing in core areas.#33
Fix: Serialization/Deserialization bug; significantly expand testing in core areas.#33bashandbone wants to merge 9 commits intomainfrom
Conversation
bashandbone
commented
Mar 19, 2026
- feat: Add schema; delete old CLAUDE.md for regeneration.
- fix: Fixed an issue with toml deserialization due to mismatched expectations between serialize and deserialize forms. Caught by some of the new expanded tests.
…tations between serialize and deserialize forms. Caught by some of the new expanded tests.
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a TOML serialization/deserialization mismatch for branch configuration (ensuring serialized form matches the deserializer’s expectations), adds a JSON schema update, and substantially expands test coverage across core config/options/shell and CLI workflows.
Changes:
- Fix
SerializableBranchserialization to emit the git/gitmodules-compatible string form. - Add/expand unit + integration tests for config/options behavior and CLI command contracts.
- Update docs/supporting files (schema, CLAUDE.md) and adjust dependencies.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sparse_checkout_tests.rs | Reformat CLI argument arrays for readability/consistency. |
| tests/performance_tests.rs | Reformat CLI argument arrays in performance loop. |
| tests/integration_tests.rs | Reformat argument arrays and assertion formatting. |
| tests/error_handling_tests.rs | Reformat argument arrays and minor formatting cleanup. |
| tests/command_contract_tests.rs | Reformat argument arrays/assertions; minor readability tweaks. |
| src/utilities.rs | Add extensive unit tests for utility helpers. |
| src/shells.rs | Add extensive unit tests for shell parsing/conversions/completions. |
| src/options.rs | Fix SerializableBranch serialization; add comprehensive tests for option wrappers. |
| src/main.rs | Formatting-only changes to iterator chaining for readability. |
| src/git_ops/simple_gix.rs | Import formatting only. |
| src/git_ops/mod.rs | Formatting-only changes in reopen and cleanup command args. |
| src/git_ops/gix_ops.rs | Import formatting only. |
| src/git_manager.rs | Formatting-only changes; preserves behavior. |
| src/config.rs | Add a large unit test module covering config and submodule entry behavior. |
| src/commands.rs | Attribute formatting only for clap args/help strings. |
| schemas/v1.0.0/submod_config_v1.0.0.json | Improve branch description guidance (aliases and refs/heads note). |
| CLAUDE.md | Regenerated contributor/agent guidance (commands, architecture, conventions). |
| Cargo.toml | Dependency cleanup and add explicit toml dependency. |
| Cargo.lock | Lockfile updated to reflect dependency changes. |
| .serena/project.yml | Add Serena project configuration. |
| .serena/.gitignore | Ignore Serena cache and local project override file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot tests now fail after applying your suggestions. Please resolve and ensure all tests pass: test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 143 filtered out; finished in 0.00s stderr ─── Cancelling due to test failure: 3 tests still running |
|
@bashandbone I've opened a new pull request, #34, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * fix: use correct fetchRecurseSubmodules key in from_gitmodules with fetchRecurse fallback Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a config serialization/deserialization mismatch (notably around branch handling) and aligns config parsing with Git’s fetchRecurseSubmodules naming, while substantially expanding test coverage across core CLI/config/git behaviors.
Changes:
- Fix TOML (de)serialization for
SerializableBranchby implementing customSerializeto match string-basedDeserialize. - Update gitmodules parsing to prefer
fetchRecurseSubmodules(with backward-compatible fallback). - Add/expand extensive unit + integration/contract tests; update schema/docs and adjust dependencies.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sparse_checkout_tests.rs | Formatting updates to test command invocations. |
| tests/performance_tests.rs | Formatting updates to test command invocations. |
| tests/integration_tests.rs | Formatting updates and clearer assertions in integration tests. |
| tests/error_handling_tests.rs | Formatting updates to test command invocations and assertions. |
| tests/command_contract_tests.rs | Formatting updates; keeps contract tests readable and consistent. |
| src/utilities.rs | Adds many unit tests for utility helpers and edge cases. |
| src/shells.rs | Adds broad unit tests for parsing/display/conversions and generator output. |
| src/options.rs | Fixes SerializableBranch serialization to string; adds comprehensive option tests. |
| src/main.rs | Formatting-only refactor for readability around collecting submodule names. |
| src/git_ops/simple_gix.rs | Import formatting only. |
| src/git_ops/mod.rs | Formatting only in reopen + cleanup fallback sections. |
| src/git_ops/gix_ops.rs | Import formatting only. |
| src/git_manager.rs | Mostly formatting; retains config writing/merging logic and option normalization. |
| src/config.rs | Fixes fetchRecurseSubmodules key parsing (with fallback) and adds extensive unit tests. |
| src/commands.rs | Formatting-only changes to clap arg attributes. |
| schemas/v1.0.0/submod_config_v1.0.0.json | Clarifies branch alias behavior and guidance in schema docs. |
| CLAUDE.md | Rewrites developer guidance and workflow docs (but removes SPDX header). |
| Cargo.toml | Adjusts gitoxide/gix deps/features and adds explicit toml dependency. |
| Cargo.lock | Lockfile updates reflecting dependency changes. |
| .serena/project.yml | Adds Serena project configuration file. |
| .serena/.gitignore | Adds ignores for Serena cache/local config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
| impl<'de> Deserialize<'de> for SerializableBranch { | ||
| /// Deserialize from a plain string using the same logic as [`FromStr`]. | ||
| /// Accepts `"."`, `"current"`, `"current-in-super-project"`, `"superproject"`, or `"super"` | ||
| /// as [`CurrentInSuperproject`](SerializableBranch::CurrentInSuperproject); all other strings | ||
| /// become [`Name`](SerializableBranch::Name). | ||
| fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> { | ||
| let s = String::deserialize(deserializer)?; | ||
| SerializableBranch::from_str(&s).map_err(|_| { | ||
| serde::de::Error::custom(format!("invalid branch value: {s}")) | ||
| }) | ||
| SerializableBranch::from_str(&s) | ||
| .map_err(|_| serde::de::Error::custom(format!("invalid branch value: {s}"))) | ||
| } |
|
@copilot open a new pull request to apply changes based on the comments in this thread Ensure files have both FileCopyright and LicenseIdentifier headers. Implement the suggestion to delegate to from_gitmodules |
|
@bashandbone I've opened a new pull request, #36, to work on those changes. Once the pull request is ready, I'll request review from you. |
…zation to from_gitmodules (#36) * Initial plan * fix: add SPDX headers to CLAUDE.md; delegate SerializableBranch deserialization to from_gitmodules Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes configuration parsing inconsistencies by aligning SerializableBranch TOML deserialization with the existing gitmodules parsing logic, and corrects fetchRecurse(Submodules) key handling when building SubmoduleEntry from gitmodules entries. Also updates the v1.0.0 JSON schema docs for the branch alias spelling.
Changes:
- Delegate
SerializableBranchTOML deserialization toGitmodulesConvert::from_gitmodulesand add a TOML deserialization test for empty/whitespace values. - Prefer
fetchRecurseSubmodules(with fallback tofetchRecurse) when parsing gitmodules entries intoSubmoduleEntry. - Update schema docs to reference
current-in-super-projectalias spelling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/options.rs |
Changes branch deserialization behavior and adds a unit test for invalid branch values. |
src/config.rs |
Fixes gitmodules key lookup for fetch-recurse and updates the corresponding test. |
schemas/v1.0.0/submod_config_v1.0.0.json |
Updates documented branch alias spelling in schema description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Moved the test for branch deserialization from TOML to the appropriate test module.
|
@copilot we have two failing tests that are testing behavior before our changes in this PR process. Please correct them: stdout ─── stderr ─── |
|
@bashandbone I've opened a new pull request, #37, to work on those changes. Once the pull request is ready, I'll request review from you. |
…hitespace rejection (#37) * Initial plan * fix: use wrapper struct for branch TOML deserialization test to properly isolate SerializableBranch Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>