juspay / superposition

Superposition is a context-based configuration management system designed to facilitate safe and flexible rollout of config changes
https://juspay.io/open-source/superposition
Apache License 2.0
349 stars 17 forks source link

Dependency pruning #250

Closed ayushjain17 closed 2 months ago

ayushjain17 commented 2 months ago

Problem

  1. make run compiles code twice
  2. Redundant dependencies across all crates
  3. Single use dependency specified at workspace Cargo.toml
  4. superposition_types uses diesel as dependency, which causes dependency issues in 3rd party repos using this crate
  5. dependencies in random order
  6. cac_client returning data of types superposition_types::result::Result<T> in cases where the return should neither be a Result type or can simply be a Result<T, String>

Solution

  1. Remove redundant compile step
  2. Remove unused dependencies, mandate #![deny(unused_crate_dependencies)] for all crates
  3. Localise single use dependency to the crates instead of workspace Cargo.toml
  4. make result type as a feature for superposition_types (make diesel optional)
  5. sorted dependencies in alphabetical order
  6. Update return type of cac_client functions to direct T or Result<T, String>