Skip to content

feat(cli): reconcile plugin resource env vars into .env on add - #518

Draft
MarioCadenas wants to merge 1 commit into
feat/registry-resource-listingfrom
feat/registry-env-reconcile
Draft

feat(cli): reconcile plugin resource env vars into .env on add#518
MarioCadenas wants to merge 1 commit into
feat/registry-resource-listingfrom
feat/registry-env-reconcile

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

Stack 3/7 — base: `feat/registry-resource-listing`

What

  • On `appkit add`, a plugin's declared resource fields are reconciled into the app's `.env` (values) and `.env.example` (names). Never overwrites keys the user already set.
  • Skips `platform`-origin fields (injected by Databricks Apps at deploy); pre-fills `static` defaults without prompting.
  • Interactive clack prompts by default; `--yes` for agents/CI, repeatable `--env KEY=VALUE`, `--no-resources` to opt out.
  • Pure reconcile core split from the fs+prompt writer for testability. Supersedes `declaredEnvVars`.

Tests

20 tests: origin filtering, dedup, .env parse/append, already-set/skip/write paths.

Part of the resource-aware `appkit add` stack (3/7).

- On 'appkit add', a plugin's declared resource fields are reconciled into
  the app's .env (values) and .env.example (names). Never overwrites keys
  the user already set.
- Skips platform-origin fields (injected by Databricks Apps at deploy time);
  pre-fills static defaults without prompting.
- Interactive clack prompts by default; --yes for agents/CI, repeatable
  --env KEY=VALUE to supply values, --no-resources to opt out.
- Pure reconcile core (collectEnvNeeds/reconcileEnv/parseEnv) split from the
  fs+prompt writer for testability. Supersedes declaredEnvVars.
- 20 new tests covering origin filtering, dedup, .env parsing/appending, and
  the already-set/skip/write paths.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant