fix(variable/update): stop exposing secret values in output#226
Conversation
The update command was printing all variable key-value pairs (including secrets the user didn't touch) after a successful update. Now it only shows the keys that were explicitly updated, with no values displayed. Interactive mode also masks existing values in the selection prompt. Closes SEI-413 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe variable update command now records which keys were explicitly updated, masks existing values in the interactive UI, and changes non-interactive JSON/table outputs to report only the updated keys (values omitted). Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 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 docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cmd/variable/update/update.go`:
- Line 106: The code appends keyTable[updateVarSelect] to opts.updatedKeys
without checking for duplicates; modify the update path (where opts.updatedKeys
is appended) to ensure uniqueness by checking whether keyTable[updateVarSelect]
already exists in opts.updatedKeys (or maintain a temporary set/map of seen
keys) before appending, so that repeated edits of the same variable during an
interactive session do not produce duplicate entries in opts.updatedKeys and the
final JSON/table output.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 762bfef8-9784-40c4-98e6-d2440ed3d5e5
📒 Files selected for processing (1)
internal/cmd/variable/update/update.go
Prevents duplicate rows in output when the same variable is edited multiple times in one interactive session. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
variable updateno longer prints secret values in table or JSON output — only the key names of explicitly updated variables are shownPASSWORD = K6H***instead of the full value)Closes SEI-413
Test plan
zeabur variable update --id <id> -i=false -k "FOO=bar"— output should show onlyFOO, no value--json— output should be[{"Key": "FOO"}], noValuefieldPASSWORD) are not leaked in any output mode🤖 Generated with Claude Code
Summary by CodeRabbit
Features
Changes