Skip to content

feat: cli to reindex elastic guests index#259

Merged
Dao-Ho merged 5 commits intomainfrom
dao/cmd-to-reindex-guests
Apr 4, 2026
Merged

feat: cli to reindex elastic guests index#259
Dao-Ho merged 5 commits intomainfrom
dao/cmd-to-reindex-guests

Conversation

@Dao-Ho
Copy link
Copy Markdown
Contributor

@Dao-Ho Dao-Ho commented Apr 4, 2026

Adds a reindex-guests CLI command that backfills OpenSearch from Postgres.

  • AllGuestDocuments on GuestsRepository — cursor-paginated iter.Seq2 generator, yields one doc at a time without loading the full table into memory
  • BulkIndexGuests on OpenSearchGuestsRepository — sends a batch as a single NDJSON BulkRequest, surfaces per-document errors from the response
  • CLI accumulates docs into 100-doc batches and flushes via bulk index, so DB reads and OpenSearch writes are both paged
  • Documents the pattern in CLAUDE.md
image

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 0% with 133 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.20%. Comparing base (8b18b59) to head (79bede8).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
backend/internal/repository/guests.go 0.00% 61 Missing ⚠️
backend/internal/repository/guests_opensearch.go 0.00% 40 Missing ⚠️
backend/cmd/cli/guests.go 0.00% 32 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
- Coverage   19.82%   18.20%   -1.63%     
==========================================
  Files          40       41       +1     
  Lines        1493     1626     +133     
==========================================
  Hits          296      296              
- Misses       1193     1326     +133     
  Partials        4        4              
Flag Coverage Δ
backend 18.20% <0.00%> (-1.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/cmd/cli/main.go 0.00% <ø> (ø)
backend/cmd/cli/guests.go 0.00% <0.00%> (ø)
backend/internal/repository/guests_opensearch.go 0.00% <0.00%> (ø)
backend/internal/repository/guests.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Dao-Ho Dao-Ho marked this pull request as ready for review April 4, 2026 15:51
Copy link
Copy Markdown
Contributor

@eric-kitagawa eric-kitagawa left a comment

Choose a reason for hiding this comment

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

LGTM

@Dao-Ho Dao-Ho merged commit 5e68cd7 into main Apr 4, 2026
7 checks passed
@Dao-Ho Dao-Ho deleted the dao/cmd-to-reindex-guests branch April 4, 2026 15:53
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