Support Self Managed Gitlab

Created on 18 February 2025, about 2 months ago

Problem/Motivation

Support for gitlab self manage that is hosted by the user

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom marcelovani London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @marcelovani
  • 🇬🇧United Kingdom marcelovani London
  • 🇳🇿New Zealand stewest Wellington

    Thanks so much for your work on this.

    When I go to admin/config/development/configuration/pull_request, after adding the gitlab self hosted url, owner name and repo name, and access token on my user account, I get this error:

    Error: Class "Drupal\config_pr_gitlab\RepoControllers\GitlabController" not found in include() (line 13 of modules/contrib/config_pr/modules/config_pr_gitlab/src/RepoControllers/GitlabSelfManagedController.php).
    Composer\Autoload\{closure}('/var/www/html/web/modules/contrib/config_pr/modules/config_pr_gitlab/src/RepoControllers/GitlabSelfManagedController.php') (Line: 427)
    Composer\Autoload\ClassLoader->loadClass('Drupal\config_pr_gitlab\RepoControllers\GitlabSelfManagedController') (Line: 261)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'config_pr_gitlab.repo_controller.gitlab_self_managed') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('config_pr_gitlab.repo_controller.gitlab_self_managed') (Line: 106)
    Drupal\config_pr\Form\ConfigPrForm::create(Object) (Line: 41)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\config_pr\Form\ConfigPrForm') (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\config_pr\Form\ConfigPrForm') (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
    Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
  • 🇬🇧United Kingdom marcelovani London

    Hi Stew

    I did some refactoring and also worked on automated tests, which is something that I wanted to do for a long time, the tests are all passing now https://git.drupalcode.org/project/config_pr/-/jobs/4416444

    I believe that this ticket will pass manual testing now.

    Kind Regards,
    Marcelo

  • 🇳🇿New Zealand stewest Wellington

    Hi Marcelo

    I get this error now when i go to admin/config/development/configuration/pull_request

    Error: Class "Gitlab\HttpClient\Builder" not found in Drupal\config_pr_gitlab\RepoControllers\GitlabSelfManagedController->authenticate() (line 40 of modules/contrib/config_pr/modules/config_pr_gitlab/src/RepoControllers/GitlabSelfManagedController.php).
    Drupal\config_pr\Form\ConfigPrForm->buildForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 536)
    Drupal\Core\Form\FormBuilder->retrieveForm('config_pr_form', Object) (Line: 284)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
    Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
  • 🇬🇧United Kingdom marcelovani London

    Humm, I am not sure what is happening on your local setup.

    Things that I would look:
    1 - Make sure you pulled the latest dev code https://www.drupal.org/project/config_pr/releases/8.x-1.x-dev
    2 - Make sure you require the dependencies https://git.drupalcode.org/project/config_pr/-/blob/8.x-1.x/modules/conf...
    3 - Clear caches

    Also, you can try to uninstall and reinstall the module

  • 🇳🇿New Zealand stewest Wellington

    That works! Thanks Marcelo

    I hadn't seen this part, sorry! :facepalm:

    Use composer require for the dev libraries that you need i.e. For Gitlab composer require m4tthumphrey/php-gitlab-api:^11.14 guzzlehttp/guzzle:^7.8 http-interop/http-factory-guzzle:^1.2

    I also had to make sure I had higher gitlab permissions for the access token.

  • 🇬🇧United Kingdom marcelovani London

    The permissions that I normally use are Api, Read/Write Repo.

    Thanks for your help Stew.

Production build 0.71.5 2024