Skip to content

feat(infra): wire Notion + PostHog API keys into Sam's runtime, stage Attio#144

Merged
spashii merged 3 commits into
mainfrom
feat/notion-posthog-secrets
Jul 14, 2026
Merged

feat(infra): wire Notion + PostHog API keys into Sam's runtime, stage Attio#144
spashii merged 3 commits into
mainfrom
feat/notion-posthog-secrets

Conversation

@spashii

@spashii spashii commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Adds NOTION_API_KEY and POSTHOG_API_KEY to infra/config.yaml's secrets map — the single source both Terraform (secret resources, EU-pinned replication) and the CI deploy (--set-secrets) read. Sessions inherit the daemon env (session.py passes os.environ.copy()), so both keys are usable from session bash immediately after deploy. Both names match the PR #139 redaction filter, so values get scrubbed from any outbound Slack post.

ATTIO_API_KEY is staged but commented out in both config.yaml and .env.example: no key has been provisioned yet, and deploying a mount for a versionless secret fails the Cloud Run revision. Uncommenting + apply + upload is the whole enable path later.

Also restores the missing EXA_API_KEY line in .env.example (drift since #72).

⚠️ Merge order

  1. terraform apply in infra/ (creates the two secret resources)
  2. bash infra/scripts/upload-secrets.sh (pushes values from local .env)
  3. Then merge — the CI deploy will mount them.

Merging first deploys a mount for secrets that don't exist → failed revision.

Follow-up

Sam gets told about the new keys via journal + #sam once they're live; PR #126 (Notion skills) becomes fully functional the moment NOTION_API_KEY is mounted. PostHog/Attio capabilities tracked separately in Linear.

🤖 Generated with Claude Code

sam-dembrane and others added 3 commits July 14, 2026 11:04
Adds the two new keys the operator provisioned to the config.yaml
secrets map — Terraform creates the Secret Manager resources,
upload-secrets.sh pushes the values from .env, and the CI deploy
composes them into Cloud Run --set-secrets. Sessions inherit the
daemon's env (session.py env=os.environ.copy()), so $NOTION_API_KEY /
$POSTHOG_API_KEY are usable from session bash the deploy after the
secrets exist. Both names contain KEY, so the PR #139 redactor scrubs
them from outbound posts.

ATTIO_API_KEY is staged but commented in both files: no key exists yet,
and mounting a versionless secret fails the Cloud Run revision.

Deploy order (documented in-file): terraform apply + upload-secrets.sh
BEFORE merging this — merging first would deploy a mount for secrets
that don't exist yet.

.env.example also gains the missing EXA_API_KEY line (drift since
PR #72).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@spashii
spashii merged commit d4407dc into main Jul 14, 2026
2 checks passed
@spashii
spashii deleted the feat/notion-posthog-secrets branch July 14, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant