Skip to content

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

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

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

Conversation

@gcoinstash-cmd

@gcoinstash-cmd gcoinstash-cmd commented Aug 31, 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 Improvements
    • Improved the efficiency of saving relationship and attribute data, especially during larger updates.
    • Bulk data operations now complete with less processing overhead, helping reduce delays while maintaining existing data handling and conflict behavior.

@coderabbitai

coderabbitai Bot commented Aug 31, 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: Team

Run ID: 2a8e2471-7bab-40c2-afb4-4a0a6157b630

📥 Commits

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

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

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


📝 Walkthrough

Walkthrough

PostgreSQL relationship and attribute inserts now group up to 500 records per SQL statement. The changes preserve conflict handling, ellipsis normalization, protobuf JSON serialization, and error propagation.

Changes

PostgreSQL insert batching

Layer / File(s) Summary
Batch relationship inserts
internal/storage/postgres/data_writer.go
Relationship records are grouped into batches of 500. Each batch uses a query-builder multi-row insert with conflict-ignore handling.
Batch attribute inserts
internal/storage/postgres/data_writer.go
Attribute records are grouped into batches of 500. Values remain serialized with protojson, and generated statements are queued.

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

Merge Risk: ⚪ Minimal · up to 0af7a

The PR updates PostgreSQL batch insertion to skip empty collections and group writes while preserving existing conflict and serialization handling; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes validation regression assertions, but the changeset updates PostgreSQL relationship and attribute inserts to use batched multi-value SQL statements. Rename the pull request to describe the PostgreSQL insert batching change, such as "perf(storage): batch PostgreSQL relationship and attribute inserts". If validation tests are the intended change, provide the corresponding test changes or …
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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

Resolution

Rename the pull request to describe the PostgreSQL insert batching change, such as "perf(storage): batch PostgreSQL relationship and attribute inserts". If validation tests are the intended change, provide the corresponding test changes or correct the pull request context.

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.

  • Fix all pre-merge checks with AI
✨ 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