cli icon indicating copy to clipboard operation
cli copied to clipboard

Problematic workspace file path in `bundle.sourcePath` configuraiton parameter of DLT pipeline

Open alexott opened this issue 1 year ago • 2 comments

Describe the issue

When a new DLT pipeline is created by the bundle using the default template, it adds a parameter bundle.sourcePath that points to the source code, but the path contains entry that prevents Terraform exporter from matching it to the actual file.

configuration = {
    "bundle.sourcePath" = "/Workspace//Users/[email protected]/.bundle/dlt_bundle_demo/dev/files/src"
}

Configuration

Just a new bundle generated by bundle init

Expected Behavior

The path is generated without double slashes:

/Workspace/Users/[email protected]/.bundle/dlt_bundle_demo/dev/files/src

Actual Behavior

The path is generated with double slashes:

/Workspace//Users/[email protected]/.bundle/dlt_bundle_demo/dev/files/src

OS and CLI version

0.211.0

alexott avatar Jan 20 '24 15:01 alexott

What specifically is blocking the TF exporter from exporting this? The configuration is a string/string map.

The workspace APIs will allow the /Workspace prefix to all its paths pretty soon. When this is fully rolled out, we'll be able to remove the awkward /Workspace/${workspace.file_path} and use the variable verbatim, removing the double /.

pietern avatar Feb 08 '24 20:02 pietern

It's not a problem with exporting - it's a problem with resolving references. Because of the // in the path, it's not converted into a reference to the TF resource. Although I may need to think if we should exclude all jobs & related resources that are deployed via DABs...

alexott avatar Feb 09 '24 07:02 alexott

This happens because we still use a default workspace.root_path equal to /Users/<email>/.bundle/....

The corresponding POSIX path for the FUSE mount on DBR is /Workspace/Users/<email>/.bundle/....

This is why we need to prefix it in the template:

      configuration:
        bundle.sourcePath: /Workspace/${workspace.file_path}/src

We could remove the / but it would look kind of weird.

We were held back from using the /Workspace prefix in the default root path because of reasons, but that seems to be unblocked now. Once we make this change we can remove the prefix from the template and this problem disappears.

pietern avatar Aug 21 '24 13:08 pietern