Repository navigation
fix(prisma-cloud): the deploy checks platform variables against the variable group the branch receives - #450
Draft
wmadden-electric wants to merge 6 commits into
Draft
wmadden-electric wants to merge 6 commits into
wmadden-electric wants to merge 6 commits into
Conversation
…ariable group the branch receives
Preflight now makes one read, GET /v1/projects/{projectId}/resolved-variables, for the environment's branch (the default branch for production), in place of one list call per name filtered by class. A name is present when the read lists it, whatever group or override it comes from, so a value set in a custom variable group is seen.
A failed read, or an answer that is paged, fails the deploy; there is no fallback to the old lookup, which gave wrong answers on a custom group. The commands for a missing variable follow the group's class, and the command that writes a branch override is no longer suggested.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…t's branch receives The guides, the skill and the decision on platform variables now describe variable groups: each branch receives one group, the deploy reads once what the branch receives, and the hint for a missing variable follows the group's class. The command that writes a branch override is no longer suggested, and the guide says the deploy does not see a value set on one service in Console. The glossary gains variable group and service variable. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…call, and a complete list answer is accepted Every failure of the resolved-variables read now names the call, the project and the branch: an error status with or without a body, a network failure, and a body that is not JSON or not the expected shape. Only a 404 says the platform may not offer the read yet. The deploy fails on a paged answer only when it says there is more, so a complete answer in the platform's list envelope passes. The custom-group hint names the group in double quotes, and core documents each hint line as a shell command where one exists, otherwise an instruction. The container carries the branch a deploy targets as deployBranchId. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…as the platform's model The glossary, the platform data model and the platform-variable decision now agree, in the present tense. A service variable belongs to one Composer service in one environment and is set only when a deployment is created. Lines that said a deployment receives every variable of its class now say its branch's group, and the failure and paging rules match the code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…status and one short line of the body The read now asks for its body as text and parses it itself, so a 200 whose body is not JSON names HTTP 200. An error body is shown as at most one short line, never a whole HTML page. A thrown error that carries a status names it, and the sentence ends with one full stop whatever the error's own punctuation. The container defines the branch a deploy targets once, as deployBranchId, and alchemyStage refers to it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…nd the design records the review corrections The data model's entity graph, edges and version-create row now describe groups, overrides and service variables as one model. The glossary entry for a variable on the platform says plainly which writes the platform will reject. The error table and ADR-0064 match the failure messages. The design records that only an answer saying it has more fails, that only a 404 says the read may be missing, and that the custom-group hint is a sentence; deferred.md and plan.md record what is left. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
⏸️ Gizmo skipped the automatic review of 131d933 because this pull request is a draft. It will review automatically once the PR is marked ready for review.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An app names two platform variables. Its
stagingenvironment is on a branch that receives a custom variable group namedstaging, and neither variable is set there:Today's Composer looks for
EMAIL_API_KEYin thepreviewclass instead. If it is there, the deploy succeeds and the service starts without it. If it is only instaging, the deploy fails although the value is set.This is a draft until the platform's
resolved-variablesread is live in production. See "Before this can merge".What changes
Preflight asks the platform what the environment's branch receives, in one call, and stops looking up each variable by class.
One read.
GET /v1/projects/{projectId}/resolved-variables?branchId=…, when the app names at least one platform variable. For production, the branch is the project's default branch. An app that names none makes no call.Present, unset, refused. A name in the answer is present, whatever its source. A name not in it is unset, and the existing rule decides whether a service requires it. A name the platform manages itself is refused, as before.
Redeploy triggers use the
updatedAtof the entry the branch actually receives, so a value changed in a custom group replaces the services that read it.Hints follow the group the branch receives.
productionprisma project env add 'NAME=<value>' --project <id> --role productionpreviewprisma project env add 'NAME=<value>' --project <id> --role previewcustomSet NAME in the variable group "<name>" in the Prisma Console.The
--branch <environment>command is no longer suggested: it creates a branch override, which the platform is removing.A failed read fails the deploy, with no fallback to the old lookup. The message names the call, the project and the branch. A 404 adds that the platform may not offer this read yet.
An answer that says there is more to fetch fails the deploy, telling the user to upgrade Composer. A release that read only the first page would report set variables as missing.
Why
Prisma Cloud is replacing its two variable classes with variable groups. A branch receives exactly one group, and a custom group does not combine with
preview. The old lookup cannot name the branch, so on a custom group it is wrong in both directions. The decision record for platform variables is rewritten in place for the new model, with the glossary, the platform data model, the deploy guide and the skill.Before this can merge
mainpublishes adevbuild, and this preflight calls the read on every deploy that names a platform variable. Until then theDeploy, verify, destroycheck on this pull request fails: it deploys to the real platform, which answers the read with 404.groupId, which is whatprisma project env add --role previewdoes, is stored with no group. A deployment receives it, butresolved-variablesdoes not list it (resolved-variables.tsfilters ongroupIdonly;setConfigVariable.tsstoresinput.groupId ?? null). This preflight would report such a variable missing, and the hint would write another row the read cannot see.prisma variable add … --grouphas shipped. If it has, the custom-group hint becomes that command.Known gap
A value set on one service in Console is not seen: preflight asks about the branch, not about each service. A variable a service requires that is set only on that service fails the deploy as missing. The guide says so. Recorded as later work.
How it was checked
updatedAtreplaces the service and an unchanged redeploy does not; 404, 500, 401, a body that is not JSON and a paged answer each give a message that names the call and contains no value. The test project was deleted afterwards.Alternatives considered
branchIdfor production. Rejected: the deploy already holds the default branch's id, and sending it removes a platform default Composer would depend on.prisma variable add … --groupfor a custom group. Not possible yet: the command does not exist.This is the second of three pull requests that make Composer work with variable groups. The design is in
.drive/projects/variable-groups-compat/design.md.Agent: democritus-22
🤖 Generated with Claude Code