Skip to content

Extract hydra-proto crate for shared gRPC code generation#1722

Merged
Ericson2314 merged 2 commits into
NixOS:masterfrom
obsidiansystems:misc-cleanups
May 10, 2026
Merged

Extract hydra-proto crate for shared gRPC code generation#1722
Ericson2314 merged 2 commits into
NixOS:masterfrom
obsidiansystems:misc-cleanups

Conversation

@Ericson2314
Copy link
Copy Markdown
Member

Both hydra-builder and hydra-queue-runner had near-identical
build.rs files that compiled the same .proto file and generated
the same version constant. This consolidates that into a single
hydra-proto crate with feature flags:

  • client — generates tonic client stubs (used by hydra-builder)

  • server — generates tonic server traits (used by hydra-queue-runner)

  • dbFrom impls bridging proto enums to db::models types

Proto ↔ native type conversions are also consolidated here:

  • ProtoStorePath moved from shared::proto, now depends on
    harmonia-store-core directly rather than nix-utils

  • Pressure/PressureState — both components now use the generated
    proto types directly, eliminating duplicate structs and field-by-field
    conversion boilerplate

  • PresignedUploadOpts, ConfigUpdate — queue-runner now uses the
    proto types directly instead of maintaining trivial local wrappers

  • BuildResultState — restructured as a nested enum wrapping
    hydra_proto::BuildResultState with extra Aborted/Cancelled
    variants for queue-runner-internal states

  • RelativeStorePath — new proto message type making the store path
    vs sub-path split explicit on the wire; From/TryFrom conversions
    in hydra-proto bridge to store_path_utils::RelativeStorePath

  • BuildProduct.path changed from opaque string to structured
    RelativeStorePath message

Also:

  • Groups all local workspace crates under [workspace.dependencies]
    with workspace = true references instead of relative paths

  • Updates the architecture doc with descriptions of each shared crate

Pick up latest changes from nix-community/harmonia.
@Ericson2314 Ericson2314 enabled auto-merge May 10, 2026 16:09
Both `hydra-builder` and `hydra-queue-runner` had near-identical
`build.rs` files that compiled the same `.proto` file and generated
the same version constant. This consolidates that into a single
`hydra-proto` crate with feature flags:

- `client` — generates tonic client stubs (used by `hydra-builder`)

- `server` — generates tonic server traits (used by `hydra-queue-runner`)

- `db` — `From` impls bridging proto enums to `db::models` types

Proto ↔ native type conversions are also consolidated here:

- `ProtoStorePath` moved from `shared::proto`, now depends on
  `harmonia-store-core` directly rather than `nix-utils`

- `Pressure`/`PressureState` — both components now use the generated
  proto types directly, eliminating duplicate structs and field-by-field
  conversion boilerplate

- `PresignedUploadOpts`, `ConfigUpdate` — queue-runner now uses the
  proto types directly instead of maintaining trivial local wrappers

- `BuildResultState` — restructured as a nested enum wrapping
  `hydra_proto::BuildResultState` with extra `Aborted`/`Cancelled`
  variants for queue-runner-internal states

- `RelativeStorePath` — new proto message type making the store path
  vs sub-path split explicit on the wire; `From`/`TryFrom` conversions
  in `hydra-proto` bridge to `store_path_utils::RelativeStorePath`

- `BuildProduct.path` changed from opaque `string` to structured
  `RelativeStorePath` message

Also:

- Groups all local workspace crates under `[workspace.dependencies]`
  with `workspace = true` references instead of relative paths

- Updates the architecture doc with descriptions of each shared crate
@Ericson2314 Ericson2314 added this pull request to the merge queue May 10, 2026
Merged via the queue into NixOS:master with commit da6bbb4 May 10, 2026
2 checks passed
@Ericson2314 Ericson2314 deleted the misc-cleanups branch May 10, 2026 16:50
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.

1 participant