feat(hm-cloud): scaffold cloud crate and add GitSha newtype#181
Draft
markovejnovic wants to merge 4 commits into
Draft
feat(hm-cloud): scaffold cloud crate and add GitSha newtype#181markovejnovic wants to merge 4 commits into
markovejnovic wants to merge 4 commits into
Conversation
Introduce a validated git object-id type (40/64 hex, lowercase, null-oid sentinel) with transparent-string serde, and thread it through every place a commit id is produced or carried: - git::head_commit() -> Option<GitSha>, parsed from rev-parse. - exec::SourceMeta.commit: GitSha, converted to String only at the harmont-cloud SDK boundary. - hm run derives the commit as GitSha::zero() when git has none. - cloud run's --commit parses to GitSha at clap time, rejecting a malformed id before submission.
New crate that will own the whole cloud domain (executor + verbs). This
first step lands the clap command tree only, no runtime:
- CloudCommand { Auth{login,logout,whoami}, Org, Pipeline, Build, Job,
Billing } with every arg documented.
- Pipeline-identifying args are Option<String> so an omitted --pipeline
falls back to config.default_pipeline.
- No submit verb: submission stays with hm run --cloud.
Represent a commit id as its 20 raw bytes ([u8; 20], Copy) instead of a heap String, with hex only at the edges: decode via the hex crate on parse, encode on Display/serde. Drops the speculative SHA-256 width — git and Harmont's repos are SHA-1; promote to an enum if one ever appears.
The binary now consumes hm_cloud::cli::CloudCommand instead of a duplicate enum tree, so hm-cloud's cli.rs is the single definition. Adopting it applies the shape the scaffold settled on: - login/logout/whoami move under `hm cloud auth`. - `hm cloud run` is dropped; submission stays with `hm run --cloud`. - --pipeline is optional everywhere, resolving to the project's default_pipeline (via ProjectCtx) with a clear error when neither is set. Dispatch and the verbs adapt to the new enums; verbs/run.rs is deleted.
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.
Generated by an AI agent.