A Rust-based enrichment API framework for the Warp Flow ecosystem, designed for advanced data processing and enrichment in WordPress data pipelines.
WP Advanced API is part of the Warp Flow data processing framework (similar to Apache Beam or Flink). It provides a pluggable architecture for enriching WordPress data as it flows through processing pipelines.
This is a Rust workspace containing two main crates:
- wp-enrich-api: Core enrichment API implementing traits for data field enrichment
- wp-ctrl-api: Control API crate (currently in development)
- π Pluggable Enrichment: Implement custom enrichment logic through well-defined traits
- π¦ Workspace Management: Efficient dependency management across multiple crates
- π§ Build Automation: Automated build, lint, and release processes with GXL
- π CI/CD Integration: GitHub Actions for continuous integration and deployment
- π Semantic Versioning: Automated version management and releases
- Rust 1.70+ (latest stable recommended)
- Cargo (included with Rust)
- GXL (for build automation)
Add the following to your Cargo.toml:
[dependencies]
wp-enrich-api = "0.0.2"
wp-model-core = { git = "https://github.com/wp-labs/wp-model-core.git" }use wp_enrich_api::{EnrichingAble, EnrichLibAble};
struct MyEnricher;
impl EnrichingAble for MyEnricher {
fn enrich(&self, target: &str, needs: &str) -> Result<String, Box<dyn std::error::Error>> {
// Your enrichment logic here
Ok(format!("Enriched data for {} with {}", target, needs))
}
}
struct MyEnrichRegistry;
impl EnrichLibAble for MyEnrichRegistry {
fn lookup(&self, field: &str) -> Option<Box<dyn EnrichingAble>> {
match field {
"my_field" => Some(Box::new(MyEnricher)),
_ => None,
}
}
}Trait for implementing data enrichment logic:
pub trait EnrichingAble: Send + Sync {
fn enrich(&self, target: &str, needs: &str) -> Result<String, Box<dyn std::error::Error>>;
}Trait for enrichment registry and lookup:
pub trait EnrichLibAble: Send + Sync {
fn lookup(&self, field: &str) -> Option<Box<dyn EnrichingAble>>;
}# Using GXL (recommended)
gxl run build
# Or using Cargo directly
cargo build# Run all tests
cargo test
# Run tests with coverage
cargo tarpaulin --out Html# Run all lints
gxl run lint
# Or manually
cargo clippy -- -D warnings
cargo fmt -- --checkThis project uses GXL for build automation. The following flows are available:
build: Build all crateslint: Run code formatting and clippybump-version: Bump semantic versioncommit: Commit changes with conventional commitsrelease: Create a new release
See .run.gxl for detailed flow definitions.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
gxl run lint && cargo test) - Commit your changes with conventional commit format
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
We follow conventional commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for code formatting changesrefactor:for code refactoringtest:for adding or updating testschore:for maintenance changes
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- wp-model-core - Core models and types
- wp-source-api - Source API implementation
- wp-sink-api - Sink API implementation
- 0.0.2 - Current version
- Initial release with enrichment API framework
- Workspace structure setup
- CI/CD pipeline integration
For support and questions:
Made with β€οΈ by the WP Labs team