Skip to content

Feature/remote repo support#8

Merged
kratos06 merged 4 commits intomasterfrom
feature/remote-repo-support
Apr 27, 2025
Merged

Feature/remote repo support#8
kratos06 merged 4 commits intomasterfrom
feature/remote-repo-support

Conversation

@kratos06
Copy link
Copy Markdown
Owner

@kratos06 kratos06 commented Apr 27, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a new command to evaluate all commits in a repository within a specified date range, grouped by author, with support for GitHub and GitLab platforms.
    • Generates individual reports per committer and a summary report with links to each.
  • Bug Fixes
    • Improved error handling to continue evaluations even if one committer's evaluation fails.
  • Documentation
    • Updated usage instructions and examples for the new repository evaluation feature.
    • Added a "TODO" section outlining planned improvements.
  • Style
    • Enhanced report formatting, including special formatting for adjustment notes.
  • Chores
    • Added extensive logging throughout the application for better traceability and debugging.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce comprehensive logging across the codebase, particularly focusing on tracking LLM interactions, API responses, and evaluation processes. A new CLI subcommand, repo-eval, is added to enable repository-wide evaluation of all commits within a specified date range, grouped by author, and supporting GitHub, GitLab, and (planned) local repositories. Documentation is updated to reflect these features and provide usage examples. Numerous functions and methods are enhanced with detailed info, debug, and error logs for better traceability and diagnostics. Automatic score adjustment logic is disabled to preserve original LLM outputs, and the markdown report generation is updated to highlight any adjustment notes.

Changes

File(s) Change Summary
UPDATES.md Updated documentation to add repo-eval command, usage examples, new evaluation step, renumbered sections, and a TODO list for future improvements.
codedog/utils/code_evaluator.py Added detailed logging of LLM prompts/responses, enhanced score validation and comment extraction, disabled automatic score adjustment, and updated markdown generation to highlight adjustment notes. Added log_llm_interaction utility function.
codedog/utils/langchain_utils.py Added info and debug logs for DeepSeek API responses, including token usage and cost reporting, without changing control flow or error handling.
run_codedog.py Added comprehensive logging throughout; introduced repo-eval CLI subcommand for repository-wide evaluation; added functions for fetching and evaluating commits per author; enhanced error handling and report generation; updated argument parsing and usage.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant RepoEvaluator
    participant LLM
    participant Logger
    participant Emailer

    User->>CLI: Run `repo-eval` command
    CLI->>RepoEvaluator: Parse arguments and initialize evaluation
    RepoEvaluator->>Logger: Log evaluation start and parameters
    RepoEvaluator->>RepoEvaluator: Fetch all commits by author/date/platform
    loop For each committer
        RepoEvaluator->>Logger: Log committer evaluation start
        loop For each commit
            RepoEvaluator->>LLM: Evaluate commit (prompt)
            LLM-->>RepoEvaluator: Return evaluation result
            RepoEvaluator->>Logger: Log prompt and response
        end
        RepoEvaluator->>Logger: Log committer report saved
    end
    RepoEvaluator->>Logger: Log summary report generation
    RepoEvaluator->>Emailer: (Optional) Send summary report
    RepoEvaluator->>CLI: Return/report completion
Loading

Poem

In the warren of code, the logs now bloom,
Each prompt and reply, in files they find room.
With repo-eval hopping from commit to commit,
Every bunny’s report is saved—bit by bit!
No more secret scores, no silent reviews,
The rabbit logs all, in carrots and clues.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95a63eb and 06ab3b7.

📒 Files selected for processing (4)
  • UPDATES.md (3 hunks)
  • codedog/utils/code_evaluator.py (30 hunks)
  • codedog/utils/langchain_utils.py (1 hunks)
  • run_codedog.py (13 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kratos06 kratos06 merged commit e790a18 into master Apr 27, 2025
1 of 3 checks passed
@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
codedog
   analyze_code.py19190%6–74
   localization.py17288%17, 30
codedog/actors/reporters
   code_review.py1074360%48–92, 96–111, 116, 144, 146, 148, 150, 157
codedog/chains/code_review
   base.py643152%34, 42, 50, 57–72, 79–94, 100–111, 114–117, 122–125, 135
   translate_code_review_chain.py48480%1–103
codedog/chains/pr_summary
   base.py822076%54, 62, 70, 96–116, 133–136, 178–180, 194–201
   translate_pr_summary_chain.py603542%40–49, 61–69, 77–85, 91–96, 101–117, 120–130, 135–151
codedog/retrievers
   github_retriever.py1004159%79, 87, 94–95, 98–99, 102, 111–114, 130–134, 150–151, 154, 163–167, 172–179, 197, 202, 205–209, 217–222, 225–228, 231, 242, 252
   gitlab_retriever.py1197636%43–56, 62, 66, 70, 74, 78, 81–85, 88–92, 95, 104, 116, 124–141, 146–149, 155–163, 166–176, 179–203, 206–212, 216, 219–226, 234, 237–240, 243, 254–255, 258
codedog/templates
   optimized_code_review_prompt.py990%8–259
codedog/utils
   code_evaluator.py136813680%1–3286
   email_utils.py705916%31–49, 71–113, 134–158
   git_hooks.py45450%1–146
   git_log_analyzer.py1701700%1–448
   langchain_utils.py23718622%25–41, 64, 68, 78–152, 162–305, 315, 322–343, 350–371, 378–399, 405–416, 422–433, 455–485
   remote_repository_analyzer.py1051050%1–248
TOTAL3058225726% 

Tests Skipped Failures Errors Time
46 1 💤 1 ❌ 1 🔥 4.072s ⏱️

@kratos06 kratos06 deleted the feature/remote-repo-support branch April 27, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant