You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(agents): add cluster testing guidelines to AGENTS.md (#1598)
Document the build pipeline quirks that affect anyone deploying a
patched dashboard image to a cluster:
- Compile TypeScript before building the Docker image (lib/ is copied,
not src/)
- Always build multiarch (amd64+arm64) to avoid arch mismatch failures
- Use a fresh image tag or imagePullPolicy=Always to avoid stale node
cache
- Patch the CheCluster CR instead of the Deployment directly, as the
operator silently reverts direct Deployment patches
- Do not delegate Docker/cluster commands to background agents
Assisted-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,63 @@ yarn lint:fix
112
112
-**No skipping**: All three steps are mandatory for every surgical change
113
113
-**Fix immediately**: Do not defer fixing test, format, or lint failures
114
114
115
+
## Testing Changes on a Cluster
116
+
117
+
### MANDATORY: Compile TypeScript before building the Docker image
118
+
119
+
The Dockerfile (`build/dockerfiles/skaffold.Dockerfile`) copies **compiled artifacts** from `lib/`, not the TypeScript source. Editing `.ts` files and running the Docker build without compiling first silently produces an image with stale code — no error is raised.
120
+
121
+
Always compile the changed package before building:
Then build and push the image using `run/build-multiarch.sh`. Always build for **both**`linux/amd64` and `linux/arm64` — a single-arch image will fail on nodes with a different architecture:
135
+
136
+
```bash
137
+
export IMAGE_REGISTRY_HOST=<your-registry-host># e.g. quay.io, ghcr.io, your private registry
Use `run/patch.sh` to update the dashboard image on the cluster after pushing.
144
+
145
+
### Use a unique image tag when iterating
146
+
147
+
If you push a new build under an existing tag, nodes with `imagePullPolicy: IfNotPresent` (the default) will silently reuse the cached image. Deleting a pod does **not** force a fresh pull from the registry — the node cache persists.
148
+
149
+
Either:
150
+
- Use a fresh unique tag per build (e.g., append a timestamp or iteration counter), **or**
151
+
- Set `imagePullPolicy: Always` in the operator CR before deploying (see below)
152
+
153
+
### Patch the CheCluster CR, not the Deployment directly
154
+
155
+
The dashboard Deployment (named `devspaces-dashboard` or `che-dashboard` depending on the product) is managed by the CheCluster operator. Any direct `kubectl/oc patch deploy` is silently reverted within seconds by the operator's reconcile loop.
156
+
157
+
All spec changes — image, imagePullPolicy, env vars — must go through the CheCluster CR. Use `run/patch.sh` for the common case of updating the image alone. For other changes such as `imagePullPolicy`, patch the CR directly:
158
+
159
+
```bash
160
+
# Find the CheCluster CR name and namespace first:
161
+
kubectl get checluster --all-namespaces
162
+
163
+
# Then patch — adjust CR name, namespace, and container name to match your deployment:
### Do not use background agents for Docker or cluster commands
169
+
170
+
Background agents cannot respond to interactive `dangerouslyDisableSandbox` permission prompts. Docker builds, `kubectl`, and `oc` commands that need sandbox bypass must be run directly in the main session, not delegated to a background agent.
0 commit comments