Skip to content

fix: disable x-gts-traits validation for x-gts-abstract types#99

Merged
aviator5 merged 1 commit into
GlobalTypeSystem:mainfrom
fluiderson:abstract-fix
Jun 8, 2026
Merged

fix: disable x-gts-traits validation for x-gts-abstract types#99
aviator5 merged 1 commit into
GlobalTypeSystem:mainfrom
fluiderson:abstract-fix

Conversation

@fluiderson

@fluiderson fluiderson commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Validation for abstract entities now correctly skips trait completeness and schema checks.
  • Tests

    • Added validation tests confirming abstract entities are exempt from trait checks even when trait values are unresolved, and that non-abstract entities providing trait schemas must supply corresponding trait values.

@coderabbitai

coderabbitai Bot commented Jun 8, 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

Run ID: 2e7bebe3-89ae-46b3-8d93-dd54afe7752c

📥 Commits

Reviewing files that changed from the base of the PR and between 790f7cc and e23fbcc.

📒 Files selected for processing (2)
  • gts/src/store.rs
  • gts/src/store_test.rs

📝 Walkthrough

Walkthrough

The validate_entity_traits function adds an early-exit check: when a schema entity is marked x-gts-abstract: true, it immediately returns success and skips all OP#13 trait completeness and closure validations. Two test cases verify that abstract entities are exempted from trait checks, and that non-abstract entities without trait values correctly fail validation.

Changes

Abstract Schema Trait Validation Exemption

Layer / File(s) Summary
Abstract schema exemption from trait completeness checks
gts/src/store.rs, gts/src/store_test.rs
validate_entity_traits adds an early-return guard when x-gts-abstract: true to skip trait-schema presence, completeness (x-gts-traits existence), and closure (additionalProperties: false) validation. Two test cases verify abstract schema exemption and non-abstract schema failure without trait values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • GlobalTypeSystem/gts-rust#80: Both PRs update gts/src/store.rs to bypass trait validation when x-gts-abstract: true is set, directly overlapping in abstract-entity gating logic.
  • GlobalTypeSystem/gts-rust#57: This PR's OP#13 entity-traits validation tweak is directly connected to the original OP#13 trait validation implementation added in PR #57.
  • GlobalTypeSystem/gts-rust#90: Both PRs modify OP#13 trait-validation logic in gts/src/store.rs to treat abstract entities as exempt from validation.

Suggested reviewers

  • Artifizer

Poem

🐰 A schema cloaked in abstract truth,
Now skips the trait checks, sooth to sooth,
The tests confirm: exempt the wise,
While mundane ones must scrutinize.
Hoppy hops — the validation gleams!

🚥 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 main change: disabling x-gts-traits validation for types marked x-gts-abstract: true, which is the core modification in both store.rs and the corresponding tests.
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.

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

✨ Finishing Touches
🧪 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 and usage tips.

@fluiderson fluiderson changed the title fix: disable x-gts-traits validation for x-gts-abstract types` fix: disable x-gts-traits validation for x-gts-abstract types Jun 8, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fluiderson

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aviator5 aviator5 merged commit 47b51aa into GlobalTypeSystem:main Jun 8, 2026
7 checks passed
@fluiderson fluiderson deleted the abstract-fix branch June 8, 2026 14:25
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.

3 participants