-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cannot add self-hosted Gitlab repos as a Gitpod Project #7781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@shaal, please help us to sort out issues with the project integration of self-managed GitLabs. It seems to be some sort of incompatibility in the API, which blocks the reading of projects here. We've seen similar with a very old installation of GitLab, thus would you mind to provide the version number? Also, I just tried to find relevant log entries, but couldn't spot any related errors. Would you mind trying again and posting the time, please? |
Alternatively, maybe you could invite one of us to your Self-Managed GitLab instance? I think this could make debugging easier. |
@jankeromnes, thanks for the hint! Just signed up successfully to https://www.drupal.org/u/alextugarev Unfortunately, I'm not allowed to create any projects there. Trying with existing ones. |
I should be able to reproduce now. |
@shaal, please check with this URL https://git.drupalcode.org/api/v4/projects?min_access_level=40 and let me know, how many projects are accessible to your account having For me this is empty, actually I'm not able to see any in there. GItLab projects/repos can only be added to Gitpod if you have |
@AlexTugarev i can see projects listed on that url https://git.drupalcode.org/api/v4/projects?min_access_level=40 But I could see them only after I went to https://git.drupalcode.org and logged in (with my Drupal account) |
that is expected.
☝🏻 could you do this, please? |
@AlexTugarev sure, relevant log entries for what? What should I try doing? I just tried adding again any project that is hosted on drupal.org (empty list) If it's easier we can also discuss this on Gitpod discord. |
@AlexTugarev please see my question above ^ |
@AlexTugarev @jankeromnes Is there any update on this issue? Anything I can do to help? |
Thanks for the ping @shaal! @AlexTugarev is the issue status still up-to-date? (I.e. you are assigned, project says "In Progress")
|
There were actually two issues in here, and one got resolved with integrating Bitbucket Server into the New Project page. The remaining issue seems to be that the @shaal, what does https://git.drupalcode.org/api/v4/projects?min_access_level=40 return for you? For me, it's an empty array, which is expected as I'm not maintainer of any of those projects. Does the response contain the wanted projects for you? |
@AlexTugarev yeah, I am getting an array of 3 items, which are the 3 projects I have write-access to.
[
{
"id": 77335,
"description": "For more information about this repository, visit the project page at https://www.drupal.org/project/gin_dashboard",
"name": "gin_dashboard",
"name_with_namespace": "project / gin_dashboard",
"path": "gin_dashboard",
"path_with_namespace": "project/gin_dashboard",
"created_at": "2021-10-11T18:10:08.878Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@git.drupal.org:project/gin_dashboard.git",
"http_url_to_repo": "https://git.drupalcode.org/project/gin_dashboard.git",
"web_url": "https://git.drupalcode.org/project/gin_dashboard",
"readme_url": null,
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2021-10-11T18:10:08.878Z",
"namespace": {
"id": 2,
"name": "project",
"path": "project",
"kind": "group",
"full_path": "project",
"parent_id": null,
"avatar_url": null,
"web_url": "https://git.drupalcode.org/groups/project"
},
"_links": {
"self": "https://git.drupalcode.org/api/v4/projects/77335",
"merge_requests": "https://git.drupalcode.org/api/v4/projects/77335/merge_requests",
"repo_branches": "https://git.drupalcode.org/api/v4/projects/77335/repository/branches",
"labels": "https://git.drupalcode.org/api/v4/projects/77335/labels",
"events": "https://git.drupalcode.org/api/v4/projects/77335/events",
"members": "https://git.drupalcode.org/api/v4/projects/77335/members"
},
"packages_enabled": true,
"empty_repo": true,
"archived": false,
"visibility": "public",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2021-10-12T18:10:08.910Z"
},
"issues_enabled": false,
"merge_requests_enabled": true,
"wiki_enabled": false,
"jobs_enabled": false,
"snippets_enabled": false,
"container_registry_enabled": true,
"service_desk_enabled": false,
"can_create_merge_request_in": true,
"issues_access_level": "disabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "disabled",
"builds_access_level": "disabled",
"snippets_access_level": "disabled",
"pages_access_level": "private",
"operations_access_level": "disabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"emails_disabled": null,
"shared_runners_enabled": false,
"lfs_enabled": false,
"creator_id": 2,
"import_status": "none",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"build_coverage_regex": null,
"ci_config_path": "",
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "ff",
"squash_option": "default_on",
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"approvals_before_merge": 0,
"mirror": false,
"external_authorization_classification_label": null,
"marked_for_deletion_at": null,
"marked_for_deletion_on": null,
"requirements_enabled": true,
"requirements_access_level": "enabled",
"security_and_compliance_enabled": true,
"compliance_frameworks": [],
"merge_requests_template": null,
"merge_pipelines_enabled": true,
"merge_trains_enabled": true,
"permissions": {
"project_access": {
"access_level": 40,
"notification_level": 3
},
"group_access": null
}
},
{
"id": 76369,
"description": "For more information about this repository, visit the project page at https://www.drupal.org/project/drupalpod",
"name": "drupalpod",
"name_with_namespace": "project / drupalpod",
"path": "drupalpod",
"path_with_namespace": "project/drupalpod",
"created_at": "2021-09-29T15:59:40.376Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@git.drupal.org:project/drupalpod.git",
"http_url_to_repo": "https://git.drupalcode.org/project/drupalpod.git",
"web_url": "https://git.drupalcode.org/project/drupalpod",
"readme_url": "https://git.drupalcode.org/project/drupalpod/-/blob/main/README.md",
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-04-15T19:44:51.728Z",
"namespace": {
"id": 2,
"name": "project",
"path": "project",
"kind": "group",
"full_path": "project",
"parent_id": null,
"avatar_url": null,
"web_url": "https://git.drupalcode.org/groups/project"
},
"_links": {
"self": "https://git.drupalcode.org/api/v4/projects/76369",
"merge_requests": "https://git.drupalcode.org/api/v4/projects/76369/merge_requests",
"repo_branches": "https://git.drupalcode.org/api/v4/projects/76369/repository/branches",
"labels": "https://git.drupalcode.org/api/v4/projects/76369/labels",
"events": "https://git.drupalcode.org/api/v4/projects/76369/events",
"members": "https://git.drupalcode.org/api/v4/projects/76369/members"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"visibility": "public",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2021-09-30T15:59:40.446Z"
},
"issues_enabled": false,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": false,
"can_create_merge_request_in": true,
"issues_access_level": "disabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "private",
"operations_access_level": "disabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": false,
"creator_id": 2,
"import_status": "none",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"build_coverage_regex": null,
"ci_config_path": "",
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "ff",
"squash_option": "default_on",
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"approvals_before_merge": 0,
"mirror": false,
"external_authorization_classification_label": null,
"marked_for_deletion_at": null,
"marked_for_deletion_on": null,
"requirements_enabled": true,
"requirements_access_level": "enabled",
"security_and_compliance_enabled": true,
"compliance_frameworks": [],
"merge_requests_template": null,
"merge_pipelines_enabled": true,
"merge_trains_enabled": true,
"permissions": {
"project_access": {
"access_level": 40,
"notification_level": 3
},
"group_access": null
}
},
{
"id": 62395,
"description": "For more information about this repository, visit the project page at https://www.drupal.org/project/rector",
"name": "rector",
"name_with_namespace": "project / rector",
"path": "rector",
"path_with_namespace": "project/rector",
"created_at": "2020-02-24T18:39:00.037Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@git.drupal.org:project/rector.git",
"http_url_to_repo": "https://git.drupalcode.org/project/rector.git",
"web_url": "https://git.drupalcode.org/project/rector",
"readme_url": null,
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2020-04-14T17:59:51.414Z",
"namespace": {
"id": 2,
"name": "project",
"path": "project",
"kind": "group",
"full_path": "project",
"parent_id": null,
"avatar_url": null,
"web_url": "https://git.drupalcode.org/groups/project"
},
"_links": {
"self": "https://git.drupalcode.org/api/v4/projects/62395",
"merge_requests": "https://git.drupalcode.org/api/v4/projects/62395/merge_requests",
"repo_branches": "https://git.drupalcode.org/api/v4/projects/62395/repository/branches",
"labels": "https://git.drupalcode.org/api/v4/projects/62395/labels",
"events": "https://git.drupalcode.org/api/v4/projects/62395/events",
"members": "https://git.drupalcode.org/api/v4/projects/62395/members"
},
"packages_enabled": true,
"empty_repo": true,
"archived": false,
"visibility": "public",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "7d",
"enabled": false,
"keep_n": null,
"older_than": null,
"name_regex": null,
"name_regex_keep": null,
"next_run_at": "2020-03-02T18:39:00.087Z"
},
"issues_enabled": false,
"merge_requests_enabled": true,
"wiki_enabled": false,
"jobs_enabled": false,
"snippets_enabled": false,
"container_registry_enabled": true,
"service_desk_enabled": false,
"can_create_merge_request_in": true,
"issues_access_level": "disabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "disabled",
"builds_access_level": "disabled",
"snippets_access_level": "disabled",
"pages_access_level": "private",
"operations_access_level": "disabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"emails_disabled": null,
"shared_runners_enabled": false,
"lfs_enabled": false,
"creator_id": 2,
"import_status": "none",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": null,
"ci_job_token_scope_enabled": false,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"build_coverage_regex": null,
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "ff",
"squash_option": "default_on",
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"approvals_before_merge": 0,
"mirror": false,
"external_authorization_classification_label": null,
"marked_for_deletion_at": null,
"marked_for_deletion_on": null,
"requirements_enabled": true,
"requirements_access_level": "enabled",
"security_and_compliance_enabled": true,
"compliance_frameworks": [],
"merge_requests_template": null,
"merge_pipelines_enabled": true,
"merge_trains_enabled": true,
"permissions": {
"project_access": {
"access_level": 40,
"notification_level": 3
},
"group_access": null
}
}
] |
edit Oh no! That was a trap. I managed to mix up my gitlab.com accounts for testing. So, in the end group projects will be shown, when using the right account. |
@shaal, just one question on the UI. You are sure to have clicked the drop down to select the |
@AlexTugarev When I choose Drupal Gitlab self-hosted as git provider, I see this |
@AlexTugarev, I opened Devtools -> Network -> WS, |
@shaal, getting closer 🤞🏻 It seems to be an issue with GitLab after all. For some reasons the authorization of the Here you see the
vs. the browsers output for GET
Reading on https://docs.gitlab.com/ee/api/projects.html#list-all-projects it seems the authorization is not applied/accepted. Just verified with gitlab.com, and it works as expected, i.e. |
In case it helps, the only changes that were made to the /projects API endpoint from the release of the 14.9.3[1] in April 12, 2022 to the next major 15.0 release which is already deployed on GitLab.com are the following two commits but not sure if these are related to the issue here. |
@AlexTugarev Anything I can help with? |
@shaal, can you check if there are any restrictions configured in the GitLab instance to the permission model? I'll try to verify with a test instance of GitLab, maybe starting same version of GitLab in a workspace. But I don't yet see a way to proceed 😢 |
@AlexTugarev Are you available for a chat / call on Gitpod Discord? Also, we could ask/discuss some of these things with the people who are in charge of Drupal's infrastructure / Self-hosted Gitlab. |
@AlexTugarev, great news!
So now I can see DrupalPod (from Drupal's self-hosted Gitlab) and add it to my projects. After clicking on the green
I asked Neil Drumm if he knew what it was, and he responded -
|
@shaal, that makes sense now!
Well the next error seems to be of the same kind. Could it be that requests to subpaths are still modified? You can verify it yourself, the wanted repo to be added as project, for which the error from above is thrown is printed as simple (i.e. the unauthorized format)
But if you change the header to include the cookie from browser, you'll see the full representation, which is expected as response. |
@shaal, oh I missed the last paragraph of your last message.
That's a pity, that basically means, we'd need to scan the API surface used in Gitpod to enable it, right? |
From reading https://github.com/gitpod-io/gitpod/blob/main/components/server/src/gitlab/api.ts#L101-L112, I can tell it's at least the following list of request (query params omitted)
|
@shaal, can we close this issue now? I think, once the web application firewall is setup correctly on Drupal's self-hosted Gitlab it should be good. We've verified with 2 different GitLab installations by now. Please reopen or create another more specific follow up. |
I don't think this is resolved yet... But now, in https://gitpod.io/projects/new after choosing Drupal git here (the last option) with this error in console.
The git repo I am trying to add to my personal user in Gitpod, is https://git.drupalcode.org/project/drupalpod |
Just came across this issue and it seems to be working for git.drupalcode.org now: Steps to reproduce
Now, in https://gitpod.io/projects/new after choosing Drupal git here (the last option), I can see 1 project that I am currently the maintainer for. |
@AlexTugarev @gtsiolis @axonasif It is now possible to open https://gitpod.io/#https://git.drupalcode.org/project/drupalpod, but there seems to be a bug. When the warning displays that you are not authorized, and you click to authorize, you are brought back to the page with the warning that you are still not authorized. However, reloading the page solves this issue. When opening the above link, you only have read permissions. When I try to push changes, I get an error that I am not allowed to do so. When I check https://gitpod.io/user/integrations, I see that I am missing write permissions. When I try to add write permissions, I get a new error. You can see the thread below for all the details of what I tried doing and what the Drupal organization tried doing, following Gitpod's documentation: https://www.drupal.org/project/infrastructure/issues/3404441#comment-15396581 Could you please clarify what is missing so that users can open the Drupal-hosted GitLab repository in Gitpod and get write permissions? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bug description
When I want to add a new project in Gitpod (in https://gitpod.io/new)

and I choose a self-hosted Gitlab server (last option in the screenshot above)
It doesn't show any repos available

Steps to reproduce
Create a user in Drupal.org - https://www.drupal.org/user/register
Open https://gitpod.io/#https://git.drupalcode.org/project/drupalpod

You'll see this screen
Click on the button
Authorize with git.drupalcode.org
(You can ignore the workspace that opens, the steps above was just to get the authorization in Gitpod)
Go to https://gitpod.io/new
Click on

(change)
buttonChoose the 4th option in the screen above (
Continue with git.drupalcode.org
)You'll see that there are no repos to choose

Workspace affected
No response
Expected behavior
I was expecting to see all the repos under
https://git.drupalcode.org/project/*
Specifically - https://git.drupalcode.org/project/drupalpod
Example repository
No response
Anything else?
This is what I have in Gitpod's

Integrations
page -The text was updated successfully, but these errors were encountered: