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_IDas optional trigger;CLIENT_SECRET,REFRESH_TOKEN,WORKSPACEbecome required when it is set (viaJoi.when()) - Added
BITBUCKET_REPO,BITBUCKET_BOT_USERNAME,BITBUCKET_WEBHOOK_SECRETas plain optional entries - Added
JIRA_OAUTH_CLIENT_IDas optional trigger;CLIENT_SECRET,REFRESH_TOKEN,SITE_URL,CLOUD_IDbecome required when it is set - Added
JIRA_PROJECT_KEY,JIRA_BOT_USERNAME,JIRA_WEBHOOK_SECRETas plain optional entries - Extended
config.schema.spec.tswithBitbucket modeandJira modedescribe blocks (empty / partial-fail / complete-pass cases) - Appended commented
# --- Bitbucket (optional) ---and# --- Jira (optional) ---blocks to.env.example
Notes#
- Only
CLIENT_IDtriggers required-companion validation (matchesGITHUB_APP_IDsingle-gateway pattern); setting onlyCLIENT_SECRETwill not error — intentional design. *_REFRESH_TOKENvalidated 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)