chore(infra): manage every Functions runtime setting in Terraform and Deploy Infra #449
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.76) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.76 · 516 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.076
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #449"
general
weight: 0.35
mattmck
What
Every app setting the Functions code reads is now Terraform-managed and set by Deploy Infra from a GitHub environment variable of the same name.
infrastructure/variables.tf, default = code default) and Function App app settings (infrastructure/main.tf) for:CAPTURE_FRAME_SWEEP_SCHEDULE,CAPTURE_FRAME_RETENTION_SECONDS,CORS_ALLOWED_METHODS,CORS_ALLOWED_HEADERS,CORS_SUPPORT_CREDENTIALS,GALLERY_MAX_IMAGES_PER_SHADE,HEX_DETECTION_BATCH_MAX_IN_FLIGHT,HEX_DETECTION_CONCURRENCY,HEX_DETECTION_DELAY_MS,HEX_SNAP_MAX_DISTANCE,IMAGE_PROXY_ID_TTL_SECONDS,IMAGE_PROXY_PRIVATE_ID_TTL_SECONDS,IMAGE_PROXY_LEGACY_ID_ACCEPT_UNTIL,INGESTION_AI_IMAGE_PROXY_ORIGIN,INGESTION_JOB_LOG_MAX_ENTRIES,INGESTION_LOG_FLUSH_INTERVAL_MS,INGESTION_WORKER_TIME_BUDGET_MS,ORPHAN_MEDIA_SWEEP_,PG_pool/retry settings,SHOPIFY_CONNECTOR_,SOURCE_IMAGE_CONTAINER,SOURCE_IMAGE_MAX_EDGE_PX,SOURCE_IMAGE_MAX_DOWNLOAD_BYTES,SUSPICIOUS_HEX_.AZURE_OPENAI_DEPLOYMENTis set to the hex deployment.deploy-infra.yml) exports each asTF_VAR_<lowercase name>fromvars.<NAME>with the default as fallback, and now also wires the existing Terraform variables it never passed (HEX_DETECTION_BATCH_MIN_IMAGES,INGESTION_JOB_QUEUE_NAME,INGESTION_AI_BATCH_POLL_SCHEDULE,INGESTION_AI_BATCH_MAX_POLL_JOBS,AZURE_OPENAI_BATCH_API_VERSION,AZURE_OPENAI_BATCH_COMPLETION_WINDOW,AZURE_OPENAI_VISION_DETAIL,OPENAI_LABEL_DEPLOYMENT_NAME).CAPTURE_FRAME_SWEEP_SCHEDULE(hourly) /CAPTURE_FRAME_RETENTION_SECONDS(86400, validated 3600–604800) are provisioned ahead of the capture-frame sweep in the bottle recognition design (§9.1); nothing reads them until that code ships.infrastructure/README.mdvariable list + table,CLAUDE.mdInfra env section, Functions README note;CORS_ALLOWED_METHODS/CORS_ALLOWED_HEADERSadded tolocal.settings.json.example(the code already read them).Left out on purpose: eval/admin-script settings, the
NEXT_PUBLIC_convenience copies, Azure-managedAzureWebJobsStorage/APPLICATIONINSIGHTS_CONNECTION_STRING/WEBSITE_, the deprecatedRAW_SNAPSHOT_CONTAINER.Rollout
devandprodenvironments already have every new variable at its default (plusAZURE_AD_B2C_TENANTon dev,ALERTS_ENABLED,OPENAI_BATCH_,NEXT_PUBLIC_APPINSIGHTS_SAMPLING). Variables with an empty default stay undefined (GitHub has no empty variables).INGESTION_AI_BATCH_POLL_SCHEDULEgoes from Terraform's stale0 /2to the code/docs default0(the AI batch poller runs every minute instead of every two).Verification
terraform fmt+terraform validatepass; workflow YAML parses.npm testpasses.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Function App runtime settings can now be configured through deployment environment variables, with defaults when values aren’t provided. Options include CORS, image and gallery limits, processing schedules, and database and connector behavior.
CORS preflight requests are handled by the application in both local and Azure environments. HTTP routes support preflight, and handler errors return a CORS-aware 500 response.
Documentation
Updated infrastructure and Functions guides with configuration options, defaults, and limits, and clarified application-level CORS setup.
* Expanded the local settings example with CORS options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->