Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Add doppler_config CI checks for agent-harness and notification (#5981)

Wolf Mermelstein79220fd7cbfc
diff --git a/Cargo.lock b/Cargo.lock
index 91d68e373e..6e938cd2bb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -309,6 +309,7 @@ dependencies = [
"cursor_api_key",
"cursor_cloud_agents",
"database_env_vars",
+ "doppler-config",
"entity_access",
"futures",
"github",
@@ -11201,6 +11202,7 @@ dependencies = [
"axum",
"chrono",
"database_env_vars",
+ "doppler-config",
"email_formatting",
"hmac 0.12.1",
"http-body-util",
diff --git a/services/agent_harness_service/Cargo.toml b/services/agent_harness_service/Cargo.toml
index d5b1151f11..8512f80b65 100644
--- a/services/agent_harness_service/Cargo.toml
+++ b/services/agent_harness_service/Cargo.toml
@@ -12,6 +12,10 @@ path = "src/main.rs"
name = "agent_harness_service_openapi"
path = "src/openapi.rs"
+[[bin]]
+name = "agent_harness_service_doppler_config"
+path = "src/doppler_config.rs"
+
[dependencies]
agent_egress = { path = "../../crates/agent_egress" }
agent_fold = { path = "../../crates/agent_fold" }
@@ -68,6 +72,7 @@ redis = { workspace = true, features = ["aio", "tokio-comp"] }
utoipa = { workspace = true }
utoipa-swagger-ui = { workspace = true }
macro_config = { path = "../../crates/macro_config" }
+doppler-config = { workspace = true }
macro_entrypoint = { path = "../../crates/macro_entrypoint" }
macro_env = { path = "../../crates/macro_env" }
macro_env_var = { path = "../../crates/macro_env_var" }
diff --git a/services/agent_harness_service/src/config.rs b/services/agent_harness_service/src/config.rs
index 36c7f63513..c1c9080ebc 100644
--- a/services/agent_harness_service/src/config.rs
+++ b/services/agent_harness_service/src/config.rs
@@ -1,5 +1,9 @@
//! Configuration for the agent harness service, loaded via the standard
-//! `macro_config` pattern.
+//! `macro_config` pattern so it gets a `doppler_config` validation binary.
+//!
+//! Required env vars are declared here as typed fields. The `doppler_config`
+//! binary loads this `Config` from Doppler for both the dev and prod
+//! environments, surfacing any missing or mistyped values at CI time.
use anyhow::Context;
use database_env_vars::{DatabaseUrl, RedisUri};
diff --git a/services/agent_harness_service/src/doppler_config.rs b/services/agent_harness_service/src/doppler_config.rs
new file mode 100644
index 0000000000..641a14c78d
--- /dev/null
+++ b/services/agent_harness_service/src/doppler_config.rs
@@ -0,0 +1,31 @@
+#![allow(unused)]
+#![recursion_limit = "256"]
+
+use macro_env::Environment;
+
+mod config;
+
+const DOPPLER_PROJECT: &str = "agent-harness-service";
+
+#[tokio::main]
+async fn main() -> anyhow::Result<()> {
+ let dev = doppler_config::DopplerConfig::builder()
+ .token_from_env("DOPPLER_TOKEN")
+ .config(Environment::Develop.to_doppler_slug())
+ .project(DOPPLER_PROJECT)
+ .build()
+ .expect("able to grab doppler project");
+
+ dev.load::<config::Config>().await?;
+
+ let prd = doppler_config::DopplerConfig::builder()
+ .token_from_env("DOPPLER_TOKEN")
+ .config(Environment::Production.to_doppler_slug())
+ .project(DOPPLER_PROJECT)
+ .build()
+ .expect("able to grab doppler project");
+
+ prd.load::<config::Config>().await?;
+
+ Ok(())
+}
diff --git a/services/notification_service/Cargo.toml b/services/notification_service/Cargo.toml
index 308ed6651f..fa56c3a0ce 100644
--- a/services/notification_service/Cargo.toml
+++ b/services/notification_service/Cargo.toml
@@ -13,6 +13,10 @@ path = "src/main.rs"
name = "notification_service_openapi"
path = "src/openapi.rs"
+[[bin]]
+name = "notification_service_doppler_config"
+path = "src/doppler_config.rs"
+
[features]
default = ["push_notification_event_handler"]
local_queue = []
@@ -38,6 +42,7 @@ macro_authorization = { path = "../../crates/macro_authorization", features = [
] }
macro_aws_config = { path = "../../crates/macro_aws_config" }
macro_config = { path = "../../crates/macro_config" }
+doppler-config = { workspace = true }
macro_cors = { path = "../../crates/macro_cors" }
macro_entrypoint = { path = "../../crates/macro_entrypoint" }
macro_env = { path = "../../crates/macro_env" }
diff --git a/services/notification_service/src/config.rs b/services/notification_service/src/config.rs
index 4ab0400179..8e33cd1d79 100644
--- a/services/notification_service/src/config.rs
+++ b/services/notification_service/src/config.rs
@@ -1,3 +1,10 @@
+//! Configuration for the notification service, loaded via the standard
+//! `macro_config` pattern so it gets a `doppler_config` validation binary.
+//!
+//! Required env vars are declared here as typed fields. The `doppler_config`
+//! binary loads this `Config` from Doppler for both the dev and prod
+//! environments, surfacing any missing or mistyped values at CI time.
+
use anyhow::Context;
use database_env_vars::{DatabaseUrl, RedisUri};
use macro_auth::InternalApiKey;
diff --git a/services/notification_service/src/doppler_config.rs b/services/notification_service/src/doppler_config.rs
new file mode 100644
index 0000000000..4947bc432e
--- /dev/null
+++ b/services/notification_service/src/doppler_config.rs
@@ -0,0 +1,31 @@
+#![allow(unused)]
+#![recursion_limit = "256"]
+
+use macro_env::Environment;
+
+mod config;
+
+const DOPPLER_PROJECT: &str = "notification-service";
+
+#[tokio::main]
+async fn main() -> anyhow::Result<()> {
+ let dev = doppler_config::DopplerConfig::builder()
+ .token_from_env("DOPPLER_TOKEN")
+ .config(Environment::Develop.to_doppler_slug())
+ .project(DOPPLER_PROJECT)
+ .build()
+ .expect("able to grab doppler project");
+
+ dev.load::<config::Config>().await?;
+
+ let prd = doppler_config::DopplerConfig::builder()
+ .token_from_env("DOPPLER_TOKEN")
+ .config(Environment::Production.to_doppler_slug())
+ .project(DOPPLER_PROJECT)
+ .build()
+ .expect("able to grab doppler project");
+
+ prd.load::<config::Config>().await?;
+
+ Ok(())
+}