diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f2521841..719af06e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -355,3 +355,34 @@ jobs: - name: Update site run: | docker compose exec --user root phpfpm vendor/bin/drush deploy --yes + + check-debug-patches: + name: Check that debug patches can be applied and reversed. + runs-on: ubuntu-latest + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow + strategy: + matrix: + patch: + - patches/openid_connect-debug-userinfo.patch + + steps: + - uses: actions/checkout@v4 + + - name: Start docker compose setup and install composer packages + run: | + docker network create frontend + docker compose pull + docker compose up --detach + + # Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect. + docker compose exec --user root phpfpm composer install --no-interaction + + - name: Apply patch + run: | + # Cf. documentation/openIdConnect.md + docker compose exec --user root phpfpm patch --strip=1 --input=${{ matrix.patch }} + + - name: Reverse patch + run: | + # Cf. documentation/openIdConnect.md + docker compose exec --user root phpfpm patch --strip=1 --input=${{ matrix.patch }} --reverse diff --git a/documentation/openIdConnect.md b/documentation/openIdConnect.md index a3cb200d..44b62433 100644 --- a/documentation/openIdConnect.md +++ b/documentation/openIdConnect.md @@ -63,10 +63,10 @@ docker compose --profile oidc up --detach During development it can be useful to see the user info we actually get during OpenID Connect authentification, and to do this you can apply the patch -[debug-userinfo.patch](../patches/drupal/openid_connect/debug-userinfo.patch): +[openid_connect-debug-userinfo.patch](../patches/openid_connect-debug-userinfo.patch): ```sh -docker compose exec phpfpm patch --strip=1 --input=patches/drupal/openid_connect/debug-userinfo.patch +docker compose exec phpfpm patch --strip=1 --input=patches/openid_connect-debug-userinfo.patch ``` After applying the patch and succesfully logging in, the actual userinfo @@ -79,5 +79,5 @@ docker compose exec phpfpm vendor/bin/drush watchdog:show --type=itkdev-debug -- Remove (reverse) the patch with ```sh -docker compose exec phpfpm patch --strip=1 --input=patches/drupal/openid_connect/debug-userinfo.patch --reverse +docker compose exec phpfpm patch --strip=1 --input=patches/openid_connect-debug-userinfo.patch --reverse ``` diff --git a/patches/drupal/openid_connect/debug-userinfo.patch b/patches/openid_connect-debug-userinfo.patch similarity index 100% rename from patches/drupal/openid_connect/debug-userinfo.patch rename to patches/openid_connect-debug-userinfo.patch