Skip to content

feat: support anonymous instances registration according to the latest gts specification#74

Merged
Artifizer merged 2 commits intoGlobalTypeSystem:mainfrom
Artifizer:main
Mar 5, 2026
Merged

feat: support anonymous instances registration according to the latest gts specification#74
Artifizer merged 2 commits intoGlobalTypeSystem:mainfrom
Artifizer:main

Conversation

@Artifizer
Copy link
Copy Markdown
Contributor

@Artifizer Artifizer commented Mar 5, 2026

Summary by CodeRabbit

  • Chores

    • Updated submodule pointer.
    • Bumped package versions to 0.8.3 across workspace components.
  • Improvements

    • Instance validation now accepts both well-known GTS identifiers and anonymous UUID-based instances for greater flexibility.

…t gts specification

Signed-off-by: Artifizer <artifizer@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14e0ab0e-d7cb-4b2d-87e2-359ed8c3c9a0

📥 Commits

Reviewing files that changed from the base of the PR and between 673993f and 075dc03.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • Cargo.toml
  • gts-cli/Cargo.toml
  • gts-id/Cargo.toml
  • gts-macros-cli/Cargo.toml
  • gts-macros/Cargo.toml
  • gts-validator/Cargo.toml
  • gts/Cargo.toml

📝 Walkthrough

Walkthrough

Updates a submodule pointer in .gts-spec, bumps several crate/package versions (0.8.2 → 0.8.3), and changes GtsStore::validate_instance signature/logic to accept instance_id: &str and attempt parsing it as a GtsID with fallback to the original string for lookups and error reporting.

Changes

Cohort / File(s) Summary
Submodule pointer
\.gts-spec
Updated recorded submodule commit hash only; no code or API changes.
Store validation
gts/src/store.rs
GtsStore::validate_instance signature changed to (&mut self, instance_id: &str). Introduces lookup_id by attempting to parse instance_id as a GtsID; uses lookup_id for store lookups and instance_id in messages/logs.
Workspace version bumps
Cargo.toml, gts/Cargo.toml, gts-cli/Cargo.toml, gts-id/Cargo.toml, gts-macros/Cargo.toml, gts-macros-cli/Cargo.toml, gts-validator/Cargo.toml
Bumped package/crate versions from 0.8.20.8.3 for multiple workspace crates; no functional changes besides version fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
I nibble at hashes and names so neat,
GtsID or UUID — both paws on the beat,
I hop through lookups with gentle cheer,
Fallback in place, no error to fear,
Happy hops for code now clear ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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: adding support for anonymous instances registration in accordance with the latest GTS specification, which aligns with the parameter rename and behavioral updates in validate_instance.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@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!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@gts/src/store.rs`:
- Around line 1030-1036: The two error messages use mixed identifiers:
StoreError::ObjectNotFound uses instance_id while
StoreError::SchemaForInstanceNotFound uses lookup_id, which can confuse users if
GtsID::new normalizes input; change the second error construction in the schema
lookup to use instance_id (the original user input) instead of lookup_id so both
errors consistently report the same ID (update the code around the schema_id
.ok_or_else(...) that currently references lookup_id to reference instance_id).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 846d02b4-5fa4-4af0-abe7-16d8c3113e53

📥 Commits

Reviewing files that changed from the base of the PR and between cd8ed5b and 673993f.

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

Comment thread gts/src/store.rs
Comment on lines +1030 to +1036
.ok_or_else(|| StoreError::ObjectNotFound(instance_id.to_owned()))?
.clone();

let schema_id = obj
.schema_id
.as_ref()
.ok_or_else(|| StoreError::SchemaForInstanceNotFound(gid.id.clone()))?
.ok_or_else(|| StoreError::SchemaForInstanceNotFound(lookup_id.clone()))?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent ID used in error messages.

Line 1030 reports instance_id (the user's input) in ObjectNotFound, but line 1036 reports lookup_id (the resolved internal ID) in SchemaForInstanceNotFound. If GtsID::new() normalizes the input, these could differ, confusing the user.

For consistency, use instance_id in both error messages since that's what the user passed in.

Proposed fix
     let schema_id = obj
         .schema_id
         .as_ref()
-        .ok_or_else(|| StoreError::SchemaForInstanceNotFound(lookup_id.clone()))?
+        .ok_or_else(|| StoreError::SchemaForInstanceNotFound(instance_id.to_owned()))?
         .clone();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.ok_or_else(|| StoreError::ObjectNotFound(instance_id.to_owned()))?
.clone();
let schema_id = obj
.schema_id
.as_ref()
.ok_or_else(|| StoreError::SchemaForInstanceNotFound(gid.id.clone()))?
.ok_or_else(|| StoreError::SchemaForInstanceNotFound(lookup_id.clone()))?
.ok_or_else(|| StoreError::ObjectNotFound(instance_id.to_owned()))?
.clone();
let schema_id = obj
.schema_id
.as_ref()
.ok_or_else(|| StoreError::SchemaForInstanceNotFound(instance_id.to_owned()))?
.clone();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@gts/src/store.rs` around lines 1030 - 1036, The two error messages use mixed
identifiers: StoreError::ObjectNotFound uses instance_id while
StoreError::SchemaForInstanceNotFound uses lookup_id, which can confuse users if
GtsID::new normalizes input; change the second error construction in the schema
lookup to use instance_id (the original user input) instead of lookup_id so both
errors consistently report the same ID (update the code around the schema_id
.ok_or_else(...) that currently references lookup_id to reference instance_id).

Signed-off-by: Artifizer <artifizer@gmail.com>
@Artifizer Artifizer merged commit db9ef09 into GlobalTypeSystem:main Mar 5, 2026
1 check was pending
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