From 7be2e8e19a7c405e646792b8a95f98a612d4b329 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Wed, 24 Apr 2024 19:00:30 -0400 Subject: [PATCH 1/7] Make sure test fails with default --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ Makefile | 5 +---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b244fcfe..aac33488e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Make nightly build check latest isle-buildkit + if: github.event_name == 'schedule' + run: |- + echo "TAG=main" >> $GITHUB_OUTPUT + - name: Setup make and secrets for Windows if: matrix.os == 'windows-latest' run: | @@ -55,6 +60,24 @@ jobs: exit 1 fi + - name: "Make sure we can export the site config through the UI" + run: |- + # login as admin + COOKIE=$(curl -s -c - $(make login)) + + # try exporting the config through the UI + STATUS=$(curl -s \ + --cookie <(echo "$COOKIE") \ + -w '%{http_code}' \ + -o /dev/null \ + https://islandora.traefik.me/admin/config/development/configuration/full/export-download) + + # make sure the config export worked + if [ ${STATUS} -ne 200 ]; then + echo "Could not export config through Drupal UI" + echo ${STATUS} + exit 1 + fi - name: make build run: make build shell: bash diff --git a/Makefile b/Makefile index f0f8c398e..111bc3be2 100644 --- a/Makefile +++ b/Makefile @@ -562,10 +562,7 @@ hydrate: update-settings-php update-config-from-environment solr-cores namespace .SILENT: login ## Runs "drush uli" to provide a direct login link for user 1 login: - echo "\n\n=========== LOGIN ===========" - docker compose exec -T drupal with-contenv bash -lc "drush uli --uri=$(DOMAIN)" - echo "=============================\n" - + docker compose exec -T drupal with-contenv bash -lc "drush uli --uri=https://$(DOMAIN)" .PHONY: init init: generate-secrets From 0e0c86306cb8f4d207fec60e02ed4d010c7692e6 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Wed, 24 Apr 2024 19:03:54 -0400 Subject: [PATCH 2/7] Add environment variables to ensure config export works through UI --- build/docker-compose/docker-compose.drupal.yml | 12 ++++++++++++ sample.env | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/docker-compose/docker-compose.drupal.yml b/build/docker-compose/docker-compose.drupal.yml index ef3ae475c..3e8d670de 100644 --- a/build/docker-compose/docker-compose.drupal.yml +++ b/build/docker-compose/docker-compose.drupal.yml @@ -18,7 +18,19 @@ services: PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT} PHP_POST_MAX_SIZE: ${PHP_POST_MAX_SIZE} PHP_UPLOAD_MAX_FILESIZE: ${PHP_UPLOAD_MAX_FILESIZE} + NGINX_FASTCGI_CONNECT_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_FASTCGI_READ_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_FASTCGI_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_KEEPALIVE_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_CONNECT_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_READ_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + PHP_DEFAULT_SOCKET_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} PHP_MAX_EXECUTION_TIME: ${PHP_MAX_EXECUTION_TIME} + PHP_MAX_INPUT_TIME: ${PHP_MAX_EXECUTION_TIME} + PHP_PROCESS_CONTROL_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} + PHP_REQUEST_TERMINATE_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} labels: - traefik.enable=${EXPOSE_DRUPAL:-true} - traefik.http.services.${COMPOSE_PROJECT_NAME-isle-dc}-drupal.loadbalancer.server.port=80 diff --git a/sample.env b/sample.env index ba399d705..ef5cc6d63 100644 --- a/sample.env +++ b/sample.env @@ -155,7 +155,7 @@ RESTART_POLICY=unless-stopped PHP_MEMORY_LIMIT=256M PHP_POST_MAX_SIZE=128M PHP_UPLOAD_MAX_FILESIZE=128M -PHP_MAX_EXECUTION_TIME=30 +PHP_MAX_EXECUTION_TIME=300 # If you're just demoing or are starting from scratch, use this. INSTALL_EXISTING_CONFIG=false From 6bde49f2c97548d446230b17078ad194585f2a4a Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Thu, 25 Apr 2024 09:19:44 -0400 Subject: [PATCH 3/7] Don't mess with the Makefile --- .github/workflows/test.yml | 2 +- Makefile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aac33488e..4b68a543d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,7 +63,7 @@ jobs: - name: "Make sure we can export the site config through the UI" run: |- # login as admin - COOKIE=$(curl -s -c - $(make login)) + COOKIE=$(curl -s -c - $(make login | grep traefik)) # try exporting the config through the UI STATUS=$(curl -s \ diff --git a/Makefile b/Makefile index 111bc3be2..54fe00cd0 100644 --- a/Makefile +++ b/Makefile @@ -562,7 +562,9 @@ hydrate: update-settings-php update-config-from-environment solr-cores namespace .SILENT: login ## Runs "drush uli" to provide a direct login link for user 1 login: - docker compose exec -T drupal with-contenv bash -lc "drush uli --uri=https://$(DOMAIN)" + echo "\n\n=========== LOGIN ===========" + docker compose exec -T drupal with-contenv bash -lc "drush uli --uri=$(DOMAIN)" + echo "=============================\n" .PHONY: init init: generate-secrets From 52adb079505b318247946373a3cc3b5bb99b0ad6 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sat, 27 Apr 2024 03:13:37 -0400 Subject: [PATCH 4/7] fixup login --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b68a543d..288c6295b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,8 +62,11 @@ jobs: - name: "Make sure we can export the site config through the UI" run: |- + # login as admin - COOKIE=$(curl -s -c - $(make login | grep traefik)) + ULI=$(make login | grep traefik) + echo "getting cookie from $ULI" + COOKIE=$(curl -s -c - "${ULI}") # try exporting the config through the UI STATUS=$(curl -s \ From 2894537c656133a4005aa9cfa4357c7760a3e7c3 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sat, 27 Apr 2024 03:28:12 -0400 Subject: [PATCH 5/7] follow redirects on login --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 288c6295b..dd35a5e99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,7 @@ jobs: # login as admin ULI=$(make login | grep traefik) echo "getting cookie from $ULI" - COOKIE=$(curl -s -c - "${ULI}") + COOKIE=$(curl -L -s -c - "${ULI}") # try exporting the config through the UI STATUS=$(curl -s \ From 6e07f2659a42e270087797d98413e4e52bd14dc3 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sat, 27 Apr 2024 04:25:36 -0400 Subject: [PATCH 6/7] see if /tmp/config.tar.gz is still left around --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd35a5e99..a17291e4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,6 +81,9 @@ jobs: echo ${STATUS} exit 1 fi + + # see if /tmp/config.tar.gz is still left around + docker compose exec -T drupal with-contenv bash -lc "ls -l /tmp" - name: make build run: make build shell: bash From ae61925794401849a71cb70737b6bddec3e92ec8 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sat, 27 Apr 2024 04:51:25 -0400 Subject: [PATCH 7/7] Move test into bash script --- .github/workflows/test.yml | 23 +---------------------- scripts/ci/drush-cex-ui.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100755 scripts/ci/drush-cex-ui.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a17291e4e..262d11740 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,29 +61,8 @@ jobs: fi - name: "Make sure we can export the site config through the UI" - run: |- - - # login as admin - ULI=$(make login | grep traefik) - echo "getting cookie from $ULI" - COOKIE=$(curl -L -s -c - "${ULI}") - - # try exporting the config through the UI - STATUS=$(curl -s \ - --cookie <(echo "$COOKIE") \ - -w '%{http_code}' \ - -o /dev/null \ - https://islandora.traefik.me/admin/config/development/configuration/full/export-download) - - # make sure the config export worked - if [ ${STATUS} -ne 200 ]; then - echo "Could not export config through Drupal UI" - echo ${STATUS} - exit 1 - fi + run: ./scripts/ci/drush-cex-ui.sh - # see if /tmp/config.tar.gz is still left around - docker compose exec -T drupal with-contenv bash -lc "ls -l /tmp" - name: make build run: make build shell: bash diff --git a/scripts/ci/drush-cex-ui.sh b/scripts/ci/drush-cex-ui.sh new file mode 100755 index 000000000..b6abf9991 --- /dev/null +++ b/scripts/ci/drush-cex-ui.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +ULI=$(make login | grep traefik) +echo "getting cookie from $ULI" +COOKIE=$(curl -L -s -c - "${ULI}") + +# try exporting the config through the UI +STATUS=$(curl -s \ + --cookie <(echo "$COOKIE") \ + -w '%{http_code}' \ + -o /dev/null \ + https://islandora.traefik.me/admin/config/development/configuration/full/export-download) + +# make sure the config export worked +if [ ${STATUS} -ne 200 ]; then + echo "Could not export config through Drupal UI" + echo ${STATUS} + exit 1 +fi