Skip to content

fix(unified water): add IsDisabledByDefault#2474

Merged
SkrubbySkrubInAShrub merged 1 commit into
devfrom
claude/crazy-tesla-509d97
Jun 6, 2026
Merged

fix(unified water): add IsDisabledByDefault#2474
SkrubbySkrubInAShrub merged 1 commit into
devfrom
claude/crazy-tesla-509d97

Conversation

@doodlum

@doodlum doodlum commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds virtual bool IsDisabledByDefault() const to the Feature base class (returns false by default)
  • During State::Load, features not already in the user's saved config that declare IsDisabledByDefault() == true are automatically disabled at boot
  • User's explicit enable/disable choice is always preserved once saved
  • UnifiedWater overrides this to return true, so it starts disabled on fresh installs

Test plan

  • Fresh install: verify Unified Water is disabled at boot without any user config
  • Existing install with Unified Water enabled: verify it stays enabled (user override preserved)
  • Toggle Unified Water on via Disable at Boot menu, restart — verify it stays enabled
  • Verify other features are unaffected (all default to enabled)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Features can now be disabled by default at startup while remaining user-configurable.
    • UnifiedWater is now disabled by default at boot.

Extend Feature base class with a virtual IsDisabledByDefault() method
so individual features can declare themselves disabled at boot by
default. The user's explicit toggle still takes precedence once saved.

Unified Water uses this to start disabled on fresh installs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bb9bc4e-3437-4750-8f64-15908bdd4df3

📥 Commits

Reviewing files that changed from the base of the PR and between d1f4060 and 4c7da8f.

📒 Files selected for processing (3)
  • src/Feature.h
  • src/Features/UnifiedWater.h
  • src/State.cpp

📝 Walkthrough

Walkthrough

This PR adds a feature-level mechanism to disable features by default at install or boot time. The base Feature class gains a new virtual hook IsDisabledByDefault(), UnifiedWater implements it to return true, and config loading logic auto-populates the disabled features map for any feature claiming default-disabled status.

Changes

Default-disabled feature initialization

Layer / File(s) Summary
Default-disabled feature hook and boot-time integration
src/Feature.h, src/Features/UnifiedWater.h, src/State.cpp
Feature base class adds IsDisabledByDefault() virtual method (default false); UnifiedWater overrides it to return true; State::Load checks each feature's IsDisabledByDefault() and pre-populates the disabledFeatures map for disabled-by-default features not already explicitly present in config.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • alandtse

Poem

🐰 A feature flag, disabled by default they say,
UnifiedWater joins the disabled array,
At boot-time we check, in the config we store,
Default behavior blooms forevermore! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references 'unified water' and 'IsDisabledByDefault', matching the PR's primary changes (adding the hook and disabling Unified Water by default), though it uses a 'fix' prefix rather than 'feat' which may not fully capture the feature addition aspect.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/crazy-tesla-509d97

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.12][ERROR]: Error: exception Unix_error: No such file or directory stat src/State.cpp
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called from Scan_CLI.repla

🔧 Infer (1.2.0)
src/State.cpp

Usage Error: Failed to execute compilation command:
'/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/clang/install/bin/clang++'
-c src/State.cpp -o /tmp/coderabbit-infer/efb6d02cbcf5a872/file.o

Error message:
clang++: error: no such file or directory: 'src/State.cpp'

*** Infer needs a working compilation command to run.


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.

@doodlum doodlum changed the title feat(feature): add IsDisabledByDefault; disable Unified Water by default fix(unified water): add IsDisabledByDefault Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

No actionable suggestions for changed features.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub merged commit eda4e97 into dev Jun 6, 2026
17 checks passed
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