From 3077e62927b41c805621f97c6631a6cc4a9ba0af Mon Sep 17 00:00:00 2001 From: dsenalik Date: Sat, 27 Jan 2024 11:40:34 -0600 Subject: [PATCH 01/16] add PHP8.3 to automated testing and docker builds --- .../ALL-testCoverage-codeclimate.yml | 4 +- .github/workflows/MAIN-buildDocker.yml | 1 + .../workflows/MAIN-phpunit-php8.3_D10_0x.yml | 23 ++ .../workflows/MAIN-phpunit-php8.3_D10_1x.yml | 23 ++ README.md | 4 + tripaldocker/Dockerfile-php8.3-pgsql13 | 224 ++++++++++++++++++ 6 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/MAIN-phpunit-php8.3_D10_0x.yml create mode 100644 .github/workflows/MAIN-phpunit-php8.3_D10_1x.yml create mode 100644 tripaldocker/Dockerfile-php8.3-pgsql13 diff --git a/.github/workflows/ALL-testCoverage-codeclimate.yml b/.github/workflows/ALL-testCoverage-codeclimate.yml index 7b24aa5e2..7b1e8f42a 100644 --- a/.github/workflows/ALL-testCoverage-codeclimate.yml +++ b/.github/workflows/ALL-testCoverage-codeclimate.yml @@ -1,5 +1,5 @@ # Run some PHPUnit tests -name: Test Coverage on Drupal 10.1.x-dev + PHP 8.1 +name: Test Coverage on Drupal 10.1.x-dev + PHP 8.3 on: workflow_dispatch: pull_request: @@ -24,7 +24,7 @@ jobs: docker build --tag=tripaldocker:localdocker \ --build-arg drupalversion="10.1.x-dev" \ --build-arg chadoschema='testchado' ./ \ - --file tripaldocker/Dockerfile-php8.1-pgsql13 + --file tripaldocker/Dockerfile-php8.3-pgsql13 # Just spin up docker the good ol' fashion way. - name: Spin up Local Docker run: | diff --git a/.github/workflows/MAIN-buildDocker.yml b/.github/workflows/MAIN-buildDocker.yml index 347d9be28..852732ec9 100644 --- a/.github/workflows/MAIN-buildDocker.yml +++ b/.github/workflows/MAIN-buildDocker.yml @@ -15,6 +15,7 @@ jobs: php-version: - "8.1" - "8.2" + - "8.3" pgsql-version: - "13" drupal-version: diff --git a/.github/workflows/MAIN-phpunit-php8.3_D10_0x.yml b/.github/workflows/MAIN-phpunit-php8.3_D10_0x.yml new file mode 100644 index 000000000..c4a8826a0 --- /dev/null +++ b/.github/workflows/MAIN-phpunit-php8.3_D10_0x.yml @@ -0,0 +1,23 @@ +name: PHPUnit +on: + push: + branches: + - 4.x + - tv4g0-issue1673-remove-drupal-9 +jobs: + running-tests: + name: "Drupal 10.0: PHP 8.3" + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Run Automated testing + uses: tripal/test-tripal-action@v1.2 + with: + directory-name: 'tripal' + modules: 'tripal tripal_biodb tripal_chado' + php-version: '8.3' + pgsql-version: '13' + drupal-version: '10.0.x-dev' + build-image: true + dockerfile: "UseTripalDockerBackupClause" diff --git a/.github/workflows/MAIN-phpunit-php8.3_D10_1x.yml b/.github/workflows/MAIN-phpunit-php8.3_D10_1x.yml new file mode 100644 index 000000000..9b0c8114b --- /dev/null +++ b/.github/workflows/MAIN-phpunit-php8.3_D10_1x.yml @@ -0,0 +1,23 @@ +name: PHPUnit +on: + push: + branches: + - 4.x + - tv4g0-issue1673-remove-drupal-9 +jobs: + running-tests: + name: "Drupal 10.1: PHP 8.3" + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Run Automated testing + uses: tripal/test-tripal-action@v1.2 + with: + directory-name: 'tripal' + modules: 'tripal tripal_biodb tripal_chado' + php-version: '8.3' + pgsql-version: '13' + drupal-version: '10.1.x-dev' + build-image: true + dockerfile: "UseTripalDockerBackupClause" diff --git a/README.md b/README.md index e7527630d..eb8e9bc0c 100755 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ |-------------|-----------------|-----------------| | **PHP 8.1** | ![Grid1A-Badge] | ![Grid1B-Badge] | | **PHP 8.2** | ![Grid2A-Badge] | ![Grid2B-Badge] | +| **PHP 8.3** | ![Grid3A-Badge] | ![Grid3B-Badge] | [Grid1A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.1_D10_0x.yml/badge.svg [Grid1B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.1_D10_1x.yml/badge.svg @@ -29,6 +30,9 @@ [Grid2A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.2_D10_0x.yml/badge.svg [Grid2B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.2_D10_1x.yml/badge.svg +[Grid3A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.3_D10_0x.yml/badge.svg +[Grid3B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.3_D10_1x.yml/badge.svg + ### Code Coverage This project uses Code Climate to determine the quality of our codebase and the coverage of our test suite. Compatibility above is based on passing of this test suite. diff --git a/tripaldocker/Dockerfile-php8.3-pgsql13 b/tripaldocker/Dockerfile-php8.3-pgsql13 new file mode 100644 index 000000000..9b58f4e93 --- /dev/null +++ b/tripaldocker/Dockerfile-php8.3-pgsql13 @@ -0,0 +1,224 @@ +FROM php:8.3-apache-bullseye + +ARG drupalversion='9.4.x-dev' +ARG modules='devel devel_php' +ARG chadoschema='chado' +ARG installchado=TRUE + +# Label docker image +LABEL drupal.version=${drupalversion} +LABEL drupal.stability="development" +LABEL tripal.version="4.x-dev" +LABEL tripal.stability="development" +LABEL os.version="bullseye" +LABEL php.version="8.3" +LABEL postgresql.version="13" + +COPY . /app + +## Install some basic support programs and update apt-get. +RUN chmod -R +x /app && apt-get update 1> ~/aptget.update.log \ + && apt-get install git unzip zip wget gnupg2 supervisor vim --yes -qq 1> ~/aptget.extras.log + +########## POSTGRESQL ######################################################### + +## See https://stackoverflow.com/questions/51033689/how-to-fix-error-on-postgres-install-ubuntu +RUN mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7 + +## Install PostgreSQL 13 +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-13 postgresql-client-13 postgresql-contrib-13 + +## Run the rest of the commands as the ``postgres`` user +## created by the ``postgres-13`` package when it was installed. +USER postgres + +## Create a PostgreSQL role named ``docker`` with ``docker`` as the password and +## then create a database `docker` owned by the ``docker`` role. +RUN /etc/init.d/postgresql start &&\ + psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" \ + && createdb -O docker docker \ + && psql --command="CREATE USER drupaladmin WITH PASSWORD 'drupaldevelopmentonlylocal'" \ + && psql --command="ALTER USER drupaladmin WITH LOGIN" \ + && psql --command="ALTER USER drupaladmin WITH CREATEDB" \ + && psql --command="CREATE DATABASE sitedb WITH OWNER drupaladmin" \ + && psql sitedb --command="CREATE EXTENSION pg_trgm" \ + && service postgresql stop + +## Now back to the root user. +USER root + +## Adjust PostgreSQL configuration so that remote connections to the +## database are possible. +RUN mv /app/tripaldocker/default_files/postgresql/pg_hba.conf /etc/postgresql/13/main/pg_hba.conf + +## And add ``listen_addresses`` to ``/etc/postgresql/13/main/postgresql.conf`` +RUN echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf \ + && echo "max_locks_per_transaction = 1024" >> /etc/postgresql/13/main/postgresql.conf + +########## PHP EXTENSIONS ##################################################### +RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" + +## Xdebug +RUN pecl install xdebug-3.2.1 \ + && docker-php-ext-enable xdebug \ + && cat /app/tripaldocker/default_files/xdebug/xdebug-coverage.ini >> /usr/local/etc/php/php.ini \ + && echo "error_reporting=E_ALL" >> /usr/local/etc/php/conf.d/error_reporting.ini \ + && cp /app/tripaldocker/default_files/xdebug/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.dis \ + && rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + +## install the PHP extensions we need +RUN set -eux; \ + \ + if command -v a2enmod; then \ + a2enmod rewrite; \ + fi; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libfreetype6-dev \ + libjpeg-dev \ + libpng-dev \ + libwebp-dev \ + libpq-dev \ + libzip-dev \ + ; \ + \ + docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \ + \ + docker-php-ext-install -j "$(nproc)" \ + gd \ + opcache \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +## set recommended PHP.ini settings +## see https://secure.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.fast_shutdown=1'; \ + echo 'opcache.memory_limit=1028M';\ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + +RUN echo 'memory_limit = 1028M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini + +WORKDIR /var/www/html + +############# APACHE ########################################################## + +# Fix Could not determine server's fully qualified domain name. +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf + +############# DRUPAL ########################################################## + +## Environment variables used for phpunit testing. +ENV SIMPLETEST_BASE_URL=http://localhost +ENV SIMPLETEST_DB=pgsql://drupaladmin:drupaldevelopmentonlylocal@localhost/sitedb +ENV BROWSER_OUTPUT_DIRECTORY=/var/www/drupal/web/sites/default/files/simpletest +ENV COMPOSER_MEMORY_LIMIT=-1 +ENV COMPOSER_NO_INTERACTION=1 +ENV COMPOSER_ALLOW_SUPERUSER=1 + +## Install composer and Drush. +WORKDIR /var/www +RUN chmod a+x /app/tripaldocker/init_scripts/composer-init.sh \ + && /app/tripaldocker/init_scripts/composer-init.sh + +## Use composer to install Drupal. +WORKDIR /var/www +ARG requiredcomposerpackages="drupal/core:${drupalversion} drupal/core-dev:${drupalversion} drush/drush phpspec/prophecy-phpunit" +ARG composerpackages="drupal/devel drupal/devel_php" +RUN composer create-project drupal/recommended-project:${drupalversion} --stability dev --no-install drupal \ + && cd drupal \ + && composer config --no-plugins allow-plugins.composer/installers true \ + && composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true \ + && composer config --no-plugins allow-plugins.drupal/core-project-message true \ + && composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true \ + && rm composer.lock \ + && composer require --dev ${requiredcomposerpackages} ${composerpackages} \ + && composer install + +## Set files directory permissions +RUN mkdir /var/www/drupal/web/sites/default/files \ + && mkdir /var/www/drupal/web/sites/default/files/simpletest \ + && chown -R www-data:www-data /var/www/drupal \ + && chmod 02775 -R /var/www/drupal/web/sites/default/files \ + && usermod -g www-data root + +## Install Drupal. +RUN cd /var/www/drupal \ + && service apache2 start \ + && service postgresql start \ + && sleep 30 \ + && /var/www/drupal/vendor/drush/drush/drush site-install standard \ + --db-url=pgsql://drupaladmin:drupaldevelopmentonlylocal@localhost/sitedb \ + --account-mail="drupaladmin@localhost" \ + --account-name=drupaladmin \ + --account-pass=some_admin_password \ + --site-mail="drupaladmin@localhost" \ + --site-name="Tripal 4 on Drupal 10 DEVELOPMENT" \ + && service apache2 stop \ + && service postgresql stop + +############# Tripal ########################################################## + +WORKDIR /var/www/drupal +RUN service apache2 start \ + && service postgresql start \ + && sleep 30 \ + && mkdir -p /var/www/drupal/web/modules/contrib \ + && cp -R /app /var/www/drupal/web/modules/contrib/tripal \ + && vendor/bin/drush en tripal tripal_biodb tripal_chado ${modules} -y \ + && if [ "$installchado" = "TRUE" ]; then \ + vendor/bin/drush trp-install-chado --schema-name=${chadoschema} \ + && vendor/bin/drush trp-prep-chado --schema-name=${chadoschema} \ + && vendor/bin/drush trp-import-types --collection_id=general_chado --username=drupaladmin; \ + fi \ + && service apache2 stop \ + && service postgresql stop + +############# Scripts ######################################################### + +## Configuration files & Activation script +RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ + && mv /app/tripaldocker/default_files/000-default.conf /etc/apache2/sites-available/000-default.conf \ + && echo "\$settings['trusted_host_patterns'] = [ '^localhost$', '^127\.0\.0\.1$', \$_SERVER['SERVER_NAME'] ];" >> /var/www/drupal/web/sites/default/settings.php \ + && mv /app/tripaldocker/init_scripts/init.sh /usr/bin/init.sh \ + && chmod +x /usr/bin/init.sh \ + && mv /app/tripaldocker/default_files/xdebug/xdebug_toggle.sh /usr/bin/xdebug_toggle.sh \ + && echo "\$config['system.logging']['error_level'] = 'verbose';" >> /var/www/drupal/web/sites/default/settings.php + +## Make global commands. +RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ + && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ + && ln -s /var/www/drupal /var/www/drupal9 + +## Set the working directory to DRUPAL_ROOT +WORKDIR /var/www/drupal/web + +## Expose http, xdebug and psql port +EXPOSE 80 5432 9003 + +ENTRYPOINT ["init.sh"] From e35792503f16d066f374091c797a37d6966dc6f7 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Sat, 27 Jan 2024 12:05:57 -0600 Subject: [PATCH 02/16] need xdebug version >=3.3 for PHP 8.3 --- tripaldocker/Dockerfile-php8.3-pgsql13 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripaldocker/Dockerfile-php8.3-pgsql13 b/tripaldocker/Dockerfile-php8.3-pgsql13 index 9b58f4e93..2d3a6d53c 100644 --- a/tripaldocker/Dockerfile-php8.3-pgsql13 +++ b/tripaldocker/Dockerfile-php8.3-pgsql13 @@ -60,7 +60,7 @@ RUN echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf \ RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" ## Xdebug -RUN pecl install xdebug-3.2.1 \ +RUN pecl install xdebug-3.3.1 \ && docker-php-ext-enable xdebug \ && cat /app/tripaldocker/default_files/xdebug/xdebug-coverage.ini >> /usr/local/etc/php/php.ini \ && echo "error_reporting=E_ALL" >> /usr/local/etc/php/conf.d/error_reporting.ini \ From 5a581e626dd56761481e6ae1ceca8bc708e6602c Mon Sep 17 00:00:00 2001 From: dsenalik Date: Sun, 28 Jan 2024 09:27:26 -0600 Subject: [PATCH 03/16] Run phpunit tests on PHP 8.3 --- .github/workflows/ALL-phpunit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ALL-phpunit.yml b/.github/workflows/ALL-phpunit.yml index e8c1e67af..f45a627a6 100644 --- a/.github/workflows/ALL-phpunit.yml +++ b/.github/workflows/ALL-phpunit.yml @@ -14,6 +14,7 @@ jobs: php-version: - "8.1" - "8.2" + - "8.3" pgsql-version: - "13" drupal-version: From a19cbc9d8e670a4b4be21519ffb78bac2a491436 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Sun, 28 Jan 2024 09:33:25 -0600 Subject: [PATCH 04/16] codeclimate-test-reporter is deprecated, revert to PHP 8.1 --- .github/workflows/ALL-testCoverage-codeclimate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ALL-testCoverage-codeclimate.yml b/.github/workflows/ALL-testCoverage-codeclimate.yml index 7b1e8f42a..7b24aa5e2 100644 --- a/.github/workflows/ALL-testCoverage-codeclimate.yml +++ b/.github/workflows/ALL-testCoverage-codeclimate.yml @@ -1,5 +1,5 @@ # Run some PHPUnit tests -name: Test Coverage on Drupal 10.1.x-dev + PHP 8.3 +name: Test Coverage on Drupal 10.1.x-dev + PHP 8.1 on: workflow_dispatch: pull_request: @@ -24,7 +24,7 @@ jobs: docker build --tag=tripaldocker:localdocker \ --build-arg drupalversion="10.1.x-dev" \ --build-arg chadoschema='testchado' ./ \ - --file tripaldocker/Dockerfile-php8.3-pgsql13 + --file tripaldocker/Dockerfile-php8.1-pgsql13 # Just spin up docker the good ol' fashion way. - name: Spin up Local Docker run: | From c61e2bd87671d7743e30743ad628753fc4126746 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Sun, 28 Jan 2024 14:05:10 -0600 Subject: [PATCH 05/16] PHP8.3 only supported on Drupal 10.2 --- .github/workflows/ALL-phpunit.yml | 8 +++++++ .github/workflows/MAIN-buildDocker.yml | 8 +++++++ .../workflows/MAIN-phpunit-php8.1_D10_0x.yml | 1 - .../workflows/MAIN-phpunit-php8.1_D10_1x.yml | 1 - .../workflows/MAIN-phpunit-php8.1_D10_2x.yml | 22 +++++++++++++++++++ .../workflows/MAIN-phpunit-php8.2_D10_0x.yml | 1 - .../workflows/MAIN-phpunit-php8.2_D10_1x.yml | 1 - ..._0x.yml => MAIN-phpunit-php8.2_D10_2x.yml} | 7 +++--- ..._1x.yml => MAIN-phpunit-php8.3_D10_2x.yml} | 5 ++--- README.md | 15 +++++++------ 10 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/MAIN-phpunit-php8.1_D10_2x.yml rename .github/workflows/{MAIN-phpunit-php8.3_D10_0x.yml => MAIN-phpunit-php8.2_D10_2x.yml} (82%) rename .github/workflows/{MAIN-phpunit-php8.3_D10_1x.yml => MAIN-phpunit-php8.3_D10_2x.yml} (81%) diff --git a/.github/workflows/ALL-phpunit.yml b/.github/workflows/ALL-phpunit.yml index f45a627a6..a556abb21 100644 --- a/.github/workflows/ALL-phpunit.yml +++ b/.github/workflows/ALL-phpunit.yml @@ -20,6 +20,14 @@ jobs: drupal-version: - "10.0.x-dev" - "10.1.x-dev" + - "10.2.x-dev" + exclude: + - php-version: "8.3" + pgsql-version: "13" + drupal-version: "10.0.x-dev" + - php-version: "8.3" + pgsql-version: "13" + drupal-version: "10.1.x-dev" steps: # Check out the repo diff --git a/.github/workflows/MAIN-buildDocker.yml b/.github/workflows/MAIN-buildDocker.yml index 852732ec9..78b4028be 100644 --- a/.github/workflows/MAIN-buildDocker.yml +++ b/.github/workflows/MAIN-buildDocker.yml @@ -21,6 +21,14 @@ jobs: drupal-version: - "10.0.x-dev" - "10.1.x-dev" + - "10.2.x-dev" + exclude: + - php-version: "8.3" + pgsql-version: "13" + drupal-version: "10.0.x-dev" + - php-version: "8.3" + pgsql-version: "13" + drupal-version: "10.1.x-dev" name: Docker Build (drupal${{ matrix.drupal-version }}) steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/MAIN-phpunit-php8.1_D10_0x.yml b/.github/workflows/MAIN-phpunit-php8.1_D10_0x.yml index d76ce0384..94eebeb89 100644 --- a/.github/workflows/MAIN-phpunit-php8.1_D10_0x.yml +++ b/.github/workflows/MAIN-phpunit-php8.1_D10_0x.yml @@ -3,7 +3,6 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: name: "Drupal 10.0: PHP 8.1" diff --git a/.github/workflows/MAIN-phpunit-php8.1_D10_1x.yml b/.github/workflows/MAIN-phpunit-php8.1_D10_1x.yml index 7cf1a219d..9a8b9fc9b 100644 --- a/.github/workflows/MAIN-phpunit-php8.1_D10_1x.yml +++ b/.github/workflows/MAIN-phpunit-php8.1_D10_1x.yml @@ -3,7 +3,6 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: name: "Drupal 10.1: PHP 8.1" diff --git a/.github/workflows/MAIN-phpunit-php8.1_D10_2x.yml b/.github/workflows/MAIN-phpunit-php8.1_D10_2x.yml new file mode 100644 index 000000000..69010775c --- /dev/null +++ b/.github/workflows/MAIN-phpunit-php8.1_D10_2x.yml @@ -0,0 +1,22 @@ +name: PHPUnit +on: + push: + branches: + - 4.x +jobs: + running-tests: + name: "Drupal 10.2: PHP 8.1" + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Run Automated testing + uses: tripal/test-tripal-action@v1.2 + with: + directory-name: 'tripal' + modules: 'tripal tripal_biodb tripal_chado' + php-version: '8.1' + pgsql-version: '13' + drupal-version: '10.2.x-dev' + build-image: true + dockerfile: "UseTripalDockerBackupClause" diff --git a/.github/workflows/MAIN-phpunit-php8.2_D10_0x.yml b/.github/workflows/MAIN-phpunit-php8.2_D10_0x.yml index a56148d27..94c54b6e3 100644 --- a/.github/workflows/MAIN-phpunit-php8.2_D10_0x.yml +++ b/.github/workflows/MAIN-phpunit-php8.2_D10_0x.yml @@ -3,7 +3,6 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: name: "Drupal 10.0: PHP 8.2" diff --git a/.github/workflows/MAIN-phpunit-php8.2_D10_1x.yml b/.github/workflows/MAIN-phpunit-php8.2_D10_1x.yml index 068f834b8..0861fea5d 100644 --- a/.github/workflows/MAIN-phpunit-php8.2_D10_1x.yml +++ b/.github/workflows/MAIN-phpunit-php8.2_D10_1x.yml @@ -3,7 +3,6 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: name: "Drupal 10.1: PHP 8.2" diff --git a/.github/workflows/MAIN-phpunit-php8.3_D10_0x.yml b/.github/workflows/MAIN-phpunit-php8.2_D10_2x.yml similarity index 82% rename from .github/workflows/MAIN-phpunit-php8.3_D10_0x.yml rename to .github/workflows/MAIN-phpunit-php8.2_D10_2x.yml index c4a8826a0..4d94f7183 100644 --- a/.github/workflows/MAIN-phpunit-php8.3_D10_0x.yml +++ b/.github/workflows/MAIN-phpunit-php8.2_D10_2x.yml @@ -3,10 +3,9 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: - name: "Drupal 10.0: PHP 8.3" + name: "Drupal 10.2: PHP 8.2" runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -16,8 +15,8 @@ jobs: with: directory-name: 'tripal' modules: 'tripal tripal_biodb tripal_chado' - php-version: '8.3' + php-version: '8.2' pgsql-version: '13' - drupal-version: '10.0.x-dev' + drupal-version: '10.2.x-dev' build-image: true dockerfile: "UseTripalDockerBackupClause" diff --git a/.github/workflows/MAIN-phpunit-php8.3_D10_1x.yml b/.github/workflows/MAIN-phpunit-php8.3_D10_2x.yml similarity index 81% rename from .github/workflows/MAIN-phpunit-php8.3_D10_1x.yml rename to .github/workflows/MAIN-phpunit-php8.3_D10_2x.yml index 9b0c8114b..aa9a0b672 100644 --- a/.github/workflows/MAIN-phpunit-php8.3_D10_1x.yml +++ b/.github/workflows/MAIN-phpunit-php8.3_D10_2x.yml @@ -3,10 +3,9 @@ on: push: branches: - 4.x - - tv4g0-issue1673-remove-drupal-9 jobs: running-tests: - name: "Drupal 10.1: PHP 8.3" + name: "Drupal 10.2: PHP 8.3" runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -18,6 +17,6 @@ jobs: modules: 'tripal tripal_biodb tripal_chado' php-version: '8.3' pgsql-version: '13' - drupal-version: '10.1.x-dev' + drupal-version: '10.2.x-dev' build-image: true dockerfile: "UseTripalDockerBackupClause" diff --git a/README.md b/README.md index eb8e9bc0c..6444d59e3 100755 --- a/README.md +++ b/README.md @@ -18,20 +18,21 @@ ![PostgreSQL 13](https://img.shields.io/badge/PostreSQL-13-success) -| Drupal | 10.0.x | 10.1.x | -|-------------|-----------------|-----------------| -| **PHP 8.1** | ![Grid1A-Badge] | ![Grid1B-Badge] | -| **PHP 8.2** | ![Grid2A-Badge] | ![Grid2B-Badge] | -| **PHP 8.3** | ![Grid3A-Badge] | ![Grid3B-Badge] | +| Drupal | 10.0.x | 10.1.x | 10.2.x | +|-------------|-----------------|-----------------|-----------------| +| **PHP 8.1** | ![Grid1A-Badge] | ![Grid1B-Badge] | ![Grid1C-Badge] | +| **PHP 8.2** | ![Grid2A-Badge] | ![Grid2B-Badge] | ![Grid2C-Badge] | +| **PHP 8.3** | | | ![Grid3C-Badge] | [Grid1A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.1_D10_0x.yml/badge.svg [Grid1B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.1_D10_1x.yml/badge.svg +[Grid1C-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.1_D10_2x.yml/badge.svg [Grid2A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.2_D10_0x.yml/badge.svg [Grid2B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.2_D10_1x.yml/badge.svg +[Grid2C-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.2_D10_2x.yml/badge.svg -[Grid3A-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.3_D10_0x.yml/badge.svg -[Grid3B-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.3_D10_1x.yml/badge.svg +[Grid3C-Badge]: https://github.com/tripal/tripal/actions/workflows/MAIN-phpunit-php8.3_D10_2x.yml/badge.svg ### Code Coverage From 6c6b4e966fe9a7f7d7e102a4d0cc587a5b858aa0 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Mon, 29 Jan 2024 08:43:54 -0600 Subject: [PATCH 06/16] fix deprecated get_class() without parameters --- tripal_chado/src/Task/ChadoPreparer.php | 2 +- tripal_chado/src/TripalImporter/ChadoImporterBase.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tripal_chado/src/Task/ChadoPreparer.php b/tripal_chado/src/Task/ChadoPreparer.php index fe4cafea6..483198e49 100644 --- a/tripal_chado/src/Task/ChadoPreparer.php +++ b/tripal_chado/src/Task/ChadoPreparer.php @@ -136,7 +136,7 @@ public function performTask() :bool { $this->chado_schema_main = $schema_name; $chado = \Drupal::service('tripal_chado.database'); $chado->setSchemaName($schema_name); - $chado->useTripalDbxSchemaFor(get_class()); + $chado->useTripalDbxSchemaFor(self::class); try { diff --git a/tripal_chado/src/TripalImporter/ChadoImporterBase.php b/tripal_chado/src/TripalImporter/ChadoImporterBase.php index 9542eae28..4ddf55d2d 100644 --- a/tripal_chado/src/TripalImporter/ChadoImporterBase.php +++ b/tripal_chado/src/TripalImporter/ChadoImporterBase.php @@ -103,7 +103,7 @@ public function getChadoConnection() { if ($chado->getSchemaName() != $schema_name) { $chado->setSchemaName($schema_name); } - $chado->useTripalDbxSchemaFor(get_class()); + $chado->useTripalDbxSchemaFor(self::class); return $chado; } From dcec10a8fc61c3399253e19a15a3b6bf228d9cf1 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Tue, 30 Jan 2024 10:32:05 -0600 Subject: [PATCH 07/16] fix drupal schema not in search path for D10.2 --- tripal/src/TripalDBX/TripalDbx.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tripal/src/TripalDBX/TripalDbx.php b/tripal/src/TripalDBX/TripalDbx.php index 5b3447a07..872080e19 100644 --- a/tripal/src/TripalDBX/TripalDbx.php +++ b/tripal/src/TripalDBX/TripalDbx.php @@ -99,7 +99,8 @@ public function getDrupalSchemaName() :string { // Get Drupal connection details. $drupal_database = \Drupal::database(); $connection_options = $drupal_database->getConnectionOptions(); - if (array_key_exists('driver', $connection_options) AND ($connection_options['driver'] != 'pgsql')) { + // Drupal <= 10.1 driver will be 'pgsql', Drupal 10.2 it will be 'Drupal\pgsql\Driver\Database\pgsql' + if (array_key_exists('driver', $connection_options) AND (!preg_match('/pgsql$/', $connection_options['driver']))) { // Not using PostgreSQL. There might be something wrong! // @todo we may want to evaluate this further as it does tie our Drupal // database to being in pgsql. It doesn't support the case where Drupal From fb91dc2cd724ad4e59d39de6dec65579fc5ebe1e Mon Sep 17 00:00:00 2001 From: Douglas Senalik Date: Tue, 6 Feb 2024 15:31:05 -0600 Subject: [PATCH 08/16] Changes from PR #1775 --- tripaldocker/Dockerfile-php8.1-pgsql13 | 7 +++---- tripaldocker/Dockerfile-php8.2-pgsql13 | 7 +++---- tripaldocker/Dockerfile-php8.3-pgsql13 | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tripaldocker/Dockerfile-php8.1-pgsql13 b/tripaldocker/Dockerfile-php8.1-pgsql13 index 7443bcb60..322ef8f79 100644 --- a/tripaldocker/Dockerfile-php8.1-pgsql13 +++ b/tripaldocker/Dockerfile-php8.1-pgsql13 @@ -1,13 +1,13 @@ FROM php:8.1-apache-bullseye -ARG drupalversion='10.0.x-dev' +ARG drupalversion='10.1.x-dev' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE # Label docker image LABEL drupal.version=${drupalversion} -LABEL drupal.stability="development" +LABEL drupal.stability="production" LABEL tripal.version="4.x-dev" LABEL tripal.stability="development" LABEL os.version="bullseye" @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4 on Drupal 10 DEVELOPMENT" \ + --site-name="Tripal 4.x-dev on Drupal 10.1.0" \ && service apache2 stop \ && service postgresql stop @@ -213,7 +213,6 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ - && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web diff --git a/tripaldocker/Dockerfile-php8.2-pgsql13 b/tripaldocker/Dockerfile-php8.2-pgsql13 index 7119d6261..3231db7e8 100644 --- a/tripaldocker/Dockerfile-php8.2-pgsql13 +++ b/tripaldocker/Dockerfile-php8.2-pgsql13 @@ -1,13 +1,13 @@ FROM php:8.2-apache-bullseye -ARG drupalversion='9.4.x-dev' +ARG drupalversion='10.1.x-dev' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE # Label docker image LABEL drupal.version=${drupalversion} -LABEL drupal.stability="development" +LABEL drupal.stability="production" LABEL tripal.version="4.x-dev" LABEL tripal.stability="development" LABEL os.version="bullseye" @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4 on Drupal 10 DEVELOPMENT" \ + --site-name="Tripal 4.x-dev on Drupal 10.1.0" \ && service apache2 stop \ && service postgresql stop @@ -213,7 +213,6 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ - && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web diff --git a/tripaldocker/Dockerfile-php8.3-pgsql13 b/tripaldocker/Dockerfile-php8.3-pgsql13 index 2d3a6d53c..26de7c345 100644 --- a/tripaldocker/Dockerfile-php8.3-pgsql13 +++ b/tripaldocker/Dockerfile-php8.3-pgsql13 @@ -1,13 +1,13 @@ FROM php:8.3-apache-bullseye -ARG drupalversion='9.4.x-dev' +ARG drupalversion='10.2.x-dev' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE # Label docker image LABEL drupal.version=${drupalversion} -LABEL drupal.stability="development" +LABEL drupal.stability="production" LABEL tripal.version="4.x-dev" LABEL tripal.stability="development" LABEL os.version="bullseye" @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4 on Drupal 10 DEVELOPMENT" \ + --site-name="Tripal 4.x-dev on Drupal 10.2.0" \ && service apache2 stop \ && service postgresql stop @@ -213,7 +213,6 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ - && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web From e6b75392ef394e1b906e0e0240028aeba23b0cb0 Mon Sep 17 00:00:00 2001 From: Douglas Senalik Date: Wed, 7 Feb 2024 10:15:53 -0600 Subject: [PATCH 09/16] resolve problems with TripalRoutePermissionsTest --- .../src/Functional/TripalRoutePermissionsTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tripal/tests/src/Functional/TripalRoutePermissionsTest.php b/tripal/tests/src/Functional/TripalRoutePermissionsTest.php index 4937ccb8b..b4fb0c09c 100644 --- a/tripal/tests/src/Functional/TripalRoutePermissionsTest.php +++ b/tripal/tests/src/Functional/TripalRoutePermissionsTest.php @@ -19,7 +19,7 @@ class TripalRoutePermissionsTest extends BrowserTestBase { // protected $htmlOutputEnabled = TRUE; protected $defaultTheme = 'stark'; - protected static $modules = ['tripal', 'file', 'field_ui']; + protected static $modules = ['tripal', 'tripal_chado', 'file', 'field_ui']; /** * Test all the base Tripal admin paths. @@ -40,11 +40,15 @@ public function testTripalAdminPages() { 'Tripal Managed Files' => 'admin/tripal/files', 'Tripal Content Terms' => 'admin/tripal/config/terms', 'Data Storage' => 'admin/tripal/storage', - 'Extensions' => 'admin/tripal/extension', + // Under Drupal ~10.2, if there are no extensions present, and there aren't, then + // we won't be able to access the 'admin/tripal/extension' menu, even as admin. + // To test, we would have to create an extension first. + // 'Extensions' => 'admin/tripal/extension', ]; $userAuthenticatedOnly = $this->drupalCreateUser(); - $userTripalAdmin = $this->drupalCreateUser(['administer tripal']); + // Drupal 10.2 tightens permissions, we need additional permissions to access loaders and files + $userTripalAdmin = $this->drupalCreateUser(['administer tripal', 'allow tripal import', 'admin tripal files']); // First check all the URLs with no user logged in. // This checks the anonymous user cannot access these pages. From b6d82cbe15ac5d5be07d506a2a05004f91ed2590 Mon Sep 17 00:00:00 2001 From: Douglas Senalik Date: Wed, 7 Feb 2024 10:22:30 -0600 Subject: [PATCH 10/16] More changes from PR #1769 --- tripaldocker/Dockerfile-php8.1-pgsql13 | 5 +++-- tripaldocker/Dockerfile-php8.2-pgsql13 | 5 +++-- tripaldocker/Dockerfile-php8.3-pgsql13 | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tripaldocker/Dockerfile-php8.1-pgsql13 b/tripaldocker/Dockerfile-php8.1-pgsql13 index 322ef8f79..cbd2ffdfd 100644 --- a/tripaldocker/Dockerfile-php8.1-pgsql13 +++ b/tripaldocker/Dockerfile-php8.1-pgsql13 @@ -1,6 +1,6 @@ FROM php:8.1-apache-bullseye -ARG drupalversion='10.1.x-dev' +ARG drupalversion='~10.1.0' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4.x-dev on Drupal 10.1.0" \ + --site-name="Tripal 4.x-dev on Drupal ${drupalversion}" \ && service apache2 stop \ && service postgresql stop @@ -213,6 +213,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ + && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web diff --git a/tripaldocker/Dockerfile-php8.2-pgsql13 b/tripaldocker/Dockerfile-php8.2-pgsql13 index 3231db7e8..79a4252aa 100644 --- a/tripaldocker/Dockerfile-php8.2-pgsql13 +++ b/tripaldocker/Dockerfile-php8.2-pgsql13 @@ -1,6 +1,6 @@ FROM php:8.2-apache-bullseye -ARG drupalversion='10.1.x-dev' +ARG drupalversion='~10.1.0' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4.x-dev on Drupal 10.1.0" \ + --site-name="Tripal 4.x-dev on Drupal ${drupalversion}" \ && service apache2 stop \ && service postgresql stop @@ -213,6 +213,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ + && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web diff --git a/tripaldocker/Dockerfile-php8.3-pgsql13 b/tripaldocker/Dockerfile-php8.3-pgsql13 index 26de7c345..1344a7072 100644 --- a/tripaldocker/Dockerfile-php8.3-pgsql13 +++ b/tripaldocker/Dockerfile-php8.3-pgsql13 @@ -1,6 +1,6 @@ FROM php:8.3-apache-bullseye -ARG drupalversion='10.2.x-dev' +ARG drupalversion='~10.2.0' ARG modules='devel devel_php' ARG chadoschema='chado' ARG installchado=TRUE @@ -178,7 +178,7 @@ RUN cd /var/www/drupal \ --account-name=drupaladmin \ --account-pass=some_admin_password \ --site-mail="drupaladmin@localhost" \ - --site-name="Tripal 4.x-dev on Drupal 10.2.0" \ + --site-name="Tripal 4.x-dev on Drupal ${drupalversion}" \ && service apache2 stop \ && service postgresql stop @@ -213,6 +213,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ ## Make global commands. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ + && ln -s /var/www/drupal /var/www/drupal9 ## Set the working directory to DRUPAL_ROOT WORKDIR /var/www/drupal/web From 583a0f9110609c24de5c16c0b47ffd3e7b3fbf84 Mon Sep 17 00:00:00 2001 From: Douglas Senalik Date: Wed, 7 Feb 2024 10:35:11 -0600 Subject: [PATCH 11/16] comment added for drupal9 symlink --- tripaldocker/Dockerfile-php8.1-pgsql13 | 2 +- tripaldocker/Dockerfile-php8.2-pgsql13 | 2 +- tripaldocker/Dockerfile-php8.3-pgsql13 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tripaldocker/Dockerfile-php8.1-pgsql13 b/tripaldocker/Dockerfile-php8.1-pgsql13 index cbd2ffdfd..0f51f18bb 100644 --- a/tripaldocker/Dockerfile-php8.1-pgsql13 +++ b/tripaldocker/Dockerfile-php8.1-pgsql13 @@ -210,7 +210,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ && mv /app/tripaldocker/default_files/xdebug/xdebug_toggle.sh /usr/bin/xdebug_toggle.sh \ && echo "\$config['system.logging']['error_level'] = 'verbose';" >> /var/www/drupal/web/sites/default/settings.php -## Make global commands. +## Make global commands. Symlink for drupal9 is for backward compatibility. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ && ln -s /var/www/drupal /var/www/drupal9 diff --git a/tripaldocker/Dockerfile-php8.2-pgsql13 b/tripaldocker/Dockerfile-php8.2-pgsql13 index 79a4252aa..e9e045510 100644 --- a/tripaldocker/Dockerfile-php8.2-pgsql13 +++ b/tripaldocker/Dockerfile-php8.2-pgsql13 @@ -210,7 +210,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ && mv /app/tripaldocker/default_files/xdebug/xdebug_toggle.sh /usr/bin/xdebug_toggle.sh \ && echo "\$config['system.logging']['error_level'] = 'verbose';" >> /var/www/drupal/web/sites/default/settings.php -## Make global commands. +## Make global commands. Symlink for drupal9 is for backward compatibility. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ && ln -s /var/www/drupal /var/www/drupal9 diff --git a/tripaldocker/Dockerfile-php8.3-pgsql13 b/tripaldocker/Dockerfile-php8.3-pgsql13 index 1344a7072..8288840ad 100644 --- a/tripaldocker/Dockerfile-php8.3-pgsql13 +++ b/tripaldocker/Dockerfile-php8.3-pgsql13 @@ -210,7 +210,7 @@ RUN mv /app/tripaldocker/init_scripts/supervisord.conf /etc/supervisord.conf \ && mv /app/tripaldocker/default_files/xdebug/xdebug_toggle.sh /usr/bin/xdebug_toggle.sh \ && echo "\$config['system.logging']['error_level'] = 'verbose';" >> /var/www/drupal/web/sites/default/settings.php -## Make global commands. +## Make global commands. Symlink for drupal9 is for backward compatibility. RUN ln -s /var/www/drupal/vendor/phpunit/phpunit/phpunit /usr/local/bin/ \ && ln -s /var/www/drupal/vendor/drush/drush/drush /usr/local/bin/ \ && ln -s /var/www/drupal /var/www/drupal9 From a5a1f292d73904cd5cfacb422e922b815865e0ea Mon Sep 17 00:00:00 2001 From: Douglas Senalik Date: Wed, 7 Feb 2024 11:14:49 -0600 Subject: [PATCH 12/16] fix unserialize error in GFF3 importer --- tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php b/tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php index d50197e7d..3ea7a20ff 100644 --- a/tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php +++ b/tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php @@ -1920,6 +1920,7 @@ private function getCachedFeature($findex) { ['%findex' => $findex, '%file' -> $this->gff_cache_file])); } $feature = fgets($this->gff_cache_file); + $feature = rtrim($feature, "\n"); $feature = unserialize($feature); return $feature; } From 1c5cc49f5a159a92f94d3394a59bf1319704818f Mon Sep 17 00:00:00 2001 From: dsenalik Date: Thu, 8 Feb 2024 10:29:44 -0600 Subject: [PATCH 13/16] move tripal_chado route tests to tripal_chado module --- tripal/.tripal.routing.yml.swp | Bin 0 -> 1024 bytes .../TripalRoutePermissionsTest.php | 12 +-- .../TripalChadoRoutePermissionsTest.php | 98 ++++++++++++++++++ 3 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 tripal/.tripal.routing.yml.swp rename tripal/tests/src/Functional/{ => Permissions}/TripalRoutePermissionsTest.php (97%) create mode 100644 tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php diff --git a/tripal/.tripal.routing.yml.swp b/tripal/.tripal.routing.yml.swp new file mode 100644 index 0000000000000000000000000000000000000000..e8675048a2f04a3bed1b7ac85bb1673c944d4fe9 GIT binary patch literal 1024 zcmYc?$V<%2S1{8vVn6|w8(A3=Q*tx&P(-nF%94vp^~y7gll4+lO0g>ei 'admin/tripal', 'Registration' => 'admin/tripal/register', 'Jobs' => 'admin/tripal/tripal_jobs', - 'Data Loaders' => 'admin/tripal/loaders', 'Data Collections' => 'admin/tripal/data-collections', 'Tripal Managed Files' => 'admin/tripal/files', 'Tripal Content Terms' => 'admin/tripal/config/terms', - 'Data Storage' => 'admin/tripal/storage', - // Under Drupal ~10.2, if there are no extensions present, and there aren't, then - // we won't be able to access the 'admin/tripal/extension' menu, even as admin. - // To test, we would have to create an extension first. - // 'Extensions' => 'admin/tripal/extension', ]; $userAuthenticatedOnly = $this->drupalCreateUser(); - // Drupal 10.2 tightens permissions, we need additional permissions to access loaders and files - $userTripalAdmin = $this->drupalCreateUser(['administer tripal', 'allow tripal import', 'admin tripal files']); + // Drupal 10.2 tightens permissions, second permission is needed to access files path + $userTripalAdmin = $this->drupalCreateUser(['administer tripal', 'admin tripal files']); // First check all the URLs with no user logged in. // This checks the anonymous user cannot access these pages. diff --git a/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php new file mode 100644 index 000000000..3c8b6c5e6 --- /dev/null +++ b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php @@ -0,0 +1,98 @@ +getSession(); + + // The URLs to check with the key being the label expected in the + // Tripal admin menu listing. + $urls = [ + 'Data Loaders' => 'admin/tripal/loaders', + 'Data Storage' => 'admin/tripal/storage', + // Under Drupal ~10.2, if there are no extensions present, and there aren't, then + // we won't be able to access the 'admin/tripal/extension' menu, even as admin. + // To test, we would have to create an extension first. + // 'Extensions' => 'admin/tripal/extension', + ]; + + $userAuthenticatedOnly = $this->drupalCreateUser(); + // Drupal 10.2 tightens permissions, second permission is needed to access importers + $userTripalAdmin = $this->drupalCreateUser(['administer tripal', 'allow tripal import']); + + // First check all the URLs with no user logged in. + // This checks the anonymous user cannot access these pages. + foreach ($urls as $title => $path) { + $html = $this->drupalGet($path); + $status_code = $session->getStatusCode(); + $this->assertEquals(403, $status_code, "The anonymous user should not be able to access this admin page: $title."); + } + + // Next check all the URLs with the authenticated, unprivileged user. + // This checks generic authenticated users cannot access these pages. + $this->drupalLogin($userAuthenticatedOnly); + $this->assertFalse($userAuthenticatedOnly->hasPermission('administer tripal'), "The unprivileged user should not have the 'administer tripal' permission."); + foreach ($urls as $title => $path) { + $html = $this->drupalGet($path); + $status_code = $session->getStatusCode(); + $this->assertEquals(403, $status_code, "The unprivileged user should not be able to access this admin page: $title."); + } + + // Finally check all URLs with the authenticated, privileged user. + // This checks privileged users can access these pages. + $this->drupalLogin($userTripalAdmin); + $this->assertTrue($this->drupalUserIsLoggedIn($userTripalAdmin), "The privileged user should be logged in."); + $this->assertTrue($userTripalAdmin->hasPermission('administer tripal'), "The privileged user should have the 'administer tripal' permission."); + foreach ($urls as $title => $path) { + $html = $this->drupalGet($path); + $status_code = $session->getStatusCode(); + $this->assertEquals(200, $status_code, "The privileged user should be able to access this admin page: $title which should be at '$path'."); + } + + // Test that the Tripal admin menu includes the above links. + // We use try/catch here because WebAssert throws exceptions which are not very readable. + $assert = $this->assertSession(); + $html = $this->drupalGet('admin/tripal'); + unset($urls['Tripal']); + foreach ($urls as $label => $path) { + // -- Find links with the label. + try { + $assert->linkExists($label, 0); + } + catch (Exception $e) { + $this->assertTrue(FALSE, "The '$label' link should exist in the Tripal admin listing."); + } + + // -- Find links with the URL/path. + try { + $assert->linkByHrefExists($path, 0); + } + catch (Exception $e) { + $this->assertTrue(FALSE, "The '$path' link should exist in the Tripal admin listing."); + } + } + } + +} From 045e68bf8781d306c2435a4ce766e5df893f66e9 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Thu, 8 Feb 2024 10:39:29 -0600 Subject: [PATCH 14/16] move extensions back to tripal --- .../src/Functional/Permissions/TripalRoutePermissionsTest.php | 4 ++++ .../Permissions/TripalChadoRoutePermissionsTest.php | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tripal/tests/src/Functional/Permissions/TripalRoutePermissionsTest.php b/tripal/tests/src/Functional/Permissions/TripalRoutePermissionsTest.php index 1026baf5d..5802c1fe7 100644 --- a/tripal/tests/src/Functional/Permissions/TripalRoutePermissionsTest.php +++ b/tripal/tests/src/Functional/Permissions/TripalRoutePermissionsTest.php @@ -38,6 +38,10 @@ public function testTripalAdminPages() { 'Data Collections' => 'admin/tripal/data-collections', 'Tripal Managed Files' => 'admin/tripal/files', 'Tripal Content Terms' => 'admin/tripal/config/terms', + // Under Drupal ~10.2, if there are no extensions present, and there aren't, then + // we won't be able to access the 'admin/tripal/extension' menu, even as admin. + // To test, we would have to create an extension first. + // 'Extensions' => 'admin/tripal/extension', ]; $userAuthenticatedOnly = $this->drupalCreateUser(); diff --git a/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php index 3c8b6c5e6..6196f357e 100644 --- a/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php +++ b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php @@ -32,10 +32,6 @@ public function testTripalChadoAdminPages() { $urls = [ 'Data Loaders' => 'admin/tripal/loaders', 'Data Storage' => 'admin/tripal/storage', - // Under Drupal ~10.2, if there are no extensions present, and there aren't, then - // we won't be able to access the 'admin/tripal/extension' menu, even as admin. - // To test, we would have to create an extension first. - // 'Extensions' => 'admin/tripal/extension', ]; $userAuthenticatedOnly = $this->drupalCreateUser(); From ece107ad2d329c712c077f9c26cb8d3ff5d962a6 Mon Sep 17 00:00:00 2001 From: dsenalik Date: Thu, 8 Feb 2024 11:12:05 -0600 Subject: [PATCH 15/16] Remove unneeded modules --- .../Functional/Permissions/TripalChadoRoutePermissionsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php index 6196f357e..8328d2c3a 100644 --- a/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php +++ b/tripal_chado/tests/src/Functional/Permissions/TripalChadoRoutePermissionsTest.php @@ -18,7 +18,7 @@ class TripalChadoRoutePermissionsTest extends BrowserTestBase { protected $defaultTheme = 'stark'; - protected static $modules = ['tripal', 'tripal_chado', 'file', 'field_ui']; + protected static $modules = ['tripal', 'tripal_chado']; /** * Test all the base Tripal Chado admin paths. From 04ba37035300518cba1e65a36a80a8a4da5c1a01 Mon Sep 17 00:00:00 2001 From: Lacey Sanderson Date: Thu, 8 Feb 2024 15:23:31 -0600 Subject: [PATCH 16/16] Update the latest tag to point to D10.2 + PHP8.3 --- .github/workflows/MAIN-buildDocker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MAIN-buildDocker.yml b/.github/workflows/MAIN-buildDocker.yml index 78b4028be..3ca104197 100644 --- a/.github/workflows/MAIN-buildDocker.yml +++ b/.github/workflows/MAIN-buildDocker.yml @@ -68,8 +68,8 @@ jobs: buildArgs: "drupalversion=${{ matrix.drupal-version }}" labels: 'tripal.branch=4.x,drupal.version.label="${{ matrix.label }}",php.version.label="${{ matrix.php-version }}", postgresql.version.label="${{ matrix.pgsql-version }}"' - uses: mr-smithers-excellent/docker-build-push@v6 - name: Build latest using 10.0.x-dev, PHP 8.1, PgSQL 13 - if: ${{ matrix.drupal-version == '10.0.x-dev' && matrix.php-version == '8.1' && matrix.pgsql-version == '13' }} + name: Build latest using 10.2.x-dev, PHP 8.3, PgSQL 13 + if: ${{ matrix.drupal-version == '10.2.x-dev' && matrix.php-version == '8.3' && matrix.pgsql-version == '13' }} with: image: tripalproject/tripaldocker tags: latest