Add tempfile and improve git error handling - #38
Merged
Conversation
- Add `tempfile` as a dev-dependency in `Cargo.toml` to enable temporary file handling in tests - Update `Cargo.lock` to lock `tempfile` and its transitive dependencies for reproducible CI - Improve `src/git.rs` error handling to include git's `stderr` when present, falling back to exit status if not - Make `staged_diff_for_file` robust when run from subdirectories by anchoring the pathspec to the repo root with `:/path`; document this behavior - Extend `tests/git.rs` with a focused test for `staged_diff_for_file` and `staged_files` from a subdirectory; add helper `repo_with_staged_nested_file` to create a temp repo with a nested staged change - Update imports in tests to include `staged_diff_for_file` and `staged_files` to exercise staging-related functionality
- devops/render-release-notes.sh: Extend release notes to cover Amazon Linux (musl) installation with a dedicated section and a one-shot install command that downloads the linux-musl tarball for the current architecture and installs to /usr/local/bin. - devops/render-release-notes.sh: Acknowledge the need for a musl-compatible build and document a curl | tar approach for easy installation on Amazon Linux. - src/config.rs: Add request_timeout_secs with default 90s across default, file, repo, and environment sources; extend Config and FileConfig to store and propagate the new timeout. - src/config.rs: Introduce u64-based resolution paths (get_u64, file_u64, env_u64) to align with existing numeric config handling. - src/config.rs: Ensure proper precedence and log the decision source (Hardcoded/FileDefault/FileRepo/Env) when resolving the timeout. - src/llm/ollama.rs: Add configurable HTTP timeout and latency timing for Ollama requests; include explicit request/response timing logs for streaming and non-streaming paths. - src/llm/ollama.rs: Skip real Ollama /api/tags validation to reduce network dependency; defer model listing to a separate command. - src/llm/ollama.rs: Update tests to reflect the new timeout parameter and adjusted tags behavior for compatibility. - src/llm/openai.rs: Add configurable HTTP timeout via timeout_secs to OpenAiClient::new, replacing the hard-coded 90s timeout. - src/llm/openai.rs: Add timing instrumentation to log non-stream OpenAI response times and total streaming response time for observability. - src/llm/openai.rs: Update tests to pass the new timeout parameter when constructing the client. - src/main.rs: Instrument performance timing around file summarization, commit message generation, and PR message generation; expose elapsed durations in user-visible output. - src/main.rs: Apply minor formatting/bracing/whitespace adjustments with no functional impact. - src/setup.rs: Wire cfg.request_timeout_secs through to OpenAiClient and OllamaClient constructors; include timeout value in debug logs for both providers. Token usage: prompt=4924, completion=5829, total=10753
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.
tempfileas a dev-dependency inCargo.tomlto enable temporary file handling in testsCargo.lockto locktempfileand its transitive dependencies for reproducible CIsrc/git.rserror handling to include git'sstderrwhen present, falling back to exit status if notstaged_diff_for_filerobust when run from subdirectories by anchoring the pathspec to the repo root with:/path; document this behaviortests/git.rswith a focused test forstaged_diff_for_fileandstaged_filesfrom a subdirectory; add helperrepo_with_staged_nested_fileto create a temp repo with a nested staged changestaged_diff_for_fileandstaged_filesto exercise staging-related functionality