fix(hm): discovery prefers Python + empty registry for pipeline-less repos#34
Merged
Merged
Conversation
…-less repos
Two fixes for backend pipeline discovery, surfaced running the hm-based
render sandbox in prod:
1. A repo with no .harmont/ (or no .py/.ts files) now yields the empty
discovery envelope {"pipelines":[]} instead of erroring. The backend
fans discovery across every repo in an installation, most of which
declare no pipelines; those must be a no-op, not a render_failed retry
loop. New detect::has_pipeline_files + EMPTY_ENVELOPE short-circuit.
2. hm pipelines / hm render now prefer Python when a repo carries BOTH
.py and .ts (new detect::detect_language_python_first). The discovery
envelope is Python-only today, so a repo with a redundant .ts (e.g.
harmont-cli's own ci.ts) resolved to the unsupported TS registry and
bailed. hm run keeps the TypeScript-preferring detect_language, so the
local-run default is unchanged.
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
Two fixes to the machine-facing
hm pipelines/hm rendercommands, found when the Harmont backend started driving its render sandbox viahmin prod:Empty registry for pipeline-less repos. A repo with no
.harmont/(or no.py/.tsfiles) now prints the empty envelope{"schema_version":"1","pipelines":[]}instead of erroring. The backend fans pipeline discovery across every repo in a GitHub App installation — most declare no pipelines — so those must be a no-op, not arender_failedretry loop. (detect::has_pipeline_files+EMPTY_ENVELOPEshort-circuit.)Prefer Python when both DSLs are present.
hm pipelines/hm rendernow resolve to Python when a repo carries both.pyand.ts(detect::detect_language_python_first). The discovery envelope is Python-only today, so a repo with a redundant.ts(e.g. this repo's own.harmont/ci.ts) was resolving to the unsupported TS registry and bailing.hm runkeeps the TypeScript-preferringdetect_language— the local-run default is unchanged.Why
In prod, after switching the render sandbox to
hm, discovery surfaced:no .harmont/ directory foundfor the ~7 pipeline-less repos in the installation (fix feat(dev): hm dev local-deployment CLI + docker-gated CI #1),hm pipelines not supported for TypeScriptfor this repo, which has bothci.pyandci.ts(fix feat(tui): host-side Mission Control TUI for hm run/dev/cloud watch #2).Tests
detect.rs:detect_language_python_first(mixed→Python, ts-only→TS, no-dir→error) +has_pipeline_files(true for py/ts, false for missing/empty).cmd_pipelines.rs: newpipelines_emits_empty_envelope_when_no_harmont_dir(runs without python3 — short-circuits before the engine).detect_language(TS-preferring, used byhm run) and its tests are untouched.cargo clippy --all-targets -- -D warningsclean.Note
Pre-existing on
main(not this PR):bundled_sources::tests::{harmont_py_contains_pipeline,extract_harmont_py_creates_files}referencepipeline.py, removed by #32. Untouched here.