feat(run): make hm run --cloud register/create pipelines automatically#140
Merged
Conversation
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.
What
Makes
hm run --cloud"just work" afterhm init— no manual dashboard registration.pipeline_not_found, the driver resolves-or-creates the pipeline and submits the build by its org-global slug (submit_build), bypassing repo-identity discovery (which can't see API-created pipelines). New by-slug submit path inCloudBackend, gated byRunRequest.cloud_pipeline_slug.@hm.pipeline("…")slug; prompts the user for the repo name (owner/repo, default = directory name) only when a create is actually needed; persists[cloud] pipeline = "<slug>"to.hm/config.tomlso later runs submit by slug with no prompt. CI/non-TTY auto-registers under the directory name.CloudConfig.pipeline: Option<String>.docs https://harmont.dev/docs/errors/<code>URLs (all 404) from every error, and dropped the misleading "check that the Docker daemon is running" hint from the overloadedBackendError::Localarm.Resolution flow (cloud)
Backward compatibility
A normal connected-repo
hm run --cloud(has remote, no persisted pipeline) is unchanged — it still uses the repo-identity submit and only diverges on an actualpipeline_not_found.CloudConfig.pipelineisOption/#[non_exhaustive]and defaults toNone, so existing.hm/config.tomlfiles deserialize unchanged;cloud_pipeline_slugis internal (not serialized).Testing
is_missing_pipeline,parse_default_branch,build_create_pipeline_request(Some/None),persist_project_pipeline(creates + preserves existing keys).register_remoteless_pipeline/resolve_or_create_cloud_pipeline) verified by review — no HTTP-mock harness in this crate.cargo build/cargo clippy --workspace --all-targets/cargo test --workspace/cargo fmt --checkall green.Server-contract assumptions (need live validation)
Two things only a live cloud run can confirm, both surfacing a clear error if wrong:
allow_manual = true(else the by-slug build is rejected).create_pipelinemust accept a non-URLrepositorystring for a remoteless/manual pipeline.