-
Notifications
You must be signed in to change notification settings - Fork 1
Implement RSP CLI tool for YAML ConfigMap string processing #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
This commit adds a complete Rust CLI tool that converts escaped strings embedded in YAML ConfigMaps into properly formatted multi-line strings using YAML's pipe (|) syntax. Features: - CLI interface with clap supporting peel command - YAML parsing and processing with serde_yaml - String unescaping for newlines, tabs, quotes, and backslashes - Automatic detection of files by extension (.yaml, .yml, .json, .toml) - Output to stdout or specified file with -o option - Comprehensive error handling with custom error types - Sample test data and documentation The tool successfully transforms hard-to-read escaped JSON/YAML/TOML strings into human-readable format as specified in specs/README.md. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit adds extensive testing coverage and automated CI/CD as specified in the updated requirements: **Test Suite (31 tests total):** - Unit tests (tests/peeler_tests.rs): Core functionality, string processing, file handling, and YAML serialization - Integration tests (tests/cli_tests.rs): CLI commands, argument parsing, file I/O, and error conditions - Edge case tests (tests/edge_cases_tests.rs): Malformed input, large strings, unicode content, binary files, and unexpected scenarios **CI/CD Pipeline (.github/workflows/ci.yml):** - Build verification on ubuntu-latest - Complete test suite execution - Code formatting checks (rustfmt) - Linting with clippy (zero warnings) - Security audit with cargo-audit - Release build verification **Infrastructure:** - Added library structure (src/lib.rs) for test imports - Made key methods public for unit testing - Added tempfile dependency for test isolation - Updated documentation with testing instructions All tests pass successfully, providing robust coverage for both normal operation and edge cases. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit addresses all CI/CD pipeline failures by fixing: **Formatting Issues:** - Applied cargo fmt --all to ensure consistent code formatting - Fixed line endings and spacing throughout codebase **Clippy Warnings:** - Added Default trait implementations for Cli and Peeler structs - Removed needless borrows in function calls (.args(&[...]) → .args([...])) - Removed needless borrows in HashMap lookups (.get(&key) → .get(key)) - Collapsed nested if-let patterns for better readability - Fixed all clippy warnings to pass --deny warnings **Local CI Verification:** - Verified all checks pass locally as specified in development guidelines - Build: ✅ cargo build --verbose - Tests: ✅ cargo test --all --verbose (31/31 tests passing) - Format: ✅ cargo fmt --all -- --check - Lint: ✅ cargo clippy --all-targets --all-features -- -D warnings - Audit: ✅ cargo audit (no vulnerabilities) All local checks now mirror the GitHub Actions CI pipeline exactly, ensuring smooth integration and preventing CI failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixed 3 clippy warnings about format strings that can use inline variables: - Updated println\! in output file path display - Updated print\! for stdout output - Updated format\! in YAML key serialization All tests passing (31/31) and clippy warnings resolved. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixed all uninlined format argument warnings in test files: - tests/cli_tests.rs: Updated write\! macros to use inline variables - tests/edge_cases_tests.rs: Updated format\! macro to use inline variables - tests/peeler_tests.rs: Updated write\! macros to use inline variables All 31 tests passing and no Clippy warnings remaining. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add peel_stdin() method to Peeler for reading from stdin - Make file argument optional in CLI, defaulting to stdin when not provided - Add comprehensive tests for stdin functionality with and without output files - Support pipe operations: cat file.yaml | rsp peel - Maintain backward compatibility with existing file input - Update help text to indicate stdin usage when file not provided 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add TOC placeholder section to README.md - Add contents: write permissions to TOC workflow - Fix TARGET_PATHS to only include existing README.md file 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
peelcommandFeatures
rsp peel <file>with optional-ooutput flag.yaml,.yml,.json,.toml\n,\t,\r,\",\\escape sequences|) formatTest Plan
cargo run -- peel tests/test_data/sample_configmap.yamlcargo run -- --helpandcargo run -- peel --helpcargo run -- --versioncargo run -- peel input.yaml -o output.yamlcargo buildandcargo build --release🤖 Generated with Claude Code