Skip to content

test: add comprehensive E2E tests for git clone/fetch operations and … - #33

Merged
livrasand merged 1 commit into
mainfrom
add-comprehensive-E2E-tests-for-git-clone/fetch-operations-and-upload-pack-handlers
Feb 19, 2026
Merged

test: add comprehensive E2E tests for git clone/fetch operations and …#33
livrasand merged 1 commit into
mainfrom
add-comprehensive-E2E-tests-for-git-clone/fetch-operations-and-upload-pack-handlers

Conversation

@livrasand

@livrasand livrasand commented Feb 19, 2026

Copy link
Copy Markdown
Owner

…upload-pack handlers

Agregado archivo e2e_test.go con helpers gitCmd(), requireGit(), mockGitHubUploadPack() y mustGitInit() para simular repositorios Git reales. Implementados tests E2E: TestE2E_InfoRefs_UploadPack (verifica advertisement de git-upload-pack), TestE2E_GitClone (valida clone completo con mock de GitHub), TestE2E_GitFetch (prueba fetch desde repo clonado), TestE2E_InfoRefs_UnsupportedService (valida rechazo de servicios desconoc

Summary by CodeRabbit

  • New Features

    • Added Git upload-pack support enabling git clone and fetch operations via the proxy.
    • Implemented theme toggle with dark/light mode and persistent state.
    • Added markdown editor with live preview for issues and comments.
    • Introduced dynamic badge generator for contributors.
    • Added "Fetch & Pull Support" to features section.
  • UI/Style

    • Redesigned interface with improved colors, spacing, and visual hierarchy.
    • Enhanced issue creation and commenting forms with structured layouts.
    • Improved terminal UI with tab-driven navigation.

…upload-pack handlers

Agregado archivo e2e_test.go con helpers gitCmd(), requireGit(), mockGitHubUploadPack() y mustGitInit() para simular repositorios Git reales. Implementados tests E2E: TestE2E_InfoRefs_UploadPack (verifica advertisement de git-upload-pack), TestE2E_GitClone (valida clone completo con mock de GitHub), TestE2E_GitFetch (prueba fetch desde repo clonado), TestE2E_InfoRefs_UnsupportedService (valida rechazo de servicios desconoc
@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR adds Git upload-pack support to the HTTP proxy, enabling Git clone and fetch operations with GitHub authentication. It includes end-to-end tests, unit tests, new routes, and a comprehensive web UI redesign featuring theme support, markdown editor, and badge generator.

Changes

Cohort / File(s) Summary
Git Upload-Pack Support
internal/http/handlers.go, internal/http/router.go
Added UploadPackDiscoveryHandler and UploadPackHandler with GitHub token-based authentication, 30-second HTTP client timeout, and 50 MB body limit. Introduced basicAuth helper and adjusted side-band protocol responses. Routes registered for both discovery (/info/refs) and upload-pack operations (POST /git-upload-pack).
Upload-Pack Testing
internal/http/e2e_test.go, internal/http/handlers_upload_test.go
Added comprehensive end-to-end tests for git clone/fetch via proxy with mock GitHub server and temporary Git repository. Unit tests validate authentication, token handling, proxying behavior, and routing for upload-pack vs receive-pack services.
Web UI Redesign
web/index.html
Complete redesign with light/dark theme support, tab-driven anonymous issues interface, markdown editor with live preview, dynamic badge generator with copy functionality, new "Fetch & Pull Support" feature card, and responsive mobile layout improvements.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client (Git)
    participant Router as Proxy Router
    participant Handler as UploadPackHandler
    participant Auth as Auth Logic
    participant GitHub as GitHub API
    participant Response as Git Stream Response

    Client->>Router: POST /git-upload-pack<br/>(with upload-pack data)
    Router->>Handler: Route to UploadPackHandler
    Handler->>Auth: Check GITHUB_TOKEN
    Auth-->>Handler: Token retrieved
    Handler->>Handler: Set Authorization header<br/>(basicAuth)
    Handler->>Handler: Enforce 50MB body limit
    Handler->>GitHub: Forward request<br/>(with auth header)
    GitHub-->>Handler: Git response data
    Handler->>Response: Stream response back
    Response-->>Client: Git pack data
    Client->>Client: Process git objects
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Suggested reviewers

  • gitgost-anonymous

Poem

🐰 Hops of joy through Git's new door,
Upload-pack and fetch galore!
Themes that dance in dark and light,
Badges shine so crisp and bright.
A proxy swift, a UI grand—
This little rabbit helped it stand! 🌟

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-comprehensive-E2E-tests-for-git-clone/fetch-operations-and-upload-pack-handlers

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 merged commit 20c451d into main Feb 19, 2026
1 check was pending
@livrasand
livrasand deleted the add-comprehensive-E2E-tests-for-git-clone/fetch-operations-and-upload-pack-handlers branch February 19, 2026 00:30
@livrasand livrasand linked an issue Feb 19, 2026 that may be closed by this pull request
5 tasks
@livrasand livrasand self-assigned this Feb 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a0cda9b5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/http/router.go
gh.POST("/:owner/:repo/git-receive-pack", ReceivePackHandler)

// Git Smart HTTP - upload-pack (fetch/pull)
gh.POST("/:owner/:repo/git-upload-pack", UploadPackHandler)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow anonymous access to git-upload-pack

Registering /:owner/:repo/git-upload-pack inside the /v1 group makes it pass through anonymousAuthMiddleware, but that middleware only bypasses auth for git-receive-pack and info/refs. In deployments where GITGOST_API_KEY is set, every clone/fetch request will fail on the POST phase with 401 unless clients send X-Gitgost-Key, which standard Git clone/fetch flows do not send by default.

Useful? React with 👍 / 👎.

Comment thread internal/http/handlers.go
"github.com/gin-gonic/gin"
)

var uploadPackClient = &http.Client{Timeout: 30 * time.Second}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove hard 30s timeout from upload-pack proxying

Using a single http.Client{Timeout: 30 * time.Second} for upload-pack can terminate valid clone/fetch operations for large repos or slower networks, because this timeout applies to the entire upstream request/response transfer (including streaming the packfile body). That makes fetch reliability dependent on finishing within 30 seconds rather than on connection health.

Useful? React with 👍 / 👎.

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] Add Support for Fetch and Pull Operations

2 participants