Skip to content

feat(code-review): Send experiment assignment to Seer#107483

Merged
giovanni-guidini merged 2 commits intomasterfrom
gio/cw-697-send-experiment-assignment-to-seer
Feb 5, 2026
Merged

feat(code-review): Send experiment assignment to Seer#107483
giovanni-guidini merged 2 commits intomasterfrom
gio/cw-697-send-experiment-assignment-to-seer

Conversation

@giovanni-guidini
Copy link
Contributor

@giovanni-guidini giovanni-guidini commented Feb 3, 2026

Summary

Adds experiment assignment to code review payloads sent to Seer. This allows Seer to apply different experimental behaviors (e.g., different prompts, features) based on whether an organization is enrolled in A/B testing experiments.

Changes

  • Add experiment_enabled field to SeerCodeReviewRequestForPrReview model
  • Conditionally include experiment_enabled in payload for PR review requests only (not PR closed)
  • Add explicit type annotation to prevent mypy errors
  • Add comprehensive test coverage using @with_feature decorator

Implementation Details

The monolith checks the feature flag organizations:code-review-experiments-enabled and includes the boolean flag in the request payload sent to Seer. The field is only included for pr-review request types, not pr-closed events.

Payload structure:

{
  "request_type": "pr-review",
  "external_owner_id": "...",
  "data": {
    "repo": {...},
    "bug_prediction_specific_information": {...},
    "config": {...},
    "experiment_enabled": true  // <-- New field
  }
}

Dependencies

Requires: #107478 (CW-696 - feature flag registration)

References

Linear: CW-697

@linear
Copy link

linear bot commented Feb 3, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 3, 2026
@giovanni-guidini giovanni-guidini changed the base branch from master to feat/cw-696-port-experiments-flag February 3, 2026 11:26
@giovanni-guidini giovanni-guidini marked this pull request as ready for review February 3, 2026 12:55
@giovanni-guidini giovanni-guidini requested a review from a team as a code owner February 3, 2026 12:55
@giovanni-guidini giovanni-guidini force-pushed the feat/cw-696-port-experiments-flag branch from 853d51f to e4aef30 Compare February 3, 2026 15:47
Copy link
Member

@armenzg armenzg left a comment

Choose a reason for hiding this comment

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

This looks good!

Base automatically changed from feat/cw-696-port-experiments-flag to master February 4, 2026 12:59
Add experiment_enabled field to PR review payloads sent to Seer.
The field indicates whether an organization is enrolled in code
review A/B testing experiments, controlled by the feature flag
organizations:code-review-experiments-enabled.

Changes:
- Add experiment_enabled bool field to SeerCodeReviewRequestForPrReview
- Conditionally include experiment_enabled in payload for PR review requests only
- Add type annotation to prevent mypy errors when adding bool to dict
- Add comprehensive test coverage using @with_feature decorator

The field is only included for pr-review request types, not pr-closed,
allowing Seer to apply different experimental behaviors based on the
assignment.

Refs CW-697
Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@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 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@giovanni-guidini giovanni-guidini merged commit 0492c51 into master Feb 5, 2026
72 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/cw-697-send-experiment-assignment-to-seer branch February 5, 2026 12:52
jaydgoss pushed a commit that referenced this pull request Feb 12, 2026
## Summary

Adds experiment assignment to code review payloads sent to Seer. This
allows Seer to apply different experimental behaviors (e.g., different
prompts, features) based on whether an organization is enrolled in A/B
testing experiments.

## Changes

- Add `experiment_enabled` field to `SeerCodeReviewRequestForPrReview`
model
- Conditionally include `experiment_enabled` in payload for PR review
requests only (not PR closed)
- Add explicit type annotation to prevent mypy errors
- Add comprehensive test coverage using `@with_feature` decorator

## Implementation Details

The monolith checks the feature flag
`organizations:code-review-experiments-enabled` and includes the boolean
flag in the request payload sent to Seer. The field is only included for
`pr-review` request types, not `pr-closed` events.

**Payload structure:**
```json
{
  "request_type": "pr-review",
  "external_owner_id": "...",
  "data": {
    "repo": {...},
    "bug_prediction_specific_information": {...},
    "config": {...},
    "experiment_enabled": true  // <-- New field
  }
}
```
dcramer pushed a commit that referenced this pull request Feb 17, 2026
## Summary

Adds experiment assignment to code review payloads sent to Seer. This
allows Seer to apply different experimental behaviors (e.g., different
prompts, features) based on whether an organization is enrolled in A/B
testing experiments.

## Changes

- Add `experiment_enabled` field to `SeerCodeReviewRequestForPrReview`
model
- Conditionally include `experiment_enabled` in payload for PR review
requests only (not PR closed)
- Add explicit type annotation to prevent mypy errors
- Add comprehensive test coverage using `@with_feature` decorator

## Implementation Details

The monolith checks the feature flag
`organizations:code-review-experiments-enabled` and includes the boolean
flag in the request payload sent to Seer. The field is only included for
`pr-review` request types, not `pr-closed` events.

**Payload structure:**
```json
{
  "request_type": "pr-review",
  "external_owner_id": "...",
  "data": {
    "repo": {...},
    "bug_prediction_specific_information": {...},
    "config": {...},
    "experiment_enabled": true  // <-- New field
  }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants