fix(config): migrate ~/.harmont config forward, plumb HARMONT_* env, hint on legacy .harmont/ project dir#133
Merged
Conversation
…hint on legacy .harmont/ The 0.0.5 -> rename release moved user config from ~/.harmont/ to ~/.config/hm/ and the project pipeline dir from .harmont/ to .hm/, but left no migration or fallback. Upgrading users silently lost custom api_url/org, found HARMONT_ORG/HARMONT_API_URL ignored despite docs and error messages telling them to set those vars, and hit dead-end errors in repos still carrying .harmont/. This fixes the four config-contract gaps: - cfg-migrate-config-2: layer the legacy ~/.harmont/config.toml as a lowest-priority figment layer below the new file (Config::load_layered), so a custom [cloud] api_url/org survives an upgrade; the new file always wins. creds::load() falls back to ~/.harmont/credentials.toml when the new store is empty, so stored tokens + active org carry forward (writes still target the new path, migrating on first login). - cfg-env-contract-4: bind HARMONT_API_URL -> cloud.api_url and HARMONT_ORG -> cloud.org into the figment config (harmont_env provider), the single source of truth read by both `hm run` (ctx.config) and `hm cloud *` (settings.rs). Drop the dead `Cli.api_url` clap field that parsed HARMONT_API_URL but was never read. - cfg-project-dir-3: when .hm/ is absent but a legacy .harmont/ dir is present, detect_language[_python_first] now emits a doctrine-shaped actionable error pointing at the rename and `mv .harmont .hm` instead of the bare "no .hm/ directory found". - cfg-harmontignore-5: delete the never-constructed ArchiveTooLarge variant whose hint referenced the stale .harmontignore (honored nowhere); also delete the never-constructed NoOrganization variant whose stale string said `hm org switch` and `HARMONT_ORG` (the live path is ResolvedCtx::org()). Tests: legacy-layer carry-forward + new-file-wins (hm-config), HARMONT_* env override via figment::Jail, legacy .harmont/ migration hint (hm-dsl-engine), legacy_hm_config_dir (hm-util).
Remove the ~/.harmont config/credential forward-migration and the legacy .harmont/ project-dir detection hint — no point keeping the old directory alive. Keeps the HARMONT_* env-var plumbing and the api_url->env move. - hm-util: drop legacy_hm_config_dir() - hm-config: drop creds legacy_path fallback; drop the legacy config layer (collapse load_layered back into load_from_paths, env layering retained) - hm-dsl-engine: detect bails plainly when .hm/ is absent (no .harmont hint)
Config/auth: HM_ORG, HM_API_URL, HM_API_TOKEN, HM_APP_URL, HM_LOGIN_CODE. Pipeline envelope: HM_PIPELINE_ORG/SLUG (Python + TS readers). Test harness: HM_LOCAL_E2E, HM_CLI_PATH, HM_CIDSL_PY. Install script: HM_INSTALL_*, HM_UNAME_*. Rust statics (HARMONT_PY/HARMONT_TS_*) are not env vars and are untouched.
…migrate-and-env # Conflicts: # crates/hm-config/src/lib.rs # crates/hm-plugin-cloud/src/auth/login.rs
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
Migrates the
hmCLI configuration forward and tightens its environment plumbing:~/.harmontconfig into the new layered config store (hm-configcrate, figment-based) so users upgrading do not lose credentials or settings.HARMONT_*environment variables through the new config layering so env overrides apply consistently across verbs (auth, build, run, billing, etc.)..harmont/project directory is detected (the project pipeline dir is now.hm/), pointing them at the rename without silently failing discovery.This rides along with the broader CLI restructure already merged on this feature line (new
hm-config,hm-exec,hm-render,hm-vmcrates;.harmont/→.hm/migration across examples and templates).Findings addressed
~/.harmontforward-compat and legacy.harmont/project-dir hinting.HARMONT_*env-var plumbing through the layered config store.(No blocking issues were raised by the judge; finding ids: config-migrate, harmont-env-plumb, legacy-harmont-dir-hint.)
Verification evidence
cargo check -p hm-config -p hm-plugin-cloud→ Finisheddevprofile ... in 5.83s (clean; touched config crates compile).main.Heavy full-suite runs were deliberately skipped per shared-machine guardrails (no DB mutation, no long-running servers); checks were time-boxed to the touched crates.
Judge verdict
Approved. Blocking issues: none.
Generated by the Harmont release-readiness workflow (automated; needs human review before merge). 🤖