template: add greeter (methods-only) + extend catalog service methods + regenerated tests #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "methods-only-canary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
schemas/greeter/greeter.oschema): new methods-only canary — zero rootobjects, five service methods (greet,echo,add,concat,info) covering every parameter shape (single str, multi primitive, list, zero-arg). Handwritten handlers incrates/hero_service_server/src/greeter/rpc.rsare trivial pure functions — the point is exercising the wire path, not the business logic.schemas/catalog/catalog.oschema): addcount() -> u32andclear() -> boolto the existingservice ServiceCatalogblock. Catalog is now a hybrid:ServiceDefinition [rootobject](CRUD + indexed find) plus a 9-method service block.greeterfeature flag across hero_service / hero_service_server / hero_service_sdk; build.rs registers the domain;main.rsadds the cfg-gatedMultiDomainBuilder::with_domain::<OsisGreeter>("greeter")line.ServiceCatalogTraitis still sync. Bridge through a singletokio::task::block_in_place+Handle::block_onhelper solist/get_by_name/list_by_interface/service_exists/ the newcount/clearkeep compiling. Tracked for proper async-trait codegen in a follow-up.Generated tests inventory
Before this PR (one e2e file per rootobject, zero coverage of service-block methods):
9 generated tests, 0 service-method coverage.
After this PR (post hero_rpc#131 codegen):
13 generated test files. The new service-method tests cover all 14 service-block methods (5 Greeter + 9 ServiceCatalog).
Test plan
cargo build --workspaceclean against the hero_rpc#131 patch.cargo build --workspace --tests— every generated<*>_e2e.rsbinary compiles and links against the regenerated SDK trait.lab service hero_service --start --ephemeral --json) is gated on the lab subprocess driver landing on the host — that's hero_rpc#124's territory, out of scope here. The pre-existing rootobject E2Es (e.g.service_definition_e2e) fail with the sameunknown flag --ephemeralmessage on the currentlabbuild, confirming the new service-method tests behave identically to the rest of the suite.Layer-by-layer (
lab service hero_service --test)lab service <name> --testis the post-hero_rpc#124 entry point — not yet shipped on the host'slabbuild (unknown flag --test for lab service hero_service). The cargo path validates the codegen and link surface, which is the bar this PR sets. Runtime execution will go green automatically when the lab--testverb lands.Dependency note
Depends on lhumina_code/hero_rpc#134 (closes hero_rpc#131). CI here will fail on master
cargo builduntil that PR merges and this branch rebases onto the updatedhero_rpc developmentSHA. Squash-merge order:lhumina_code/hero_rpc#134→developmenthero_rpcSHAlhumina_code/hero_servicemethods-only-canary →developmentlhumina_code/hero_rpc#131
Add a `greeter` feature across hero_service / hero_service_server / hero_service_sdk so the methods-only canary lives behind a feature flag (no admin/web UI emission — those scaffolds assume at least one rootobject; tracked as a separate codegen concern per hero_rpc#131). - build.rs registers the new `greeter` domain. - crates/hero_service{,_server}/src/greeter/ are the codegen-scaffolded modules — handwritten `rpc.rs` implements `GreeterTrait` with trivial pure functions (`greet`, `echo`, `add`, `concat`, `info`) so the generated round-trip tests have something concrete to exercise. - main.rs adds the `#[cfg(feature = "greeter")]` arm onto the `MultiDomainBuilder` so the greeter handler is registered alongside bench + catalog. lhumina_code/hero_rpc#131