gitlab.repositories setting (used for preferred remote) can't handle relative path
Checklist
-
I'm using the latest version of the extension (see the latest version in the right column of this page) - Extension version: v3.40.2
-
I'm using the latest VS Code version (find the latest version here) - VS Code version: Version: 1.65.0 (user setup) Commit: b5205cc8eb4fbaa726835538cd82372cc0222d43 Date: 2022-03-02T11:12:08.962Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19043
-
I'm using a supported version of GitLab (see README for the supported version) - GitLab version: "happens on
gitlab.com
"
- GitLab version: "happens on
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.