[IDEA] Integrate GitLab API with ECA and make all methods available as actions

Created on 2 September 2023, 10 months ago
Updated 20 June 2024, 11 days ago

Problem/Motivation

We are using the GitLab API heavily in a lot of our Drupal projects, either to generate issues on GitLab or even to create new projects, create branches and trigger pipelines to roll out new Drupal sites on the fly. We always write custom modules to automate processes like these.

Now, I wonder if we couldn't do better by integrating with ECA such that an action plugin deriver scanned the GitLab API from https://packagist.org/packages/m4tthumphrey/php-gitlab-api (the library used by this Drupal module) to provide a configurable action plugin for each public method. If this were possible, it would be another game changer.

I'm uncertain if this is technically possible, and I'm looking for feedback on the if and how something like that would be addressed.

✨ Feature request
Status

Fixed

Version

2.3

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

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

Comments & Activities

  • Issue created by @jurgenhaas
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    Gitlab API is limted, but I successfully can query/create Milestones and Tasks using Postman.
    Pretty sure we can start with tasks and then extend further.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    With the implementation of πŸ“Œ Provide access to all methods of the GitLab client Fixed the full GitLab API is available and we're already using that. It's very powerful.

    Pretty sure we can start with tasks and then extend further.

    I wouldn't want to build action plugins for each available method, that's not worth the effort. Especially when it comes to long-term maintenance as we would always have to make sure that we keep up to date with new and changed API methods.

    What I would hope is possible it to scan the PHP code of the linked library and detect all the methods and their arguments automatically, so that we can use a plugin deriver that builds the action plugins on the fly.

  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    As in scanning all library APIs and trying to call each available method on the fly?
    Does ECA have something already that can understand different parameters?

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    That's not ECA supposed to be doing that job. It's the action plugin system from Drupal core combined with a Deriver who should be providing an action plugin for each API method. The question of how to do that is what my initial post was about. I want to believe that PHP Reflections should be able to help us with that.

  • Assigned to jurgenhaas
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I've started implementing this and all API methods are already available with their config forms. Just the execution of the methods needs to be done next.

  • Status changed to Fixed 11 days ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    This is now fully implemented, and we now have access to ALL API calls in GitLab through ECA. This is available in a sub-module and can be enabled if ECA is also installed.

    This provides 384 new action plugins!!!

Production build 0.69.0 2024