Skip to content

Add openIssuesCount to RepoResponse#8

Merged
rainxchzed merged 1 commit intomainfrom
add-open-issues-count
May 4, 2026
Merged

Add openIssuesCount to RepoResponse#8
rainxchzed merged 1 commit intomainfrom
add-open-issues-count

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

Summary

Surface a repo's open-issues count on the details screen + everywhere else RepoResponse is returned. No new endpoint, no pagination -- the count rides on the existing repo response shape.

GitHub's open_issues_count includes both open issues AND open PRs (GitHub treats PRs as a kind of issue). Same number the GitHub website shows on the Issues tab. Documented in the field comment + the client integration guide so the client UI labels it correctly ("Issues" not "Bugs").

Changes

Per CLAUDE.md's RepoResponse-fan-out checklist:

  • db/migration/V14__open_issues_count.sql -- adds open_issues INT NOT NULL DEFAULT 0. Idempotent (ADD COLUMN IF NOT EXISTS).
  • db/DatabaseFactory.kt -- registers V14 in the migrations list.
  • db/Tables.kt -- Exposed column on Repos.
  • model/RepoResponse.kt -- new openIssuesCount: Int = 0 field.
  • db/RepoRepository.kt -- maps the column on every category/topic/repo DB read.
  • db/MeilisearchClient.kt -- adds open_issues to MeiliRepoHit.
  • ingest/GitHubSearchClient.kt -- new field on GitHubRepo (deserialized from GitHub's open_issues_count), upsert writes it to Postgres, sync writes it to Meili, RepoWithRelease.toRepoResponse carries it.
  • routes/RepoRoutes.kt -- toMetadataOnlyResponse() (lazy-fetch path) carries it.
  • routes/SearchRoutes.kt -- MeiliRepoHit.toRepoResponse() carries it.

Existing curated rows have open_issues = 0 until any of the four write paths fires:

  1. Search-passthrough ingest (immediate for any repo searched / explored)
  2. POST /v1/repo/{o}/{n}/refresh (immediate when user taps refresh)
  3. RepoRefreshWorker hourly cycle (passthrough rows by oldest indexed_at)
  4. Daily Python fetcher (after fetcher repo's db_writer.py + meili_sync.py are updated)

The Python fetcher repo update is not in this PR -- it lives in a separate repo. Backend is forward-compatible: rows update gracefully as they're touched.

Client integration

docs/client/open-issues-count.md -- standalone guide for the client coding agent. Covers the field shape, display recommendations, backwards compatibility (Int = 0 default + ignoreUnknownKeys), and what NOT to wire (no separate list endpoint, no pagination).

Test plan

  • ./gradlew test -- all suites green.
  • After deploy, hit /v1/repo/sindresorhus/refined-github -- expect openIssuesCount field present in JSON.
  • Hit a curated repo: value will be 0 until refreshed; POST .../refresh then re-fetch -- expect non-zero.
  • Verify Meili sync still produces valid documents (search continues to work post-deploy).
  • Update Python fetcher in a follow-up PR to write open_issues_count from the GitHub response into Postgres + propagate via meili_sync.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@rainxchzed has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 15 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16f12fff-3e4d-43eb-a96a-899fbe889c0e

📥 Commits

Reviewing files that changed from the base of the PR and between 82f785a and b90def2.

📒 Files selected for processing (11)
  • CLAUDE.md
  • docs/client/open-issues-count.md
  • src/main/kotlin/zed/rainxch/githubstore/db/DatabaseFactory.kt
  • src/main/kotlin/zed/rainxch/githubstore/db/MeilisearchClient.kt
  • src/main/kotlin/zed/rainxch/githubstore/db/RepoRepository.kt
  • src/main/kotlin/zed/rainxch/githubstore/db/Tables.kt
  • src/main/kotlin/zed/rainxch/githubstore/ingest/GitHubSearchClient.kt
  • src/main/kotlin/zed/rainxch/githubstore/model/RepoResponse.kt
  • src/main/kotlin/zed/rainxch/githubstore/routes/RepoRoutes.kt
  • src/main/kotlin/zed/rainxch/githubstore/routes/SearchRoutes.kt
  • src/main/resources/db/migration/V14__open_issues_count.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-open-issues-count

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
Review rate limit: 0/1 reviews remaining, refill in 22 minutes and 15 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@rainxchzed rainxchzed merged commit 3d426de into main May 4, 2026
2 checks passed
@rainxchzed rainxchzed deleted the add-open-issues-count branch May 4, 2026 16:30
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.

1 participant