Skip to content
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

feat(constraint_graph): make the constraint graph framework generic and move it into a separate crate #3071

Merged
merged 30 commits into from
May 6, 2024

Conversation

vspecky
Copy link
Member

@vspecky vspecky commented Dec 6, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR separates out and refactors the Euclid Knowledge Graph into the Constraint Graph in its own crate, and makes the Constraint Graph generic so it can work on custom key and value types as opposed to just the Euclid Key and Value types.

This will remove the dependency on Euclid when one needs to only use the Constraint Graph, plus the now generic nature of Constraint Graphs will allow them to be utilized for varied use cases other than routing.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Making the constraint graph generic opens up the opportunity for other developers to adapt and use the constraint graph for their own usecases. There are many validation use cases currently in Hyperswitch that can be fulfilled by using Constraint Graphs, including but not limited to Connector domain validations, required field selection, etc.

How did you test it?

Unit tests for the euclid and kgraph_utils crates. No specific API tests required.

Euclid:
image

Kgraph_utils:
image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@vspecky vspecky added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L1 Review: Waiting on L1 reviewer A-euclid-foc Area: Euclid Family of Crates A-constraint-graph Area: Constraint Graph labels Dec 6, 2023
@vspecky vspecky added this to the December 2023 Release milestone Dec 6, 2023
@vspecky vspecky self-assigned this Dec 6, 2023
@vspecky vspecky requested review from a team as code owners December 6, 2023 13:01
prajjwalkumar17
prajjwalkumar17 previously approved these changes Dec 8, 2023
Copy link
Contributor

@prajjwalkumar17 prajjwalkumar17 left a comment

Choose a reason for hiding this comment

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

LGTM

crates/euclid_wasm/src/lib.rs Outdated Show resolved Hide resolved
Aprabhat19
Aprabhat19 previously approved these changes Dec 8, 2023
@vspecky vspecky linked an issue Dec 8, 2023 that may be closed by this pull request
2 tasks
@vspecky vspecky requested review from a team and Narayanbhat166 December 8, 2023 10:36
Narayanbhat166
Narayanbhat166 previously approved these changes Dec 11, 2023
jarnura
jarnura previously approved these changes May 2, 2024
@bernard-eugine bernard-eugine modified the milestones: April 2024, May 2024 May 3, 2024
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Other than that, looks good to me!

Comment on lines +1 to +6
[package]
name = "hyperswitch_constraint_graph"
description = "Constraint Graph Framework for modeling Domain-Specific Constraints"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a license and optionally, a readme field?

Copy link
Member

Choose a reason for hiding this comment

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

Will add the PR to the merge queue as @vspecky confirmed to add the license and readme in the next upcoming PR.

@pixincreate pixincreate added this pull request to the merge queue May 6, 2024
Merged via the queue into main with commit a23a365 May 6, 2024
12 of 15 checks passed
@pixincreate pixincreate deleted the make-constraint-graphs-generic branch May 6, 2024 13:23
@SanchithHegde SanchithHegde removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-constraint-graph Area: Constraint Graph A-euclid-foc Area: Euclid Family of Crates C-feature Category: Feature request or enhancement
Projects
No open projects
Status: Code Review
Development

Successfully merging this pull request may close these issues.

[FEATURE] Make the Euclid Knowledge Graph generic in its supported keys & values
9 participants