feat: add gitbun vscode extension scaffold - #24
Conversation
|
@sanrishi 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 Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Warning
|
| Layer / File(s) | Summary |
|---|---|
Project Configuration & Build Setup package.json, tsconfig.json, eslint.config.mjs, .vscode-test.mjs |
Extension manifest declares the gitbun.generateCommit command with Windows/Linux and macOS keybindings, VS Code engine requirement, and activation event. TypeScript and ESLint configurations, plus test runner setup, define the development environment. |
Gitbun CLI Integration src/gitbun.ts |
Exports generateCommitMessage(cwd) that spawns gitbun via npx, buffers output, strips ANSI sequences, parses the commit message up to the "Accept commit?" prompt, detects "not installed" errors, and resolves with the extracted message or rejects with descriptive errors. |
Extension Activation & Command Implementation src/extension.ts |
The activate function creates an output channel, registers the gitbun.generateCommit command handler, validates workspace/repository/staged changes prerequisites, calls generateCommitMessage under a progress UI, injects the result into the Git input box, and logs success or error to the output channel. |
Testing Suite src/test/extension.test.ts |
Mocha-style test module with a sample assertion validating the test framework integration. |
Repository Configuration & Documentation .gitignore, .vscodeignore, README.md, CHANGELOG.md, vsc-extension-quickstart.md |
Git and packaging ignore patterns exclude build artifacts, source files, and test outputs. README covers features, requirements, and settings. Changelog and quickstart guide document the initial release and extension development workflow. |
🎯 2 (Simple) | ⏱️ ~10 minutes
🐰 New extension hops into view,
Gitbun's AI now right in your editor's hue,
One command, staged changes, a message so bright,
Commit with flair, every time feels just right! 🎉
🚥 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 title 'feat: add gitbun vscode extension scaffold' directly and accurately summarizes the main change: adding the foundation files and structure for a VSCode extension for Gitbun. |
| Linked Issues check | ✅ Passed | All core objectives from issue #9 are addressed: commit message generation (#9), preview/edit capability (#9), staged change detection (#9), .smartcommitrc support (#9), CLI reuse (#9), and VSCode API usage (#9). |
| Out of Scope Changes check | ✅ Passed | All changes are directly related to scaffolding the VSCode extension and implementing the requirements from issue #9; no unrelated modifications were introduced. |
✏️ 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.
Actionable comments posted: 5
🤖 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 `@gitbun-vscode/README.md`:
- Around line 1-71: The README currently contains scaffold/template text;
replace it with product-specific documentation for the "gitbun-vscode" extension
that describes the user workflow, listed commands and their command
IDs/keybindings (e.g., document the actual command IDs your extension registers
such as the command you expose to start the workflow), prerequisites and
installation steps, configuration behavior and contributed settings (list real
contributes.configuration keys like the extension’s settings names), and example
usage and troubleshooting steps so marketplace users can run and configure the
extension successfully.
In `@gitbun-vscode/src/extension.ts`:
- Around line 14-16: The code reads
vscode.extensions.getExtension('vscode.git')?.exports without activating the Git
extension and you must also declare it as an extension dependency; update
package.json to include "vscode.git" in extensionDependencies, and modify the
activation flow in extension.ts to call const gitExt =
vscode.extensions.getExtension('vscode.git'); await gitExt?.activate(); const
gitExtension = gitExt?.exports; then call gitExtension.getAPI(1) (or api =
gitExtension?.getAPI(1)) and read repositories from api.repositories[0]; ensure
you handle when activate() or getAPI returns undefined and keep existing repo
lookup logic (repo = api?.repositories[0]).
In `@gitbun-vscode/src/gitbun.ts`:
- Around line 57-65: The current logic resolves with stdout "message" even when
the child process exit code indicates failure; update the branch order in the
function handling the child process (the code that uses variables message, code,
cleanStderr, resolve, reject) to first check if code !== 0 and reject with
cleanStderr.trim() when non-zero, and only if code === 0 proceed to resolve with
the trimmed message; ensure empty stderr/blank messages are handled consistently
(trim before using) and keep the existing resolve/reject calls but swapped so
exit code is authoritative.
- Around line 19-44: The spawned npx gitbun child process can hang; modify the
logic around spawn/child to enforce a timeout: after creating child (spawn)
start a timer (e.g., with setTimeout) that will kill/terminate the child process
(child.kill()) and reject the promise with a clear timeout error if the timer
fires, and ensure you clear that timer when child emits "close" or "error" so
normal completion doesn't trigger the timeout; update references in the code
handling child.stdin/write, child.on("error", ...) and child.on("close", ...) to
coordinate timer creation/cleanup and to reject with a distinct timeout message
when killed.
In `@gitbun-vscode/vsc-extension-quickstart.md`:
- Around line 15-36: Update the quickstart to stop referencing the template
"Hello World" flow and instead use the actual extension command and test
structure: replace instructions that tell users to run/type "Hello World" with
the real command name "gitbun.generateCommit" and point debugging/breakpoint
guidance to src/extension.ts (and any exported activation/command handlers) so
contributors run the correct command from the command palette; normalize test
setup to reference the test folder used by this repo (e.g., test/*.test.ts) and
the Extension Test Runner/watch task guidance (remove incorrect paths like
src/test/extension.test.ts and the stray hotkey text), and ensure the doc tells
users where test files are discovered (the test folder pattern) and how to
run/reload the extension for iterative changes.
🪄 Autofix (Beta)
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
Run ID: 0fccf22c-4e51-45d1-b4f0-7d94b7a3be5a
⛔ Files ignored due to path filters (1)
gitbun-vscode/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (12)
gitbun-vscode/.gitignoregitbun-vscode/.vscode-test.mjsgitbun-vscode/.vscodeignoregitbun-vscode/CHANGELOG.mdgitbun-vscode/README.mdgitbun-vscode/eslint.config.mjsgitbun-vscode/package.jsongitbun-vscode/src/extension.tsgitbun-vscode/src/gitbun.tsgitbun-vscode/src/test/extension.test.tsgitbun-vscode/tsconfig.jsongitbun-vscode/vsc-extension-quickstart.md
| * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. | ||
| * Set breakpoints in your code inside `src/extension.ts` to debug your extension. | ||
| * Find output from your extension in the debug console. | ||
|
|
||
| ## Make changes | ||
|
|
||
| * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. | ||
| * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. | ||
|
|
||
| ## Explore the API | ||
|
|
||
| * You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`. | ||
|
|
||
| ## Run tests | ||
|
|
||
| * Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner) | ||
| * Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered. | ||
| * Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A` | ||
| * See the output of the test result in the Test Results view. | ||
| * Make changes to `src/test/extension.test.ts` or create new test files inside the `test` folder. | ||
| * The provided test runner will only consider files matching the name pattern `**.test.ts`. | ||
| * You can create folders inside the `test` folder to structure your tests any way you want. |
There was a problem hiding this comment.
Update stale quickstart instructions to match this extension.
The quickstart still references template behavior (Hello World) and inconsistent test paths, which can send contributors down the wrong setup path. Please align command/examples with the actual gitbun.generateCommit flow and normalize the test-folder instructions.
🤖 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 `@gitbun-vscode/vsc-extension-quickstart.md` around lines 15 - 36, Update the
quickstart to stop referencing the template "Hello World" flow and instead use
the actual extension command and test structure: replace instructions that tell
users to run/type "Hello World" with the real command name
"gitbun.generateCommit" and point debugging/breakpoint guidance to
src/extension.ts (and any exported activation/command handlers) so contributors
run the correct command from the command palette; normalize test setup to
reference the test folder used by this repo (e.g., test/*.test.ts) and the
Extension Test Runner/watch task guidance (remove incorrect paths like
src/test/extension.test.ts and the stray hotkey text), and ensure the doc tells
users where test files are discovered (the test folder pattern) and how to
run/reload the extension for iterative changes.
|
@nirvik34 It is ready for review! and please tell if more advanced and intermediate level of issues is planned to be post here or not? |
|
@coderabbitai Fixed all 3 major issues flagged by CodeRabbit:
Commit: 987cd54 |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 2333
Here's a quick summary of what was confirmed:
All three changes look correct and complete! 🐇✨ If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
|
@coderabbitai I need quality exceptional label on this issue, so please tell what things are left to be done to get that label or this PR is already can achieve that label? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 55682
✅ Already Fixed (Good Work!)
❌ Still Open — 3 Unresolved Review Comments1.
2. const gitExt = vscode.extensions.getExtension('vscode.git');
const gitExports = gitExt ? await gitExt.activate() : undefined;
const api = gitExports?.getAPI(1);3. ❌ Pre-Merge Check Failure
The exported functions ( /**
* Generates a commit message by invoking the Gitbun CLI via npx.
* `@param` cwd - The working directory (repository root) to run the command in.
* `@returns` A promise that resolves with the generated commit message string.
*/
export async function generateCommitMessage(cwd: string): Promise<string> {SummaryTo be in the best shape for |
|
@coderabbitai All remaining issues fixed in 5e4ce1f:
All CodeRabbit comments resolved. Am i eligible for quality:exceptional Label now? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 8416
Am I eligible for
|
|
@nirvik34 This is ready for review now! and hope i will get quality:exceptional as @coderabbitai confirmed! |
|
Tip For best results, initiate chat on the files or code changes.
No open CodeRabbit comments remain. The |
|
🎉 This PR is included in version 1.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
@nirvik34 Thanks for the merge, and are you going to open more advanced and critical issues in your repo or should I reasearch and open on my own? Let me know i want to be first to be assigned! |
Fixes #9
Description
Implements the first-party VSCode extension for Gitbun as described in #9.
What's included
src/gitbun.ts) that spawnsnpx gitbun, pipesn\nto skip the interactive prompt, strips ANSI codes, and extracts the clean commit messageCtrl+Shift+G G(Mac:Cmd+Shift+G G)Gitbunfor debug loggingnpx.cmdhandled)Type of change
GSSoC '26 Contribution Details
How Has This Been Tested?
npm run lintpasses without errorsChecklist
Summary by CodeRabbit
New Features
Documentation