Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Sep 15, 2025

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Changes reorder filtering in MiniLcmRepository: exemplar and Gridify filters are applied at the start of GetEntries before full-text search and sorting. FilterEntries no longer applies these filters. Tests add SearchEntries GridifyFilter cases mirroring GetEntries coverage. No public APIs changed.

Changes

Cohort / File(s) Summary of changes
Repository filtering/order updates
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs
Apply exemplar and Gridify filtering at the start of GetEntries before FTS and sorting; obtain vernacular writing system ID and throw if missing; remove colocated filtering from FilterEntries; add comment explaining pre-FTS filtering rationale.
Test coverage for SearchEntries + Gridify
backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs
Add 10 tests exercising Api.SearchEntries with GridifyFilter across senses, parts of speech, examples, semantic domains, complex form types, lexeme, gloss, and example sentence text; validate parity with GetEntries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • hahn-kev

Poem

I hop through filters, swift and spry 🐇
Gridify first, then FTS fly!
Exemplar paths now clear and bright,
Tests abound to prove it right.
With carrots cached and queries neat,
This bunny’s build is lean and fleet.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive No pull request description was provided by the author, so there is insufficient author-written context in the PR description to judge intent or scope from that field alone; this makes the description check inconclusive even though the raw summary contains details. Please add a brief PR description summarizing what changed and why (for example: reordering gridify/exemplar filtering before FTS, removal of duplicate filtering, and added tests for missing-senses behavior), note any behavioral or compatibility impacts, and include a link to issue #2006 if applicable.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Fix search + missing senses" concisely reflects the primary intent of the changeset: correcting search/filter behavior related to missing senses. The raw summary shows the key code changes (reordering exemplar/gridify filtering before FTS and adjusting FilterEntries) and added tests for missing-senses scenarios, so the title accurately describes the main change.

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.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 15, 2025
@argos-ci
Copy link

argos-ci bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 15, 2025, 1:50 PM

@github-actions
Copy link

github-actions bot commented Sep 15, 2025

UI unit Tests

  1 files  ±0   45 suites  ±0   28s ⏱️ ±0s
111 tests ±0  111 ✅ ±0  0 💤 ±0  0 ❌ ±0 
160 runs  ±0  160 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 6ae712d. ± Comparison against base commit 13cf941.

♻️ This comment has been updated with latest results.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (1)

160-166: Use a domain‑specific exception instead of NullReferenceException.

Throwing NullReferenceException for a missing writing system is misleading. Prefer a NotFound/InvalidOperation exception for clarity and consistency with other repo methods.

Suggested change:

-            if (ws is null)
-                throw new NullReferenceException($"writing system {options.Exemplar.WritingSystem} not found");
+            if (ws is null)
+                throw new InvalidOperationException($"Writing system {options.Exemplar.WritingSystem} not found");

If available, consider throw new NotFoundException($"Writing system {options.Exemplar.WritingSystem} not found"); to match your existing NotFound semantics.

backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs (1)

103-110: De‑duplicate repeated test patterns with a helper.

Most new tests follow “run SearchEntries with gridify, project LexemeForm[en], assert set.” A small helper will cut repetition and improve readability.

Example helper and one refactor:

 public abstract class QueryEntryTestsBase : MiniLcmTestBase
 {
+    private async Task<string[]> SearchLexemesAsync(string? term, string gridify)
+        => (await Api.SearchEntries(term, new(Filter: new() { GridifyFilter = gridify }))
+                       .ToArrayAsync())
+           .Select(e => e.LexemeForm["en"]).ToArray();
@@
-    public async Task CanFilterLexemeFormContains_AndSearch()
-    {
-        var results = await Api.SearchEntries(Banana, new(Filter: new() { GridifyFilter = "LexemeForm[en]=*nan" })).ToArrayAsync();
-        results.Select(e => e.LexemeForm["en"]).Should().BeEquivalentTo(Banana);
-    }
+    public async Task CanFilterLexemeFormContains_AndSearch()
+    {
+        var lexemes = await SearchLexemesAsync(Banana, "LexemeForm[en]=*nan");
+        lexemes.Should().BeEquivalentTo(Banana);
+    }

Optional: add one exemplar+search test to exercise the new exemplar‑first pipeline.

Also applies to: 118-124, 133-140, 150-158, 166-172, 195-202, 239-245, 262-268, 276-282, 297-303

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13cf941 and d471cd3.

📒 Files selected for processing (2)
  • backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (1 hunks)
  • backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs (7 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (1)
backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs (1)
  • WritingSystem (105-119)
backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs (1)
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (10)
  • Task (26-29)
  • Task (94-102)
  • Task (104-111)
  • Task (113-117)
  • Task (119-124)
  • Task (156-194)
  • Task (214-232)
  • Task (234-240)
  • Task (242-247)
  • Task (249-254)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build FwHeadless / publish-fw-headless
  • GitHub Check: Analyze (csharp)
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: frontend
🔇 Additional comments (2)
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (1)

160-173: Pre‑FTS exemplar + Gridify filtering is the right call.

Applying exemplar and ApplyFiltering before FTS avoids EF expression composition issues and reduces the search set early. Looks good.

backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs (1)

103-110: Solid parity coverage for Gridify + SearchEntries.

These tests mirror the GetEntries cases and validate the pre‑FTS filter order. Assertions focus on membership, avoiding ordering coupling. Good additions.

Also applies to: 118-124, 133-140, 150-158, 166-172, 195-202, 239-245, 262-268, 276-282, 297-303

@myieye myieye merged commit 584f4fd into develop Sep 16, 2025
19 checks passed
@myieye myieye deleted the fix-search-with-missing-senses branch September 16, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants