Repository navigation
fix(secrets): compensate managed value delete failures - #1298
Conversation
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughEnvironment-variable and secret deletion now use a shared managed-value flow. The flow persists binding detachment before store deletion and applies compensation based on the store outcome. The local secret store snapshots backend values and restores them when backend removal or index persistence fails. ChangesManaged-value deletion
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Command
participant ManagedValueDelete
participant Config
participant SecretsStore
Command->>ManagedValueDelete: submit deletion request
ManagedValueDelete->>Config: save detached binding
ManagedValueDelete->>SecretsStore: delete managed value
alt ordinary store error
ManagedValueDelete->>Config: restore and save binding
else indeterminate store error
ManagedValueDelete-->>Command: return consistency error
end
Merge Risk: ⚪ Minimal · up to No deletion-consistency issue remains established by this review; the change is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The new flow improves recovery from ordinary deletion failures, but an interrupted deletion can leave a credential stored after its context attachment has been removed. The identified exposure is limited to the selected local context; no new remote entrypoint is evident. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
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 |
✅ Deploy Preview for devsydev canceled.
|
|
@greptileai review |
|
| if !exists { | ||
| return nil |
There was a problem hiding this comment.
If the requested name is absent, Delete may still have repaired ownership information for other legacy secrets in memory. This return skips saving those repairs, unlike the previous delete path, so they remain absent from the index on disk until a later operation saves them. Save the index when the ownership repair changed it.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Summary
Store.Get; context deletion continues to propagate store errors without masking their type.Closes #1293
Validation
go test ./pkg/secrets/... ./cmd/internal/managedvalue/... ./cmd/secrets/... ./cmd/env/... ./cmd/context/...go vet ./pkg/secrets/... ./cmd/secrets/... ./cmd/env/... ./cmd/context/... ./cmd/internal/managedvalue/...git diff --checktask cli:lintreports 233 repository-wide findings outside this branch diff.Summary by CodeRabbit