Skip to content

fix: improve logging for rules with missing profileDataRequired#803

Merged
matthyx merged 1 commit into
mainfrom
no-error-profiledatarequired
May 12, 2026
Merged

fix: improve logging for rules with missing profileDataRequired#803
matthyx merged 1 commit into
mainfrom
no-error-profiledatarequired

Conversation

@matthyx
Copy link
Copy Markdown
Contributor

@matthyx matthyx commented May 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation messaging for rules with missing profile configurations. Consolidated multiple individual error logs into a single aggregated warning message for clearer feedback and reduced log noise.

Review Change Stack

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@matthyx matthyx added the release Create release label May 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

The rule manager's soft-launch validation behavior for rules with declared ProfileDependency but missing ProfileDataRequired now logs at DEBUG level per rule instead of ERROR, accumulates missing rule IDs, and emits a single WARNING only when all loaded rules lack the required configuration.

Changes

Soft-launch validation logging behavior

Layer / File(s) Summary
Soft-launch validation logging refactor
pkg/rulemanager/rule_manager.go
Per-rule validation errors downgraded to DEBUG logs; missing rule IDs are collected and a single WARNING is emitted after the loop only if every rule is missing ProfileDataRequired. Strict mode filtering remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A log once loud now whispers low,
ERROR becomes DEBUG's gentle glow,
Many rules bundled in one WARNING call,
Softer launch behavior for one and all! 📝

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: improving logging behavior for rules with missing profileDataRequired configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 no-error-profiledatarequired

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/rulemanager/rule_manager.go (1)

138-141: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the function doc comment to match current log level behavior.

Line 141 still says this path emits an ERROR, but the implementation now emits DEBUG (Line 154). Please align the comment to avoid drift.

Suggested doc fix
-// soft-launch validation: rules with profileDependency>0 but no
-// profileDataRequired emit an ERROR log (not rejected in default soft mode).
+// soft-launch validation: rules with profileDependency>0 but no
+// profileDataRequired emit a DEBUG log (not rejected in default soft mode).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/rulemanager/rule_manager.go` around lines 138 - 141, Update the doc
comment for recompileProjectionSpec to reflect the current logging behavior:
change the statement that says the path emits an ERROR to state it emits a DEBUG
log (since the implementation logs at DEBUG when rules have profileDependency >
0 but no profileDataRequired); mention RuleProjectionSpec and
ContainerProfileCache to locate the function and note the soft-launch validation
behavior remains the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/rulemanager/rule_manager.go`:
- Around line 138-141: Update the doc comment for recompileProjectionSpec to
reflect the current logging behavior: change the statement that says the path
emits an ERROR to state it emits a DEBUG log (since the implementation logs at
DEBUG when rules have profileDependency > 0 but no profileDataRequired); mention
RuleProjectionSpec and ContainerProfileCache to locate the function and note the
soft-launch validation behavior remains the same.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a673c9c3-1248-4587-96e7-dd499f41e1f1

📥 Commits

Reviewing files that changed from the base of the PR and between 2d768cb and f4cd733.

📒 Files selected for processing (1)
  • pkg/rulemanager/rule_manager.go

@matthyx matthyx merged commit cc59fa0 into main May 12, 2026
28 checks passed
@matthyx matthyx deleted the no-error-profiledatarequired branch May 12, 2026 11:25
@github-actions
Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.207 0.203 -1.7%
Peak CPU (cores) 0.217 0.212 -2.2%
Avg Memory (MiB) 317.501 265.842 -16.3%
Peak Memory (MiB) 321.840 269.660 -16.2%
Dedup Effectiveness (AFTER only)
Event Type Passed Deduped Ratio
capabilities 0 0 N/A
hardlink 6001 0 0.0%
http 1762 119396 98.5%
network 900 77916 98.9%
open 36335 619913 94.5%
symlink 6000 0 0.0%
syscall 985 1887 65.7%
Event Counters
Metric BEFORE AFTER
capability_counter 9 9
dns_counter 1443 1400
exec_counter 7258 7043
network_counter 95397 92556
open_counter 794744 771159
syscall_counter 3510 3515

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

Labels

release Create release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant