Document config-shaping env vars delivered via loadEnv .env files#564
Document config-shaping env vars delivered via loadEnv .env files#564kylebernhardy wants to merge 4 commits into
Conversation
Companion to HarperFast/harper#1580 (fixes HarperFast/harper#1513): HARPER_CONFIG / HARPER_SET_CONFIG / HARPER_DEFAULT_CONFIG delivered via a component .env are now applied before config composition. Documents precedence, encrypted-value and componentsRoot limitations. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds a new section to the environment variables documentation explaining how config-shaping variables are loaded early from .env files starting in version 5.2.0. The review feedback suggests a minor clarification to specify that the override: true property belongs to the loadEnv configuration rather than a generic component.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564 This preview will update automatically when you push new commits. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564 This preview will update automatically when you push new commits. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
harper#1580 has merged to main and is cherry-picked to v5.1 (harper#1754, patch label) — hold released, version text updated to mention 5.1.18+. Ready for review. Comment generated by an LLM (Claude Fable 5). |
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564 This preview will update automatically when you push new commits. |
kriszyp
left a comment
There was a problem hiding this comment.
I think you are filing a duplicate PR?
|
|
||
| Files are loaded in the order specified. | ||
|
|
||
| ## Config-Shaping Variables Are Not Honored |
There was a problem hiding this comment.
This guidance is now already present on origin/main in the loadEnv warning added by #579 (current main lines 49-57). A three-way merge keeps both insertions, so the page would explain the same rule and workaround twice. Could we rebase and fold only the uniquely useful warning-timing detail into the existing warning, or close this PR as superseded?
|
|
||
| The three configuration env vars — `HARPER_DEFAULT_CONFIG`, `HARPER_CONFIG`, and `HARPER_SET_CONFIG` (see [Configuration](../configuration/overview.md)) — shape Harper's root configuration, which is composed once at startup, **before components load**. Delivering one of them through a `loadEnv` `.env` file therefore has **no effect**: configuration is strictly top-down (the instance's configuration controls components, never the reverse), so a component cannot shape instance-wide config. | ||
|
|
||
| As of 5.2.0 (and 5.1.x patch releases from 5.1.18) this is no longer silent: Harper logs a prominent warning at startup for each config-shaping variable found in a component `.env` file — naming the variable and the file — and again at component load time (which also covers components deployed after startup). Earlier versions ignored these variables without any message. |
There was a problem hiding this comment.
The v5.1 backport first shipped in v5.1.19, not v5.1.18: merge 2fff82731 is not contained by the v5.1.18 tag, while it is contained by v5.1.19 (componentEnvPrepass.ts is likewise absent in 5.1.18 and present in 5.1.19). Please change this to from 5.1.19 so 5.1.18 operators are not told to expect warnings their version cannot emit.
Companion docs for HarperFast/harper#1580 (fixes HarperFast/harper#1513) — pivoted with the PR: config-shaping env vars delivered via a component's
.envare not honored (config is strictly top-down); what 5.2.0 adds is the loud, actionable warning replacing the old silent no-op. The section documents the behavior, the warning, and the supported channels.Hold merging until harper#1580 lands.
Generated by an LLM (Claude Fable 5).