Repository navigation
fix(terraform): mark litellm_key partial when /key/update rejects the request - #40522
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
… request Only the plannedKeyMetadata error path was calling d.Partial(true). When /key/update itself returned an error (e.g. 400 on Invalid budget_duration), the SDK still persisted the rejected planned values into state, so the next plan reported no changes and silently dropped the update. TestResourceKeyUpdateFailureKeepsPriorState caught this on litellm_internal_staging. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
devin-ai-integration
Bot
changed the base branch from
litellm_internal_staging
to
main
September 23, 2026 14:37
This branch has not been deployed
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.
TLDR
Problem this solves:
/key/updatestill persisted the bad planned values into Terraform state, so the nextterraform planshowed no drift and the update was silently droppedHow it solves it:
d.Partial(true)in thec.UpdateKeyerror path too, not only onplannedKeyMetadatafailuresUser Flow
Before: a Terraform user who typos
budget_duration = "bad"on alitellm_keysees the apply fail and then loses the guard on retriesterraform applyon alitellm_keywithbudget_duration = "bad"Invalid budget_duration 'bad'and the apply failsbudget_duration = "30d"and runterraform planagainAfter: the same user's retry actually applies the corrected value
terraform applyon alitellm_keywithbudget_duration = "bad"Invalid budget_duration 'bad'and the apply failsbudget_duration = "30d"and runterraform planagainbudget_durationchanging from""to"30d"and the next apply pushes it to the proxyRelevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (5264f8e)
cd terraform/provider && go test -timeout 60s -run TestResourceKeyUpdateFailureKeepsPriorState ./...After (ff8e0f8)
cd terraform/provider && go test -timeout 120s ./...Type
🐛 Bug Fix
Final Attestation