feat(org): run commands against an organization - #13
Merged
Merged
Conversation
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.
dpctlhad no organization awareness at all: it only ever saw your personal apps, and apps belonging to an organization were simply invisible.dpctl org list- marks the one in use with *dpctl org use acme- saves the resolved id to the session filedpctl org clear- back to your personal accountEvery request carries x-org-id while an organization is set. Two overrides for a single command or job:
--org <slug|name|id>, andDEPLOYPULSE_ORG_IDfor CI, where there's no session file to save to.--orgtakes priority over the environment variable, which overrides org use, so CI can switch context without rewriting the file you logged in with.dpctl loginnow asks which organization to use, once, if your account belongs to any. It asks nothing when--orgalready answered, when you belong to none, or when stdin isn't a terminal, so piped CI logins never block. A failure listing organizations doesn't fail the login and the access key has already been created by then.Resolution is tiered id → slug → name and refuses an ambiguous answer. Slugs are unique server-side but names are not: two orgs called "Acme Inc" get slugs acme and acme-2, and a single find() over all three fields could match the wrong one by name and quietly persist it.