[TRI-2840] Allow `TRIGGER_ACCESS_TOKEN` to be used with the dev command
Problem
Using the TRIGGER_ACCESS_TOKEN works with the deploy command, which is used in CI (like GitHub Actions).
That token is not currently read from for the dev command which means you can't do things like end-to-end tests.
Solution
We need to read from the access token before we look at the auth config file.
We currently call isLoggedIn here: https://github.com/triggerdotdev/trigger.dev/blob/7976d924fb31dcbdcf4698cbbad0a189d799fc2d/packages/cli-v3/src/commands/dev.tsx#L113
But that doesn't use the access token.
Whereas the login function does: https://github.com/triggerdotdev/trigger.dev/blob/7976d924fb31dcbdcf4698cbbad0a189d799fc2d/packages/cli-v3/src/commands/login.ts#L78
We might be able to just call the login function instead of isLoggedIn?
Hey there! Have been spinning trying to see if this would work, but guessing since it's an active issue it isn't possible yet! Is this something that may be coming soon?
I also noticed that the login command succeeds when you have a TRIGGER_ACCESS_TOKEN, but it doesn't appear to write out the auth creds to the file. Not sure if that's working as intended or might be an alternative solution.
For context I'm hoping to have this to be able to run dev within a e2e testing environment. Is there an alternative method I might try in the meantime?
@ericallam I won't make this change now because I know we'll have horrible conflicts with your major changes that are coming next week. But I think we should make the change I suggested above so it works in CI as well for doing E2E tests.
@benaduggan our new build system now has preview packages available. One of the many improvements is that it works with TRIGGER_ACCESS_TOKEN with the dev command. https://trigger.dev/docs/guides/new-build-system-preview#trigger-access-token-in-dev