Page MenuHomePhabricator

Ensure that origins don't change when we switch from cli api repos to grpc repos
ClosedPublic

Authored by dgibson on Oct 20 2020, 12:29 AM.

Details

Summary

The grpc server defaults the working dir to the current directory if its empty or null (much like other dagster cli commands do). However, if we are spinning up a gRPC server for a repo in a workspace that did not set the working directory, this causes the origin to change - in particular, when we swap the default loading API to be gRPC instead of the CLI Api, a bunch of origins will change if we're not careful.

This diff makes sure that repos with an empty working directory still have an empty workspace when their gRPC server loads, by using a new --empty-working-directory parameter, while ensuring that people spinning up their own gRPC servers manually still get a nice default.

Test Plan

New test cases that were failing before the changes in open_server_process

Diff Detail

Repository
R1 dagster
Branch
grpcworkdir (branched from master)
Lint
Lint OK
Unit
No Unit Test Coverage

Event Timeline

prha added inline comments.
python_modules/dagster/dagster/cli/api.py
467–473

oh, this is a good idea.

This revision is now accepted and ready to land.Oct 20 2020, 4:05 PM
python_modules/dagster/dagster/cli/api.py
467–473

we could also add it to commands like dagit/launch/execute too, this was just the only command where we needed it to ensure correctness