Skip to content

chore(config): remove unused Config fields with no readers#836

Merged
matthyx merged 1 commit into
mainfrom
chore/remove-unused-config-fields
Jun 15, 2026
Merged

chore(config): remove unused Config fields with no readers#836
matthyx merged 1 commit into
mainfrom
chore/remove-unused-config-fields

Conversation

@matthyx

@matthyx matthyx commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Removes four Config fields (and their viper defaults) that are not referenced anywhere in node-agent:

  • backendStorageEnabled
  • hostMalwareSensorEnabled
  • hostNetworkSensorEnabled
  • testMode

Why

Nothing in the codebase reads these fields, so they have no effect on behavior — they only add noise to the Config struct and the documented config surface. Dropping them keeps the config lean.

Safety

  • No behavioral change: grep shows zero readers of the struct fields or their mapstructure keys outside pkg/config.
  • go build ./... and go test ./pkg/config/... pass.
  • Reviewers: please confirm no out-of-tree consumer sets these keys before merging (they were public config keys). Opened as draft for that reason.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed several deprecated configuration options from the system settings to streamline configuration management.

These fields are not referenced anywhere in node-agent — nothing reads them,
and removing them (plus their viper defaults) has no effect on behavior. This
trims the Config struct and the documented config surface.

Removed: backendStorageEnabled, hostMalwareSensorEnabled,
hostNetworkSensorEnabled, testMode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63452cfc-db77-4aaf-8fb2-8c640d1fb3e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7edbd72 and 97e1c31.

📒 Files selected for processing (2)
  • pkg/config/config.go
  • pkg/config/config_test.go

📝 Walkthrough

Walkthrough

Four fields (EnableBackendStorage, EnableHostMalwareSensor, EnableHostNetworkSensor, TestMode) are removed from the exported Config struct in pkg/config/config.go. Their corresponding Viper defaults are also removed from LoadConfigOptional. The TestLoadConfig test fixture is updated to drop the two removed sensor fields from its expected Config value.

Changes

Config struct field removal

Layer / File(s) Summary
Remove fields from Config struct and Viper defaults
pkg/config/config.go, pkg/config/config_test.go
EnableBackendStorage, EnableHostMalwareSensor, EnableHostNetworkSensor, and TestMode are deleted from the Config struct; Viper SetDefault calls for hostMalwareSensorEnabled, hostNetworkSensorEnabled, and testMode are removed from LoadConfigOptional; the TestLoadConfig expected struct is updated to remove EnableHostMalwareSensor and EnableHostNetworkSensor.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop, hop, snip, snip!
Four fields have left the nest,
TestMode, sensors, storage too—
The struct is trimmed and dressed.
Less is more, the rabbit says,
Clean config is the best! 🌿

✨ 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 chore/remove-unused-config-fields

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.

@matthyx matthyx marked this pull request as ready for review June 15, 2026 15:42
@matthyx matthyx merged commit ca2feee into main Jun 15, 2026
4 of 6 checks passed
@matthyx matthyx deleted the chore/remove-unused-config-fields branch June 15, 2026 15:43
@github-actions

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.210 0.226 +7.7%
Peak CPU (cores) 0.224 0.238 +6.2%
Avg Memory (MiB) 349.987 274.930 -21.4%
Peak Memory (MiB) 352.570 282.602 -19.8%
Dedup Effectiveness

No data available.

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