cloudflare / cloudflare/workers-sdk

Workers Builds: preview-trigger build variables are invisible in the dashboard and silently wiped when editing build config

Open
#15,349 5 comments 3 reactions 0 assignees View on GitHub
feature:workers-builds
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
186

Description

### Which Cloudflare product(s) does this pertain to?

Workers Builds (CI/CD)

### Describe the Bug

A Git-connected Worker has two build triggers — one for the production branch, one for all preview branches — and each keeps its **own separate** list of build variables. Two things about this bit me badly:

**1. The dashboard only shows one of the two lists.** When I edit build variables in the UI, I'm only editing the production trigger. There's no switch or hint that a second list exists for preview branches. So I renamed a variable, the dashboard showed it as set, but every preview-branch build kept failing with the value `undefined` — because those builds read the other, invisible list. You can only reach it through the API.

**2. Editing build config in the dashboard silently wipes the preview trigger's variables.** Any change to the build/branch settings recreates the preview trigger from scratch (new UUID, empty variables) with no warning. I watched a trigger go from 18 variables to 0 this way. Since secrets can't be read back, I then had to re-enter all of them by hand.

Together these turned a simple variable rename into hours of "it's clearly set, why is it undefined" — and then into "all my build variables are gone."

### Steps to reproduce

1. Connect a Worker to Git (gives you a production trigger + a preview trigger).
2. In the dashboard, rename or add a build variable. It only changes the production trigger; the preview one isn't shown anywhere.
3. Build a non-production branch → the variable comes through as `undefined`, even though the UI shows it set.
4. Make any edit to the build config in the dashboard, then check the triggers via API → the preview trigger has a new UUID and zero variables.

### Expected behavior

- Show and let me edit **both** triggers' build variables in the dashboard, or at least make it clear the preview list exists.
- Don't silently delete the preview trigger's variables when I edit build config — warn me, or keep them.

### Impact

Builds fail on variables the dashboard clearly shows as set, so the cause is basically invisible. One rename plus one later config edit went from "one missing var" to "all 18 build variables wiped," none of it surfaced in the UI.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two-trigger setup and tracing the dashboard flows for editing build variables and build configuration, then compare the production and preview triggers through the API. Done means both trigger variable lists are visible or clearly represented, and editing build configuration no longer silently removes preview variables or warns before doing so.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ci-cd, cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.