Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ coverage/
.tmp/
# generated by hyperi-ci's osv-scanner stage from quality.ignore (mirrors deny.toml)
osv-scanner.toml
# written by `dfe-loader --emit-helm`; the release assembles the chart from the contract
/chart/

# Rust / cargo build artefacts
/target
Expand Down
11 changes: 7 additions & 4 deletions .hyperi-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,25 @@ test:
# Building
build:
enabled: true
type: app # Build binaries (not just crate)
strategies:
- native
rust:
targets:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu

# Release (where the artefacts go)
# Release (where the artefacts go). The thin chart is assembled from the
# emitted contract and ships beside the image.
release:
enabled: true
# Keep `library` at the scalo version in Cargo.toml: the library renders only the contract version its scalo release writes.
helm:
enabled: true
contract: emit
library: "2.14.3"
container:
enabled: true
dockerfile: Dockerfile
platforms:
- linux/amd64
- linux/arm64
helm:
enabled: true
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tokio-util = { version = ">=0.7.19, <0.8", features = ["rt"] }

# Shared library with transport abstraction. The floor is the first release whose
# contract carries no vendor defaults, so the app names its own.
scalo = { version = "2.14.1", features = ["config-schema", "transport-kafka", "transport-grpc", "dlq-kafka", "config", "config-reload", "deployment", "version-check", "scaling", "cli-service", "top", "logger", "metrics", "service-metrics", "expression", "memory", "worker-batch", "governor", "secrets", "sink-stack"] }
scalo = { version = "2.14.3", features = ["config-schema", "transport-kafka", "transport-grpc", "dlq-kafka", "config", "config-reload", "deployment", "version-check", "scaling", "cli-service", "top", "logger", "metrics", "service-metrics", "expression", "memory", "worker-batch", "governor", "secrets", "sink-stack"] }

# Steps scalo's jittered retry schedule (sink_stack backoff). Range MUST track
# scalo's: BackoffBuilder only applies to the ExponentialBuilder scalo returns.
Expand All @@ -60,7 +60,6 @@ csv = ">=1.4.0, <2" # CSV remap file parsing (ecs-mapper format compatible)
# Configuration
figment = { version = ">=0.10.19, <0.11", features = ["env"] }
clap = { version = ">=4.6.7, <5", features = ["derive", "env"] }
dotenvy = ">=0.15.7, <0.16"

# Error handling
thiserror = ">=2.0.21, <3"
Expand Down Expand Up @@ -140,6 +139,9 @@ time = ">=0.3.55, <0.4"
tokio-test = ">=0.4.6, <0.5"
tempfile = ">=3.27.0, <4"

# The repo's own .env for live-service tests and benches. The binary's .env is read by scalo's cascade.
dotenvy = ">=0.15.7, <0.16"

[[bench]]
name = "json_parsing"
harness = false
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# AUTOGENERATED -- do not edit by hand.
# Generated by scalo::deployment::generate_dockerfile()
# Schema version: 3
# Schema version: 4
# Source contract: dfe-loader::deployment::contract()
# Regenerate by calling scalo::deployment::generate_dockerfile() on that contract.

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ NOT a transform stage, NOT a schema manager. Its only outbound topic is the DLQ.
| `src/routing/`, `src/transform/`, `src/enrich/` | Routing, coercion and capture, enrichment |
| `src/buffer/`, `src/clickhouse/` | Per-table buffers; query client, schema cache, inserter |
| `src/clickhouse_ext/` | Dynamic insert: runtime type parser, RowBinary encoder |
| `chart/` | Helm chart, generated from the deployment contract and committed |
| `tests/` | `smoke.rs`, `integration/`, `e2e/` -- see `tests/TESTING.md` |

### Commands that prove a change
Expand All @@ -127,22 +126,21 @@ Green lies three ways: `skip_if_no_clickhouse!()` and `skip_if_no_kafka!()` retu

| Don't | Do | Why |
|-------|----|-----|
| Bump scalo and commit without regenerating the chart | `dfe-loader --emit-helm chart` | `committed_chart_matches_the_generator` (`tests/integration/deployment.rs:250`) compares `chart/` to the generator file by file. A failure is the guard working -- dfe-fetcher shipped a chart missing `keda-triggerauth.yaml` that its ScaledObject referenced, and never scaled (dfe-fetcher#71) |
| Gate a test behind a cargo feature without adding it to `.hyperi-ci.yaml` | Add `default,<feature>` to the feature-set list | `default = []` (`Cargo.toml:327`), so it compiles out of every CI run and CI still reports green. `helm_contract.rs:106` asserts `transport-memory` and `testcontainers` stay listed |
| Bump scalo and leave `release.helm.library` behind | Move `release.helm.library` in `.hyperi-ci.yaml` to the same scalo version | The release assembles the chart from the emitted contract on that scalo-service version, and a scalo-service release ships the schema for only the contract version its scalo release writes |
| Gate a test behind a cargo feature without adding it to `.hyperi-ci.yaml` | Add `default,<feature>` to the feature-set list | `default = []` (`Cargo.toml:304`), so it compiles out of every CI run and CI still reports green. `helm_contract.rs:64` asserts `transport-memory` and `testcontainers` stay listed |
| Inject a nested config key as `DFE_LOADER_SECTION_FIELD` | `DFE_LOADER__SECTION__FIELD` | figment strips exactly `DFE_LOADER_`, so it arrived as `_kafka.sasl.username`, matched no field and was dropped silently. Pods ran with no SASL and an empty ClickHouse password (`tests/integration/config_reachability.rs`) |
| Set `clickhouse.protocol: native` | `http`, on an 8123-family port | The pinned fork has no TCP row fetch, so schema queries stall silently and messages back up pending schema (#115). `validate()` rejects it by name |
| Name `clickhouse.tls.ca_cert_file`, `cert_file`, `key_file` or `skip_verify` | Set `tls.enabled`, mount the CA into the trust store | Only `enabled` reaches a client. The rest parsed and did nothing, so `validate()` now fails naming them |
| Widen the `cel` range past scalo's | Keep it on `>=0.13, <0.14` | `cel::Program` crosses the scalo boundary. Wider resolves two semver-incompatible `cel` crates and `Program` stops being the same type (`Cargo.toml:41-45`) |
| Pin the `clickhouse` fork by branch | Pin by `rev` or tag | The `hyperi-port/*` chain is force-pushed, so a branch pin rots with no warning (`Cargo.toml:313-321`) |
| Widen the `cel` range past scalo's | Keep it on `>=0.14.5, <0.15` | `cel::Program` crosses the scalo boundary. Wider resolves two semver-incompatible `cel` crates and `Program` stops being the same type (`Cargo.toml:46-51`) |
| Pin the `clickhouse` fork by branch | Pin by `rev` or tag | The `hyperi-port/*` chain is force-pushed, so a branch pin rots with no warning (`Cargo.toml:289-300`) |
| Mechanically sync dfe-engine's loader validation to `Config::validate()` | Read both, keep the divergence | dfe-engine scopes the broker check to the Kafka transport and adds a `grpc.listen` check this side lacks. A blind sync rejects valid gRPC-only configs at author time |

### Where this sits

Inbound, declared in `dfe-infra/suite.yaml`:

- **scalo-rs -> dfe-loader** (`cargo-dep`) -- `Cargo.toml:35` takes `scalo` by range for transports, config cascade, CLI, metrics, deployment contract and DLQ. A scalo release reaches this repo here.
- **scalo-rs -> dfe-loader** (`generated-file`, lockstep) -- `Dockerfile` is emitted by `scalo::deployment::generate_dockerfile()` at schema version 3. Regenerate and commit the diff.

- **scalo-rs -> dfe-loader** (`cargo-dep`) -- `Cargo.toml:36` takes `scalo` by range for transports, config cascade, CLI, metrics, deployment contract and DLQ. A scalo release reaches this repo here.
- **scalo-rs -> dfe-loader** (`generated-file`, lockstep) -- `Dockerfile` is emitted by `scalo::deployment::generate_dockerfile()` at schema version 4. Regenerate and commit the diff.
Outbound, so what a change here can break:

- **dfe-loader -> dfe-infra** (`image-pin`, lockstep) -- `dfe-infra/helm/charts/dfe-loader/Chart.yaml:6` pins this image as tag plus digest.
Expand Down
3 changes: 2 additions & 1 deletion benches/insert_bakeoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ struct BenchEnv {

impl BenchEnv {
fn from_env() -> Option<Self> {
dotenvy::dotenv().ok();
// The repo's own .env only: dotenvy::dotenv() would load the first .env in any parent.
let _ = dotenvy::from_path(std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join(".env"));
let host = env::var("CLICKHOUSE_HOST").ok()?;
if host.is_empty() {
return None;
Expand Down
9 changes: 0 additions & 9 deletions chart/Chart.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions chart/templates/NOTES.txt

This file was deleted.

83 changes: 0 additions & 83 deletions chart/templates/_helpers.tpl

This file was deleted.

9 changes: 0 additions & 9 deletions chart/templates/configmap.yaml

This file was deleted.

Loading
Loading