fix(direct_control): honor bare EPICS_CA_* env vars - #120
Merged
Anubhuti Sinha (anubhutisinha04) merged 1 commit intoAug 12, 2026
Merged
Conversation
…re explicit overrides only
There was a problem hiding this comment.
Pull request overview
This PR fixes EPICS Channel Access environment-variable precedence in the direct-control PV monitoring module so that deployment-provided bare EPICS_CA_* variables are honored unless service-prefixed DIRECT_CONTROL_EPICS_CA_* overrides are explicitly set, matching stock EPICS client behavior.
Changes:
- Stop defaulting
DIRECT_CONTROL_EPICS_CA_AUTO_ADDR_LISTto"YES"inpv_monitorso it no longer silently clobbers a bareEPICS_CA_AUTO_ADDR_LIST=NO. - Add subprocess-based regression tests to validate precedence across bare vars, prefixed overrides, and “nothing set” behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/direct_control_service/src/direct_control/monitoring/pv_monitor.py | Removes the prefixed auto-address-list default so bare EPICS_CA_* (and libca defaults) are not overridden implicitly. |
| backend/direct_control_service/tests/test_epics_env_precedence.py | Adds regression tests that import pv_monitor in a clean subprocess env to validate precedence rules. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Anubhuti Sinha (anubhutisinha04)
approved these changes
Aug 12, 2026
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.
The PV monitor module set EPICS_CA_AUTO_ADDR_LIST from the service-prefixed DIRECT_CONTROL_EPICS_CA_AUTO_ADDR_LIST with a default of YES, which silently overrode a bare EPICS_CA_AUTO_ADDR_LIST=NO set by the deployment (every pod compose sets the bare form). Broadcast CA discovery therefore stayed on despite the compose comments promising confinement to the explicit address list.
The prefixed variables are now explicit overrides only: when unset, the standard EPICS_CA_* variables — and libca's own defaults (AUTO_ADDR_LIST=YES) — apply untouched, matching how a stock EPICS client behaves.
Adds subprocess-based regression tests covering all four precedence cases (bare honored, prefixed override wins when set, nothing set leaves the env alone). Test-suite conftest is unaffected: it sets the prefixed forms explicitly.