litellm/.github/workflows
Kolade Fajimi d1320404fe
fix(redis): coerce env var string types and fix param discovery through decorator wrappers (#30644)
* fix(redis): coerce env var string types and fix param discovery through decorator wrappers

inspect.getfullargspec doesn't work on redis.Redis/redis.RedisCluster because
their __init__ is wrapped by @deprecated_args, which replaces the explicit
signature with *args/**kwargs internally. getfullargspec returns an empty arg
list, so _get_redis_kwargs and _get_redis_cluster_kwargs silently dropped every
real constructor parameter not in their hand-picked include_args set --
cluster_error_retry_attempts and connection_error_retry_attempts among them, so
an operator's configured retry bound never reached the Redis Cluster client and
it fell back to redis-py's own default instead.

Rebased onto litellm_internal_staging, which had independently added
_init_arg_names (MRO-walking, inspect.unwrap-based) for the same class of bug
in _get_redis_url_kwargs. Reused that pattern (as _unwrapped_init_args, without
the MRO walk: redis.Redis/RedisCluster declare every real parameter directly on
their own __init__, and MRO-walking breaks the tests here that mock the class
with autospec=True, since inspect.getmro needs a real __mro__) rather than
introducing a second, differently-shaped fix for the same problem.
_get_redis_cluster_kwargs now also honors its own client argument instead of
ignoring it, so the async cluster client's own extra constructor kwargs
(cluster_error_retry_attempts, connection_error_retry_attempts,
decode_responses, ...) are no longer filtered out by introspecting the sync
class regardless of which client is actually built.

Also fixes environment variables and Helm --set values always arriving as
strings: redis-py 8.x changed health_check_interval's arithmetic to require a
real number, so a stringified value raised TypeError on every Redis operation
instead of connecting. _coerce_redis_kwargs_types coerces to each parameter's
declared type at the end of _get_redis_client_logic, with an explicit type
table for max_connections/socket_timeout/socket_connect_timeout since redis-py
8.x changed the timeout defaults from None to int 5, which would otherwise
make a fractional value fail int() and get dropped.

Co-authored-by: mangabits <1457532+mangabits@users.noreply.github.com>

* ci: verify redis-py client version compatibility across a version matrix

* test(redis): assert an async-only cluster kwarg every matrix version declares

connection_error_retry_attempts is on the async cluster constructor in redis-py
5.x only; 6.0 removed it in favor of retry. The 6.4.0, 7.4.1 and 8.0.1 legs were
failing on that missing parameter name rather than on the behavior under test,
while the allow-list itself was doing the right thing on all four versions.

decode_responses is async-cluster-only on every version the matrix covers, so it
stands in for the same property: the sync cluster class takes it through **kwargs
and never names it in its signature. Reverting _get_redis_cluster_kwargs to ignore
its client argument still fails both tests on 5.3.1 and 8.0.1.

test_async_cluster_passes_async_only_kwargs now builds the real async cluster
client and reads connection_kwargs off it, so it no longer needs a patched class
factory; the constructor does no I/O. The retry-attempts test keeps its patch,
since redis-py >= 6 stores no cluster_error_retry_attempts attribute on the built
client and the constructor call is the only place the forwarded value shows up.

The _get_redis_cluster_kwargs docstring cited the same two parameters as its
examples of async-only kwargs, which is what made the test look reasonable;
cluster_error_retry_attempts is on both classes and connection_error_retry_attempts
is gone from 6.0 on, so it now names decode_responses instead.

* test(redis): drop internal patches from the kwarg coercion tests

The test-quality gate flagged the new patch() calls on litellm internals these
tests added. Three of them faked litellm._redis.inspect.signature with a MagicMock
to hand _coerce_redis_kwargs_types a synthetic parameter; that function already
takes a client argument, so they pass stub functions instead, matching the
_redis_signature_8x idiom the file uses elsewhere. The fourth patched
_redis_kwargs_from_environment to {} to prove _get_redis_client_logic raises
without a host or url, which clearing the real env keys through
_get_redis_env_kwarg_mapping does without pinning the test to that call.

Both files now sit one TQ008 below the merge base rather than six above it.

* fix(redis): keep the sync client construction inside the basedpyright budget

_get_redis_client_logic now returns dict[str, object] rather than an untyped
dict, which is the honest type for operator-supplied config, but it turns the
33 reportUnknownArgumentType errors at redis.Redis(**redis_kwargs) into 33
reportArgumentType errors plus one reportCallIssue, both over their budget.
No static type fits: redis-py's constructor declares 40-odd differently typed
parameters and the values arrive from config and env, so the allow-list and
coercion above are derived from that same signature and redis-py validates each
value itself at runtime.

The two suppressions name their exact rule and carry that reason. The file ends
up 42 basedpyright errors below the merge base, with reportArgumentType and
reportCallIssue back at the base counts of 3 and 0.

* fix(redis): coerce cluster-only and None-default bool kwargs

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: mangabits <1457532+mangabits@users.noreply.github.com>
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-31 20:51:31 -07:00
..
_test-unit-base.yml ci: measure enterprise/ coverage (#37788) 2026-08-22 22:55:01 -07:00
auto-close-duplicates.yml fix(ci): close only identical-title duplicates, dry-run the sweep, reopen on reply 2026-08-29 17:30:01 -04:00
auto_update_price_and_context_window.yml chore(ci): close the test-census blind spots and move scripts out of workflows/ (#37586) 2026-08-20 10:07:14 -07:00
check-schema-sync.yml ci: give the remaining pull_request workflows a concurrency group 2026-08-08 03:25:38 +00:00
check-ui-api-types.yml fix(proxy): regenerate lazy OpenAPI snapshot and guard it in CI 2026-08-26 14:32:04 -07:00
check_duplicate_issues.yml fix(ci): close only identical-title duplicates, dry-run the sweep, reopen on reply 2026-08-29 17:30:01 -04:00
ci-coverage.yml feat(ci): assert .github/workflows holds only workflows, correctly named (#37616) 2026-08-20 21:36:26 +00:00
close_low_quality_prs.yml feat(agent-shin): automated PR/issue triage, low-quality auto-close, and review-gate label lifecycle (#30433) 2026-06-17 20:42:27 -07:00
codeql.yml ci(zizmor): gate PRs on medium+ findings and clear existing ones (#30797) 2026-06-18 18:26:03 -07:00
codspeed.yml ci: build the benchmark environment outside the CodSpeed runner (#38426) 2026-08-29 13:58:04 -07:00
conventional-commits.yml ci: give the remaining pull_request workflows a concurrency group 2026-08-08 03:25:38 +00:00
create-release-branch.yml ci(release): create stable/X.Y.x line branch on X.Y.0 tags (#29457) 2026-06-01 15:56:34 -07:00
create-release.yml fix(release): make Create Release reliable for stable maintenance cuts (#31986) 2026-07-02 16:05:11 -07:00
create_daily_oss_agent_shin_branch.yml fix(ci): make every remaining CI checkout shallow (#35997) 2026-08-05 14:32:17 -07:00
create_daily_staging_branch.yml fix(ci): make every remaining CI checkout shallow (#35997) 2026-08-05 14:32:17 -07:00
e2e_record_replay.yml ci(e2e): record the e2e suite weekly and replay it on weekdays with zero egress (#38163) 2026-08-24 23:49:03 -04:00
guard-fork-dependencies.yml ci: give the remaining pull_request workflows a concurrency group 2026-08-08 03:25:38 +00:00
guard-main-branch.yml chore(ci): retire daily OSS branches in favor of litellm_internal_staging 2026-07-20 11:38:52 -07:00
helm_unit_test.yml ci: give the remaining pull_request workflows a concurrency group 2026-08-08 03:25:38 +00:00
image-scan.yml fix(ui): boot the UI image as an arbitrary uid by anchoring nginx writes under /tmp (#37982) 2026-08-24 11:57:36 -07:00
issue-keyword-labeler.yml chore: fixes 2026-04-05 01:30:57 -07:00
label-component.yml chore: fixes 2026-04-05 01:30:57 -07:00
mutation-test.yml fix(ci): name the file mutmut actually writes partial results to 2026-08-25 23:54:48 -07:00
osv-scan.yml fix(ci): point OSS contributor workflows to litellm_oss_staging (#31270) 2026-06-24 21:07:59 -07:00
publish-basedpyright-base-counts.yml perf(ci): cache the Rust build the unit shards compile from scratch (#37795) 2026-08-21 20:15:08 -07:00
scorecard.yml chore: fixes 2026-04-05 01:30:57 -07:00
stale.yml chore: fixes 2026-04-05 01:30:57 -07:00
sync-schema.yml chore: fixes 2026-04-05 01:30:57 -07:00
sync-together-ai-models.yml fix(ci): fall back to github.token when the GH_TOKEN secret is unset in the Together sync workflow 2026-08-28 12:24:05 -07:00
test-code-quality.yml Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_ban_data_migrations 2026-08-22 09:55:24 -07:00
test-linting.yml perf(ci): cache uv dependencies in the lint job (#37783) 2026-08-22 22:44:32 -07:00
test-litellm-ui-build.yml perf(ci): gate the lint, MCP and dashboard jobs on the pull request's file list (#37559) 2026-08-19 18:32:21 -07:00
test-litellm-ui-lint.yml ci: give the remaining pull_request workflows a concurrency group 2026-08-08 03:25:38 +00:00
test-litellm-ui-unit.yml fix(ci): run the full dashboard suite when a change reaches outside src/ (#37563) 2026-08-19 23:09:03 -07:00
test-mcp.yml ci: measure enterprise/ coverage (#37788) 2026-08-22 22:55:01 -07:00
test-model-map.yml feat(ci): assert .github/workflows holds only workflows, correctly named (#37616) 2026-08-20 21:36:26 +00:00
test-postgres.yml ci: port the Postgres suites off CircleCI onto service containers (#37785) 2026-08-22 22:45:30 -07:00
test-redis-compat.yml fix(redis): coerce env var string types and fix param discovery through decorator wrappers (#30644) 2026-08-31 20:51:31 -07:00
test-rust.yml feat(rust): port BaseAWSLLM auth (credential resolution + SigV4) to litellm-core as a base provider (#33888) 2026-07-18 19:12:00 -07:00
test-semgrep.yml fix(ci): retry setup-uv installs to survive transient manifest fetch failures 2026-07-14 14:41:36 -07:00
test-terraform-modules.yml feat(terraform/aws): make VPC, Aurora, and Redis optional (#36676) 2026-08-12 15:27:13 -07:00
test-terraform-provider.yml feat(terraform): coverage-enforcing CI gate against the latest OpenAPI spec (#38710) 2026-08-28 17:11:43 -07:00
test-unit-documentation.yml perf(ci): cache the Rust build the unit shards compile from scratch (#37795) 2026-08-21 20:15:08 -07:00
test-unit-proxy-db.yml feat(ci): guard shard assignment across every sharded test tree (#37593) 2026-08-20 17:30:55 +00:00
test-unit.yml ci: add tests/test_litellm/endpoints to the misc unit-test shard 2026-08-29 15:21:39 -07:00
triage_issue_with_llm.yml feat(agent-shin): automated PR/issue triage, low-quality auto-close, and review-gate label lifecycle (#30433) 2026-06-17 20:42:27 -07:00
triage_reconsider.yml feat(agent-shin): automated PR/issue triage, low-quality auto-close, and review-gate label lifecycle (#30433) 2026-06-17 20:42:27 -07:00
weekly_load_anomaly.yml perf(ci): cache the Rust build the unit shards compile from scratch (#37795) 2026-08-21 20:15:08 -07:00
zizmor.yml ci: run zizmor and proxy-db unit tests on PRs targeting litellm_ branches 2026-07-16 11:44:35 -07:00