Unable to Validate CI config for mirrored repository
Checklist
-
I'm using the latest version of the extension (see the latest version in the right column of this page) - Extension version: 3.38.1
-
I'm using the latest VS Code version (find the latest version here) - VS Code version: 1.62.3
-
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'm trying to validate our gitlab-ci.yml file for a repository that is hosted on Github and mirrored to Gitlab. It runs its pipelines on Gitlab.
After setting up Gitlab Workflow and using the command GitLab: Validate GitLab CI Config I get the error "Current folder doesn't contain a GitLab project". This happens even though I've setup a remote to point to gitlab:
➜ financeit (master) ✔ git remote -v
gitlab git@gitlab.com:financeitcanada/dev/financeit.git (fetch)
gitlab git@gitlab.com:financeitcanada/dev/financeit.git (push)
origin git@github.com:financeit/financeit (fetch)
origin git@github.com:financeit/financeit (push)
and set the VSCode setting "gitlab.pipelineGitRemoteName": "gitlab".
I've restarted VSCode throughout the process several times.
Steps to reproduce
- Have a project hosted on Github
- Mirror the project to Gitlab (https://docs.gitlab.com/ee/user/project/repository/mirror/)
- Install GitLab Workflow in VSCode
- Set a git remote that points to the Gitlab mirror eg.
git remote add gitlab git@gitlab.com:myorg/myrepo.git. - Add the setting
"gitlab.pipelineGitRemoteName": "gitlab"to your VSCodesettings.json - Create a gitlab-ci.yml file in your repository
- Run VSCode command
GitLab: Validate GitLab CI Configon that file.
What is the current bug behavior?
The extension periodically posts No preferred remote for /Users/aszczepanski/codes/financeit to its logs.
When running GitLab: Validate GitLab CI Config, we get the following error:
Current folder doesn't contain a GitLab project
AssertionError [ERR_ASSERTION]: Current folder doesn't contain a GitLab project
at iK (/Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:525:3960)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:551:2500
at async o._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:111743)
No preferred remote for /Users/aszczepanski/codes/financeit.
What is the expected correct behavior?
The extension should validate my gitlab-ci.yml file.
Relevant logs and/or screenshots
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
Current folder doesn't contain a GitLab project
AssertionError [ERR_ASSERTION]: Current folder doesn't contain a GitLab project
at iK (/Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:525:3960)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:551:2500
at async o._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:111743)
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
Current folder doesn't contain a GitLab project
AssertionError [ERR_ASSERTION]: Current folder doesn't contain a GitLab project
at iK (/Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:525:3960)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/aszczepanski/.vscode/extensions/gitlab.gitlab-workflow-3.38.1/out/extension.js:551:2500
at async o._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:111743)
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
No preferred remote for /Users/aszczepanski/codes/financeit.
Possible fixes
My only gut-feeling is it may be associated to the fact that the repository on Gitlab and Github do not share the same organization prefix in its URIs. financeitcanada/dev on Gitlab vs. financeit on Github.