Skip to content

chore(server): Remove GenerateBillingOutcome flag usage#6228

Merged
klochek merged 2 commits into
masterfrom
christopherklochek/ingest-1012-remove-relay-outcomes-flag
Jul 17, 2026
Merged

chore(server): Remove GenerateBillingOutcome flag usage#6228
klochek merged 2 commits into
masterfrom
christopherklochek/ingest-1012-remove-relay-outcomes-flag

Conversation

@klochek

@klochek klochek commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@klochek
klochek requested a review from a team as a code owner July 14, 2026 17:40
@linear-code

linear-code Bot commented Jul 14, 2026

Copy link
Copy Markdown

INGEST-1012

@klochek
klochek force-pushed the christopherklochek/ingest-1012-remove-relay-outcomes-flag branch from 797ceb7 to 69b1fb4 Compare July 17, 2026 14:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 69b1fb4. Configure here.

/// Enable relay billing outcome generation.
#[serde(rename = "organizations:relay-generate-billing-outcome")]
GenerateBillingOutcome,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Graduated billing flag not preserved

Medium Severity

Removing GenerateBillingOutcome without a deprecated serde variant or GRADUATED_FEATURE_FLAGS entry means organizations:relay-generate-billing-outcome deserializes as Unknown and is dropped from FeatureSet. Upstream Relays no longer retain or inject that flag in forwarded project configs, so older processing Relays that still gate track_accepted_outcome on it can stop emitting metric billing outcomes.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 69b1fb4. Configure here.

Comment on lines +1104 to 1114

outcomes.sort(key=lambda o: o["outcome"])

# skip billing outcomes
assert outcomes[0]["outcome"] == 0
assert outcomes[1]["outcome"] == 0

o = outcomes[2]
assert [(o["category"], o["outcome"], o["reason"])] == [
(9, 1, "discarded"), # TransactionIndexed, Filtered
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The test test_discard_transaction hardcodes an expectation of 3 outcomes, but 4 are now generated, causing an assertion failure in poll_many.
Severity: LOW

Suggested Fix

The test should be made more robust. Instead of fetching a hardcoded number of outcomes with get_outcomes(n=3), it should fetch all available outcomes without specifying n. Then, it should filter the results to find the specific outcome being tested or dynamically verify the total count. Sorting should also use a more stable key, like the outcome category, to avoid flakiness.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: tests/integration/test_spans.py#L1103-L1114

Potential issue: The test `test_discard_transaction` hardcodes an expectation for
exactly 3 outcomes by calling `outcomes_consumer.get_outcomes(n=3)`. However, due to the
removal of the `GenerateBillingOutcome` feature flag, `track_accepted_outcome` is now
always called. For the `envelope_with_transaction_and_spans` fixture, this change causes
4 outcomes to be generated: one for a non-segment child span, two for the segment span
(one `Span` and one `Transaction`), and one `TransactionIndexed` filtered outcome. The
`poll_many` method asserts that the number of received messages matches the requested
number `n`, which will fail with an error like "Expected 3 messages, only got 4".

Did we get this right? 👍 / 👎 to inform future reviews.

@klochek
klochek added this pull request to the merge queue Jul 17, 2026
Merged via the queue into master with commit c455da1 Jul 17, 2026
36 checks passed
@klochek
klochek deleted the christopherklochek/ingest-1012-remove-relay-outcomes-flag branch July 17, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants