-
Notifications
You must be signed in to change notification settings - Fork 3.9k
refactor(euclid): refactor logs for evaluation of equality for dynamic routing evaluate response #8834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…c routing evaluate response
Changed Files
|
jagan-jaya
requested changes
Aug 6, 2025
Sarthak1799
approved these changes
Aug 7, 2025
jagan-jaya
approved these changes
Aug 7, 2025
ShankarSinghC
approved these changes
Aug 7, 2025
pixincreate
added a commit
that referenced
this pull request
Aug 8, 2025
…ordea-sepa * 'main' of github.com:juspay/hyperswitch: feat(core): Adding integration for webhooks through UCS (#8814) refactor(euclid): refactor logs for evaluation of equality for dynamic routing evaluate response (#8834) feat(connector): [SIFT] add Connector Template Code (#8488) feat(router): Add tokenization support for proxy and update the route for proxy (#8530) fix(ci): Fix Spell Check For CI Pull Request (#8857) feat(checkbook_io): connector integrate ACH (#8730) fix(connector): Change Refund Reason Type in Adyen (#8849)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR refactors the routing logic to improve how logs are emitted and connector evaluation is handled when dynamic routing is performed using the Decision Engine (Euclid). Key updates include:
perform_decision_euclid_routing
with a wrappedRoutingEvaluateResponse
containing bothoutput
andevaluated_output
.extract_de_output_connectors()
to deserialize and normalizeoutput
from Euclid into a list ofConnectorInfo
.transform_de_output_for_router()
to combineoutput
andevaluated_output
, ensuring deduplication and priority order.compare_and_log_result
to include diff details betweende_result
androuter_result
more clearly.TryFrom<ConnectorInfo> for DeRoutableConnectorChoice
to safely convert API inputs to internal representations.Diff Hunk Explanation
crates/router/src/core/payments/routing.rs
de_euclid_connectors
→de_evaluated_connector
to reflect the structured response.perform_decision_euclid_routing
call with success match block to:output
usingextract_de_output_connectors
.output
andevaluated_output
usingtransform_de_output_for_router
.crates/router/src/core/payments/routing/utils.rs
perform_decision_euclid_routing
to returnRoutingEvaluateResponse
instead of just connector list.extract_de_output_connectors
: deserializes various output types (single
,priority
,volume_split
, etc.).transform_de_output_for_router
: deduplicates connectors and maintains priority betweenevaluated_output
and fallbackoutput
.compare_and_log_result
to log equality and diff details between Decision Engine result and final connector result.TryFrom<ConnectorInfo>
forDeRoutableConnectorChoice
.This refactor sets the stage for cleaner observability and deterministic routing behavior between evaluated and fallback paths.
How did you test it?
The testing guidelines are present in this doc.
Checklist
cargo +nightly fmt --all
cargo clippy