fix(cloud): correct watch URL host/path, taxonomy, and archive size guard#132
Merged
markovejnovic merged 1 commit intoJun 10, 2026
Merged
Conversation
…uard
Four cloud-path fixes for `hm run --backend cloud`:
- Watch URL pointed at the API host with the wrong path shape, so the
printed link landed on raw JSON / a 404 instead of the dashboard. Lift
the `api.` -> `app.` heuristic out of `hm-plugin-cloud`'s login flow
into a shared `hm_config::app_url` helper, plumb the resolved dashboard
base into `CloudBackend`, and build the link as
`{app}/{org}/pipelines/{slug}/builds/{n}` to match the SPA route.
(cloud-watch-url-host-1)
- A server-side canceled build was reported to the user as a failure
(exit 1). `watch_build` now maps the terminal state via
`exit_code_for_state` (passed->0, canceled->130, else->1) and the
backend maps that to `BuildStatus::Canceled`, mirroring the local
scheduler; the `BuildEnd` event carries 130 too.
(cloud-canceled-as-failed-1)
- The worktree archive had no size guard and uploaded silently. Add an
"uploading N.N MB" notice before the POST, a soft warning that names
the largest top-level paths, and a hard cap (6 MiB, aligned with the
backend's ~8 MB JSON body limit after base64) that fails fast with a
§5 doctrine error (`source_too_large`: observed vs cap, biggest paths,
the .gitignore fix, stable code + doc URL). (cloud-archive-no-size-guard-1)
- A log token was minted once; on expiry mid-build the remaining logs
were silently dropped. Re-mint before spawning a stream when within a
5-minute safety margin of expiry, and on a `401 Unauthorized` surface a
one-line notice on the step instead of dropping it.
(cloud-logtoken-expiry-silent-loss-1)
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Four cloud-path fixes for
hm run --backend cloud, consolidated into one commit on top ofmain:api.→app.heuristic is lifted out ofhm-plugin-cloud's login flow into a sharedhm_config::app_urlhelper, the resolved dashboard base is plumbed intoCloudBackend, and the link is built as{app}/{org}/pipelines/{slug}/builds/{n}to match the SPA route.watch_buildnow maps the terminal state viaexit_code_for_state(passed→0, canceled→130, else→1), the backend maps that toBuildStatus::Canceled(mirroring the local scheduler), and theBuildEndevent carries 130.source_too_largeerror (observed vs cap, biggest paths, the.gitignorefix, stable code + doc URL).401 Unauthorizedsurface a one-line notice on the step instead of dropping it.Findings addressed
cloud-watch-url-host-1cloud-canceled-as-failed-1cloud-archive-no-size-guard-1cloud-logtoken-expiry-silent-loss-1Verification
Targeted checks on the touched crates (
hm-config,hm-exec,hm-plugin-cloud,harmont-cli). No full-suite or DB-touching runs (shared-machine guardrails).Fix-specific tests that passed:
cloud::backend::tests::watch_url_uses_app_host_and_pipelines_pathcloud::watch::tests::passed_is_zero_canceled_is_130_else_is_onecloud::backend::tests::archive_over_cap_fails_with_source_too_largecloud::backend::tests::archive_under_warn_passescloud::backend::tests::human_mb_formats_one_decimalerror::tests::unauthorized_is_matchable_and_displayedlocal::source::tests::build_archive_emits_nonempty_gzip_for_simple_treelocal::source::tests::build_archive_skips_dot_gitJudge verdict
Approved. No blocking issues. Implementer verification passed.
Generated by the Harmont release-readiness workflow (automated; needs human review before merge). 🤖