Fix false standard vars warning when variable is wired via init decorator#596
Conversation
🦋 Changeset detectedLatest commit: 5e8624e The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…init decorator When _checkStandardVars detects a standard env var in the environment, it now checks whether that variable is already referenced in the corresponding init decorator (e.g. @initOp(token=$OP_SERVICE_ACCOUNT_TOKEN)). If so, the warning is suppressed since the variable IS connected to the plugin. Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/96c43351-fdd6-4a8d-b946-cdf545a71da8 Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
…ParsedValue Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/96c43351-fdd6-4a8d-b946-cdf545a71da8 Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
|
@copilot - is there not simpler way to figure out which config items a decorator depends on? If not, maybe we should add that as a more general helper on the decorator instance itself? |
…standard vars check Move _checkStandardVars call to after root decorator processing so decValueResolver.deps is populated. This replaces the custom collectVarRefsFromParsedValue AST walker with a simple check against the existing resolver dependency tracking infrastructure. Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/f865c23c-ab01-4fbe-9f36-6ef2867aca6e Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Yes — the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
commit: |
_checkStandardVarsunconditionally warns when a plugin's standard env var (e.g.OP_SERVICE_ACCOUNT_TOKEN) exists in the environment, even when it's already wired via the init decorator (@initOp(token=$OP_SERVICE_ACCOUNT_TOKEN)).Changes
packages/varlock/src/env-graph/lib/plugins.ts:_checkStandardVarsnow checksdecValueResolver.depson processed init decorator instances to identify already-wired variables. Detected standard vars that match a wired dependency are filtered out before the warning is emitted.packages/varlock/src/env-graph/lib/env-graph.ts: Moved_checkStandardVarscall to after root decorator processing so thatdecValueResolver.depsis populated and available for the check.packages/varlock/src/env-graph/test/plugins.test.ts: Three new test cases covering: warning fires when var is present but not wired, warning suppressed when wired via init decorator, no warning when var absent from environment.Example
Previously warned despite
token=$OP_SERVICE_ACCOUNT_TOKENbeing explicitly wired. Now correctly suppressed.