Skip to content

Remove Spanish comments and align variable declarations - #130

Merged
livrasand merged 1 commit into
mainfrom
Remove-Spanish-comments-and-align-variable-declarations
Aug 1, 2026
Merged

Remove Spanish comments and align variable declarations#130
livrasand merged 1 commit into
mainfrom
Remove-Spanish-comments-and-align-variable-declarations

Conversation

@livrasand

@livrasand livrasand commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Eliminados comentarios en español de internal/http/handlers.go y router.go. Alineadas declaraciones de variables globales en handlers.go para mejorar legibilidad. Agregados parámetros de paginación (per_page, page) a funciones getTrendingGitHub, getTrendingGitLab y getTrendingCodeberg. Eliminado comentario HTML en README.md.

Summary by CodeRabbit

  • New Features

    • Added a Legal page combining approach, guidelines, and karma content.
    • Added a Popular repositories tab, sorted by stars, with loading and error states.
    • Added pagination controls for trending repository results.
  • Improvements

    • Trending and popular repository results are randomized for a more varied browsing experience.
    • Improved cleanup during temporary-directory test failures.
  • Documentation

    • Simplified README and internal documentation comments without changing application behavior.

Eliminados comentarios en español de internal/http/handlers.go y router.go. Alineadas declaraciones de variables globales en handlers.go para mejorar legibilidad. Agregados parámetros de paginación (per_page, page) a funciones getTrendingGitHub, getTrendingGitLab y getTrendingCodeberg. Eliminado comentario HTML en README.md.
@livrasand livrasand self-assigned this Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds paginated trending requests, a popular repository tab, randomized repository display, and a combined legal page. It also removes explanatory comments across backend and frontend files and adds cleanup paths in temporary-directory tests.

Changes

Trending pagination

Layer / File(s) Summary
Trending request pagination
internal/http/handlers.go
TrendingHandler validates per_page and page, then passes them to GitHub, GitLab, and Codeberg requests.

Backend routing and cleanup

Layer / File(s) Summary
Backend behavior preservation
internal/http/router.go, internal/jobs/*, internal/provider/*
Routes, job execution, retries, storage, and provider APIs remain unchanged while explanatory comments are removed.
Test and temporary-directory cleanup
internal/http/router_test.go, internal/jobs/*_test.go, internal/utils/temp_test.go
Existing assertions remain unchanged. Temporary-directory tests add cleanup on assertion failure and after verification.

Frontend navigation and repository discovery

Layer / File(s) Summary
Popular and trending repository views
web/index.html
A popular tab loads star-sorted repositories, truncates and shuffles results, and reports loading and error states. Trending results are shuffled before rendering.
Legal navigation page
web/index.html
The FAQ navigation entry becomes legal, whose content combines FAQ, guidelines, and karma content.
Repository page cleanup
web/repo.html
Comments are removed from styles, markup, loading, rendering, and interaction logic without changing behavior.
README markup cleanup
README.md
The <!-- Screenshots --> comment is removed. The screenshot block remains unchanged.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: gitgost-anonymous

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 clearly summarizes two main changes: removing Spanish comments and aligning variable declarations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Remove-Spanish-comments-and-align-variable-declarations

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.

@livrasand
livrasand merged commit 1be39e1 into main Aug 1, 2026
4 of 5 checks passed
@livrasand
livrasand deleted the Remove-Spanish-comments-and-align-variable-declarations branch August 1, 2026 18:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@internal/http/handlers.go`:
- Around line 3376-3383: The getTrendingGitLab language-backfill flow should
avoid unnecessary and excessive API calls for paginated results. Only initiate a
language request for projects whose Language is empty, and apply the same
backfill cap already used by searchGitLab; preserve existing behavior for
projects with populated languages and the surrounding pagination logic.

In `@internal/utils/temp_test.go`:
- Around line 75-81: The cleanup paths in the test must report failures from
both os.RemoveAll calls. Update the removal after the old-directory fallback and
the removal of recentDir in the Stat success branch to capture and check each
returned error, reporting failures through the test’s existing error mechanism
while preserving the current cleanup flow.
🪄 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 Plus

Run ID: 44542971-60e7-464a-bec3-6f1e873f659b

📥 Commits

Reviewing files that changed from the base of the PR and between 3e549c0 and a2fac4a.

⛔ Files ignored due to path filters (4)
  • web/assets/images/index-finger.svg is excluded by !**/*.svg
  • web/assets/images/surich.svg is excluded by !**/*.svg
  • web/assets/logos/gitgost-logo.svg is excluded by !**/*.svg
  • web/assets/sponsors/openbin.livrasand.com.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • README.md
  • internal/http/handlers.go
  • internal/http/router.go
  • internal/http/router_test.go
  • internal/jobs/clone.go
  • internal/jobs/clone_test.go
  • internal/jobs/jobs.go
  • internal/jobs/retry.go
  • internal/jobs/run.go
  • internal/jobs/store.go
  • internal/jobs/store_test.go
  • internal/provider/codeberg/codeberg.go
  • internal/provider/github/github.go
  • internal/provider/gitlab/gitlab.go
  • internal/provider/provider.go
  • internal/utils/temp_test.go
  • web/index.html
  • web/repo.html
💤 Files with no reviewable changes (10)
  • README.md
  • internal/provider/github/github.go
  • internal/jobs/clone_test.go
  • internal/provider/provider.go
  • internal/jobs/store.go
  • internal/jobs/retry.go
  • internal/provider/codeberg/codeberg.go
  • internal/provider/gitlab/gitlab.go
  • internal/jobs/clone.go
  • internal/jobs/store_test.go

Comment thread internal/http/handlers.go
Comment on lines +3376 to +3383
func getTrendingGitLab(sort string, perPage, page int) []gin.H {
results := []gin.H{}

var url string
if sort == "new" {
url = "https://gitlab.com/api/v4/projects?order_by=created_at&sort=desc&per_page=10"
url = fmt.Sprintf("https://gitlab.com/api/v4/projects?order_by=created_at&sort=desc&per_page=%d&page=%d", perPage, page)
} else {
url = "https://gitlab.com/api/v4/projects?order_by=star_count&sort=desc&per_page=10"
url = fmt.Sprintf("https://gitlab.com/api/v4/projects?order_by=star_count&sort=desc&per_page=%d&page=%d", perPage, page)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Limit GitLab language backfills for paginated responses.

With per_page=100, getTrendingGitLab starts a language request for every returned project at Lines 3425-3437. The semaphore limits concurrency, but one request can still make 100 additional API calls and wait through ten timeout batches. loadPopular makes this request path routine.

Only backfill projects with an empty Language, and cap the number of backfills as searchGitLab already does.

🤖 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 `@internal/http/handlers.go` around lines 3376 - 3383, The getTrendingGitLab
language-backfill flow should avoid unnecessary and excessive API calls for
paginated results. Only initiate a language request for projects whose Language
is empty, and apply the same backfill cap already used by searchGitLab; preserve
existing behavior for projects with populated languages and the surrounding
pagination logic.

Comment on lines +75 to +81
os.RemoveAll(oldDir)
}

// Check that recent directory still exists
if _, err := os.Stat(recentDir); os.IsNotExist(err) {
t.Errorf("Recent directory should still exist: %s", recentDir)
} else {
os.RemoveAll(recentDir) // cleanup
os.RemoveAll(recentDir)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Check both os.RemoveAll errors.

The fallback at Line 75 and the cleanup at Line 81 ignore removal failures. A failed removal can leave temporary directories and affect later tests. Report each error.

Proposed fix
-		os.RemoveAll(oldDir)
+		if err := os.RemoveAll(oldDir); err != nil {
+			t.Errorf("Failed to remove old directory: %v", err)
+		}
...
-		os.RemoveAll(recentDir)
+		if err := os.RemoveAll(recentDir); err != nil {
+			t.Errorf("Failed to remove recent directory: %v", err)
+		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
os.RemoveAll(oldDir)
}
// Check that recent directory still exists
if _, err := os.Stat(recentDir); os.IsNotExist(err) {
t.Errorf("Recent directory should still exist: %s", recentDir)
} else {
os.RemoveAll(recentDir) // cleanup
os.RemoveAll(recentDir)
if err := os.RemoveAll(oldDir); err != nil {
t.Errorf("Failed to remove old directory: %v", err)
}
}
if _, err := os.Stat(recentDir); os.IsNotExist(err) {
t.Errorf("Recent directory should still exist: %s", recentDir)
} else {
if err := os.RemoveAll(recentDir); err != nil {
t.Errorf("Failed to remove recent directory: %v", err)
}
🧰 Tools
🪛 golangci-lint (2.12.2)

[error] 75-75: Error return value of os.RemoveAll is not checked

(errcheck)

🤖 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 `@internal/utils/temp_test.go` around lines 75 - 81, The cleanup paths in the
test must report failures from both os.RemoveAll calls. Update the removal after
the old-directory fallback and the removal of recentDir in the Stat success
branch to capture and check each returned error, reporting failures through the
test’s existing error mechanism while preserving the current cleanup flow.

Source: Linters/SAST tools

@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: a2fac4aa66

ℹ️ 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 web/index.html
showSkeletons();
const container = document.getElementById('repo-list');
try {
const response = await fetch(`${API_BASE}/api/trending/all?sort=stars&per_page=100`);

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 Implement a real stars mode before wiring popular

When the new popular tab is opened, this requests sort=stars, but TrendingHandler only special-cases sort == "new"; every other value takes the existing GitHub trending path with a created:> cutoff for the last 30 days (internal/http/handlers.go:3307-3317). As a result, the popular tab excludes established high-star GitHub repositories while GitLab/Codeberg are sorted by all-time stars, so the cross-forge list is inconsistent. Either add a true stars mode without the GitHub recency cutoff or use one of the supported sorts.

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.

2 participants