Skip to content

Conversation

@PriyanshuC132
Copy link
Collaborator

Changes for EliminationV2 consumption

Copilot AI review requested due to automatic review settings September 22, 2025 14:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for EliminationV2 consumption by integrating gateway reference ID functionality into the scoring system. The changes enable the system to use gateway reference IDs for elimination scoring decisions and provide fallback mechanisms between Redis and service configuration sources.

  • Add gateway reference ID support to scoring data structures and functions
  • Implement Redis-based configuration lookup with service config fallback for elimination thresholds
  • Update scoring functions to pass gateway scoring data throughout the elimination flow

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/feedback/types.rs Adds gatewayReferenceId field to GatewayScoringKeyType struct
src/feedback/gateway_scoring_service.rs Passes gateway_scoring_data parameter to scoring functions
src/feedback/gateway_elimination_scoring/flow.rs Updates elimination scoring functions to accept and use gateway_scoring_data
src/decider/gatewaydecider/utils.rs Adds common gateway reference ID logic and updates scoring data initialization
src/decider/gatewaydecider/types.rs Adds gatewayReferenceId field to scoring data structures
src/decider/gatewaydecider/gw_scoring.rs Implements Redis fallback mechanism and updates scoring functions
src/decider/gatewaydecider/constants.rs Adds aggregateKeyPrefix constant
Comments suppressed due to low confidence (2)

src/decider/gatewaydecider/gw_scoring.rs:1

  • Missing space after comma in function call parameters. Should have space after txn_detail, in both lines.
// use eulerhs::prelude::*;

src/decider/gatewaydecider/gw_scoring.rs:1

  • Missing space after comma in function call parameters. Should have space after txn_detail, in both lines.
// use eulerhs::prelude::*;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

let app_state = get_tenant_app_state().await;
app_state
.redis_conn
.get_key::<MetricEntry>(key, "metric_entry")
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The function call uses key but should use dkey which contains the actual dimension key value. The key parameter is the aggregate key, not the specific metric key.

Suggested change
.get_key::<MetricEntry>(key, "metric_entry")
.get_key::<MetricEntry>(dkey, "metric_entry")

Copilot uses AI. Check for mistakes.
Comment on lines 1929 to 1939
let pmt = &txn_card_info.paymentMethodType;
let source_obj = if txn_card_info.paymentMethod == UPI {
txn_detail.sourceObject.clone()
} else {
Some(txn_card_info.paymentMethod.clone())
};
let pm = if txn_card_info.paymentMethodType == UPI {
source_obj.clone()
} else {
Some(txn_card_info.paymentMethod.clone())
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let pmt = &txn_card_info.paymentMethodType;
let source_obj = if txn_card_info.paymentMethod == UPI {
txn_detail.sourceObject.clone()
} else {
Some(txn_card_info.paymentMethod.clone())
};
let pm = if txn_card_info.paymentMethodType == UPI {
source_obj.clone()
} else {
Some(txn_card_info.paymentMethod.clone())
};
let pmt = &txn_card_info.paymentMethodType;
let pm = if txn_card_info.paymentMethodType == UPI {
txn_detail.sourceObject.clone()
} else {
Some(txn_card_info.paymentMethod.clone())
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

jagan-jaya
jagan-jaya previously approved these changes Oct 14, 2025
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.

4 participants