-
Notifications
You must be signed in to change notification settings - Fork 1
Develop #24
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
Conversation
- Add signoff option to CLI arguments in `cli.rs` - Implement author name and email retrieval in `git.rs` - Append signoff to commit message in `main.rs` if enabled - Add tests for author name and email functions in `git.rs` Signed-off-by: mingcheng <[email protected]>
- Implement detection of GIT_AUTO_SIGNOFF environment variable - Enable signoff if environment variable is set to true or 1 - Update logic to combine CLI signoff option with environment variable check Signed-off-by: mingcheng <[email protected]>
- Add `AIGITCOMMIT_SIGNOFF` environment variable to README - Mention auto sign-off feature when variable is set to true Signed-off-by: mingcheng <[email protected]>
- Replace static string formatting with variable interpolation in log messages - Apply consistent formatting for trace logs across `git.rs` and `openai.rs` Signed-off-by: mingcheng <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Update `AIGITCOMMIT_SIGNOFF` to `GIT_AUTO_SIGNOFF` in README for consistency - Reflect the correct variable used in the code for auto signoff feature Signed-off-by: mingcheng <[email protected]>
- Replace static string formatting with variable interpolation in log messages - Apply consistent formatting for trace logs across `git.rs` and `openai.rs` Signed-off-by: mingcheng <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Update `AIGITCOMMIT_SIGNOFF` to `GIT_AUTO_SIGNOFF` in README for consistency - Reflect the correct variable used in the code for auto signoff feature Signed-off-by: mingcheng <[email protected]>
- Adjust last modified timestamps in `main.rs` and `openai.rs` for accuracy - Resolve merge conflict timestamp in `main.rs` to reflect latest update Signed-off-by: mingcheng <[email protected]>
- Bump version from 1.3.2 to 1.3.3 in Cargo.toml - Add "grok" to keywords list in package metadata
- Introduce --check flag in CLI to verify API key and model - Implement check_model function to list and validate available models - Integrate check logic in main.rs with error handling - Comment out unused dependencies in Cargo.toml - Update package categories in Cargo.toml
- Update error message formatting in main.rs to use direct variable interpolation - Simplify debug and error messages in openai.rs with consistent string formatting - Remove redundant string concatenation for cleaner code readability Signed-off-by: mingcheng <[email protected]>
- Add support for signed-off-by line in commit messages with configurable option - Refactor commit function to accept signoff parameter in git.rs - Retrieve author name and email from repository config for signoff - Remove redundant signoff logic from main.rs and centralize in git.rs - Update commit call in main.rs to pass signoff requirement Signed-off-by: mingcheng <[email protected]>
- Add instructions for generating git commit messages - Include details on diff-based message creation - Remove signed-off-by message from commit instructions - Update examples to reflect recent commit styles Signed-off-by: mingcheng <[email protected]>
- Update version from 1.3.3 to 1.4.0 in Cargo.toml - Enhance system template with additional instructions - Simplify and clarify template content for better usability - Remove redundant information to streamline template - Ensure template aligns with latest commit message standards Signed-off-by: mingcheng <[email protected]>
- Add support for signed-off-by line in commit messages with configurable option - Refactor commit function to accept signoff parameter in git.rs - Retrieve author name and email from repository config for signoff - Remove redundant signoff logic from main.rs and centralize in git.rs - Update commit call in main.rs to pass signoff requirement Signed-off-by: mingcheng <[email protected]>
- align indentation with recent project standards - fix timestamp formatting inconsistencies - remove redundant comments in template sections - simplify conditional phrasing for clarity - normalize line endings across file Signed-off-by: mingcheng <[email protected]> Co-authored-by: Copilot <[email protected]>
…ility 🔍 - Add --check CLI flag to verify API key and model availability - Implement check_model method to list and validate models server-side - Integrate error handling for invalid keys or models in main.rs - Update Cargo.toml to remove unused dependencies and categorize package fields - Store last validation timestamp in configuration for audit purposes Signed-off-by: mingcheng <[email protected]>
- restructure opening statement for better readability - add context note about commit relevance to current changes - remove redundant quote charset references - simplify content introduction phrases - maintain consistency with system template formatting Signed-off-by: mingcheng <[email protected]>
Warning Rate limit exceeded@mingcheng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 50 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughUpdates add a debug log during model-name validation, adjust OpenAI client initialization to use CLI constants for user-agent and headers (including a new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as main.rs
participant OpenAI as src/openai.rs
Note over App,OpenAI: Build HTTP client with updated headers/UA
App->>OpenAI: request client build()
OpenAI->>OpenAI: import CMD/CMD_ABOUT/CMD_ABOUT_URL
OpenAI->>OpenAI: compose User-Agent = CMD + " " + CMD_ABOUT
OpenAI->>OpenAI: set default headers (HTTP-Referer, X-Title, X-Client-Type: CLI)
OpenAI-->>App: return configured client
sequenceDiagram
autonumber
participant User as CLI flow
participant Main as src/main.rs
Note over User,Main: model-name validation path
User->>Main: provide model name
Main->>Main: validate model name
Main-->>Main: debug log "the model name is `…`"
Main-->>User: continue existing flow (unchanged)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideEnhanced HTTP client identification with structured user-agent and custom headers, added debug logging for model name, updated documentation for semantic commits, and bumped version to 1.4.0. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the AI Git commit message generator to follow the Conventional Commits specification and improves system integration. The changes focus on standardizing commit message formatting, updating HTTP client headers, and adding documentation references.
- Rewrote system templates to enforce Conventional Commits specification with detailed formatting rules
- Enhanced HTTP client configuration with better user agent and additional headers
- Added semantic commit documentation references to README
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
templates/system.txt | Complete rewrite to implement Conventional Commits specification with detailed formatting rules and examples |
templates/user.txt | Updated instructional text for better clarity and context |
src/openai.rs | Enhanced HTTP client with improved user agent formatting and additional headers |
src/main.rs | Added debug logging for model name validation |
src/git.rs | Updated modification timestamp |
README.md | Added semantic commit references and updated description |
Cargo.toml | Version bump to 1.4.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Consider extracting the HTTP header setup (names and values) into constants or a helper method to avoid repetition and typos.
- It may be useful to include the client version in the User-Agent string so API providers can easily identify which version of the CLI is in use.
- Double-check the custom "HTTP-Referer" header name against the standard "Referer" header to ensure it’s being sent as intended.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the HTTP header setup (names and values) into constants or a helper method to avoid repetition and typos.
- It may be useful to include the client version in the User-Agent string so API providers can easily identify which version of the CLI is in use.
- Double-check the custom "HTTP-Referer" header name against the standard "Referer" header to ensure it’s being sent as intended.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
#12) Signed-off-by: mingcheng <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Update src/openai.rs Co-authored-by: Copilot <[email protected]> Update src/openai.rs Co-authored-by: Copilot <[email protected]>
Summary by Sourcery
Enhance client API integration with richer metadata and update project details for semantic commit messaging
Enhancements:
Build:
Documentation:
Summary by CodeRabbit