Extract hydra-proto crate for shared gRPC code generation#1722
Merged
Conversation
Pick up latest changes from nix-community/harmonia.
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
2c1cfa8 to
9afc0a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both
hydra-builderandhydra-queue-runnerhad near-identicalbuild.rsfiles that compiled the same.protofile and generatedthe same version constant. This consolidates that into a single
hydra-protocrate with feature flags:client— generates tonic client stubs (used byhydra-builder)server— generates tonic server traits (used byhydra-queue-runner)db—Fromimpls bridging proto enums todb::modelstypesProto ↔ native type conversions are also consolidated here:
ProtoStorePathmoved fromshared::proto, now depends onharmonia-store-coredirectly rather thannix-utilsPressure/PressureState— both components now use the generatedproto types directly, eliminating duplicate structs and field-by-field
conversion boilerplate
PresignedUploadOpts,ConfigUpdate— queue-runner now uses theproto types directly instead of maintaining trivial local wrappers
BuildResultState— restructured as a nested enum wrappinghydra_proto::BuildResultStatewith extraAborted/Cancelledvariants for queue-runner-internal states
RelativeStorePath— new proto message type making the store pathvs sub-path split explicit on the wire;
From/TryFromconversionsin
hydra-protobridge tostore_path_utils::RelativeStorePathBuildProduct.pathchanged from opaquestringto structuredRelativeStorePathmessageAlso:
Groups all local workspace crates under
[workspace.dependencies]with
workspace = truereferences instead of relative pathsUpdates the architecture doc with descriptions of each shared crate