Skip to content

Commit

Permalink
Cleaned up debug patch
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Jan 8, 2025
1 parent c423187 commit f2d2488
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions documentation/openIdConnect.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
File renamed without changes.

0 comments on commit f2d2488

Please sign in to comment.