feat(env): adding env var commands to cli - #90
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Pull request overview
Adds support for managing plain-text deployment environment variables in the Serverless CLI, including API client methods, CLI commands, display formatting, and generated documentation.
Changes:
- Introduces
serverless apps envwithlist,set, andunsetsubcommands (including--value/--value-filehandling). - Adds Serverless API client support for listing/updating/deleting deployment environment variables, plus tests.
- Extends serverless display/table helpers to render env-var outputs (including created/updated timestamps) and updates docs.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/serverless/value.go | New shared helper to read values from --value / --value-file / stdin with newline trimming. |
| internal/cmd/serverless/value_test.go | Unit tests for readValueFlag behavior (flag/file/stdin/error). |
| internal/cmd/serverless/secrets.go | Reuses shared readValueFlag and removes duplicated secret value-reading helper. |
| internal/cmd/serverless/secrets_test.go | Removes tests tied to the deleted readSecretValue helper. |
| internal/cmd/serverless/display.go | Adds env-var display result types and new table columns (Key/Value/Created/Updated). |
| internal/cmd/serverless/display_test.go | Tests env-var display rows/headers and unset result shape. |
| internal/cmd/serverless/apps.go | Registers the new apps env command group. |
| internal/cmd/serverless/apps_env.go | Implements serverless apps env {list,set,unset} commands and flag wiring. |
| internal/api/serverless/env.go | Adds API client methods for env-var list/update/delete endpoints. |
| internal/api/serverless/env_test.go | Adds API client tests for env-var list/update/delete and error cases. |
| docs/runware_serverless_apps.md | Adds apps env to the serverless apps command docs. |
| docs/runware_serverless_apps_env.md | New generated docs for runware serverless apps env. |
| docs/runware_serverless_apps_env_list.md | New generated docs for apps env list. |
| docs/runware_serverless_apps_env_set.md | New generated docs for apps env set. |
| docs/runware_serverless_apps_env_unset.md | New generated docs for apps env unset. |
Suppressed comments (1)
internal/api/serverless/env.go:77
- This debug log records the full response body, which includes plaintext environment variable values on success. To reduce the chance of leaking sensitive data into logs, prefer logging only metadata (e.g., status/path) and body length, or redact
valuefields.
if c.logger != nil && c.logger.Enabled(ctx, slog.LevelDebug) {
c.logger.Debug("serverless response", //nolint:errcheck,gosec
"path", "/v1/deployments/"+deploymentID+"/environment-variables/"+key,
"status", resp.StatusCode(),
"body", string(resp.Body),
)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fb5d85d to
9ac2ed2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (1)
internal/cmd/serverless/secrets.go:116
- When setting a secret, errors from readValueFlag will say "read value from ..." (stdin/file). This is a user-facing message and is less clear in the context of
serverless secrets set. Wrapping the error here makes it explicit that the failure occurred while reading the secret value.
secretValue, err := readValueFlag(value, valueFile, cmd.InOrStdin())
if err != nil {
return err
}
9ac2ed2 to
87c682f
Compare
No description provided.