Deprecate service-authoring API in herolib_core::base (moved to hero_lifecycle::base per hero_rpc#142) #145

Closed
opened 2026-05-26 09:27:51 +00:00 by timur · 1 comment
Owner

Context

hero_rpc#142 consolidated the service-authoring primitives (ServiceToml schema + closed enums, validate_service_toml, handle_info_flag, print_startup_banner, prepare_sockets, socket resolvers, the new peer_socket_path helper) into hero_lifecycle::base and called for a #[deprecated] shim to remain in herolib_core::base for one release cycle so consumer repos can migrate at their own cadence.

Without the shim, downstream services (hero_osis, hero_proxy, hero_compute, hero_os, hero_router, hero_voice, hero_inspector, …) silently keep using herolib_core::base::* with no migration signal, and the two implementations risk diverging over the release cycle.

Goals

  • Add #[deprecated] attributes to the service-authoring pub use statements in crates/core/src/base/mod.rs. Note text points at hero_lifecycle::base and references hero_rpc#142.
  • Keep paths.rs re-exports (path_root / path_var / hero_var_dir / hero_bin / parse_git_url / scan_local_repos / ensure_env / …) untouched — those are lab-specific path/repo helpers, not service-authoring primitives, and stay in herolib_core.
  • Leave the service_base!() macro definition in place; the deprecation on validate_service_toml and handle_info_flag (which the macro calls) is the migration signal for every macro user.
  • cargo build --workspace clean (no other internal hero_lib code uses these deprecated re-exports — they're consumed by downstream repos).
  • Implementations in crates/core/src/base/service.rs stay as-is — no removal in this PR. Removal happens one release cycle after hero_rpc#142 lands, in a follow-up.

Out of scope

  • Re-exporting from hero_lifecycle::base (full re-export shim). Adds a cross-repo git dep, requires a wasm32 conditional split, and risks pulling tokio/hyper transitively into anything that touches herolib_core. Filed separately if drift between the two impls becomes a real problem during the deprecation window.
  • Migrating any downstream consumer — each repo does its own pass under hero_service_refactor.
## Context hero_rpc#142 consolidated the service-authoring primitives (`ServiceToml` schema + closed enums, `validate_service_toml`, `handle_info_flag`, `print_startup_banner`, `prepare_sockets`, socket resolvers, the new `peer_socket_path` helper) into `hero_lifecycle::base` and called for a `#[deprecated]` shim to remain in `herolib_core::base` for one release cycle so consumer repos can migrate at their own cadence. Without the shim, downstream services (hero_osis, hero_proxy, hero_compute, hero_os, hero_router, hero_voice, hero_inspector, …) silently keep using `herolib_core::base::*` with no migration signal, and the two implementations risk diverging over the release cycle. ## Goals - Add `#[deprecated]` attributes to the service-authoring `pub use` statements in `crates/core/src/base/mod.rs`. Note text points at `hero_lifecycle::base` and references hero_rpc#142. - Keep `paths.rs` re-exports (path_root / path_var / hero_var_dir / hero_bin / parse_git_url / scan_local_repos / ensure_env / …) untouched — those are lab-specific path/repo helpers, not service-authoring primitives, and stay in herolib_core. - Leave the `service_base!()` macro definition in place; the deprecation on `validate_service_toml` and `handle_info_flag` (which the macro calls) is the migration signal for every macro user. - `cargo build --workspace` clean (no other internal hero_lib code uses these deprecated re-exports — they're consumed by downstream repos). - Implementations in `crates/core/src/base/service.rs` stay as-is — no removal in this PR. Removal happens one release cycle after hero_rpc#142 lands, in a follow-up. ## Out of scope - Re-exporting from `hero_lifecycle::base` (full re-export shim). Adds a cross-repo git dep, requires a wasm32 conditional split, and risks pulling tokio/hyper transitively into anything that touches herolib_core. Filed separately if drift between the two impls becomes a real problem during the deprecation window. - Migrating any downstream consumer — each repo does its own pass under `hero_service_refactor`.
Author
Owner

Merged in PR #146 (commit 5cfc08d8a2) on development.

Changes

  • Added #[deprecated] attributes to the service-authoring pub use statements in crates/core/src/base/mod.rs covering ServiceToml + closed enums (Kind, Category, Protocol, SockType), Binary, Socket, TcpEntry, Dependency, EnvVar, ServiceMeta, SocketPrep, validate_service_toml, handle_info_flag, print_startup_banner, prepare_sockets, resolve_socket_dir, resolve_socket_path, resolve_socket_path_with_override, resolve_domain_socket_path.
  • Note text directs consumers to hero_lifecycle::base with the hero_rpc#142 link.
  • service_base!() macro internal call gets #[allow(deprecated)] so the macro itself stays usable without forcing every existing call site into the deprecation churn — direct imports still see the warning.
  • paths.rs untouched (lab-specific path/repo helpers stay in herolib_core).
  • cargo build --workspace clean.

Follow-up

  • Full re-export shim (re-export from hero_lifecycle::base rather than in-place deprecate) deferred per the issue spec — file if drift between the two implementations becomes a real problem during the deprecation window.
  • Downstream consumer migrations happen per-repo under hero_service_refactor.
  • Removal of the deprecated re-exports scheduled for one release cycle after hero_rpc#142 lands.
Merged in PR #146 (commit 5cfc08d8a2) on `development`. ## Changes - Added `#[deprecated]` attributes to the service-authoring `pub use` statements in `crates/core/src/base/mod.rs` covering `ServiceToml` + closed enums (`Kind`, `Category`, `Protocol`, `SockType`), `Binary`, `Socket`, `TcpEntry`, `Dependency`, `EnvVar`, `ServiceMeta`, `SocketPrep`, `validate_service_toml`, `handle_info_flag`, `print_startup_banner`, `prepare_sockets`, `resolve_socket_dir`, `resolve_socket_path`, `resolve_socket_path_with_override`, `resolve_domain_socket_path`. - Note text directs consumers to `hero_lifecycle::base` with the hero_rpc#142 link. - `service_base!()` macro internal call gets `#[allow(deprecated)]` so the macro itself stays usable without forcing every existing call site into the deprecation churn — direct imports still see the warning. - `paths.rs` untouched (lab-specific path/repo helpers stay in herolib_core). - `cargo build --workspace` clean. ## Follow-up - Full re-export shim (re-export from `hero_lifecycle::base` rather than in-place deprecate) deferred per the issue spec — file if drift between the two implementations becomes a real problem during the deprecation window. - Downstream consumer migrations happen per-repo under `hero_service_refactor`. - Removal of the deprecated re-exports scheduled for one release cycle after hero_rpc#142 lands.
timur closed this issue 2026-05-26 09:33:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_lib#145
No description provided.