Skip to content

feat!: declare the Prisma Cloud variables your services read with variable() in the app root; envSecret() and envParam() are removed - #431

Merged
wmadden-electric merged 74 commits into
mainfrom
claude/platform-variables-s3
Nov 17, 2026
Merged

wmadden-electric merged 74 commits into
mainfrom
claude/platform-variables-s3

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This changes how an app says which Prisma Cloud environment variables its services read. Here is one app's root file, before and after:

// before: the variable is named inline, wherever a value is bound
export default appRoot('shop', ({ provision }) => {
  provision(email(), {
    input: { from: '[email protected]', deliveryCredential: envSecret('EMAIL_DELIVERY_CREDENTIAL') },
  });
});
// after: the root declares the variable once, and passes its value down
export default appRoot('shop', ({ provision }) => {
  const deliveryCredential = provision(variable.secret({ name: 'EMAIL_DELIVERY_CREDENTIAL' }));

  provision(email(), { input: { from: '[email protected]', deliveryCredential } });
});

Nothing changes on Prisma Cloud. The variable keeps its name, the operator still sets it with prisma project env add, and the service still reads it when it boots. A deploy with the variable unset still stops before anything is created:

$ prisma deploy --environment staging
Deploy failed. 1 platform variable a service needs has no value:
  - EMAIL_DELIVERY_CREDENTIAL  (read by service "shop.email.service", field "deliveryCredential")

Set it on the platform, then deploy again:
  - prisma project env add 'EMAIL_DELIVERY_CREDENTIAL=<value>' --project 'proj_…' --role preview
  - prisma project env add 'EMAIL_DELIVERY_CREDENTIAL=<value>' --project 'proj_…' --branch 'staging'

The decision

A platform variable is an environment variable on Prisma Cloud that the operator sets and a service reads at boot. After this change:

  1. The app's root declares each platform variable, with variable({ name }) for a plain value or variable.secret({ name }) for a secret. Both come from @prisma/composer-prisma-cloud. provision() returns the variable's value, and the root passes it to whatever needs it.
  2. Only the root can declare one. The root is written with appRoot(). The same call inside a module() does not compile.
  3. envSecret() and envParam() are removed, with secretName() and paramName(). This is a breaking change; the migration guide is below.

That leaves exactly two ways for an operator's value to reach an app:

The value is read Where it comes from How the app declares it
by the service, at boot a platform variable, set on Prisma Cloud provision(variable({ name })) in the root
by the deploy, when it runs the config adapters in prisma.config.ts, by default the deploying shell a field of the root's input schema

Why

envSecret('NAME') and envParam('NAME') could be written in any binding, in any module. That caused three problems.

  • Nothing listed an app's platform variables. They were values scattered through bindings, so you could not ask the loaded app which variables it needs, or which service reads each one, without deploying it.
  • A reusable module could claim a name. Variable names are shared by the whole deployed app. A module from a package that wrote envSecret('API_KEY') took that name in every app that used it, and two such modules could collide with no way for the app's author to fix it.
  • envParam() meant two different things. In a service's input it was a value the deploy read from the shell, which a field of the root's input already does. In a service's params it was a value read from the platform at boot.

How it works

Each part builds on the one before.

1. Declaring a variable gives you its value

const from = provision(variable({ name: 'EMAIL_FROM' }));

from stands for the text the variable will hold at boot. The root's code cannot read it; it can only pass it on. The declaration is also an entry in the app's graph, with an address like any service or database: shop.emailFrom, the variable's name in camel case. Pass { id } to provision() to choose another.

2. The value goes into a field of a service's or a module's input

A plain value fits a field the schema wraps in field(). A secret fits a secretString() field, and the service receives it in a box that prints as [REDACTED]. Binding a plain value to a secret field, or a secret to a plain one, does not compile.

To reach a service inside a module, the module declares a field in its own input and passes it on:

export const email = () =>
  module('email', { input: type({ from: field(type('string')), deliveryCredential: secretString() }) }, ({ input, provision }) => {
    provision(emailService(), { id: 'service', input: { from: input.from, deliveryCredential: input.deliveryCredential } });
  });

So a reusable module never names a platform variable. It says what it needs, and the app decides which variable supplies it.

3. Only the root can declare one, and the compiler says so

Inside a module() body, provision(variable({ name: 'OTHER' })) fails to compile:

error TS2769: … "Only appRoot() can provision a resource that is a value. Provision it in the app root and pass its value down through this module's input."

A root still written module('shop', …) is still accepted as a root, but it must become appRoot('shop', …) to declare a variable.

4. A value cannot go where the deploy needs a number or a fact

A platform variable's value does not exist until the service boots. So it cannot be used where the deploy itself needs the value:

  • A service's params. On a compute service that means port. The deploy tells Prisma Cloud which port to route to before the service exists, so port takes a number written in the code or a field of the root's input. Binding it to a variable does not compile.
  • A resolve() dependency, or a resource's props, such as a public URL's hostname.

envParam() could be bound to port before this change. It compiled, and the service failed at boot whenever the variable was set, because the variable's text is not a number.

5. Three mistakes are refused before anything is created

Right after the app is loaded, and before the deploy contacts Prisma Cloud:

  • Two declarations of one name. The platform variable "EMAIL_FROM" is declared twice in the app root, by "shop.emailFrom" and "shop.sender". Declare each platform variable once and pass its value to every module that needs it.
  • One name used both ways: as a platform variable and as a field of the root's input.
  • A variable bound as a service's whole input instead of one field of it.

Two variables whose names give the same address, such as EMAIL_FROM and EMAIL__FROM, fail with an error that names both and says to pass id.

6. The deploy creates nothing for a variable, and checks that it is set

A declaration creates no resource on Prisma Cloud and has no line in the deploy report. The deploy does not read or write the variable's value. As before this change, it checks that each variable has a value in the environment being deployed:

  • A variable a service cannot boot without stops the deploy, as in the output at the top.
  • A variable bound to an optional field is listed under "Platform variables with no value:" with the commands that set it, and the deploy succeeds.
  • A variable the root declares and nothing reads is listed the same way, once.

7. prisma dev plays the platform's part

There is no Prisma Cloud locally, so prisma dev supplies the values from the two adapter lists in prisma.config.ts: a plain variable from the config adapters and a secret from the secrets adapters, each under the variable's name. Both lists default to the shell. A required variable with no value stops prisma dev before any service starts, and so does a plain value that is not text.

8. The loaded app lists who reads what

The graph that Load returns has a new list, valueReads. Each entry names a service, the variable declaration it reads, and the field of the service's input that reads it. Tests and tools can use it without deploying.

Migration guide

1. envSecret('X') becomes variable.secret({ name: 'X' }) in the root. This is the before and after at the top. If the envSecret() was written inside a module, move it to the root, give the module a secretString() field in its input, and pass the value down.

2. envParam('X') in a service's input becomes a field of the root's input. The deploy still reads the value from the config adapters, by default the shell.

// before
export default appRoot('shop', ({ provision }) => {
  provision(web, { input: { greeting: envParam('GREETING') } });
});

// after
export default appRoot('shop', { input: type({ GREETING: 'string' }) }, ({ input, provision }) => {
  provision(web, { input: { greeting: input.GREETING } });
});

For a value that may be unset, declare the field optional: 'GREETING?': 'string'. If the envParam() was a resolve() dependency or in a resource's props, use the root field there: resolve([input.X], …).

3. envParam('X') in a service's params becomes a number or a field of the root's input. It could only bind port.

// before
provision(web, { params: { port: envParam('WEB_PORT') } });

// after
export default appRoot('shop', { input: type({ WEB_PORT: 'string.integer.parse' }) }, ({ input, provision }) => {
  provision(web, { params: { port: input.WEB_PORT } });
});

Leave port out to use 3000.

4. A root written with module() becomes appRoot() if it declares a platform variable. appRoot() takes no deps and no expose.

5. Tests that called secretName() to find which variable a binding reads use the graph instead: find the entry in graph.valueReads, take the node at its resource from graph.nodes, and read props.name.

Internal Prisma apps call the removed functions: the deploy apps in prisma/streams, and the apps in prisma/asks, prisma/program and prisma/pdp-control-plane. prisma/skills and prisma/web document them. Each moves when it upgrades Composer.

Also in this pull request

  • A wrong command is fixed. For one branch's value, the deploy suggested prisma project env add … --role preview --branch 'staging', which the prisma CLI refuses. It now suggests --branch 'staging' alone. This was already wrong on main.
  • examples/env-param is now examples/root-input, package @prisma/example-root-input. It shows a value the deploy reads through a field of the root's input.
  • prisma dev pauses rebuilds when the app's variable reads change, and says to restart. The values are worked out once at start, so a read added later would have none. See the known limit below.
  • A test in the local Postgres emulator's package no longer fails when another package's tests claim its port first. The two ran at the same time in CI and raced for port 51300.

For authors of extensions

  • Core has a new kind of resource node, the value resource, built with valueResource() and recognised with isValueResource(). A platform variable declaration is one. Only an appRoot() body can provision one.
  • paramSource() no longer takes configurationKey, and ParamBindings accepts no source. A service's param takes a literal or a value the deploy has.
  • AppConfigurationRead has no configurationKeyText.
  • A local target's preflight returns the new type DevPreflightResult, { payload, plainVariableText }. prisma dev refuses a local target that returns the old shape, with a message that names the extension and says to upgrade it.
  • LocalTargetProvidersInput.configurationKeyText is now plainVariableText. localTargetProviders() and the CLI's prepareSecondProcess() take it.
  • paramManifest() and secretSourceManifest() are removed. Nothing used them once the old functions went.
  • prisma dev has a new event, value-reads-changed, which the CLI prints as a warning.

Reading the diff

About 190 files change. Most are tests, examples and documents that moved off the removed functions.

  • Core (packages/0-framework/1-core/core/src): the value resource and what provision() returns for it in node.ts, value.ts and load-module.ts; the list of reads in resolve-values.ts.
  • The Prisma Cloud target (packages/1-prisma-cloud/1-extensions/target/src): platform-variable.ts is the two constructors; graph-check.ts is the three refusals; preflight.ts and local-target/preflight.ts are the deploy's and prisma dev's checks.
  • The CLI (packages/0-framework/3-tooling/cli/src): app-configuration-file.ts and operations/execute-dev.ts carry plain values to the local services; dev/value-reads-change.ts is the rebuild check.
  • Documents: every decision record, glossary entry and guide that described the old functions is rewritten to describe this. The guide's new section is "Two ways to get a value" in docs/guides/building-an-app.md.

How it was checked

  • Every package's tests, type tests, lint, the cast check and the dependency check pass, and the three local-dev integration scripts pass when run alone.
  • On Prisma Cloud, with an app built for the check (two plain variables and a secret, passed through a module to two services):
    • A required secret with no value stops the deploy before any service or database is created. After running the printed command, the deploy succeeds and the service boots with the value.
    • An optional variable with no value is listed with its reader and commands, and the deploy succeeds.
    • A fresh preview environment prints two commands per variable. Both were run exactly as printed, and the prisma CLI accepts both.
    • Changing one variable's value and deploying again replaced only the deployment of the service that reads it.
    • A made-up secret set under the secret's name appears in no deploy output, deploy report, generated file or service log.
    • examples/root-input deploys, and its smoke script passes.
  • The same app under prisma dev receives its values. A required variable with no value, and a value that is not text, each stop it before any service starts.
  • Every project created for the check is destroyed.

Known limits

  • The check for one name used both ways sees only the root input fields the root passes on. Composer cannot list the fields a schema declares. A field the root declares and never uses reaches no service, so nothing reads the name two ways, but nothing refuses the app either.
  • Under prisma dev, an edit to module.ts is not picked up by the check that pauses rebuilds. prisma dev keeps the copy of the app's modules it loaded at start. So after an edit that adds a variable, the rebuild fails with an existing error, "the second process built a different graph", and the fix is to restart prisma dev. This is how prisma dev treats every edit that adds or removes a service or resource today; it is not new here.

Alternatives considered

  • Keep envSecret() and envParam(), deprecated. There would be two ways to name one variable, and an inline envSecret() would still be missing from the list of declarations. Every known caller is inside Prisma.
  • Remove only envSecret(). envParam() in a service's input duplicates a field of the root's input, and in params it could only bind port, where it failed at boot.
  • Let any module declare a variable. A module from a package would claim a name in every app that used it, and its input would no longer say everything it needs.
  • Check "root only" when the app is loaded, not when it is compiled. A package could then ship a module that compiles and fails every app that uses it.
  • Make the variable a property of an input field, such as field(type('string'), { env: 'EMAIL_FROM' }). A value the operator must set is part of what the app is made of, so it is declared in the graph beside the services and databases.
  • Let a variable be bound to port. The deploy needs the port before the service exists, so it would route to 3000 while the service read the variable. Whether a compute service's port should be set through params at all is not decided; it is recorded in .drive/projects/platform-variables/deferred.md.
  • Have provision() return { id, value }. Returning the value itself, with id on it, lets a binding read { from, deliveryCredential }, as generatedParam() and serviceOrigin() already do.
  • Re-check the variables on every rebuild under prisma dev, so an added read needs no restart. Left for later: it is a change to the dev loop, not to platform variables.

Agent: gavroche-74

🤖 Generated with Claude Code

wmadden-electric and others added 30 commits November 11, 2026 09:51
…tect and principal engineer

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…natives; plan and design match it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…a value from a root input field or a platform variable node

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…no open findings

Fixes the factual errors a code check found, moves build mechanics out of
the design, and applies review rounds 4 to 6: an appRoot() body reports a
bad option on a platform variable node, and prisma dev pauses rebuilds
when the app's platform variable reads change.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…an provision

valueResource() builds a resource node that holds a secret or param source under a core-only key. In an appRoot() body, provision() returns a frozen copy of that source whose origin records the node's address and whose id, not enumerable, is the address. A module() body cannot provision one: the compiler shows that only appRoot() can, and Load refuses one that a cast got past the types.

The graph gains valueReads, which lists each service that reads a value resource's value and where in its binding, through any number of module inputs. Every secret value resource is in the graph's secret sources, named by the node itself when no service reads it, so its value is a known secret.

The duplicate-id error now names the module by its address and the node already at the id, and says to pass an id.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
A value resource is lowered through its descriptor like every resource, but it deploys nothing. An empty line for it in the deploy report would read as something Composer deployed, so the deploy leaves it out of the report.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…plicate-id error names both nodes

valueReads now walks a binding with the existing sourcesByPath walker, which guards against cycles only, so one object bound at two keys gives a read at each. Param reads reuse pointersIn.

The duplicate-id error names the node already at the id and the node that takes it too. The OnlyInAppRoot text no longer names a target's concept. The check that proves a value resource holds a source with an origin hands that origin to provisionedValue(), so its unreachable error is gone. Doc comments on internal code are removed, and the provision() cast reasons say what the one implementation serves and returns.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ages name no target concept

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…rm variable node

The app root provisions a plain platform variable with variable({ name }) and a platform secret with variable.secret({ name }). Each checks the name with the same rules as envSecret(), and its empty-name message shows the call with an options object. The node is a platform-variable value resource whose default provision id is the name in camel case, and its value is a plain or a secret source whose payload carries the name.

secretName() and paramName() also read the name of a node value, so a node works wherever an envSecret() or a per-key envParam() works.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…criptor that creates nothing, and is not sent to the application topology

prismaCloud().nodes registers platform-variable, so the deploy walk and registry coverage look the node up like every other resource. Its lowering returns no outputs and no entities. The application topology leaves out every value resource: the platform has no node kind for it, and Composer owns nothing it names.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…rm variable node value

A plain or secret node value stays in place in the binding and is written as a $platform marker with the variable name, and secret: true for a secret. A plain node in per-key params writes the same pointer row a per-key envParam() writes. A schema failure on a field that reads a node now ends by naming the variable, and an array position that reads an unset plain node names it.

The absentSecrets option also leaves out a plain node named in it, so preflight can tell whether the service needs it. Its rename to absentVariables waits for the removal of envSecret().

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…red twice, read two ways, or bound as a service's whole input

Two platform variable nodes with one name fail, naming both, and say which is plain and which is a secret when they differ. A plain node and a root input field the root's body passes on, with one name, fail: the name would be both a value services read at boot and a value the deploy reads. A secret node and such a field are already refused by core's Load. A node value bound as a service's whole input fails. The check for an envParam() and a root input field with one name stays until envParam() is removed.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…able nodes, including nodes no service reads

Preflight finds plain and secret node names from the same walk of each service's binding, and a plain node in a per-key param, then checks each has a row with slice 2's rules. A node no service reads is listed once, named by the node, also when a module receives it. The prisma dev preflight still reads only secrets from the walk; it fills plain nodes in a later change.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…er resource

A value resource needs a descriptor in its extension, found by its type with no special case, as a platform variable node needs its descriptor in prismaCloud().nodes.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… as a lowering must

The descriptor the previous commit's test registers returned undefined, which the package's type check refuses.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…er requires

The formatter rewraps lines and sorts imports. One test reads the deployment triggers without an optional chain the linter calls unsafe.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Both the authoring side and the deploy side import it, like the envSecret() module beside it.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…able

The test that names every node type the extension registers did not list the platform variable descriptor.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…platform variables, and rule 1 names every node with the name

A value resource of another extension was treated as a platform variable, so preflight would have looked for its row and the graph check called it one. The target now selects its nodes by extension and type, and refuses one of its nodes whose props hold no name instead of skipping it.

Rule 1 named only the first two nodes when three or more shared a name, so the user fixed one and met the error again. It now names every node, says how many, and which are plain and which are secrets.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…nvalid-input error, and writes array positions as the serializer does

Preflight's requirement check reused the schema message with that line appended, so the list of variables a service needs held a sentence that repeated the list. The line is now added only where the input is refused as invalid, at deploy and in preflight. It writes the field as list[1], as the serializer's other errors do, not list.1.

Doc comments this change and the last made untrue are corrected on the public secretName() and paramName(), and removed from internal functions and options.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…riable node

The whole-lowering test now checks the deploy report holds only the two services. The triggers test is renamed for what it checks: which node rows each deployment's triggers hold.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…pe, and the one-node-per-name error names every node

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…iable texts, and the local providers receive them

LocalTargetDescriptor.preflight now returns DevPreflightResult, { payload, plainVariableText }, exported beside LocalTargetDescriptor. LocalTargetProvidersInput and localTargetProviders() gain plainVariableText beside configurationKeyText, which stays until envParam() is removed.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ariable's text from the app configuration

For each plain node a service reads, the dev preflight reads the app configuration under the variable's name once. Text is returned in plainVariableText and fingerprinted for its readers. An unset or empty value is left out of the input document when an input field reads it, and is judged as a per-key param when a param reads it. A value that is not text stops dev, naming the node and every service that reads it.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…y pointers from the plain platform variable texts

A secret marker still takes its text from the named secrets.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…iable texts in the app configuration file

The app configuration file gains the top-level member plainVariableText. prisma dev keeps the texts from the preflight it runs at start and writes them on the first converge and on every rebuild; deploy and destroy write {}. A file without the member is refused. Each text is checked against the known secrets before the file is written, and a text that holds a secret's value fails with CONFIG.SECRET_AS_PLAIN_VALUE, naming the platform variable. The dev stack passes the texts to the local providers.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…s pauses prisma dev until it restarts

After a rebuild's Load, prisma dev compares the reads (reader, resource and site) and each read value resource's address with its props against the same sets at start, using only core's graph. On a difference it does not converge, emits value-reads-changed once with the nodes whose reads were only added, only removed, or changed, and pauses rebuilds, as a changed value already does. Reordering provision() calls changes neither set.

The previous commit's execute-dev.ts already calls valueReadsChange(); this commit adds it, the event, its warning and the tests, including the tests that run executeDev through a first converge and a rebuild.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…does, as main's tests now do

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…low from its code findings

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
A source built without a label is named "a source". The unread
reader is { kind: 'unread', node }, with no one-value nodeKind.
paramManifest() and secretSourceManifest() are removed: nothing
outside core used them. The two-sources param message reads plainly,
comments the branch touched are cut, and the tests pin the whole
pointer refusal and the module-call diagnostic.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
A local target whose dev preflight returns a payload string, or
nothing, now stops prisma dev with a message that names the extension
and says to upgrade it, instead of a TypeError or a silently dropped
payload. A test shows that a secret value resource no binding reads is
redacted from every output, and the unread reader has no nodeKind.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…d the review's target findings

ComputeSerialized.pointers, pointerVersion(s) and the local target's
pointedVariables become platformVariables and
platformVariableVersion(s): they hold the names and versions of the
platform variables a service's input document names, not pointers.
The serializer writes one binding path, so the schema-failure note
reads list.1 like every other message. Its secret-box and
deploy-validation messages are plain sentences. Tests pin per-reader
trigger members under prisma dev, a literal per-key param adding no
trigger member, and the whole not-a-platform-variable text.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…iable to the web service

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… from the rename

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 088eee5d-33df-49ae-abc3-0c58d039cf6d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@prisma-gizmo

prisma-gizmo Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✅ Gizmo reviewed dad369d — posted 0 inline comment(s) this pass.

Open findings: none

Change walkthrough

This delta hardens the squatter setup in the stale-@prisma/dev-record test in postgres.test.ts so a CI port race can no longer fail the run. It is part of the larger PR that turns platform variables into app-root-provisioned value resources; the delta itself touches only this test's flake defense.

What changed. The squatter @prisma/dev server is now started through a retry helper. Each attempt derives a fresh name (pcdev-pgtest-squatter-<pid>-<attempt>) and picks a fresh port (OS probe plus registryClaimedPorts exclusion), then starts the server. If the start is refused with PortBelongsToAnotherServerError, the attempt returns undefined and the loop retries; anything else, or a refusal on the fifth attempt, throws. The previously removed comment's concern — a refusal poisoning the squatter's name by leaking its lock — is now sidestepped rather than documented, since every retry abandons the poisoned name.

Fit with the codebase. The retry mirrors the same defensive style the production allocator uses in postgres-main.ts (fresh picks per attempt, registry exclusions refreshed each round, bounded retries). Failed attempts record no server record, so they claim no ports afterward, and the finally still deletes only the successful squatter's record, as before. The rest of the test — close-without-delete arming the trap, the fresh-allocation assertions, the 120 s timeout — is untouched.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@prisma/composer@431
npm i https://pkg.pr.new/@prisma/composer-cli@431
npm i https://pkg.pr.new/@prisma/composer-prisma-cloud@431

commit: dad369d

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: 🔴 2 critical · trace

…e TypeScript writes paths with forward slashes

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: none · trace

Still open from previous reviews: 🔴 2 critical

…to the secret scanner

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: none · trace

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Gizmo finding is open and the head commit has been reviewed. Approving.

…ain when another process claims it first

The test scans the machine's @prisma/dev server records, picks the
lowest free port from 51300 that no record claims, and starts a
squatter server on it. @prisma/dev scans the records again inside the
start. In CI, turbo runs @internal/prisma-cloud's tests at the same
time, and its local-target-current test runs a real Postgres emulator
that creates databases on the lowest free port from 51300 too. When
that emulator records 51300 between the test's scan and @prisma/dev's
scan, the start is refused with PortBelongsToAnotherServerError.

The refused start keeps the name's lock for the life of the process,
so the retry uses a new name. The refused name is not deleted:
deleting a lock this process still holds makes proper-lockfile throw
from a timer. It has no server.json, so it claims no ports.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: none · trace

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Gizmo finding is open and the head commit has been reviewed. Approving.

@wmadden-electric wmadden-electric changed the title feat!: an app root declares each platform variable as a node; envSecret() and envParam() are removed feat!: declare the Prisma Cloud variables your services read with variable() in the app root; envSecret() and envParam() are removed Nov 17, 2026
@wmadden-electric
wmadden-electric merged commit 62a3261 into main Nov 17, 2026
25 checks passed
@wmadden-electric
wmadden-electric deleted the claude/platform-variables-s3 branch November 17, 2026 11:30
wmadden-electric added a commit that referenced this pull request Nov 17, 2026
Brings in #431: the app root declares each platform variable with variable(), and envSecret() and envParam() are removed. The in-process deploy keeps passing values to lower(); the secret refusal now covers main's plain platform variable text for prisma dev.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Nov 18, 2026
main now holds the deploy work as merged (#405), platform variables declared with variable() (#431) and the input document in the artifact (#432). Files the early deploy draft on this branch shared with #405 take main's version.

prisma dev keeps converging in the prisma process: plain platform variable text and named secrets reach the local target as values, the secret refusal runs before each converge, and no app configuration file is written for dev.

The documents are main's. The dev changes to them are re-applied once the reload design is final.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
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