Skip to content

sync local env files with cloud on pull/push#6

Open
anserwaseem wants to merge 11 commits into
mainfrom
issue/2
Open

sync local env files with cloud on pull/push#6
anserwaseem wants to merge 11 commits into
mainfrom
issue/2

Conversation

@anserwaseem

@anserwaseem anserwaseem commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Env sync manual testing (issue #2)

Test app: ZEBtYm15gELt1xBwOsF3 (dev) · project: /tmp/ensemble-pull-test

Pull / push (verified)

Behavior Result
Pull syncs .env.config (user vars + asset keys) and .env.secrets
Push syncs both files to Firestore (content + envVariables/secrets + updatedAt)
Config CRUD both directions (Studio ↔ local)
Secrets CRUD both directions
Asset keys preserved on config push; excluded from env diff
Missing env file → push skipped + warning; empty .env.config → delete non-asset vars in cloud
${env.*} / ${secrets.*} in YAML after pull

Rules: Asset keys (assets, *_png) managed by asset sync, not user env CRUD. Missing file ≠ empty file.

Releases (verified)

Local snapshots only — release use does not push to cloud.

Rule Behavior
snapshot.config Full .env.config (assets, *_png, E1, …)
snapshot.secrets Never stored (security)
snapshot.assets fileName only — no publicUrl / copyText
release use Restores .env.config; does not touch .env.secrets

Flow: release create → mutate local → release use --hash <id> → optional ensemble push.

Automated: tests/core/envSync.test.ts, tests/commands/release.test.ts.

Commands

npm run build
node dist/index.js pull --app dev --dry-run --verbose
node dist/index.js push --app dev --dry-run --verbose
node dist/index.js release create --app dev -m "baseline" -y
node dist/index.js release use --app dev --hash <hash>

@anserwaseem anserwaseem self-assigned this Jun 15, 2026
@anserwaseem anserwaseem changed the title sync local env files with cloud on pull/push WIP: sync local env files with cloud on pull/push Jun 15, 2026
- Remove unused assetFileNames param from readProjectEnvFiles
- Consolidate config DTO builders via shared helpers
- Extract missing-env-file push warnings into envSync
- Partition cloud config into asset vs non-asset env variables
- Add prepareEnvPushState and computeEnvPullChanges helpers
- Slim push and sync command env wiring
@anserwaseem anserwaseem changed the title WIP: sync local env files with cloud on pull/push sync local env files with cloud on pull/push Jun 16, 2026
Also drop stale asset env keys from appConfig so pull doesn’t resurrect deleted asset vars
Missing or empty .env.config/.env.secrets now warn and prompt
[y/N] before clearing cloud values; empty secrets push {}
- resolve base vs .env.*.<alias> by default alias + file presence
- non-default pull creates scoped files; never stomps base
- missing env file skips push side; empty file wipes with confirm
- pull asset keys to resolved config path
- wire push/pull/release + docs/tests
- Commander ate --app when parent+child both declared it
- read --app from release parent opts in create/list/use
- align Firestore version id with GCS snapshot path
- alias-aware success/list hints for non-default apps
@sharjeelyunus sharjeelyunus linked an issue Jun 18, 2026 that may be closed by this pull request
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.

ensemble pull doesn't pull config folder not .env.config file.

2 participants