feat(web-analytics): make heatmap chromium sandbox configurable#60794
Merged
Conversation
Gate the --no-sandbox launch flag for the local heatmap Chromium behind a new HEATMAP_CHROMIUM_NO_SANDBOX setting (defaults to passing the flag, preserving current behavior). Lets the sandbox be re-enabled per-environment once the runtime permits it.
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
products/web_analytics/backend/tasks/test/test_heatmap_screenshot.py:564-574
The first test case passes an empty `overrides` dict, so `override_settings(**{})` is a no-op and `settings.HEATMAP_CHROMIUM_NO_SANDBOX` keeps whatever value was loaded from the process environment at Django startup. If `HEATMAP_CHROMIUM_NO_SANDBOX=false` is set in a developer's local `.env` or in a CI job, this case will fail unexpectedly — while the second case `("no_sandbox_enabled", True, True)` already explicitly tests the `True` branch. Either remove the first case (redundant once you have the explicit-`True` case) or, to specifically verify the compile-time default, assert the *settings default* separately rather than relying on the live environment.
```suggestion
@parameterized.expand(
[
("no_sandbox_enabled", True, True),
("no_sandbox_disabled", False, False),
]
)
def test_no_sandbox_flag_respects_setting(
self, _name: str, setting_value: bool, should_include: bool
) -> None:
overrides = {"HEATMAP_CHROMIUM_NO_SANDBOX": setting_value}
```
Reviews (1): Last reviewed commit: "feat(web-analytics): make heatmap chromi..." | Re-trigger Greptile |
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.
Gate the
--no-sandboxlaunch flag for the local heatmap Chromium behind a newHEATMAP_CHROMIUM_NO_SANDBOXsetting. Lets the sandbox be re-enabled per-environment once the runtime permits it.