Skip to content

test(lk): allow the project fallback only for an unconfigured livekit.toml - #1086

Merged
Topherhindman merged 1 commit into
mainfrom
topherhindman/devx-889-lk-property-test-narrow-the-mistyped-project-allowance
Oct 29, 2026
Merged

Topherhindman merged 1 commit into
mainfrom
topherhindman/devx-889-lk-property-test-narrow-the-mistyped-project-allowance

Conversation

@Topherhindman

Copy link
Copy Markdown
Contributor

Fixes DEVX-889

TestCredentialResolution let room list fall back to the only configured project in every API-key case. That allowance dates from when a --project or --subdomain that didn't resolve fell back to the only project. #1076 made that an error, and #1084 made --dev with an API key or secret an error too. Since then, lk falls back only when no project is named on the command line and a livekit.toml names a project that isn't configured. That fallback is on purpose: an agent repo still gets a project to choose. Allowing the fallback anywhere else would hide the #1076 bug if it came back.

What changed

  • The allowance now covers only the case where livekit.toml names an unconfigured project and nothing earlier in the resolution order (--project, --subdomain, a full inline key pair, --dev) has picked a project.
  • The temporary allowance for --dev with an inline key or secret is removed. With fix(lk): --dev with an API key or secret is an error #1084 merged, mustFail covers that case.

How tested

  • go test ./cmd/lk -run '^TestCredentialResolution$' -rapid.checks=1000 -rapid.seed={1,42,20261027} passes.
  • With the fix(lk): a --project or --subdomain that doesn't resolve is an error #1076 fix reverted in requireProjectWithOpts, the property fails on all three seeds. The counterexamples are lk --subdomain one room list and lk --project one room list with only two configured. With the old allowance, the same revert passes on all three seeds.
  • With the livekit.toml allowance removed, the property fails on two of the three seeds (42 and 20261027), with lk room list and a livekit.toml naming one while only two is configured. So the allowance is still needed.
  • go test ./..., go vet ./... and golangci-lint run all pass.

….toml

TestCredentialResolution let room list fall back to the only configured
project in every API-key case, because a --project or --subdomain that
didn't resolve used to fall back to it. #1076 made that an error and
#1084 made --dev with an API key or secret one too, so lk now falls back
only when no project is named on the command line and a livekit.toml
names a project that isn't configured. Allowing it anywhere else hid a
return of the mistyped-project fallback.
@Topherhindman
Topherhindman merged commit 410b29c into main Oct 29, 2026
26 checks passed
@Topherhindman
Topherhindman deleted the topherhindman/devx-889-lk-property-test-narrow-the-mistyped-project-allowance branch October 29, 2026 22:52
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.

2 participants