Skip to content

Promote staging → main (secrets guard + bot /doc feature) - #27

Merged
qiuethan merged 11 commits into
mainfrom
staging
Jul 3, 2026
Merged

Promote staging → main (secrets guard + bot /doc feature)#27
qiuethan merged 11 commits into
mainfrom
staging

Conversation

@qiuethan

@qiuethan qiuethan commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Promote stagingmain (production).

What ships

1. Secrets boot-guard (was PR #25)

  • Both Python services refuse to boot outside local while API_KEY (and doc-system's DIRECTORY_API_KEY) is still the built-in dev default.
  • Adds DOCS_ENV to documentation-system (mirrors TT_ENV).

2. Discord bot /doc feature

  • docClient HTTP client + docService (team-slug resolution, outcome mapping).
  • /doc renderers and message formatting.
  • config.js now requires DOC_BASE_URL + DOC_API_KEY.
  • Autocomplete plumbing for command options.

Production readiness — already prepped

Railway production env vars are set and verified before this merge:

  • team-tracking: TT_ENV=production, strong API_KEY, PORT=8000.
  • documentation-system: DOCS_ENV=production, PORT=8000, strong API_KEY, DIRECTORY_API_KEY.
  • discord-bot: DIRECTORY_API_KEY, DOC_BASE_URL → doc-system:8000, scoped DOC_API_KEY (docs:read/write, prod-specific key id 04295b96-…).

Bot boot confirmed in both environments (Bot ready as Misty Staging#1997 / Misty#9616).

🤖 Generated with Claude Code

qiuethan and others added 10 commits July 3, 2026 10:15
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both services shipped `api_key = "dev-api-key-change-me"` as the default. That
value is the committed env-bootstrap admin key (src/api/auth.py grants admin
scope to any caller presenting it), so any staging/production deploy that
forgot to override API_KEY accepted a publicly-known admin credential.

Add verify_production_secrets(), called first in create_app(), which raises at
startup when the environment tier is not `local` and a secret is still the
built-in dev default:
- team-tracking: guards API_KEY (gated on TT_ENV).
- documentation-system: guards API_KEY and the outbound DIRECTORY_API_KEY;
  adds a DOCS_ENV tier field (mirroring TT_ENV) since it had none.

Empty secrets are still allowed — an empty api_key disables the env-bootstrap
path entirely, which is a valid DB-keys-only config. Only the known default
sentinel trips the guard. Document the tier vars in each .env.example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Refuse to boot on default secrets outside local
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e255b31b-1bc6-486f-9ca7-8b819f623207

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

Comment @coderabbitai help to get the list of available commands.

@railway-app
railway-app Bot temporarily deployed to Misty / staging July 3, 2026 16:21 Inactive
@qiuethan
qiuethan enabled auto-merge July 3, 2026 16:22
@qiuethan
qiuethan merged commit 001aa29 into main Jul 3, 2026
13 checks passed
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