Skip to content

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

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

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

Conversation

@gcoinstash-cmd

@gcoinstash-cmd gcoinstash-cmd commented Sep 3, 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 storage write efficiency by batching relationship and attribute records into larger database insert operations.
    • Added handling to skip unnecessary write operations when there are no records to save.

@coderabbitai

coderabbitai Bot commented Sep 3, 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: 03286fd1-f967-44f2-ab74-df837027629c

📥 Commits

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

📒 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

PostgreSQL relationship and attribute writers now build chunked squirrel INSERT queries. Each chunk contains up to 500 records. Empty collections return immediately.

Changes

PostgreSQL insert batching

Layer / File(s) Summary
Chunk relationship and attribute inserts
internal/storage/postgres/data_writer.go
batchInsertRelationships and batchInsertAttributes now queue one squirrel INSERT per 500 records. Empty inputs return early. Relationship inserts retain the conflict constraint handling, and attribute values are marshaled to JSON.

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

Merge Risk: ⚪ Minimal · up to 4fcd5

PostgreSQL relationship and attribute writes now batch inserts in chunks while preserving conflict handling. No merge-blocking risk remains.

🚥 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 summary describes a PostgreSQL data-writer refactor for chunked relationship and attribute inserts. The title does not identify … Update the title to describe the chunked PostgreSQL batch insert refactor, or add the validation test changes described by the current title.
✅ 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

Explanation

The title describes validation regression assertions, but the changeset summary describes a PostgreSQL data-writer refactor for chunked relationship and attribute inserts. The title does not identify the implemented change.

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