Skip to content

gitlab.repositories setting (used for preferred remote) can't handle relative path

Checklist

Summary

I have a workspace I want to share accross project. I need to use relative path like ../repo1 instead of absolute path. Reading variable accessible by code-worspace would be good too.

Steps to reproduce

In workspace.code-workspace change full path to relative path

{
...
"settings": {
		"gitlab.repositories": {
			"c:\\Users\\user_name\\my_repo": {
				"preferredRemoteName": "origin"
			}

	}
}

to

...
"settings": {
		"gitlab.repositories": {
			"./my_repo": {
				"preferredRemoteName": "origin"
			}

	}
}

What is the current bug behavior?

[error]: Cannot read property 'restId' of undefined

What is the expected correct behavior?

Could run with relative path in independant OS format. With ..

Relevant logs and/or screenshots

Relative path gives this error:

[error]: Cannot read property 'restId' of undefined
         TypeError: Cannot read property 'restId' of undefined
         	at Je.getIssuables (c:\Users\thomas.pedot\.vscode\extensions\gitlab.gitlab-workflow-3.40.2\out\extension.js:276:1842)
         	at Kn.getProjectIssues (c:\Users\thomas.pedot\.vscode\extensions\gitlab.gitlab-workflow-3.40.2\out\extension.js:300:2192)
         	at runMicrotasks (<anonymous>)
         	at processTicksAndRejections (internal/process/task_queues.js:93:5)
         	at async Kn.getChildren (c:\Users\thomas.pedot\.vscode\extensions\gitlab.gitlab-workflow-3.40.2\out\extension.js:300:2872)

Possible fixes

In this part of the codebase https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/5e72e36189f049b7088a1146a2d485d54860b100/src/utils/extension_configuration.ts#L44-55 we use the repositoryRoot as a settings key. The repositoryRoot is an absolute path and fix for this issue is to implement support for relative paths as well.

Edited by Tomas Vik (OOO back on 2026-01-05)