Repository navigation
kubectl long values, --all_namespaces, and Vercel services roots (#153) - #179
Merged
Merged
Conversation
Pure move, so item 4 can change the parser: kubernetes.ts is over the file-size cap. shortLetters, splitShortGroups, VALUE_FLAGS and commandWords moved unchanged; splitShortGroups gained `export`, and kubernetes.ts re-exports commandWords for readonly.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n't tell (#153) `kubectl logs pod --container -n x`: pflag gives --container the next word whole, so no namespace is set, while cloudpin read namespace x and passed when x was pinned. cloudpin now keeps the flags that never take the next word (every boolean and NoOptDefVal flag of kubectl 1.36.1 and helm v3.22.1 and v4.3.1). Any other long flag without "=", followed by a word that starts with "-", stops when that word or a later one would pick the target, since the two readings can differ. The message names the flag and no value, and says how to write it so it can be read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With services on, a command in a service's folder links the parent project's root, not the folder (vercel 50.35 util/projects/find-project-root.ts resolveProjectCwd), through getLinkedProject, ensureLink, build and dev, so this is every command that reads a link, not only `vercel dev`. cloudpin now reads that root's link as well: the nearest folder above with .vercel, vercel.json, vercel.toml or .git, when VERCEL_USE_EXPERIMENTAL_SERVICES is on, or its config sets services, or it has a config only Vercel can read. A link in the set only adds a check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rcel project root Controls found missing when planning the mutation run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kubectl reads "_" as "-" in a flag's name. kubectl 1.36.1 accepts `get pods --all_namespaces` and refuses `--bogus_flag`, so a namespace pin passed while the command listed every namespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #153 (items 1 to 3 merged in #158).
kubectl and helm: a long flag that may take the next word
kubectl logs pod --container -n x: pflag gives--containerthe next word whole, so the container is-nand no namespace is set, but cloudpin read namespacex. Now any long flag without=, followed by a word starting with-, stops as "can't tell" when that word or a later one would pick the target, unless the flag is known never to take the next word. The lists hold every such flag of kubectl 1.36.1 (88) and helm v3.22.1 and v4.3.1 (78), compared against the source by a script.get pods --watch -n prod,--all,--force,--dry-run,logs --prefix -n prod,--container=x -n prod, helm--atomic --wait -n prod.kubectl myplugin --flag -n x) stops.--flag=truegets past it, and the message says so.src/providers/kubernetes.tswas over the size cap, so argument parsing moved tokubernetes-args.tsfirst, in a commit of its own with a move proof.kubectl:
--all_namespaceskubectl reads
_as-in a flag's name, so--all_namespaceslists every namespace while a namespace pin passed. Checked on the real kubectl 1.36.1: it acceptsget pods --all_namespacesand refuses--bogus_flag.Vercel: services
With experimental services on, Vercel links the parent project's root instead of the folder (vercel 50.35
util/projects/find-project-root.ts,detect-services.ts). This holds for every command that reads a link, not onlyvercel dev. cloudpin now reads up to two parent roots when services may be on. It doesn't run Vercel's detector, so a parent linked to another team, with services on and none found, is a false block.Evidence
test/kubernetes-long-values.test.ts(117),test/vercel-dev-services.test.ts(46),test/kubernetes-underscore-flag.test.ts(7), each seen failing first, with wrong-pin controls.npm run typecheckexit 0;npx vitest run: 3177 passed, 19 skipped.Not tested
No real cluster or Vercel services project: the long-flag and services behaviour comes from the sources named above.
Left open
A kuberc alias whose
prependArgsends in a flag that takes a value (["--container"]) still gives cloudpin the wrong reading of the user's next word. Rare, noted in #145.🤖 Generated with Claude Code