Skip to content

fix(dashboard-api): ignore commented lines in read_env_file_value in performance_oracle.py - #2510

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/dashboard-api-oracle-read-env-comments
Open

fix(dashboard-api): ignore commented lines in read_env_file_value in performance_oracle.py#2510
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/dashboard-api-oracle-read-env-comments

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Problem

In ods/extensions/services/dashboard-api/performance_oracle.py, read_env_file_value() reads key-value assignments from .env files by iterating over raw lines. If a commented line like # CTX_SIZE=32768 existed before an active variable definition, line.startswith(f"{key}=") previously matched the commented string.

Fix

Update read_env_file_value() in performance_oracle.py to strip whitespace and skip empty or comment lines starting with #.

Verification

Ran pytest ods/extensions/services/dashboard-api/tests/test_performance_oracle.py (50/50 passed). git diff --check passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant