AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-544
  5. changes
  6. pr_description.md
pr_description.md(1.5 KB)· Apr 24, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

Title#

feat: add conditionally-validated Bitbucket + Jira env blocks to config schema (BJ-4)

Problem#

The config schema had no entries for Atlassian (Bitbucket/Jira) env vars, so partial configs would boot silently and only fail at runtime. #544 requires fail-fast validation that mirrors the existing GITHUB_APP_ID conditional pattern.

Task / Link#

Closes #544

Changes#

  • Added BITBUCKET_OAUTH_CLIENT_ID as optional trigger; CLIENT_SECRET, REFRESH_TOKEN, WORKSPACE become required when it is set (via Joi.when())
  • Added BITBUCKET_REPO, BITBUCKET_BOT_USERNAME, BITBUCKET_WEBHOOK_SECRET as plain optional entries
  • Added JIRA_OAUTH_CLIENT_ID as optional trigger; CLIENT_SECRET, REFRESH_TOKEN, SITE_URL, CLOUD_ID become required when it is set
  • Added JIRA_PROJECT_KEY, JIRA_BOT_USERNAME, JIRA_WEBHOOK_SECRET as plain optional entries
  • Extended config.schema.spec.ts with Bitbucket mode and Jira mode describe blocks (empty / partial-fail / complete-pass cases)
  • Appended commented # --- Bitbucket (optional) --- and # --- Jira (optional) --- blocks to .env.example

Notes#

  • Only CLIENT_ID triggers required-companion validation (matches GITHUB_APP_ID single-gateway pattern); setting only CLIENT_SECRET will not error — intentional design.
  • *_REFRESH_TOKEN validated for presence only; format/length checks are out of scope for this wave.

Testing#

  • npx jest config.schema.spec — 14 tests pass (empty / partial-fail / complete-pass for both Bitbucket and Jira modes)
  • Lint clean (npm run lint)
PrdAi-done