From 6edfd802c375108d640c9368162d59d1d2f8327f Mon Sep 17 00:00:00 2001 From: Joel Steidl <joel@atendesigngroup.com> Date: Fri, 21 Feb 2025 15:48:35 -0700 Subject: [PATCH 1/5] 3508369-setup-github-pipelines: initial pipelines setup --- .cspell-project-words.txt | 6 ++++++ .gitlab-ci.yml | 29 +++++++++++++++++++++++++++++ README.md | 2 +- src/Event/ZoomApiWebhookEvent.php | 2 +- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .cspell-project-words.txt create mode 100644 .gitlab-ci.yml diff --git a/.cspell-project-words.txt b/.cspell-project-words.txt new file mode 100644 index 0000000..24bf647 --- /dev/null +++ b/.cspell-project-words.txt @@ -0,0 +1,6 @@ +apitools +inheritdoc +Symfony +zoomapi +Zoomapi +Yooat diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c6cd69a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +################ +# GitLabCI template for Drupal projects. +# +# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. +# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained. +# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your +# pipelines automatically. However, you can modify this template if you have additional needs for your project. +# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/ +################ + +# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/ +# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml +include: + - project: $_GITLAB_TEMPLATES_REPO + ref: $_GITLAB_TEMPLATES_REF + file: + - '/includes/include.drupalci.main.yml' + - '/includes/include.drupalci.variables.yml' + - '/includes/include.drupalci.workflows.yml' +# +################ +# Pipeline configuration variables are defined with default values and descriptions in the file +# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml +# Uncomment the lines below if you want to override any of the variables. The following is just an example. +################ +# variables: +# SKIP_ESLINT: '1' +# OPT_IN_TEST_NEXT_MAJOR: '1' +# _CURL_TEMPLATES_REF: 'main' diff --git a/README.md b/README.md index 6e0da16..43b71ac 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ A reminder, this module does nothing on its own. You must create your own custom module to leverage the Zoom API module. ### Zoom Event Subscriptions (a.k.a. Webhooks) -You'll need to add an additonal Event Secret Token in the configuration +You'll need to add an additional Event Secret Token in the configuration Configure your Zoom Application to send webhooks to https://example.com/zoomapi-webhooks All events from Zoom dispatch a Drupal event that can be subscribed to. diff --git a/src/Event/ZoomApiWebhookEvent.php b/src/Event/ZoomApiWebhookEvent.php index 31c6f79..65d2185 100644 --- a/src/Event/ZoomApiWebhookEvent.php +++ b/src/Event/ZoomApiWebhookEvent.php @@ -41,7 +41,7 @@ class ZoomApiWebhookEvent extends Event { * @param array $payload * The data posted. * @param \Symfony\Component\HttpFoundation\Request $request - * The orignal request. + * The original request. */ public function __construct($event, array $payload, Request $request) { $this->event = $event; -- GitLab From d506f2dd29463bf341a6dcb7347ae16763cd4176 Mon Sep 17 00:00:00 2001 From: Joel Steidl <joel@atendesigngroup.com> Date: Fri, 21 Feb 2025 16:16:18 -0700 Subject: [PATCH 2/5] 3508369-setup-github-pipelines: minimal coding standard stuff --- README.md | 2 +- src/Controller/ZoomApiWebhooksController.php | 14 +++++++------- src/Event/ZoomApiEvents.php | 2 +- src/Event/ZoomApiWebhookEvent.php | 2 +- src/Plugin/ApiTools/Client.php | 2 ++ src/ZoomapiServiceProvider.php | 1 + 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 43b71ac..0022d8d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ REQUIREMENTS This module requires the following modules: * APITools (https://www.drupal.org/project/apitools) - Note: Key module is - a dependencey of APITools now. + a dependency of APITools now. INSTALLATION ------------ diff --git a/src/Controller/ZoomApiWebhooksController.php b/src/Controller/ZoomApiWebhooksController.php index d7c2ca1..b0c89eb 100644 --- a/src/Controller/ZoomApiWebhooksController.php +++ b/src/Controller/ZoomApiWebhooksController.php @@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; /** - * Class ZoomApiWebhooksController. + * The Zoom API Webhooks Controller. */ class ZoomApiWebhooksController extends ControllerBase { @@ -92,12 +92,12 @@ class ZoomApiWebhooksController extends ControllerBase { * Event dispatcher interface. */ public function __construct( - LoggerInterface $logger, - KeyRepositoryInterface $key_repository, - ConfigFactoryInterface $config_factory, - RequestStack $request_stack, - EventDispatcherInterface $event_dispatcher - ) { + LoggerInterface $logger, + KeyRepositoryInterface $key_repository, + ConfigFactoryInterface $config_factory, + RequestStack $request_stack, + EventDispatcherInterface $event_dispatcher, + ) { $this->logger = $logger; $this->requestStack = $request_stack; $this->eventDispatcher = $event_dispatcher; diff --git a/src/Event/ZoomApiEvents.php b/src/Event/ZoomApiEvents.php index 398d5c5..6a97948 100644 --- a/src/Event/ZoomApiEvents.php +++ b/src/Event/ZoomApiEvents.php @@ -3,7 +3,7 @@ namespace Drupal\zoomapi\Event; /** - * Class ZoomApiEvents. + * Event constants for the Zoom API. * * @package Drupal\zoomapi\Event */ diff --git a/src/Event/ZoomApiWebhookEvent.php b/src/Event/ZoomApiWebhookEvent.php index 65d2185..80e366f 100644 --- a/src/Event/ZoomApiWebhookEvent.php +++ b/src/Event/ZoomApiWebhookEvent.php @@ -6,7 +6,7 @@ use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\HttpFoundation\Request; /** - * Class ZoomApiWebhookEvent. + * Event that is fired when a Zoom webhook is received. * * @package Drupal\zoomapi\Event */ diff --git a/src/Plugin/ApiTools/Client.php b/src/Plugin/ApiTools/Client.php index 78d9b8d..d3b7ded 100644 --- a/src/Plugin/ApiTools/Client.php +++ b/src/Plugin/ApiTools/Client.php @@ -43,6 +43,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; class Client extends ClientBase { /** + * The logger channel. + * * @var \Drupal\Core\Logger\LoggerChannelInterface */ protected $logger; diff --git a/src/ZoomapiServiceProvider.php b/src/ZoomapiServiceProvider.php index 9728f2e..364543a 100644 --- a/src/ZoomapiServiceProvider.php +++ b/src/ZoomapiServiceProvider.php @@ -24,4 +24,5 @@ class ZoomapiServiceProvider extends ServiceProviderBase { $container->setDefinition('zoomapi.client', $definition); } } + } -- GitLab From 59fbe4f0533bf644c4b3f79c595739df4ce9ba63 Mon Sep 17 00:00:00 2001 From: Joel Steidl <joel@atendesigngroup.com> Date: Fri, 21 Feb 2025 16:24:42 -0700 Subject: [PATCH 3/5] 3508369-setup-github-pipelines: limits to drupal 9 or 10 at the composer level for tests to properly run --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b7a7121..cb2a1ae 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,8 @@ "homepage": "https://drupal.org/project/zoomapi", "license": "GPL-2.0-or-later", "require": { - "drupal/apitools": "2.0.x" + "drupal/apitools": "2.0.x", + "drupal/core": "^9.1 || ^10" }, "repositories": { "drupal": { -- GitLab From 2d0d41ae58b26f842bcf83d9ea5c8201cbc8b179 Mon Sep 17 00:00:00 2001 From: Joel Steidl <joel@atendesigngroup.com> Date: Fri, 21 Feb 2025 16:28:37 -0700 Subject: [PATCH 4/5] 3508369-setup-github-pipelines: seeing if this fixes our phpunit issues --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6cd69a..d96da39 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ include: # https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml # Uncomment the lines below if you want to override any of the variables. The following is just an example. ################ -# variables: -# SKIP_ESLINT: '1' -# OPT_IN_TEST_NEXT_MAJOR: '1' -# _CURL_TEMPLATES_REF: 'main' +variables: + OPT_IN_TEST_PREVIOUS_MAJOR: '1' + OPT_IN_TEST_CURRENT: '0' + OPT_IN_TEST_NEXT_MAJOR: '0' -- GitLab From 5da6319f0c250a22a0c35f03bd446c37270800e4 Mon Sep 17 00:00:00 2001 From: Joel Steidl <joel@atendesigngroup.com> Date: Fri, 21 Feb 2025 17:11:10 -0700 Subject: [PATCH 5/5] 3508369-setup-github-pipelines: php unit tests passing --- tests/src/Functional/ApiRequestTest.php | 6 ++++++ tests/src/Functional/WebhookPostTest.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/tests/src/Functional/ApiRequestTest.php b/tests/src/Functional/ApiRequestTest.php index 91908ab..c9c6073 100644 --- a/tests/src/Functional/ApiRequestTest.php +++ b/tests/src/Functional/ApiRequestTest.php @@ -13,6 +13,11 @@ use GuzzleHttp\Exception\RequestException; */ class ApiRequestTest extends BrowserTestBase { + /** + * {@inheritdoc} + */ + protected $strictConfigSchema = FALSE; + /** * {@inheritdoc} */ @@ -37,6 +42,7 @@ class ApiRequestTest extends BrowserTestBase { */ protected function setUp(): void { parent::setUp(); + // API Secret. $this->createTestKey( 'test_zoomapi_secret', diff --git a/tests/src/Functional/WebhookPostTest.php b/tests/src/Functional/WebhookPostTest.php index ea8eddb..05e693b 100644 --- a/tests/src/Functional/WebhookPostTest.php +++ b/tests/src/Functional/WebhookPostTest.php @@ -13,6 +13,11 @@ use Drupal\Tests\BrowserTestBase; */ class WebhookPostTest extends BrowserTestBase { + /** + * {@inheritdoc} + */ + protected $strictConfigSchema = FALSE; + /** * {@inheritdoc} */ -- GitLab