Skip to content

do not get results where release_sunset is not null#213

Merged
HaneenT merged 1 commit into
developfrom
KPMP-6713_dont-get-release-sunset
Jun 2, 2026
Merged

do not get results where release_sunset is not null#213
HaneenT merged 1 commit into
developfrom
KPMP-6713_dont-get-release-sunset

Conversation

@Dert1129

@Dert1129 Dert1129 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Updated data filtering logic to improve accuracy of cell type results.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR adds a release_sunset IS NULL filter to the native SQL query in CellTypeRepository#findAllByCellTypeIsNotNullOrderByCellTypeOrdering2025(), excluding cell type records that have a non-null release sunset value while preserving the existing null check and cell type ordering.

Changes

Cell Type Query Update

Layer / File(s) Summary
Query filter for release_sunset
src/main/java/org/kpmp/cellType/CellTypeRepository.java
Native @Query annotation adds release_sunset IS NULL predicate to filter out records with sunset release dates, while maintaining existing cell_type IS NOT NULL filter and cell_type_order ASC ordering.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KPMP-6713_dont-get-release-sunset

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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/org/kpmp/cellType/CellTypeRepository.java (1)

15-20: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Confirm whether the autocomplete query should also exclude sunset records.

The PR goal is to stop returning records where release_sunset is not null, but findByCellTypeContainingOrSynonymContaining (Lines 15-19) still selects release_sunset without an IS NULL filter on either UNION branch. If sunset cell types should be hidden everywhere, this query may still surface them in autocomplete results. Confirm whether this is intentional or out of scope for this PR.

🔍 Suggested filter if autocomplete should also exclude sunset records
-	`@Query`(value = "SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + "    FROM cell_type_2025 ct "
-			+ "    JOIN celltype_synonym_2025 cs ON (ct.cell_type_id = cs.cell_type_id AND cs.synonym LIKE %:searchTerm%) "
-			+ "    UNION " + "    SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + "    FROM cell_type_2025 ct "
-			+ "    LEFT JOIN celltype_synonym_2025 cs ON ct.cell_type_id = cs.cell_type_id "
-			+ "    WHERE ct.cell_type LIKE %:searchTerm% ", nativeQuery = true)
+	`@Query`(value = "SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + "    FROM cell_type_2025 ct "
+			+ "    JOIN celltype_synonym_2025 cs ON (ct.cell_type_id = cs.cell_type_id AND cs.synonym LIKE %:searchTerm%) "
+			+ "    WHERE ct.release_sunset IS NULL "
+			+ "    UNION " + "    SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + "    FROM cell_type_2025 ct "
+			+ "    LEFT JOIN celltype_synonym_2025 cs ON ct.cell_type_id = cs.cell_type_id "
+			+ "    WHERE ct.cell_type LIKE %:searchTerm% AND ct.release_sunset IS NULL ", nativeQuery = true)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3fbf6d20-5ea8-438b-b9bc-e9a0afd9cc66

📥 Commits

Reviewing files that changed from the base of the PR and between 0af259b and 2d2c555.

📒 Files selected for processing (1)
  • src/main/java/org/kpmp/cellType/CellTypeRepository.java

@HaneenT HaneenT merged commit e907e21 into develop Jun 2, 2026
1 check passed
@HaneenT HaneenT deleted the KPMP-6713_dont-get-release-sunset branch June 2, 2026 15:00
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