Skip to content

feat(cloudflare): Instrument Flagship bindings in instrumentEnv#21244

Open
nehaprasad-dev wants to merge 2 commits into
getsentry:developfrom
nehaprasad-dev:feat/cld-ins-flg
Open

feat(cloudflare): Instrument Flagship bindings in instrumentEnv#21244
nehaprasad-dev wants to merge 2 commits into
getsentry:developfrom
nehaprasad-dev:feat/cld-ins-flg

Conversation

@nehaprasad-dev
Copy link
Copy Markdown

Before submitting a pull request, please take a look at our Contributing guidelines and verify:
  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

fix : #21184

@nehaprasad-dev nehaprasad-dev requested a review from a team as a code owner May 29, 2026 10:55
@nehaprasad-dev nehaprasad-dev requested review from JPeer264 and andreiborza and removed request for a team May 29, 2026 10:55
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 11bed6e. Configure here.

const flagKey = args[0];
if (typeof flagKey === 'string') {
recordFlagEvaluation(flagKey, result);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing boolean check before recording flag evaluations

High Severity

recordFlagEvaluation is called for all evaluation results without checking if the value is boolean. For the non-Details branch, a typeof result === 'boolean' check is missing before calling recordFlagEvaluation. For the Details branch, a typeof result.value === 'boolean' check is missing. The tests clearly expect only boolean values to be recorded (e.g., getStringValue and getStringDetails should NOT trigger recording), but the current code calls _INTERNAL_insertFlagToScope and _INTERNAL_addFeatureFlagToActiveSpan unconditionally — causing the test spies to register calls that the assertions expect not to happen.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 11bed6e. Configure here.


expect(wrapped.appId).toBe('app-123');
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing integration or E2E test for feat PR

Low Severity

Per the review rules, feat PRs require at least one integration or E2E test. This PR only includes a unit test for instrumentFlagship. No integration test exercises the full flow through instrumentEnv detecting a Flagship binding and producing the expected telemetry, and no E2E test exists in dev-packages.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 11bed6e. Configure here.

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.

Cloudflare instrument Flagship (feature flags)

1 participant