CLI deploy: env layering and secrets-aware sync#148
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
WalkthroughThe PR adds environment variable and secret management to the CLI, introducing persistent deploy state, support for environment file and CLI flag overrides, secret synchronization during deployment, and Changes
Sequence DiagramsequenceDiagram
participant CLI as User/CLI
participant DeployCmd as Deploy Command
participant Config as Config/Env System
participant Gateway as Gateway/Client
participant Remote as Remote API
CLI->>DeployCmd: run_deploy(args, config_path)
DeployCmd->>Config: load_merged_app_env(config_path, app_dir)
Config-->>DeployCmd: merged_env: HashMap
DeployCmd->>Config: resolve_env_overrides(env, flags, file)
Config-->>DeployCmd: resolved_env: HashMap
DeployCmd->>DeployCmd: checksum_env_map(resolved_env)
DeployCmd->>Gateway: create/upsert app deployment
Gateway->>Remote: POST /apps (with deployment)
Remote-->>Gateway: success
DeployCmd->>Gateway: list_secret_keys(environment_id)
Gateway->>Remote: GET /secrets (environment_id)
Remote-->>Gateway: [existing_keys]
DeployCmd->>DeployCmd: sync_environment_secrets(desired, existing)
DeployCmd->>Gateway: set_secret(environment_id, key, value)
Gateway->>Remote: POST /secrets (key, value)
Remote-->>Gateway: success
DeployCmd->>Gateway: delete_secret(environment_id, old_key)
Gateway->>Remote: DELETE /secrets (old_key)
Remote-->>Gateway: success
DeployCmd->>DeployCmd: save_state(checksums, sync_summary)
DeployCmd-->>CLI: deployment complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fb114d9 to
440d8cc
Compare
4 tasks
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
--env-fileand repeated--env KEY=VALUEflags with deterministic precedenceSummary by CodeRabbit
Release Notes
New Features
.envfiles during deployment.statespaceignorefile support to exclude files from deploymentBug Fixes
.envfiles are no longer automatically loaded during serve operations