(Local Development): Linking local checkout of cloud connector to a Python project causes missing unit_primitives config
Problem
In my local GDK I connect the workflow_service (in AIGW project) with my local checkout of the gitlab-cloud-connector project like this:
diff --git i/pyproject.toml w/pyproject.toml
index 8068bf22..9cf57a06 100644
--- i/pyproject.toml
+++ w/pyproject.toml
@@ -50,7 +50,7 @@ python-gitlab = "^5.1.0"
gitpython = "^3.1.43"
unique-names-generator = "^1.0.2"
langchain-google-vertexai = "^2.0.8"
-gitlab-cloud-connector = { version = "^2.15.0", source = "gitlab_cloud_connector" }
+gitlab-cloud-connector = { path = "/Users/tomas/workspace/gl/gitlab-cloud-connector/src/python", develop = true }
sse-starlette = "^2.1.3"
q_developer_boto3 = { path = "./vendor/q_developer_boto3-1.12.0-py3-none-any.whl" }
poetry-core = "^2.0.1"
Once I start the service, I keep getting an error:
2025-06-23_12:21:40.32864 duo-workflow-service : File "/Users/tomas/workspace/gl/gdk/gitlab-ai-gateway/duo_workflow_service/server.py", line 63, in <module>
2025-06-23_12:21:40.32866 duo-workflow-service : for unit_primitive in list_unit_primitives()
2025-06-23_12:21:40.32867 duo-workflow-service : ^^^^^^^^^^^^^^^^^^^^^^
2025-06-23_12:21:40.32867 duo-workflow-service : File "/Users/tomas/workspace/gl/gitlab-cloud-connector/src/python/gitlab_cloud_connector/data_model/unit_primitive.py", line 35, in list_unit_primitives
2025-06-23_12:21:40.32870 duo-workflow-service : for f in listdir(unit_primitives_dir):
2025-06-23_12:21:40.32871 duo-workflow-service : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-23_12:21:40.32871 duo-workflow-service : FileNotFoundError: [Errno 2] No such file or directory: '../../config/unit_primitives'
Soulution
@mkaeppler and I discussed some possible fixes for this local development issue in slack
- document configuration property
- introduce environment variable
Workaround
Hardcode the config path in the cloud connector project for local testing
diff --git i/src/python/gitlab_cloud_connector/config.py w/src/python/gitlab_cloud_connector/config.py
index 346f0ef..06e45c8 100644
--- i/src/python/gitlab_cloud_connector/config.py
+++ w/src/python/gitlab_cloud_connector/config.py
@@ -20,7 +20,7 @@ class CloudConnectorConfig:
if os.path.isdir(config_path):
return config_path
- return "../../config"
+ return "/Users/tomas/workspace/gl/gitlab-cloud-connector/config"
@property
def unit_primitives_dir(self) -> str: