Repository navigation
Accept a deployed app's addresses as command subjects: prisma service logs @pr-42:shop.api - #373
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
A scratch Project with a logicalId, a default and a preview branch, and rows sharing an address on each, built through the management API. Covers service logs and show, project show, bucket key list and delete, postgres show and delete, consent by address, and the wrong-kind and not-found errors. service logs leaves the coverage backlog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
branch list and the service read path each had their own cursor loop
over /v1/projects/{projectId}/branches. Both now use one listing that
can also ask the API for a single git name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…address postgres delete @shop.db used to ask only for 'the exact address', so a user could delete production without ever seeing the word. A destructive command given an address now names the row id, the environment (saying production plainly) and the branch in its consent question: Deleting database db_123 in production (branch main) is destructive and requires the exact address. Alongside: - The resolver moves to lib/address/address.ts with names for what they hold: AddressSubject for the typed @env:address string, AddressMatch for the one result, BranchScopedKind for service/database/bucket, and resolveBranchScopedSubject beside resolveProjectSubject. ScopeFlags is optional, so bucket no longer passes {}. - A named environment asks the API for that branch by gitName, through the shared branch listing. - Every group trims the subject before reading it as an address, and the consent token is the trimmed address. - The project commands share resolveProjectPositional. - @env:app on a project command is ADDRESS.USAGE_ERROR; every ADDRESS.AMBIGUOUS carries matches: [{id, name}], and every ADDRESS.WRONG_KIND carries expected and actual. - Tests assert which service row was deleted or listed, that the client-side logicalId/branchId check holds when the API ignores its filters, and that project delete and transfer refuse @env:app at the command level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
The service, postgres, bucket and project group cards now say how to name a resource by its address, what the address is (the name the app gave it, such as shop.db) and what the part before ':' is (the environment the app was deployed to: its branch, or production when left out). The postgres card no longer uses 'address' as a verb. command-principles.md states that production means the Project's default Branch, not the production-role Branch or a Branch named production. The error reference drops 'deploy address' and says that an ADDRESS code can replace a group's own not-found code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
The not-found test used the address the delete test had just emptied, and the bucket delete removed the bucket other tests read. The delete tests now act on their own database pair and bucket, the not-found test uses an address nothing was ever deployed at, and the consent test checks that the question names the environment and branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 58 minutes. View limit details
Comment |
commit: |
wmadden
enabled auto-merge (squash)
October 28, 2026 07:03
wmadden
approved these changes
Oct 28, 2026
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.
Decision
Every command whose subject is a project, service, database or bucket now accepts an address in place of the id:
@<environment>:<address>. Leave the environment out and it means production.Why
A Composer app names each part it deploys. For example,
shop.catalogis thecatalogdatabase inside the appshop. Composer writes that name to the platform as the row'slogicalId.prisma deploy listprints these names. Until now, using one with a platform command meant looking up the row's id first. With this change, people and agents can pass the name straight to the commands they already use.How an address is read
:. Before it is the environment; after it is the address. Branch names will reject:(PRO-225), so the split cannot be wrong.logicalId(GET /v1/projects?logicalId=).production, this is the Project's default Branch (isDefault). This is Composer's own rule for production. Any other environment is the Branch whose git name matches it.logicalIdequal to the full address on that Branch, and matches it exactly on the client too. Older address formats are not translated.A Project's address is the app name alone, with no environment.
prisma project delete @pr-42:shopis refused, because deleting a Project removes every environment, production included.Safety
A destructive command given an address takes the address itself as its
--confirmtoken. The consent question names the row's id and environment, and says plainly when the environment is production.Combining
--projector--branchwith an address is a usage error, because the address already names both.Errors
New codes, each with next actions:
ADDRESS.USAGE_ERROR: a malformed address, a flag combined with an address, or an environment on a Project address.ADDRESS.NOT_FOUND: no Project, no Branch, or nothing at that address.ADDRESS.AMBIGUOUS: more than one match.ADDRESS.WRONG_KIND: the address names another kind, such as a database given toservice logs.ADDRESS.API_ERROR: a listing failed.Commands covered
show,delete,logs,open,version list,version rollbackshow,delete,usage,backup list,backup restore,connection list,connection createdelete,key list,key create,key deleteshow,delete,transfer,linkVersion ids, connection ids and domain hostnames are not addresses, so those commands are unchanged.
Other changes
lib/branch/list.ts;branch listand the service read path now use it.postgrescommands share oneresolvePostgresDatabasehelper.docs/product/command-principles.mddescribes the address form.Evidence
e2e/address.e2e.tsruns against the real Management API: 11 of 11 pass, in order and shuffled. It also givesservice logsits first real-API test.examples/storefront-auth) with a production and a preview environment:service logsandservice showreached the right row in each environment.postgres deleteby address removed only the preview database.project delete @<app>.Alternatives considered
--nodeflag. Rejected, because flags never name a command's subject in this CLI.productionto a Branch literally namedproduction. Rejected: Composer deploys production to the default Branch, which is created asmain.Agent: mulder-63
🤖 Generated with Claude Code