Skip to content

ci: skip the broker deploy when CLOUDFLARE_API_TOKEN is not set - #2116

Closed
asasemahmed wants to merge 1 commit into
milind-soni:mainfrom
asasemahmed:fix/skip-broker-deploy-without-token
Closed

asasemahmed wants to merge 1 commit into
milind-soni:mainfrom
asasemahmed:fix/skip-broker-deploy-without-token

Conversation

@asasemahmed

@asasemahmed asasemahmed commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • deploy-composio-broker starts with a token step that records whether CLOUDFLARE_API_TOKEN is set. Checkout, pnpm, Node, install and the wrangler deploy run only when it is. Without it, the job succeeds with a warning annotation: "CLOUDFLARE_API_TOKEN is not set, so the broker Worker was not deployed."
  • scripts/ci-workflow.test.ts pins this: the first step is the token check, and every later step waits on its output. The job's needs, its if, and its absence from the merge gate are untouched.

Why

The #2074 deploy job now runs on main, but the repo has no CLOUDFLARE_API_TOKEN secret, so the latest main run fails at wrangler with "it's necessary to set a CLOUDFLARE_API_TOKEN environment variable". A missing secret then shows up as a red main commit, and the same would happen on any fork. A skipped deploy with a visible warning keeps main readable while the token is still to be created. Once the secret exists, behavior is exactly what #2074 intended.

Refs #1914 (the code is merged; the deploy still needs the token).

How it was verified

  • pnpm exec vitest run scripts/ci-scope.test.ts scripts/ci-workflow.test.ts scripts/testing/verification-docs.test.ts: 59 passed (the exact command the static job runs).
  • Windows 11, Node 24. The workflow itself can only run on GitHub, so the first main push after merge is the real check: expect a green job with the warning until the secret is added.

Screenshots (UI changes)

N/A

Checklist

  • pnpm typecheck and pnpm test pass locally
  • Server behavior changes come with tests (see CONTRIBUTING.md → Tests)
  • No dist-server/ edits (it's build output)
  • macOS-only code is platform-gated; no shell: true / cmd.exe string-building
  • No secrets in logs, responses, events, or argv

Summary by CodeRabbit

  • Bug Fixes
    • Push workflows now skip broker deployment when the Cloudflare token is unavailable, rather than failing because the secret is missing. A warning is emitted when deployment is skipped.

deploy-composio-broker runs on every push to main, but without the
CLOUDFLARE_API_TOKEN secret wrangler aborts and the run ends red, so a
missing secret looks like a broken main. Check the token in a first step
and run the remaining steps only when it is present; otherwise emit a
warning annotation saying the broker was not deployed.

The job-level condition, its dependency on control-plane and its absence
from the merge gate are unchanged, and the self-test now pins the guard.

Refs milind-soni#1914
@vercel

vercel Bot commented Oct 1, 2026

Copy link
Copy Markdown

@asasemahmed is attempting to deploy a commit to the SupaMaus Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8b89d4a6-ce15-4f8b-b2ec-8454808842d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed952a and 8a0655b.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/ci-workflow.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The broker deployment job checks whether CLOUDFLARE_API_TOKEN is set. It runs setup and deployment steps only when the token is present, and warns when it is absent. The workflow test checks the token check and step conditions.

Changes

Broker deployment

Layer / File(s) Summary
Token-gated deployment and validation
.github/workflows/ci.yml, scripts/ci-workflow.test.ts
The workflow checks for the Cloudflare token, warns when it is absent, and gates setup and deployment steps on its presence. The test asserts the token check, warning, and conditions on later steps.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8a065

Without the Cloudflare token, broker deployment is visibly skipped without blocking the documented CI gate; with the token, the existing deploy path runs. No repository evidence indicates a material merge risk.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 8a065

The change preserves the existing deployment prerequisites and does not visibly expand deployment authority. Missing credentials prevent deployment rather than bypassing authentication. Live token permissions, deployed state, and recovery after interrupted deployments remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The configured deployment target is one broker Worker, but that does not establish the maximum authority of the live Cloudflare token. The workflow documents intended Workers Scripts:Edit permission on the broker account; effective token restrictions and downstream production exposure were not available.

Trust Boundaries and Controls

  • observed — The new condition consumes a repository-managed secret, not a request parameter or pull-request field. Token presence is an execution prerequisite, not authentication validation: a nonempty but invalid token still reaches the unchanged Wrangler authentication boundary.

Resilience and Maintainability Implications

  • inferred — Main pushes use distinct concurrency groups and can overlap. Deployment ordering and convergence therefore remain unresolved, but this concurrency behavior predates the token gate. The inspected change does not add rollback, durable reconciliation, or failure suppression after deployment begins.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: skipping the broker deployment when CLOUDFLARE_API_TOKEN is not set.
Description check ✅ Passed The description follows the required template and explains the change, reason, verification, and checklist status. It clearly states that the full workflow was not run locally and that only targeted t…
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 1…
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 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@milind-soni

Copy link
Copy Markdown
Owner

The reviewed changes from this source PR were incorporated into #2155 and are on main at merge commit 3e55827, with original author commits and integration repairs preserved. Closing this source PR as incorporated.

@milind-soni milind-soni closed this Oct 2, 2026
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.

2 participants