-
Notifications
You must be signed in to change notification settings - Fork 1
chore: close test gaps and add release docs for v0.6.0 #54
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [0.6.0] — 2026-07-27 | ||
|
|
||
| ### Added | ||
| - Multi-line comment and suggestion support (#46) | ||
| - Inject review summary into MR/PR description (#45) | ||
| - Platform-specific code suggestion rendering (#42) | ||
| - Opt-in resolve mode for previous review cleanup (`cleanup_mode`) (#43) | ||
| - GitLab Draft Notes for single-notification reviews | ||
| - GitHub VCS client and platform auto-detection (#35) | ||
| - GitHub Review API hardening against production edge cases (#41) | ||
|
|
||
| ### Changed | ||
| - Add `SubmitReview` to `VCSClient`, move orchestration into client | ||
| - Address tech debt from CodeRabbit reviews (#36, #37, #38, #39) | ||
|
|
||
| ### Fixed | ||
| - Clear `GITHUB_ACTIONS` in `ci_without_project_id` test | ||
|
|
||
| ## [0.5.2] — 2026-07-25 | ||
|
|
||
| ### Added | ||
| - 10 integration tests for end-to-end pipeline verification (#33) | ||
|
|
||
| ## [0.5.1] — 2026-07-25 | ||
|
|
||
| ### Added | ||
| - Pre-push hook with install/uninstall commands | ||
| - Core.hooksPath test coverage | ||
|
|
||
| ### Changed | ||
| - Reduce false positives with 5 prompt quality improvements | ||
|
|
||
| ### Fixed | ||
| - CI lint failures and CodeRabbit review findings | ||
|
|
||
| ## [0.5.0] — 2026-07-20 | ||
|
|
||
| ### Added | ||
| - `--fix` mode — auto-apply suggestions to working tree | ||
| - `--explain` mode — explain diffs instead of reviewing | ||
| - Two-pass intent-aware review (v0.6 preview) | ||
| - Auto-summary mode (`--summarize`) | ||
| - `REVIEW.md` — repo-level review instructions with highest prompt priority | ||
|
|
||
| ### Changed | ||
| - Consolidate fix tests into table-driven format | ||
|
|
||
| ### Fixed | ||
| - Improve suggestion quality with prompt rules and sanitization | ||
| - Critical bugs in suggestion sanitizer | ||
| - Unconditional count assertions and fail on `ReadFile` error | ||
| - Security: adversarial input guardrails + terminal sanitization |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -847,3 +847,130 @@ func TestGetPRChanges_PaginatedFiles(t *testing.T) { | |
| } | ||
| } | ||
|
|
||
| func TestGetDescription_Success(t *testing.T) { | ||
| srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| w.Header().Set("Content-Type", "application/json") | ||
| _, _ = w.Write([]byte(`{"body": "PR description"}`)) | ||
| })) | ||
| defer srv.Close() | ||
|
|
||
| client := NewClient(srv.URL, "token") | ||
| desc, err := client.GetDescription(context.Background(), "owner/repo", "1") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use cancellable test contexts instead of All four client calls in this test function use a non-cancellable root context. Use a cancellable test context here so request cancellation and deadlines can propagate through the HTTP requests. Also applies to: 883, 916, 957. 🤖 Prompt for AI Agents |
||
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| if desc != "PR description" { | ||
| t.Errorf("GetDescription() = %q, want 'PR description'", desc) | ||
| } | ||
| } | ||
|
|
||
| func TestSetDescription_Success(t *testing.T) { | ||
| var gotBody string | ||
| var gotMethod string | ||
| srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| gotMethod = r.Method | ||
| var req struct { | ||
| Body string `json:"body"` | ||
| } | ||
| _ = json.NewDecoder(r.Body).Decode(&req) | ||
| gotBody = req.Body | ||
| w.Header().Set("Content-Type", "application/json") | ||
| w.WriteHeader(http.StatusOK) | ||
| })) | ||
| defer srv.Close() | ||
|
|
||
| client := NewClient(srv.URL, "token") | ||
| err := client.SetDescription(context.Background(), "owner/repo", "1", "new desc") | ||
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| if gotMethod != http.MethodPatch { | ||
| t.Errorf("Method = %q, want PATCH", gotMethod) | ||
| } | ||
| if gotBody != "new desc" { | ||
| t.Errorf("Body = %q, want 'new desc'", gotBody) | ||
| } | ||
| } | ||
|
|
||
| func TestSubmitReview_MultiLine(t *testing.T) { | ||
| var gotReq CreateReviewRequest | ||
| srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| if r.Method == http.MethodGet { | ||
| w.Header().Set("Content-Type", "application/json") | ||
| _, _ = w.Write([]byte(`[]`)) | ||
| return | ||
| } | ||
| _ = json.NewDecoder(r.Body).Decode(&gotReq) | ||
| w.Header().Set("Content-Type", "application/json") | ||
| w.WriteHeader(http.StatusOK) | ||
| })) | ||
| defer srv.Close() | ||
|
|
||
| client := NewClient(srv.URL, "token") | ||
| req := vcs.SubmitReviewRequest{ | ||
| Summary: "Summary", | ||
| Comments: []vcs.ReviewComment{ | ||
| {Path: "a.go", Line: 10, EndLine: 15, Body: "msg1"}, | ||
| }, | ||
| } | ||
| err := client.SubmitReview(context.Background(), "owner/repo", "1", req) | ||
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
|
|
||
| if len(gotReq.Comments) != 1 { | ||
| t.Fatalf("expected 1 comment, got %d", len(gotReq.Comments)) | ||
| } | ||
| comment := gotReq.Comments[0] | ||
| if comment.Line != 15 { | ||
| t.Errorf("Line = %d, want 15", comment.Line) | ||
| } | ||
| if comment.StartLine == nil || *comment.StartLine != 10 { | ||
| t.Errorf("StartLine = %v, want 10", comment.StartLine) | ||
| } | ||
| if comment.Side != "RIGHT" { | ||
| t.Errorf("Side = %q, want RIGHT", comment.Side) | ||
| } | ||
| } | ||
|
|
||
| func TestSubmitReview_SingleLine(t *testing.T) { | ||
| var gotReq CreateReviewRequest | ||
| srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| if r.Method == http.MethodGet { | ||
| w.Header().Set("Content-Type", "application/json") | ||
| _, _ = w.Write([]byte(`[]`)) | ||
| return | ||
| } | ||
| _ = json.NewDecoder(r.Body).Decode(&gotReq) | ||
| w.Header().Set("Content-Type", "application/json") | ||
| w.WriteHeader(http.StatusOK) | ||
| })) | ||
| defer srv.Close() | ||
|
|
||
| client := NewClient(srv.URL, "token") | ||
| req := vcs.SubmitReviewRequest{ | ||
| Summary: "Summary", | ||
| Comments: []vcs.ReviewComment{ | ||
| {Path: "a.go", Line: 10, EndLine: 0, Body: "msg1"}, | ||
| }, | ||
| } | ||
| err := client.SubmitReview(context.Background(), "owner/repo", "1", req) | ||
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
|
|
||
| if len(gotReq.Comments) != 1 { | ||
| t.Fatalf("expected 1 comment, got %d", len(gotReq.Comments)) | ||
| } | ||
| comment := gotReq.Comments[0] | ||
| if comment.Line != 10 { | ||
| t.Errorf("Line = %d, want 10", comment.Line) | ||
| } | ||
| if comment.StartLine != nil { | ||
| t.Errorf("StartLine = %v, want nil", comment.StartLine) | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| if comment.Side != "RIGHT" { | ||
| t.Errorf("Side = %q, want RIGHT", comment.Side) | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.