vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.21k stars 1.81k forks source link

`--api` and `--team` CLI options are ignored for `turbo run` #2040

Closed AlCalzone closed 2 years ago

AlCalzone commented 2 years ago

What version of Turborepo are you using?

1.4.7-canary.0 and later

What package manager are you using / does the bug impact?

Yarn v2/v3 (node_modules linker only)

What operating system are you using?

Linux

Describe the Bug

Starting in v1.4.7-canary.0, turbo run ignores the --api and --team CLI options and always uses a local cache. I'm using https://github.com/felixmosh/turborepo-gh-artifacts for Github Actions caching and after upgrading turbo due to another bugfix, my builds are no longer cached. By running the server binary in that action locally, I can see that no HTTP requests are made on 1.4.7-canary.0 and later versions. When going back to 1.4.6 this works again.

One workaround is creating an (undocumented) .turbo/config.json file with a content similar to this

{
    "apiurl": "http://127.0.0.1:9080",
    "teamid": "me"
}

after which the HTTP requests start happening again.

Expected Behavior

turbo run should respect these CLI options or have an official way of configuring them.

To Reproduce

Upgrade to 1.4.7-canary.0 or later, attempt remote caching on a custom URL using the --api and --team CLI options, notice cache misses all the time.

gsoltis commented 2 years ago

Those flags are intended to work, I'll take a look and see if I can figure out what's up

gsoltis commented 2 years ago

@AlCalzone sorry about that, I missed those flags in our port of our flag parsing.

Also, we're looking to add more configuration management behavior to turbo in the future, so while you're right that you can add them to .turbo/config.json, we'll eventually have tools to help you do that .

AlCalzone commented 2 years ago

Thanks for the quick fix, can confirm it works.