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
{{ message }}
Repository navigation
Commit d5f8730
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,10 +144,11 @@ src/
144
144
stacks/ the Contentstack stack and delivery-token lookups behind --from-stack, through the
145
145
CmaSession (no Launch endpoint)
146
146
variables/ the shared variable-source resolver (--var, --dotenv, --from-stack, a detected .env file), the
147
-
read-modify-write writer behind launch:variables:set / :unset, and the masked
148
-
presenter behind :list. It has no repository of its own: it reads and writes through
149
-
environments, and reads the stack template through its own VariablesApi. EnvironmentBuilder calls back into it for the create commands, so the
150
-
two folders each name the other in the layering allow-list
147
+
writer behind launch:variables:set / :unset, and the masked presenter behind :list. Its
148
+
VariablesApi owns the per-variable PATCH and the stack template read; the
149
+
pre-confirmation read for unset and the list read go through environments.
150
+
EnvironmentBuilder calls back into it for the create commands, so the two folders
151
+
each name the other in the layering allow-list
151
152
deployments/ the deployment repository, the status classification, the
152
153
wait/stream loop and LogTail that projects:create, deployments:create
153
154
and logs:get all drive, and the DeploymentFollower that watches one
@@ -321,14 +322,16 @@ the yellow `Project not deleted.` and exits 3 (`EXIT_CANCELLED`) without the `Er
321
322
`CancelledError` would print; Ctrl-C at the question is still a `CancelledError`. The success line is
322
323
the green `✔ Project deleted successfully.`, matching `projects:update`.
323
324
324
-
**Environment variables (`launch:variables:*`).** There is no per-variable endpoint, so `set` and `unset`
325
-
are `GET .../environments/:uid`, merge locally, then `PUT` the complete `environmentVariables` array and
326
-
nothing else: the update body is partial on the server, so no other environment field can be dropped by it.
327
-
Every source is resolved and every value prompted for before the `GET`, so no user interaction sits between
328
-
the read and the write; `unset` reads once to validate the keys and name the environment, confirms, then
329
-
reads again immediately before the `PUT`. Two writers racing lose one change - the API offers no ETag and no
330
-
partial update (CL-7179 is the proposed `PATCH`) - and FR34 asks that this be documented rather than treated
331
-
as a defect.
325
+
**Environment variables (`launch:variables:*`).**`set` and `unset` call the per-variable
326
+
`PATCH .../environments/:uid/variables` (`VariablesApi.patch`, CL-7179) with a body of `{set: [{key, value}]}`
327
+
or `{unset: [key]}`, never both, so the CLI no longer reads the environment to merge and cannot overwrite a
328
+
concurrent change to another key. The server merges under a compare-and-swap and its response carries keys
329
+
only, which the CLI ignores. `unset` still reads the environment once, before it asks, to name it in the
330
+
question and to refuse a key that is not set with exit 2 before any prompt; a key that disappears after that
331
+
read comes back as 404 `KEY.NOT_FOUND`, which `VariablesApi.patch` rewords to the same not-set usage error
332
+
(`variable.errors.ts`). A 409 `CONCURRENT_UPDATE` (the server gave up after its retries) exits 1 with advice to run the
333
+
command again; `PATCH_EMPTY` and `CONFLICTING_KEYS` cannot be sent by this CLI and read as a CLI bug. A PUT or
334
+
a UI save racing a PATCH is still last-writer-wins on the whole array, by design on the server.
332
335
333
336
`collectVariables` in `src/variables/variable.sources.ts` is the one resolver: stack (`--from-stack`), then
334
337
`--dotenv`, then `--var`, later wins, and the summary line names every source's new keys and every override.
@@ -339,7 +342,7 @@ prints a yellow `Skipped adding variables.` and sends nothing (sources that supp
339
342
under `--data-dir`, always printing the file it chose, and fails with exit 2 when there is none. A bare `--var KEY` is a hidden prompt on a terminal, a stdin read for exactly one bare key without one, and
340
343
exit 2 naming `--dotenv -` for two or more. The API refuses an empty value, so `KEY=` is a usage error naming
341
344
the key, and an empty value inside a dotenv file is skipped with its key reported. No value reaches stdout, a
342
-
prompt message, a confirmation or an error: `list` masks through `redactedColumn`, and a failed `PUT` is worded from
345
+
prompt message, a confirmation or an error: `list` masks through `redactedColumn`, and a failed `PATCH` is worded from
343
346
`ENVIRONMENT_ERROR_MESSAGES`, never from the API's own text.
344
347
345
348
`projects:create` and `env:create` take `--var` and `--dotenv` and reach the same resolver through
0 commit comments