Skip to content

feat: respect per-flag insightsEnabled for evaluation events - #21

Open
cosmos-explorer wants to merge 1 commit into
masterfrom
feat/insights-enabled
Open

cosmos-explorer wants to merge 1 commit into
masterfrom
feat/insights-enabled

Conversation

@cosmos-explorer

@cosmos-explorer cosmos-explorer commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Feature flags with insightsEnabled: false currently still produce evaluation events. Suppress those records while keeping evaluation values, variation IDs, match reasons, and experiment eligibility unchanged. Missing, null, and non-boolean settings retain the evaluation server's default-enabled behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Flag evaluation events are now collected only when insights are enabled. Setting insightsEnabled to false disables collection; missing or other values leave it enabled.
    • This applies to standard evaluations and later access to previously evaluated flag states. Offline and closed-client event suppression remains unchanged.
  • Documentation
    • Clarified when flag evaluation events are collected and how the insights setting affects them.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds per-flag control over evaluation event collection.

  • Flags can stop sending evaluation events without changing their values.

No actionable issues found.

Reviews (1) · Last reviewed commit: "feat: respect per-flag insightsEnabled f..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2bee0836-43d7-47c2-8af7-ec62e2c1605b
Commits

Reviewing files that changed from the base of the PR and between db68035 and a1ab7a2.

Files selected for processing: 5
  • README.md
  • fbclient/client.py
  • fbclient/common_types.py
  • fbclient/evaluator.py
  • tests/test_insights_enabled.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Evaluation events are collected unless insightsEnabled is explicitly false. Event eligibility is captured during evaluation. Evaluation results and other event types remain unchanged.

Changes: Evaluation insights

Layer / File(s) Summary
Gate evaluation events and verify delivery
fbclient/evaluator.py, fbclient/client.py, fbclient/common_types.py, tests/test_insights_enabled.py, README.md
The evaluator omits flag events only when insights are explicitly false. The client skips ineligible flag events. Tests cover synchronized and external flag data, evaluations, updates, snapshots, and existing event suppression. Documentation describes the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: dsun0720

Merge Risk: Minimal · up to a1ab7

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 clearly and concisely describes the main change: applying per-flag insightsEnabled settings to evaluation events.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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