Add Webhook support, Project support and events for this
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3588596. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !12 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The AI Initiative moved over to Gitlab and have since had some problems with the end-users not being able to assign themselves to projects or being able to set labels. Outside of this Gitlab offers alot of automation that we want to empower.</p> <p>What is currently missing for this to work well with a Drupal Gitlab server instance from an AI Initiative point of view is the possibility to setup multiple projects from multiple maintainers and have the same automation run on each. This requires different access tokens per projects.</p> <p>To be able to run automation as well, we also will need to be able to catch webhooks for different projects, with different gitlab keys and also expose events for each of these webhooks.</p> <p>There are also some conditions that are very complex to setup using current general ECA conditions for common tasks like check if an created issue follows a template or if a slash command is available in the comment.</p> <p>Thirdly there are some actions that would just be easier to use by doing composed actions in one - so adding a label right now is pretty complex, because you need to load what labels exists, load those into a token, add the on your are adding to the list and save it. Having this be just one action for instance helps a lot. For PMs in general having actions that are not endpoints, but specific expected behavior.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Switch over to using Key module for access tokens and webhook secrets.</li> <li>Create update hooks to update the server access tokens to Key module.</li> <li>Add a project entity that connects to a server entity.</li> <li>Create update hooks to install that entity.</li> <li>Create global events on webhook events.</li> <li>In the ECA submodule create Events for webhook events.</li> <li>In the ECA submodule create specific conditions for webhook events.</li> <li>In the ECA submodule create specific targeted actions (Should we do tool api tools?)</li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p>The project entity gets added.</p> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <p>The project entity gets added.</p> > Related issue: [Issue #3589676](https://www.drupal.org/node/3589676) > Related issue: [Issue #3589677](https://www.drupal.org/node/3589677) > Related issue: [Issue #3589678](https://www.drupal.org/node/3589678) > Related issue: [Issue #3589679](https://www.drupal.org/node/3589679)
issue