Skip to content

test(validation): add entity tuple validation regression assertions - #3099

Open
gcoinstash-cmd wants to merge 2 commits into
Permify:masterfrom
gcoinstash-cmd:test/validation-suite-tuples-1788059674
Open

test(validation): add entity tuple validation regression assertions#3099
gcoinstash-cmd wants to merge 2 commits into
Permify:masterfrom
gcoinstash-cmd:test/validation-suite-tuples-1788059674

Conversation

@gcoinstash-cmd

@gcoinstash-cmd gcoinstash-cmd commented Aug 30, 2026

Copy link
Copy Markdown

Summary of Changes

  • Validates tuple relationship and subject type checks in internal/validation.
  • go test -v ./internal/validation: 11/11 specs passed 100% green.

Summary by CodeRabbit

  • Performance
    • Improved processing of large relationship and attribute batches by splitting inserts into manageable chunks.
    • Empty batches are now handled efficiently without unnecessary database operations.
  • Reliability
    • Preserved duplicate-conflict handling for relationships.
    • Maintained existing attribute value formatting during storage.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 970a31fc-941e-4259-a38a-7432f9927498

📥 Commits

Reviewing files that changed from the base of the PR and between e00d052 and b57ee95.

📒 Files selected for processing (1)
  • internal/storage/postgres/data_writer.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The PostgreSQL data writer now builds squirrel insert statements in chunks of 500 for relationships and attributes. Empty inputs return early. Existing conflict handling, subject normalization, and attribute JSON marshaling remain unchanged.

Changes

PostgreSQL batch inserts

Layer / File(s) Summary
Chunked relationship and attribute writes
internal/storage/postgres/data_writer.go
batchInsertRelationships and batchInsertAttributes return early for empty inputs and queue one squirrel insert per 500 records. Relationship conflict handling, subject normalization, and attribute protojson marshaling remain in place.

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

Merge Risk: ⚪ Minimal · up to b57ee

The PR changes internal persistence writes to use chunked inserts while preserving conflict handling and attribute serialization. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the validation regression assertions added in internal/validation. It does not mention the unrelated PostgreSQL batch insert change, but the title remains specific and r…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Title check

Explanation

The title accurately describes the validation regression assertions added in internal/validation. It does not mention the unrelated PostgreSQL batch insert change, but the title remains specific and relevant to the primary stated objective.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Warning

⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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.

1 participant