Skip to content

Commit cb11116

Browse files
committed
chore(deps): migrate to gts-rust v0.11.0
- Bump workspace GTS crates and refresh lockfiles for the v0.11.0 release. - Route GTS literals through toolkit-gts helpers and gts_id! validation. - Update canonical error, permission, scanner, and lint integrations for the new GTS APIs. Signed-off-by: Aviator 5 <ai.agent.tor@gmail.com>
1 parent 322a01f commit cb11116

249 files changed

Lines changed: 2951 additions & 2196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 41 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,11 @@ fnv = "1.0"
558558
jsonschema = { version = "0.40", default-features = false }
559559
walkdir = "2.5"
560560

561-
# GTS library
562-
gts-id = "0.10.0"
563-
gts = "0.10.0"
564-
gts-macros = "0.10.0"
561+
# GTS library.
562+
# Keep in sync with tools/dylint_lints/Cargo.toml.
563+
gts-id = "0.11.0"
564+
gts = "0.11.0"
565+
gts-macros = "0.11.0"
565566

566567
[workspace.metadata.cargo-shear]
567568
ignored-paths = ["**/tests/ui/**"]

docs/toolkit_unified_system/03_clienthub_and_plugins.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ For plugin-like scenarios where multiple implementations of the same interface c
5656

5757
```rust
5858
use toolkit::client_hub::ClientScope;
59+
use toolkit_gts::gts_id;
5960

6061
// Plugin registers with a scope (e.g., GTS instance ID)
61-
let scope = ClientScope::gts_id("gts.cf.toolkit.plugins.plugin.v1~vendor.pkg.my_gear.plugin.v1~acme.test._.plugin.v1");
62+
let scope = ClientScope::gts_id(gts_id!("cf.toolkit.plugins.plugin.v1~vendor.pkg.my_gear.plugin.v1~acme.test._.plugin.v1"));
6263
ctx.client_hub().register_scoped::<dyn MyPluginClient>(scope, plugin_impl);
6364

6465
// Main gear resolves the selected plugin
@@ -168,13 +169,13 @@ pub trait MyGearPluginClient: Send + Sync {
168169

169170
```rust
170171
// <gear>-sdk/src/gts.rs
171-
use gts_macros::struct_to_gts_schema;
172-
use toolkit::gts::PluginV1;
172+
use toolkit_gts::gts_type_schema;
173+
use toolkit_gts::PluginV1;
173174

174-
#[struct_to_gts_schema(
175+
#[gts_type_schema(
175176
dir_path = "schemas",
176177
base = PluginV1,
177-
schema_id = "gts.cf.toolkit.plugins.plugin.v1~cf.y.my_gear.plugin.v1~",
178+
type_id = gts_id!("cf.toolkit.plugins.plugin.v1~cf.y.my_gear.plugin.v1~"),
178179
description = "My Gear plugin specification",
179180
properties = ""
180181
)]
@@ -281,7 +282,7 @@ impl Service {
281282

282283
async fn resolve_plugin(&self) -> Result<String, DomainError> {
283284
let registry = self.hub.get::<dyn TypesRegistryClient>()?;
284-
let plugin_type_id = MyGearPluginSpecV1::gts_schema_id().clone();
285+
let plugin_type_id = MyGearPluginSpecV1::gts_type_id().clone();
285286
let instances = registry
286287
.list(ListQuery::new()
287288
.with_pattern(format!("{plugin_type_id}*"))
@@ -348,9 +349,9 @@ gears:
348349
### Plugin Checklist
349350
350351
- [ ] SDK defines both `<Gear>Client` trait (public) and `<Gear>PluginClient` trait (plugins)
351-
- [ ] SDK defines GTS schema type with `#[struct_to_gts_schema]`
352+
- [ ] SDK defines GTS schema type with `#[gts_type_schema]` (from `toolkit_gts`)
352353
- [ ] Main gear depends on `types-registry` but MUST NOT depend on plugin crates
353-
- [ ] Main gear registers plugin **schema** using `gts_schema_with_refs_as_string()`
354+
- [ ] Main gear registers plugin **schema** using `gts_type_schema_with_refs_as_string()`
354355
- [ ] Main gear registers public client WITHOUT scope
355356
- [ ] Main gear resolves plugin lazily (after types-registry is ready)
356357
- [ ] Each plugin depends on `types-registry`

examples/toolkit/users-info/users-info-sdk/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async-trait = { workspace = true }
2222

2323
# Canonical error envelope (re-exported as `UsersInfoError`)
2424
toolkit-canonical-errors = { workspace = true }
25+
toolkit-gts = { workspace = true }
2526

2627
# OData macros (for #[derive(ODataFilterable)])
2728
toolkit-odata-macros = { workspace = true, optional = true }

examples/toolkit/users-info/users-info-sdk/src/gts.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
//! impl-crate sites that call the macro therefore duplicate these
2020
//! literals. A test in the impl crate asserts the strings stay in sync.
2121
22+
use toolkit_gts::gts_id;
2223
/// `User` resource. Used as the `resource_type` field on canonical
2324
/// errors emitted from user-scoped operations (e.g. `user {id} not
2425
/// found` → 404).
25-
pub const USER_RESOURCE_TYPE: &str = "gts.cf.example1.users.user.v1~";
26+
pub const USER_RESOURCE_TYPE: &str = gts_id!("cf.example1.users.user.v1~");
2627

2728
/// `City` resource. Used as the `resource_type` field on canonical
2829
/// errors emitted from city-scoped operations.
29-
pub const CITY_RESOURCE_TYPE: &str = "gts.cf.example1.users.city.v1~";
30+
pub const CITY_RESOURCE_TYPE: &str = gts_id!("cf.example1.users.city.v1~");
3031

3132
/// `Address` resource. Used as the `resource_type` field on canonical
3233
/// errors emitted from address-scoped operations.
33-
pub const ADDRESS_RESOURCE_TYPE: &str = "gts.cf.example1.users.address.v1~";
34+
pub const ADDRESS_RESOURCE_TYPE: &str = gts_id!("cf.example1.users.address.v1~");

0 commit comments

Comments
 (0)