Skip to content

[Backport release-1.19] fix(conf): read DAPR_* environment variables when a setting is used - #1326

Merged
dapr-bot merged 2 commits into
release-1.19from
backport-1262-to-release-1.19
Oct 21, 2026
Merged

dapr-bot merged 2 commits into
release-1.19from
backport-1262-to-release-1.19

Conversation

@dapr-bot

Copy link
Copy Markdown
Collaborator

Backport 1ae907d from #1262.

…1262)

* fix(conf): read DAPR_* environment variables when a setting is used

settings previously snapshotted the environment at import time, so
variables set afterwards (python-dotenv, CLI arg parsing, frameworks
that import dapr early) were silently ignored and the SDK dialed
localhost. Resolve them on access instead; explicit assignments to
settings still take precedence. Defaults that were bound at function
definition (RetryPolicy, actor runtime/proxy/host timeouts) now resolve
when called.

Signed-off-by: Casper Nielsen <casper@diagrid.io>

* fix(conf): address review feedback on lazy settings

Name the setting in coercion errors, keep dir(settings) listing the
settings, give the RetryPolicy default a readable repr, and cover the
actor timeout defaults and edge cases in tests.

Signed-off-by: Casper Nielsen <casper@diagrid.io>

* fix(actor): keep explicit timeout=None as "no timeout" for actor clients

Use a shared _FromSettings sentinel (now in dapr.conf) for the actor timeout
defaults and RetryPolicy.max_attempts, so omitting the argument reads the
setting at call time while an explicit None is still forwarded unchanged.
Type the sentinel honestly instead of silencing mypy, document the defaults,
restore hidden settings after each settings test, and cover register_actor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>

* fix(actor): type explicit None timeouts and restore settings in tests

Annotate the actor timeout parameters as Union[int, None, _FromSettings]
so an explicit None ("no timeout") type-checks, and widen the actor
clients' timeout to Optional[int] to match. Restore any assigned
DAPR_HTTP_TIMEOUT_SECONDS (including None) after the register_actor
tests, and document where RetryPolicy.max_attempts defaults from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>

---------

Signed-off-by: Casper Nielsen <casper@diagrid.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1ae907d)
Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com>
@dapr-bot
dapr-bot requested review from a team as code owners October 21, 2026 09:42
@dapr-bot dapr-bot added automerge allows dapr bot to merge a PR after tests pass autoupdate labels Oct 21, 2026
@dapr-bot
dapr-bot enabled auto-merge (squash) October 21, 2026 09:42
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-1.19@6c7eb89). Learn more about missing BASE report.

Files with missing lines Patch % Lines
dapr/conf/__init__.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             release-1.19    #1326   +/-   ##
===============================================
  Coverage                ?   86.87%           
===============================================
  Files                   ?      163           
  Lines                   ?    12994           
  Branches                ?        0           
===============================================
  Hits                    ?    11288           
  Misses                  ?     1706           
  Partials                ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dapr-bot
dapr-bot merged commit 51f83c3 into release-1.19 Oct 21, 2026
20 checks passed
@dapr-bot
dapr-bot deleted the backport-1262-to-release-1.19 branch October 21, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge allows dapr bot to merge a PR after tests pass autoupdate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants