Skip to content

feat: introduce a framework to fetch configs from superposition#9289

Merged
likhinbopanna merged 67 commits intomainfrom
feat/config-service-external
Oct 9, 2025
Merged

feat: introduce a framework to fetch configs from superposition#9289
likhinbopanna merged 67 commits intomainfrom
feat/config-service-external

Conversation

@Shailesh-714
Copy link
Contributor

@Shailesh-714 Shailesh-714 commented Sep 5, 2025

Type of Change

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

Description

Adding Superposition as an independent module in External Services to abstract the complexity of integrating it with the core application.

Additional Changes

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

Motivation and Context

Updating the config fetch logic from db to superposition may introduce complexity and the need for developers to have context about superposition. This implementation abstracts the complexity and exposes generic methods to fetch configs from superposition.

How did you test it?

  1. Run cargo run --features superposition --bin router -- -f ./config/docker_compose.toml
  2. Set requires_cvv=true in superposition dashboard:
Screenshot 2025-09-09 at 5 01 58 PM 3. Verify if the saved cards are listed in the `checkout page`: Screenshot 2025-09-09 at 5 02 22 PM 4. Change the value in superposition dashboard to `requires_cvv=false`: Screenshot 2025-09-09 at 5 02 49 PM 5. Verify no saved cards are listed in the `checkout page`: Screenshot 2025-09-09 at 5 02 59 PM

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

@Shailesh-714 Shailesh-714 requested review from a team as code owners September 5, 2025 13:52
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 5, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payment_methods/cards.rs  60% smaller
  crates/external_services/src/lib.rs  33% smaller
  crates/router/src/core.rs  24% smaller
  Cargo.lock Unsupported file format
  config/config.example.toml Unsupported file format
  config/deployments/env_specific.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  crates/external_services/Cargo.toml Unsupported file format
  crates/external_services/src/superposition.rs  0% smaller
  crates/external_services/src/superposition/types.rs  0% smaller
  crates/router/Cargo.toml Unsupported file format
  crates/router/src/configs/secrets_transformers.rs  0% smaller
  crates/router/src/configs/settings.rs  0% smaller
  crates/router/src/consts.rs  0% smaller
  crates/router/src/core/configs.rs  0% smaller
  crates/router/src/routes/app.rs  0% smaller
  docker-compose-development.yml  0% smaller

@SanchithHegde SanchithHegde added A-framework Area: Framework M-configuration-changes Metadata: This PR involves configuration changes labels Sep 7, 2025
@SanchithHegde
Copy link
Member

Also, please address the failing CI checks, and update the PR description with testing information and relevant screenshots (if applicable).

@SanchithHegde SanchithHegde changed the title feat(core): Framework for Superposition feat: introduce a framework to fetch configs from superposition Sep 7, 2025
@Shailesh-714 Shailesh-714 requested a review from a team as a code owner September 9, 2025 08:30
default_value: bool,
) -> CustomResult<bool, errors::StorageError> {
// Try superposition first if available
let mut superposition_result = None;
Copy link
Contributor

Choose a reason for hiding this comment

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

we should try to avoid mutable values as much as possible

@Shailesh-714 Shailesh-714 requested review from Sakilmostak and prasunna09 and removed request for Sakilmostak October 8, 2025 09:45
@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit acc1568 Oct 9, 2025
23 of 25 checks passed
@likhinbopanna likhinbopanna deleted the feat/config-service-external branch October 9, 2025 11:05
chaitak-gorai pushed a commit that referenced this pull request Oct 16, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
drdholu pushed a commit to drdholu/hyperswitch that referenced this pull request Oct 30, 2025
…ay#9289)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-framework Area: Framework M-configuration-changes Metadata: This PR involves configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants