turbo
0ad7302f - feat(Turborepo): Add spaces_id to layered config (#7330)

Commit
2 years ago
feat(Turborepo): Add spaces_id to layered config (#7330) ### Description The core goal of this PR is to make `run.run` immutable. This enforces that our config and options are all resolved before we start a run. The last remaining piece of that was picking up the `spaces_id` from the layered config system. Adding `spaces_id` to the layered config system necessitated a bunch of other changes due to the fact that it is not contained within the `remoteCache` field in `turbo.json`. The config system previously assumed that any config file could contain the entirety of the config, which wasn't strictly true, but now is even less true. To that end, I created a separate struct to represent just the `remoteCache` field in `turbo.json`. It shares much, but not all of the parser for a config file. I split the rendering of `ConfigurationOptions` into two structs, since we want to render them differently in different circumstances (`turbo info` vs `turbo.json` synthesis in `turbo prune`). This had the upshot of letting us skip rendering a) empty fields in pruned repos and b) a non-functional `token` field in pruned repos. ### Testing Instructions Updated integration tests for expected renderings of the config. Added unit tests for spaces_id. Deleted the test for not parsing a token from the `remoteCache` field in `turbo.json`, the type system no longer allows us to parse a token since it's no longer directly a `ConfigurationOptions` instance. Closes TURBO-2313 --------- Co-authored-by: Greg Soltis <Greg Soltis>
Author
Greg Soltis
Parents
Loading