feat(cloud): add Trigger.dev to polylane cloud connect - #101
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
LGTM: Clean, well-tested addition mirroring the existing Turso provider pattern; no issues found.
Verdict: approve — no findings. PR #101 adds Trigger.dev to polylane cloud connect as a faithful mirror of the Turso provider flow (union + picker entry, on-demand project-ref retry with correct guard ordering, headless usage errors, flags/examples/description updated), with six focused tests covering the happy path and every rethrow guard. The one temporary wart — the as unknown as ConnectBody cast pending codegen — is documented in-code and in the PR body. Ready to merge (pending the human-gated UAT run the PR body promises).
This was referenced Sep 17, 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.
Adds Trigger.dev to
polylane cloud connect, so a Trigger.dev environment API key can be connected from the terminal the same way the other providers are. The API side lands in coreplanelabs/nominal from the Trigger.dev cloud provider design record; this PR speaks the request contract that record fixes.What & why
Trigger.dev becomes a Polylane cloud provider (nominal #3242 added the enum, the skeleton PR adds the connect route). The CLI wizard and its headless flags need to know the provider so onboarding can connect it without the console. One Trigger.dev key is one environment; the wizard tells the user to mint a production key with the No restrictions access preset (the only kind on Free and Hobby plans) and explains that re-running the command with another key adds it to the same account. The connect body is
{ workspaceId, provider: "triggerdev", apiKey, projectRef? }; the project ref is only asked for when the API says it is required (a 400 whose message names the project ref), once, then the call is retried.The code was written by the Switchboard coding run in this thread and delivered as a patch because the run's credential is scoped to nominal; the patch was applied unchanged with
git am.Tour
1. The provider joins the union and the picker
Trigger.dev is a selectable provider with the hint the wizard shows beside it.
cli/src/commands/cloud/connect.ts
Line 54 in e92109b
cli/src/commands/cloud/connect.ts
Line 70 in e92109b
2. The request contract and the project-ref retry
The generated client trails the deployed API spec, so the body type is declared here from the design record's contract and cast at the call site (drop the cast once codegen picks up the route).
connectTriggerdevsends the body once; only a 400 that names the project ref, on a body that did not carry one, prompts for it (or, headless, fails with the--project-refhint) and retries once. Every other error, including the "key cannot read runs" 400 that already carries the API's guidance, is rethrown untouched.Look for: the guard order in the catch: non-API error, non-400, ref already sent, message without "project ref" all rethrow.
cli/src/commands/cloud/connect.ts
Lines 330 to 348 in e92109b
cli/src/commands/cloud/connect.ts
Lines 351 to 385 in e92109b
3. The wizard branch
Same shape as the sibling secret steps: headless requires
--api-key, the interactive step explains where the key comes from and offers to open cloud.trigger.dev, then the connect call above runs with the optional--project-ref.cli/src/commands/cloud/connect.ts
Lines 577 to 611 in e92109b
4. Flags, description and examples
--api-keyis shared with Render;--project-refis new; the command description and examples list the provider.cli/src/commands/cloud/connect.ts
Lines 963 to 966 in e92109b
cli/src/commands/cloud/connect.ts
Lines 988 to 989 in e92109b
5. Tests
Six cases mirroring the Turso suite: plain send, projectRef passthrough, the headless project-ref 400 becoming a usage error with the flag hint, the same 400 rethrown when a ref was already sent, the cannot-read-runs 400 rethrown untouched, and a non-400 rethrown untouched.
cli/test/cloud-connect-triggerdev.test.ts
Lines 19 to 50 in e92109b
6. Remaining changes
Decisions
Validation
npm run typecheck: clean at e92109b (codegen ran first, no generated drift).npm run lint: clean.npm test: 524 tests, 524 pass, 0 fail (includes the six new cases intest/cloud-connect-triggerdev.test.ts).polylane cloud connect --provider triggerdev), receipt to be posted on this PR.🤖 Generated with Claude Code