feat(cli): added progress spinners - #21
Conversation
|
@SATYAM-PRATIBHAN is attempting to deploy a commit to the nirvik34's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
Analysis phase error handling and unified spinner flow src/index.ts |
Wraps diff enrichment, scope/type detection, summary generation, and initial commit-message generation in a try/catch with a shared ora spinner. commitMessage is now let to allow assignment and later AI enhancement; the AI enhancement step uses spinner.start() and reuses the same spinner instance. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- nirvik34/gitbun#13: Modifies the
run()pipeline insrc/index.tsand rewires parts of analysis and summary generation; code-level related.
Suggested labels
level: advanced, quality:clean
Suggested reviewers
- 2PieRadian
Poem
🐰 I spun a light to show the way,
One loop that hums through night and day,
Try catches hold what might fall through,
The commit grows wise, the spinner true,
A hop, a patch — the changes brew.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | 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 PR title 'feat(cli): added progress spinners' accurately reflects the main change of introducing spinner indicators throughout the CLI workflow. |
| Linked Issues check | ✅ Passed | The implementation adds ora spinners for all three key operations (analyzing changes, generating messages, AI enhancement) and wraps them in try-catch for error handling as required by issue #1. |
| Out of Scope Changes check | ✅ Passed | All changes are directly related to adding progress spinners; no unrelated modifications to other features or functionality are present in the changeset. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
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 @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/index.ts (1)
99-100:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLog the error for debuggability.
The catch block silently swallows the error from
enhanceCommit. When AI enhancement fails, developers have no error details to diagnose the issue.📝 Proposed fix to log the error
- } catch { + } catch (error) { spinner.fail("AI enhancement failed"); + console.error(error); }🤖 Prompt for 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. In `@src/index.ts` around lines 99 - 100, The catch block after enhanceCommit currently swallows errors; update the catch to capture the thrown error (e.g., catch (err)) and log the error details before or as part of spinner.fail — reference the enhanceCommit call and the spinner.fail("AI enhancement failed") usage in src/index.ts; ensure the logged output uses the existing logger or console.error to print the error stack/message for debugging.
🤖 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.
Outside diff comments:
In `@src/index.ts`:
- Around line 99-100: The catch block after enhanceCommit currently swallows
errors; update the catch to capture the thrown error (e.g., catch (err)) and log
the error details before or as part of spinner.fail — reference the
enhanceCommit call and the spinner.fail("AI enhancement failed") usage in
src/index.ts; ensure the logged output uses the existing logger or console.error
to print the error stack/message for debugging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 23a3bd4e-b1e0-4f86-ae66-bb8f86ce85c8
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/index.ts
|
@nirvik34 do review it once!!!, do tell if need any changes |
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
close #1
Description
This PR introduces interactive, visual progress indicators during slower CLI processes like analyzing git diffs, generating structured commit messages, and communicating with LLM/AI endpoints (such as Ollama).
Previously, Gitbun worked silently in the background during these processes, which could feel like the terminal was hanging or frozen, especially with large diffs or slow local model inferences. We now provide real-time status updates using
ora.Changes
orastatus spinners for:Analyzing staged changes...Generating commit message...Enhancing commit with AI (<model>)....succeed()or.fail()) before proceeding to the interactive commit prompt so it doesn't pollute the prompt layout..fail()) if any background operation fails, showing an accurate failure state before exiting.Verification / Testing
Tested the CLI locally to verify the visual flows:
Summary by CodeRabbit
Refactor
Bug Fixes