Skip to content

Restore Code AI and PR Review Options - #8

Merged
SayanthRock merged 1 commit into
mainfrom
jules-restore-ai-features-12448723504427470280
Aug 8, 2026
Merged

Restore Code AI and PR Review Options#8
SayanthRock merged 1 commit into
mainfrom
jules-restore-ai-features-12448723504427470280

Conversation

@SayanthRock

@SayanthRock SayanthRock commented Aug 8, 2026

Copy link
Copy Markdown
Owner

User description

Reverts the commit that removed Code AI and PR Review options as requested by the user.


PR created automatically by Jules for task 12448723504427470280 started by @SayanthRock


CodeAnt-AI Description

Restore Code AI and PR Review features

What Changed

  • Adds a Code AI screen where users can securely save a GitHub token, analyze a file from a raw or blob URL, view the AI explanation, copy it, and reset the result
  • Adds a PR Review screen that fetches a GitHub pull request diff and generates an AI summary covering key changes, risks, testing, and release notes
  • Restores Code AI and PR Review navigation alongside Image Studio and About
  • Shows loading and clear error states during file and pull request analysis

Impact

✅ AI explanations for GitHub code files
✅ Pull request summaries without manual diff review
✅ Copyable analysis results

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Added AI-powered code analysis for GitHub files, with secure token entry, loading, error, and result states.
    • Added pull request review functionality using repository and pull request details.
    • Added options to copy analysis results or save them as text files.
    • Added dedicated Code AI and PR Review sections to the home screen.
  • Bug Fixes

    • Added validation and clear error handling for missing credentials, invalid inputs, and failed requests.
  • Tests

    • Added coverage for view model creation and pull request review scenarios.

Co-authored-by: SayanthRock <202829406+SayanthRock@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 8, 2026 18:45
@devloai

devloai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@ai-coding-guardrails

Copy link
Copy Markdown

You've hit your review limit for the week, but don't worry you'll get some more next week!

Contact us at hello@zenable.io if you want this rate limit to go away

@codeant-ai

codeant-ai Bot commented Aug 8, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 3d6cfe2 Aug 08, 2026 · 18:45 18:47

@performance-testing-bot

Copy link
Copy Markdown

Unable to locate .performanceTestingBot config file

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The application adds GitHub-backed code analysis and pull request review features. It configures authenticated Retrofit services, sends sanitized source or diff content to Pollinations AI, exposes analysis states through ViewModels, and adds Compose screens with navigation, copy, save, reset, and validation behavior.

Changes

AI review features

Layer / File(s) Summary
GitHub and Pollinations API contracts
app/src/main/java/com/sayanthrock/freeairock/data/ai/*, app/src/main/java/com/sayanthrock/freeairock/data/github/*
New Retrofit services, request models, GitHub response models, and CodeAnalysisState define the review data flow.
Analysis orchestration
app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt, app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt, app/src/main/java/com/sayanthrock/freeairock/ui/ReviewViewModel.kt
The analyzer builds bounded prompts and handles fallback responses. The ViewModels fetch GitHub content, invoke analysis, validate inputs, and publish operation states.
Analysis and review screens
app/src/main/java/com/sayanthrock/freeairock/ui/CodeResultScreen.kt, app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt, app/src/main/java/com/sayanthrock/freeairock/ui/navigation/Screen.kt
Compose screens collect inputs, render idle/loading/success/error states, support clipboard copying, save analysis results, and register new destinations.
Application wiring and validation
app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt, app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModelFactory.kt, app/src/main/java/com/sayanthrock/freeairock/ui/HomeScaffold.kt, app/src/test/java/com/sayanthrock/freeairock/*
MainActivity configures authenticated services and connects both features to navigation. Tests cover factory creation and review input errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the restoration of the Code AI and PR Review options.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-restore-ai-features-12448723504427470280

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

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Aug 8, 2026
Comment thread app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/ReviewViewModel.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt`:
- Around line 64-74: The generateText method currently converts Pollinations
request exceptions into successful text output, preventing the existing
CodeAnalysisState.Error handling in AppViewModel and ReviewViewModel. Update
generateText to propagate exceptions from pollinationsApiService.generateText
instead of catching them as analyzer text; preserve the fallback only for valid
blank responses.

In
`@app/src/main/java/com/sayanthrock/freeairock/data/ai/PollinationsApiService.kt`:
- Around line 16-20: Update PollinationsApiService.generateText to POST to
/v1/chat/completions and return the appropriate chat-completion DTO instead of a
raw String. Define or reuse DTOs for choices, message, and content, then update
AiCodeAnalyzer to use choices.firstOrNull()?.message?.content as the analysis
result while handling a missing choice/content appropriately.

In
`@app/src/main/java/com/sayanthrock/freeairock/data/github/GitHubApiService.kt`:
- Around line 18-23: Update getRepositoryContent to support GitHub’s object
response for files and array response for directories, either by separating file
and directory endpoints with appropriate return types or by introducing a shared
response model that decodes both shapes; preserve the existing owner, repo, and
encoded path parameters.

In `@app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt`:
- Around line 60-68: The OkHttp interceptor currently adds the GitHub token to
every request, including arbitrary URLs used by
githubApiService.downloadRawFile. Restrict Authorization header injection to
GitHub API requests, and route raw file downloads through an unauthenticated
client while preserving authenticated calls to githubApiService’s API methods.

In `@app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt`:
- Around line 40-43: Bound downloaded response bodies before calling
ResponseBody.string(): in AppViewModel.kt lines 40-43 and ReviewViewModel.kt
lines 30-32, read each raw file and diff with a byte limit on an I/O dispatcher,
then pass only the bounded text to the analyzer. Ensure both raw-code and diff
inputs are capped before materialization while preserving the existing analyzer
flows.

In `@app/src/main/java/com/sayanthrock/freeairock/ui/CodeResultScreen.kt`:
- Around line 176-183: Update saveTextToFile so a null result from
context.contentResolver.openFileDescriptor returns "Save failed: unable to open
selected document" immediately, without creating FileOutputStream; preserve the
existing successful write and "Saved successfully" behavior when the descriptor
opens.

In `@app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt`:
- Around line 97-100: Update the Button enabled condition in ReviewScreen so it
is disabled while loading or whenever ownerText, repoText, or prNumberText is
blank; enable it only when all three inputs are non-whitespace.

In `@app/src/test/java/com/sayanthrock/freeairock/ui/ReviewViewModelTest.kt`:
- Around line 46-50: Update the test around ReviewViewModel.run so it verifies
the intended failure source: either rename `missing Gemini key updates state to
Error` to describe the unstubbed GitHub diff failure, or stub
`githubApiService.getPullRequestDiff` and assert the credential-specific error
behavior. Ensure the assertion distinguishes the expected cause rather than only
checking the generic `CodeAnalysisState.Error` type.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78f0414d-082a-4262-95cc-f2c1b09304b5

📥 Commits

Reviewing files that changed from the base of the PR and between 982ed1a and 3d6cfe2.

📒 Files selected for processing (16)
  • app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/ai/AiCodeAnalyzer.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/ai/CodeAnalysisState.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/ai/PollinationsApiService.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/github/GitHubApiService.kt
  • app/src/main/java/com/sayanthrock/freeairock/data/github/GitHubModels.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModelFactory.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/CodeResultScreen.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/HomeScaffold.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ReviewViewModel.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/navigation/Screen.kt
  • app/src/test/java/com/sayanthrock/freeairock/MainDispatcherRule.kt
  • app/src/test/java/com/sayanthrock/freeairock/ui/AppViewModelFactoryTest.kt
  • app/src/test/java/com/sayanthrock/freeairock/ui/ReviewViewModelTest.kt

Comment thread app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/AppViewModel.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/CodeResultScreen.kt
Comment thread app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt
@SayanthRock
SayanthRock merged commit 0d75e00 into main Aug 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants