langgraph/libs/cli/tests
raghavverma-langchain c6335a4255
fix(cli): omit an empty secrets list when updating a deployment (#9737)
## Summary

`langgraph deploy` builds its secrets list from `.env`, so without one
(or with one that has no values) it sent `secrets: []` on every update.
the control plane already reads an empty list on update as "keep the
current values", so nothing changed, but the request said "replace with
nothing". now updates leave `secrets` out when there's nothing to send

- the check lives in the two update methods on the host backend client,
so local builds, remote builds and `--push-to` / `--image-uri` updates
all get it
- creating a deployment still sends `secrets`, even when empty, since
the control plane requires it there
- no change when your `.env` has variables: the full list is still sent
and replaces the deployment's variables as before
- the js cli gets the same change in langchain-ai/langgraphjs#3414

## Test Plan
- [x] `make test` passes in `libs/cli` (743 tests). ruff and format are
clean; `ty` only reports the two `contextmanager` deprecation warnings
that are also on main
- [x] New client test: an update with an empty list omits `secrets`.
Updated the four deploy command tests that expected `"secrets": []` on
update. All of these fail without the change
- [x] New client test: a remote-build update still forwards a non-empty
list. Fails if that update drops `secrets`
- [ ] After release, `langgraph deploy` without a `.env` against an
existing deployment keeps the variables set in the UI

## Demo

real cli runs, main vs this branch, against a local server that records
each request, with no .env in the project. the control plane handles
both requests the same way; the difference is the `secrets` field in the
update

<img width="1100" alt="langgraph deploy update request before and after"
src="https://github.com/user-attachments/assets/578b6edf-170f-4e4a-95d0-84a9ec97bc9a"
/>
2026-11-20 10:33:23 -08:00
..
integration_tests cli[minor]: Add langgraph new command (#2369) 2024-11-12 14:30:51 -05:00
unit_tests fix(cli): omit an empty secrets list when updating a deployment (#9737) 2026-11-20 10:33:23 -08:00
__init__.py libs: add cli, sdk-py, sdk-js and move core langgraph 2024-06-17 20:37:25 -04:00