Skip to content

Feat add anonymous pr comment system with karma tracking and UI integration - #48

Merged
livrasand merged 4 commits into
mainfrom
feat--add-anonymous-PR-comment-system-with-karma-tracking-and-UI-integration
Feb 23, 2026
Merged

Feat add anonymous pr comment system with karma tracking and UI integration#48
livrasand merged 4 commits into
mainfrom
feat--add-anonymous-PR-comment-system-with-karma-tracking-and-UI-integration

Conversation

@livrasand

@livrasand livrasand commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added PR hash-based updates—push follow-up commits to existing pull requests using a deterministic hash identifier.
    • Introduced "Update PR" terminal tab in the web interface for managing PR updates.
    • Added anonymous PR comment functionality for posting comments on existing pull requests.
    • Display PR hash in success messages and terminal output for easy reference.
  • Bug Fixes

    • Improved PR lifecycle logic to distinguish between updating and creating new pull requests.

…gration

Agregado endpoint POST /v1/gh/:owner/:repo/pulls/:number/comments/anonymous para comentarios anónimos en Pull Requests. Implementada función CreateAnonymousPRComment() en internal/github/pr.go usando issues comments endpoint. Creado handler CreateAnonymousPRCommentHandler con validación de karma, cooldown por reportes y generación de hash anónimo. Agregada pestaña "PR Comment" en sección de issues con formulario compl
…th preventDefault

Cambiado event listener de botón submit a formulario completo en sección de PR comments. Agregado preventDefault() para evitar recarga de página durante envío de comentarios anónimos.
…ing and force-push support

Agregado sistema de actualización de PRs mediante pr-hash determinístico generado desde owner/repo/branch. Implementada función GeneratePRHash() en internal/github/pr.go usando SHA256 truncado a 8 caracteres. Creada función GetExistingPR() para verificar existencia de rama y PR abierto asociado. Modificado PushToGitHub() para aceptar targetBranch opcional y usar force-push cuando se actualiza rama
@livrasand livrasand self-assigned this Feb 23, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdcb1ea and 2c3d756.

📒 Files selected for processing (6)
  • internal/git/git_test.go
  • internal/git/push.go
  • internal/git/receive.go
  • internal/github/pr.go
  • internal/http/handlers.go
  • web/index.html

📝 Walkthrough

Walkthrough

This pull request introduces a PR hash tracking feature to enable updating existing pull requests instead of creating new ones. Changes span Git operations (modified function signatures to accept target branches and extract PR hashes), GitHub API helpers (deterministic hash generation and PR lookup), HTTP handlers (conditional PR update/creation logic), and frontend UI (PR update workflows and comment features).

Changes

Cohort / File(s) Summary
Git Function Signatures
internal/git/git_test.go, internal/git/push.go, internal/git/receive.go
Updated PushToGitHub to accept targetBranch parameter and conditionally apply force-push. Enhanced ReceivePack and ExtractPackfile to extract and return PR hash from push-option metadata alongside existing return values.
GitHub PR Management
internal/github/pr.go
Added GeneratePRHash to compute deterministic SHA-256-based 8-character hashes from owner/repo/branch. Added GetExistingPR to check fork branch existence and query for open PRs matching fork branch head.
HTTP Handler Integration
internal/http/handlers.go
Extended ReceivePack flow to surface PR hash and implement conditional branching: reuse existing PR when hash maps to existing branch, or create new PR; generate deterministic outbound PR hash for success responses; updated sideband messages with PR URL, branch, and hash instructions.
Frontend UI
web/index.html
Added Update PR terminal tab with hidden panel. Introduced Anonymous PR Comment form with owner/repo/PR number/token fields. Extended terminal output rendering for hash highlights. Added persistent PR updates description card in features section.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Handler as HTTP Handler
    participant Git as Git Ops
    participant GitHub as GitHub API
    
    Client->>Handler: Push code with pr-hash
    Handler->>Git: Call ReceivePack
    Git->>Git: ExtractPackfile<br/>(extract pr-hash)
    Git-->>Handler: newSHA, commitMsg, prHash, err
    
    alt PR Hash Provided & Branch Exists
        Handler->>GitHub: GetExistingPR<br/>(check for open PR)
        GitHub-->>Handler: existingPRURL
        Handler->>Git: PushToGitHub<br/>(targetBranch)
        Git-->>Handler: Pushed to existing branch
        Handler-->>Client: PR Updated<br/>(reuse existing PR)
    else New PR Flow
        Handler->>Git: PushToGitHub<br/>(auto-generate branch)
        Git-->>Handler: Pushed to new branch
        Handler->>GitHub: Create PR
        GitHub-->>Handler: PR created
        Handler->>Handler: GeneratePRHash<br/>(outPRHash)
        Handler-->>Client: PR Created<br/>(with prHash)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • gitgost-anonymous

Poem

🐰 With hashes bright and branches true,
The rabbit's PRs find their crew,
No longer lost in endless streams,
Updates flow like carrot dreams,
Force-push magic makes it gleam! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding an anonymous PR comment system with karma tracking and UI integration, which aligns with the substantial code additions across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat--add-anonymous-PR-comment-system-with-karma-tracking-and-UI-integration

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 and usage tips.

@livrasand livrasand linked an issue Feb 23, 2026 that may be closed by this pull request
6 tasks
@livrasand
livrasand merged commit 83768ef into main Feb 23, 2026
@livrasand
livrasand deleted the feat--add-anonymous-PR-comment-system-with-karma-tracking-and-UI-integration branch February 23, 2026 14:12
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.

[FEATURE] Persistent PR Updates via PR Hash

2 participants