Skip to content

Implement full-text index for entries, make name and description inde… - #813

Merged
kurtnordstrom merged 5 commits into
mainfrom
update-cql-fields
Oct 13, 2026
Merged

kurtnordstrom merged 5 commits into
mainfrom
update-cql-fields

Conversation

@kurtnordstrom

Copy link
Copy Markdown
Contributor

…xes case insensitive

@kurtnordstrom
kurtnordstrom marked this pull request as ready for review October 9, 2026 20:22
Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:22

Copilot AI 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.

🟡 Changes recommended

The migration permits mixed-version rollout failures and introduces a symbol/entry lock-order deadlock.

2 open findings
What changed in this PR

Adds full-text directory entry search and case-insensitive name/description filtering.

Changes:

  • Adds a trigger-maintained PostgreSQL search vector and GIN index.
  • Adds cql.serverChoice and case-insensitive CQL fields.
  • Documents and tests search, migration, update, and import behavior.
File Description
directory/​api/​entries.go Configures new CQL search behavior.
directory/​api/​entries_test.go Tests CQL translation.
directory/​api.yaml Documents the API search contract.
directory/​README.md Documents search and deployment behavior.
directory/​migrations/​018_entry_search.up.sql Adds the search vector, triggers, and indexes.
directory/​migrations/​018_entry_search.down.sql Removes migration 018 objects.
directory/​import/​db/​repo_test.go Adjusts import locking coverage.
directory/​test/​entry_search_test.go Tests search indexing and concurrency.
directory/​test/​entry_search_migration_test.go Tests migration lifecycle and backfill.
directory/​test/​entry_case_insensitive_test.go Tests case-insensitive filtering.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread directory/migrations/018_entry_search.up.sql
Comment thread directory/migrations/018_entry_search.up.sql

Copilot AI 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.

🔵 Needs a closer look

The migration performs blocking index builds and an unbounded backfill during application startup, risking production write outages.

0 open findings

2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Non-concurrent symbols index build blocks live writes

directory/​migrations/​018_entry_search.up.sql:4

This regular index build takes a lock that blocks inserts, updates, and deletes on symbols, so live entry PATCH/import traffic can stall for the full scan. Build it with CREATE INDEX CONCURRENTLY in a dedicated non-transactional migration (and drop it concurrently on rollback where supported) to keep symbol writes available during rollout.

This issue also appears on line 85 of the same file.

🧠 Review effort: Balanced

Copilot AI 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.

🟡 Changes recommended

Migration 018 can block all entry traffic during an ordinary application rollout.

1 open finding

🧠 Review effort: Balanced

Comment thread directory/migrations/018_entry_search.up.sql
@kurtnordstrom

Copy link
Copy Markdown
Contributor Author

The complaints from copilot mainly center around a possible deadlock during database migration for currently running clients. However, since we are still in the pre-production phase and do not have clients to migrate, this should not be an issue.

@adamdickmeiss adamdickmeiss 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.

LGTM

@kurtnordstrom
kurtnordstrom merged commit 2e0cafc into main Oct 13, 2026
9 checks passed
@kurtnordstrom
kurtnordstrom deleted the update-cql-fields branch October 13, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants