Skip to content

[HOTFIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var (v0.161.4)#1939

Merged
ritwik-g merged 1 commit intov0.161.4-hotfixfrom
hotfix/v0.161.4-bool-parse-highlight-api
May 4, 2026
Merged

[HOTFIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var (v0.161.4)#1939
ritwik-g merged 1 commit intov0.161.4-hotfixfrom
hotfix/v0.161.4-bool-parse-highlight-api

Conversation

@ritwik-g
Copy link
Copy Markdown
Contributor

@ritwik-g ritwik-g commented May 4, 2026

Summary

Why a new hotfix branch

The fix landed on v0.161.7-hotfix (PR #1937) but was supposed to be cut from v0.161.4. This PR re-targets the same change onto v0.161.4-hotfix for the correct release line.

Original commit

Test plan

  • Confirm ENABLE_HIGHLIGHT_API_DEPLOYMENT="False" evaluates to False in backend/backend/settings/base.py
  • Verify cloud configuration plugin's ConfigSpec.default honors the falsy value
  • CI green on v0.161.4-hotfix base

🤖 Generated with Claude Code

[FIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var

os.environ.get returns the raw string when the variable is set, so
ENABLE_HIGHLIGHT_API_DEPLOYMENT="False" was truthy in Python (any
non-empty string is truthy). Wrap in CommonUtils.str_to_bool so
"False" / "false" / "0" actually evaluate to False.

The setting is consumed by the cloud configuration plugin's spec
default (ConfigSpec.default in plugins/configuration/cloud_config.py)
on cloud and on-prem builds. With this fix, an admin who explicitly
sets the env var to a falsy string sees highlight data stripped as
expected.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4785fbe-75c8-4793-9ec2-819bfd9b1feb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/v0.161.4-bool-parse-highlight-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 4, 2026

Greptile Summary

This hotfix wraps ENABLE_HIGHLIGHT_API_DEPLOYMENT env var in CommonUtils.str_to_bool, so string values like "False" or "0" correctly evaluate as False instead of the truthy non-empty string they would have been before. The change is minimal, consistent with other boolean env var patterns already used in the file (SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, ATOMIC_REQUESTS), and no issues were found.

Confidence Score: 5/5

Safe to merge — single-line bug fix with no side effects.

The change is a well-scoped, correct fix that matches the established pattern in the same file. CommonUtils.str_to_bool is already imported and tested elsewhere, and the default value is properly updated from boolean False to string "False" to match the function's expected input type. No P1 or P0 issues found.

No files require special attention.

Important Files Changed

Filename Overview
backend/backend/settings/base.py Wraps ENABLE_HIGHLIGHT_API_DEPLOYMENT env var read in CommonUtils.str_to_bool so string values like "False"/"false"/"0" evaluate as falsy; consistent with other boolean env vars in the file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["os.environ.get(ENABLE_HIGHLIGHT_API_DEPLOYMENT, 'False')"] --> B["CommonUtils.str_to_bool()"]
    B --> C{"string.lower() == 'true'?"}
    C -- Yes --> D["True"]
    C -- No --> E["False"]
    D --> F["ENABLE_HIGHLIGHT_API_DEPLOYMENT = True"]
    E --> G["ENABLE_HIGHLIGHT_API_DEPLOYMENT = False"]
Loading

Reviews (1): Last reviewed commit: "[HOTFIX] Bool-parse ENABLE_HIGHLIGHT_API..." | Re-trigger Greptile

@ritwik-g ritwik-g merged commit 449bc02 into v0.161.4-hotfix May 4, 2026
4 checks passed
@ritwik-g ritwik-g deleted the hotfix/v0.161.4-bool-parse-highlight-api branch May 4, 2026 09:08
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

ritwik-g added a commit that referenced this pull request May 5, 2026
* Change csp to report only

* [HOTFIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var (v0.161.4) (#1939)

[HOTFIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var (#1937)

[FIX] Bool-parse ENABLE_HIGHLIGHT_API_DEPLOYMENT env var

os.environ.get returns the raw string when the variable is set, so
ENABLE_HIGHLIGHT_API_DEPLOYMENT="False" was truthy in Python (any
non-empty string is truthy). Wrap in CommonUtils.str_to_bool so
"False" / "false" / "0" actually evaluate to False.

The setting is consumed by the cloud configuration plugin's spec
default (ConfigSpec.default in plugins/configuration/cloud_config.py)
on cloud and on-prem builds. With this fix, an admin who explicitly
sets the env var to a falsy string sees highlight data stripped as
expected.

Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>
Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants