[codex] Fix open contribution issues#292
Merged
vinitkumar merged 5 commits intomasterfrom May 4, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #292 +/- ##
==========================================
+ Coverage 96.07% 98.56% +2.48%
==========================================
Files 6 6
Lines 484 487 +3
==========================================
+ Hits 465 480 +15
+ Misses 19 7 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Contributor
Reviewer's GuideRefines CLI input error handling, clarifies benchmark/docs behavior, and adds tests for the Rust fast-wrapper selection and Python fallback paths so contributors can validate behavior without the optional extension. Sequence diagram for updated CLI input handling and error messagessequenceDiagram
actor User
participant CLI
participant Argparse
participant ReadInput as read_input
participant ReadFromStdin as read_from_stdin
participant ReadFromString as readfromstring
participant ReadFromJson as readfromjson
participant ExitWithError as exit_with_error
User->>CLI: invoke json2xml CLI
CLI->>Argparse: parse_args
Argparse-->>CLI: args
CLI->>ReadInput: read_input(args)
alt --string provided
ReadInput->>ReadFromString: readfromstring(args.string)
ReadFromString-->>ReadInput: JSONValue
ReadInput-->>CLI: JSONValue
else invalid JSON in --string
ReadFromString--xReadInput: StringReadError
ReadInput->>ExitWithError: Error Invalid JSON in --string input
ExitWithError-->>User: detailed guidance message
end
alt input_file is -
ReadInput->>ReadFromStdin: read_from_stdin()
ReadFromStdin-->>ReadInput: JSONValue
ReadInput-->>CLI: JSONValue
else input_file path missing
ReadInput->>ExitWithError: Error JSON file not found with hint
ExitWithError-->>User: check path or use - for stdin
else input_file exists but malformed JSON
ReadInput->>ReadFromJson: readfromjson(args.input_file)
ReadFromJson--xReadInput: JSONReadError
ReadInput->>ExitWithError: Error Could not parse JSON file with hint
ExitWithError-->>User: check file contains valid JSON
end
alt stdin has data
ReadInput->>ReadFromStdin: read_from_stdin()
ReadFromStdin->>ReadFromString: readfromstring(json_str)
ReadFromString-->>ReadFromStdin: JSONValue
ReadFromStdin-->>ReadInput: JSONValue
ReadInput-->>CLI: JSONValue
else stdin empty
ReadFromStdin->>ExitWithError: Error Empty stdin with guidance
ExitWithError-->>User: pipe JSON or pass file or --string
else stdin invalid JSON
ReadFromStdin--xReadFromString: StringReadError
ReadFromStdin->>ExitWithError: Error Invalid JSON from stdin with guidance
ExitWithError-->>User: pipe valid JSON or pass file or --string
end
alt stdin is TTY and no other inputs
ReadInput->>ExitWithError: Error No input provided with guidance
ExitWithError-->>User: pass file, -, or --string/--url
end
Class diagram for dicttoxml_fast Rust wrapper and Python fallback behaviorclassDiagram
class DicttoxmlFastFacade {
+convert(data, options)
}
class RustBackend {
+convert(data, options)
}
class PythonBackend {
+convert(data, options)
}
class FastBackendSelector {
+has_rust_extension
+supports_options
+select_backend(data, options)
}
DicttoxmlFastFacade --> FastBackendSelector : uses
FastBackendSelector --> RustBackend : uses_when_available
FastBackendSelector --> PythonBackend : fallback
class DicttoxmlFastTests {
+test_rust_backend_used_when_available()
+test_python_fallback_when_rust_missing()
+test_python_fallback_for_unsupported_options()
+test_python_fallback_for_special_keys()
}
DicttoxmlFastTests --> DicttoxmlFastFacade : verifies_behavior
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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
Fixes #288
Fixes #289
Fixes #290
Fixes #291
Validation
Summary by Sourcery
Improve CLI error messaging, add coverage for Rust fast-wrapper fallback behavior, and expand documentation for benchmarks and usage examples.
Bug Fixes:
Enhancements:
Documentation:
Tests: