Skip to content

chore(iac): enable ri_exchange_reshape schedule in GCP and Azure dev - #856

Merged
cristim merged 1 commit into
mainfrom
chore/enable-ri-exchange-schedule-gcp-azure
Oct 13, 2026
Merged

cristim merged 1 commit into
mainfrom
chore/enable-ri-exchange-schedule-gcp-azure

Conversation

@cristim

@cristim cristim commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Sets enable_ri_exchange_schedule = true in terraform/environments/{gcp,azure}/github-dev.tfvars. Follow-up to #783, which added the scheduled ri_exchange_reshape task on Cloud Run and Azure with the schedule default off. Module defaults are unchanged.

What this means

  1. The 6-hourly ri_exchange_reshape then runs automatically wherever RIExchangeEnabled is true in the app config. Where it is false the task is a no-op.
  2. The deploy needs flagging: merge to main deploys DEV automatically (deploy-gcp and deploy-azure run on push to main).
  3. Nothing is applied by this PR beyond the normal merge workflows.

Staging and prod stay off, pending an owner decision on scope.

Verification

terraform fmt -check, terraform init -backend=false and terraform validate pass in both environment dirs. No plan or apply was run; no cloud access was used. Diff touches only the two dev tfvars files.

Summary by CodeRabbit

  • New Features
    • Azure and GCP development environments now have scheduled RI exchange enabled.
    • Azure development recommendations are scheduled to run daily at 02:00.

Sets enable_ri_exchange_schedule = true in the dev tfvars only. Staging and prod stay off pending an owner decision.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: fa334fff-ea95-4006-8bc3-b0d5b087511c
📥 Commits

Reviewing files that changed from the base of the PR and between f56c6b8 and 9fde940.

📒 Files selected for processing: 2
  • terraform/environments/azure/github-dev.tfvars
  • terraform/environments/gcp/github-dev.tfvars

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

📝 Walkthrough

The Azure and GCP dev configurations enable the RI exchange schedule. The Azure configuration sets the recommendation schedule to 0 2 * * *; the GCP recommendation schedule remains unchanged.

Changes: Dev schedule configuration

Layer / File(s) Summary
Dev schedule settings
terraform/environments/azure/github-dev.tfvars, terraform/environments/gcp/github-dev.tfvars
Both configurations set enable_ri_exchange_schedule to true. Azure sets the recommendation schedule to 0 2 * * *; GCP retains its existing recommendation schedule.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 9fde9

DEV will invoke the task every six hours, but it skips exchange work when RI exchange is disabled in app config. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: enabling the RI exchange schedule in the GCP and Azure development environments.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim

cristim commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

Gate verdict: APPROVE at 9fde940

Independent adversarial review by the gate agent (non-author). Config-only change; no money/auth code path touched.

Diff scope: only terraform/environments/{gcp,azure}/github-dev.tfvars. Every changed line, before -> after (both files identical):

  • enable_scheduled_tasks = true -> enable_scheduled_tasks = true (fmt realignment, value unchanged)
  • recommendation_schedule = "0 2 * * *" -> recommendation_schedule = "0 2 * * *" (fmt realignment, value unchanged)
  • (new) enable_ri_exchange_schedule = true

Wiring: variable declared in terraform/environments/gcp/variables.tf:294 and azure/variables.tf:405 (default false, schedule default 0 */6 * * *), passed through gcp/compute.tf:95 and azure/compute.tf:120 to the Cloud Run / Container Apps modules, which gate the scheduler resources on it (modules/compute/gcp/cloud-run/main.tf:393,425,434; modules/compute/azure/container-apps/scheduled-tasks.tf:97,242,257,268,297,448). Azure's scheduled_task_secret_name precondition is already met in dev (enable_scheduled_tasks = true, azure/compute.tf:116). The task is a no-op unless the app config has RIExchangeEnabled: internal/server/handler_ri_exchange.go:42 returns early when it is false.

Deploy on merge: deploy-gcp.yml and deploy-azure.yml trigger on push to main (no paths filter), resolve the environment to dev, and run terraform plan -var-file=github-dev.tfvars then terraform apply -auto-approve. Merging therefore deploys the new schedulers to DEV automatically. Staging and prod stay off. Nothing was applied by the gate.

Local evidence (macOS, git archive of the head, Terraform v1.14.7, no cloud access): in both env dirs terraform fmt -check passes, terraform init -backend=false passes, terraform validate reports "Success! The configuration is valid." No plan/apply (needs cloud credentials).

CI: 25/25 checks pass at this SHA; mergeStateStatus CLEAN; head contains origin/main.

PR body carries the required notes (6-hourly ri_exchange_reshape runs wherever RIExchangeEnabled is true; deploy flagged; nothing applied beyond normal merge workflows). No findings.

@cristim
cristim merged commit 74c3234 into main Oct 13, 2026
25 checks passed
cristim added a commit that referenced this pull request Oct 13, 2026
…ing and prod (#863)

Mirrors #856, which did the same for dev.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@cristim
cristim deleted the chore/enable-ri-exchange-schedule-gcp-azure branch October 16, 2026 14:12
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