Skip to content

LEGLINK-653: Reduce routine validation-result persistence to submittable categories - #1824

Merged
johnbritton merged 8 commits into
devfrom
users/jbritton/LEGLINK-653
Aug 13, 2026
Merged

LEGLINK-653: Reduce routine validation-result persistence to submittable categories#1824
johnbritton merged 8 commits into
devfrom
users/jbritton/LEGLINK-653

Conversation

@johnbritton

@johnbritton johnbritton commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🛠️ Description of Changes

Only persist validation results that are categorized with submit: true.

🧪 Testing Performed

Ran Ad Hoc report and observed that only results with submit: true were added in the database.

🧑‍🔬 Unit Testing

  • I have written or updated unit tests to cover my changes
  • Coverage: 100.0%

📓 Documentation Updated

Please update any relevant sections in the project documentation that were impacted by the changes in the PR.

Summary by CodeRabbit

  • Bug Fixes

    • Validation results are now saved only when they include at least one category eligible for submission.
    • Results without categories or without submit-enabled categories are excluded from persistence.
    • Multi-category results are handled correctly, including cases where only some categories are submit-enabled.
  • Tests

    • Added coverage confirming category submission settings are correctly retained and updated during re-imports.

johnbritton and others added 8 commits August 12, 2026 10:29
…ategories/validation-categories-management/validation-categories-management.component.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Replaced Result identity generation with a dedicated dbo.result_sequence configured for Hibernate sequence allocation, and added batching settings for insert/update ordering. Included a migration that recreates the result and result_category tables plus sequence so the database matches the new JPA ID strategy.
Remove the explicit schema = "dbo" from the @SequenceGenerator on Result.id. This allows JPA to use the default schema provided by the persistence setup, improving portability across database vendors and avoiding hard-coded SQL Server schema assumptions.
Filter validation results before persisting: ReadyForValidationConsumer now saves only results that have at least one Category with submit=true, avoiding saving uncategorized or non-submittable results. Tests updated to cover the behavior: ReadyForValidationConsumerTest gains scenarios for submitted, non-submitted, multi-category, and no-submit cases. CategoryInitializationJpaTest updated to validate submit flag changes on reimport. This reduces unnecessary DB writes and ensures only intended results are persisted.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e5f1492-efc5-497b-8fc7-bb271c336647

📥 Commits

Reviewing files that changed from the base of the PR and between b7647b4 and 6084aca.

📒 Files selected for processing (3)
  • Java/validation/src/main/java/com/lantanagroup/link/validation/services/ReadyForValidationConsumer.java
  • Java/validation/src/test/java/com/lantanagroup/link/validation/services/CategoryInitializationJpaTest.java
  • Java/validation/src/test/java/com/lantanagroup/link/validation/services/ReadyForValidationConsumerTest.java

📝 Walkthrough

Walkthrough

ReadyForValidationConsumer now persists only validation results with at least one submit-enabled category. Tests cover category re-import state, mixed-category results, and empty eligible-result sets.

Changes

Validation result persistence

Layer / File(s) Summary
Category submit state
Java/validation/src/test/java/com/lantanagroup/link/validation/services/CategoryInitializationJpaTest.java
The re-import test verifies submit=false after the initial import and submit=true after the revised import.
Eligible result filtering
Java/validation/src/main/java/com/lantanagroup/link/validation/services/ReadyForValidationConsumer.java, Java/validation/src/test/java/com/lantanagroup/link/validation/services/ReadyForValidationConsumerTest.java
The consumer filters results by Category::isSubmit and skips saveAll when no result is eligible. Tests cover single-category, multi-category, and uncategorized results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 6084a

The change narrowly limits persisted validation results to categories marked submit=true, with no actionable merge-blocking risk remaining beyond normal checks and review.

Possibly related PRs

Suggested reviewers: mikeatpinnacle, seanmcilvenna, smailliwcs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and concisely describes reducing validation-result persistence to submittable categories.
Description check ✅ Passed The description covers the changes, testing, unit-test coverage, and documentation section required by the template.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch users/jbritton/LEGLINK-653

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.

@johnbritton
johnbritton merged commit db5a7bf into dev Aug 13, 2026
20 checks passed
@johnbritton
johnbritton deleted the users/jbritton/LEGLINK-653 branch August 13, 2026 14:14
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