Skip to content

Commit 8453432

Browse files
Pantheon Automationgreg-1-anderson
Pantheon Automation
authored andcommitted
Update to Drupal 7.99. For more information, see https://www.drupal.org/project/drupal/releases/7.99
1 parent ca0e4af commit 8453432

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+911
-113
lines changed

.gitlab-ci.yml

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
################
2+
# Drupal GitLabCI template
3+
#
4+
# Based off GitlabCI templates project: https://git.drupalcode.org/project/gitlab_templates
5+
# Guide: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-drupal/gitlab-ci
6+
#
7+
# With thanks to:
8+
# - The GitLab Acceleration Initiative participants
9+
# - DrupalSpoons
10+
################
11+
12+
################
13+
# Includes
14+
#
15+
# Additional configuration can be provided through includes.
16+
# One advantage of include files is that if they are updated upstream, the
17+
# changes affect all pipelines using that include.
18+
#
19+
# Includes can be overriden by re-declaring anything provided in an include,
20+
# here in gitlab-ci.yml
21+
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
22+
################
23+
24+
include:
25+
- project: $_GITLAB_TEMPLATES_REPO
26+
ref: $_GITLAB_TEMPLATES_REF
27+
file:
28+
- '/includes/include.drupalci.variables.yml'
29+
- '/includes/include.drupalci.workflows.yml'
30+
31+
################
32+
# Variables
33+
#
34+
# Overriding variables
35+
# - To override one or more of these variables, simply declare your own
36+
# variables keyword.
37+
# - Keywords declared directly in .gitlab-ci.yml take precedence over include
38+
# files.
39+
# - Documentation: https://docs.gitlab.com/ee/ci/variables/
40+
# - Predefined variables: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
41+
#
42+
################
43+
44+
variables:
45+
_TARGET_PHP: "8.1"
46+
CONCURRENCY: 15
47+
GIT_DEPTH: "3"
48+
49+
################
50+
# Stages
51+
#
52+
# Each job is assigned to a stage, defining the order in which the jobs are executed.
53+
# Jobs in the same stage run in parallel.
54+
#
55+
# If all jobs in a stage succeed, the pipeline will proceed to the next stage.
56+
# If any job in the stage fails, the pipeline will exit early.
57+
################
58+
59+
stages:
60+
################
61+
# Code quality checks
62+
#
63+
# This stage includes any codebase validation that we want to perform
64+
# before running functional tests.
65+
################
66+
- 🪄 Lint
67+
68+
################
69+
# Test
70+
#
71+
# The test phase actually executes the tests, as well as gathering results
72+
# and artifacts.
73+
################
74+
- 🗜️ Test
75+
76+
#############
77+
# Templates #
78+
#############
79+
80+
.run-on-mr: &run-on-mr
81+
if: $CI_PIPELINE_SOURCE == "merge_request_event"
82+
83+
.run-on-mr-manual: &run-on-mr-manual
84+
if: $CI_PIPELINE_SOURCE == "merge_request_event"
85+
when: manual
86+
allow_failure: true
87+
88+
.run-on-commit: &run-on-commit
89+
if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
90+
91+
.run-daily: &run-daily
92+
if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project"
93+
94+
.default-stage: &default-stage
95+
stage: 🗜️ Test
96+
trigger:
97+
# Rely on the status of the child pipeline.
98+
strategy: depend
99+
include:
100+
- local: .gitlab-ci/pipeline.yml
101+
rules:
102+
- <<: *run-on-commit
103+
- <<: *run-on-mr-manual
104+
105+
################
106+
# Jobs
107+
#
108+
# Jobs define what scripts are actually executed in each stage.
109+
################
110+
111+
'🧹 PHP Compatibility checks (PHPCS)':
112+
stage: 🪄 Lint
113+
variables:
114+
PHPCS_PHP_VERSION: "5.6"
115+
KUBERNETES_CPU_REQUEST: "16"
116+
interruptible: true
117+
allow_failure: true
118+
retry:
119+
max: 2
120+
when:
121+
- unknown_failure
122+
- api_failure
123+
- stuck_or_timeout_failure
124+
- runner_system_failure
125+
- scheduler_failure
126+
image:
127+
name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
128+
artifacts:
129+
expire_in: 6 mos
130+
paths:
131+
- phpcs-quality-report.json
132+
reports:
133+
codequality: phpcs-quality-report.json
134+
rules:
135+
- <<: *run-on-mr
136+
before_script:
137+
- echo "{}" > composer.json
138+
- composer config allow-plugins true -n
139+
- composer require --dev drupal/coder:^8.2@stable micheh/phpcs-gitlab phpcompatibility/php-compatibility dealerdirect/phpcodesniffer-composer-installer
140+
- export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}
141+
script:
142+
- git fetch -vn --depth=$GIT_DEPTH "${CI_MERGE_REQUEST_PROJECT_URL:-origin}" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
143+
- export MODIFIED=`git diff --name-only refs/heads/$TARGET_BRANCH|while read r;do echo "$CI_PROJECT_DIR/$r";done|tr "\n" " "`
144+
- echo -e "$MODIFIED" | tr " " "\n"
145+
- echo "If this list contains more files than what you changed, then you need to rebase your branch."
146+
- vendor/bin/phpcs --basepath=$CI_PROJECT_DIR --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json --report-full --report-summary --standard=PHPCompatibility --runtime-set testVersion $PHPCS_PHP_VERSION --extensions=php,module,inc,install,test,profile,theme $MODIFIED
147+
148+
# Default job.
149+
'PHP 8.1 MySQL 5.7':
150+
<<: *default-stage
151+
variables:
152+
_TARGET_PHP: "8.1"
153+
_TARGET_DB: "mysql-5.7"
154+
rules:
155+
- <<: *run-on-commit
156+
- <<: *run-on-mr
157+
158+
'PHP 5.6 MySQL 5.5':
159+
<<: *default-stage
160+
variables:
161+
_TARGET_PHP: "5.6"
162+
_TARGET_DB: "mysql-5.5"
163+
164+
'PHP 7.2 MySQL 5.7':
165+
<<: *default-stage
166+
variables:
167+
_TARGET_PHP: "7.2"
168+
_TARGET_DB: "mysql-5.7"
169+
170+
'PHP 7.4 MySQL 5.7':
171+
<<: *default-stage
172+
variables:
173+
_TARGET_PHP: "7.4"
174+
_TARGET_DB: "mysql-5.7"
175+
176+
'PHP 8.0 MySQL 5.7':
177+
<<: *default-stage
178+
variables:
179+
_TARGET_PHP: "8.0"
180+
_TARGET_DB: "mysql-5.7"
181+
182+
'PHP 8.2 MySQL 8':
183+
<<: *default-stage
184+
variables:
185+
_TARGET_PHP: "8.2"
186+
_TARGET_DB: "mysql-8"
187+
188+
'PHP 7.4 PostgreSQL 9.5':
189+
<<: *default-stage
190+
variables:
191+
_TARGET_PHP: "7.4"
192+
_TARGET_DB: "pgsql-9.5"
193+
194+
'PHP 8.1 PostgreSQL 14.1':
195+
<<: *default-stage
196+
variables:
197+
_TARGET_PHP: "8.1"
198+
_TARGET_DB: "pgsql-14.1"
199+
200+
'PHP 7.4 SQLite 3.27.0':
201+
<<: *default-stage
202+
variables:
203+
_TARGET_PHP: "7.4"
204+
_TARGET_DB: "sqlite-3"
205+
206+
'PHP 8.1 MariaDB 10.3.22':
207+
<<: *default-stage
208+
variables:
209+
_TARGET_PHP: "8.1"
210+
_TARGET_DB: "mariadb-10.3.22"

.gitlab-ci/.htaccess-parent

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Redirect everything via the subdirectory.
2+
3+
RewriteEngine on
4+
RewriteRule (.*) subdirectory/$1 [L]

.gitlab-ci/pipeline.yml

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
stages:
2+
################
3+
# Test
4+
#
5+
# The test phase actually executes the tests, as well as gathering results
6+
# and artifacts.
7+
################
8+
- 🗜️ Test
9+
10+
#############
11+
# Templates #
12+
#############
13+
14+
.default-job-settings: &default-job-settings
15+
interruptible: true
16+
allow_failure: false
17+
retry:
18+
max: 2
19+
when:
20+
- unknown_failure
21+
- api_failure
22+
- stuck_or_timeout_failure
23+
- runner_system_failure
24+
- scheduler_failure
25+
image:
26+
name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
27+
rules:
28+
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
29+
30+
.test-variables: &test-variables
31+
FF_NETWORK_PER_BUILD: 1
32+
SIMPLETEST_BASE_URL: http://localhost/subdirectory
33+
DB_DRIVER: mysql
34+
MYSQL_ROOT_PASSWORD: root
35+
MYSQL_DATABASE: drupal
36+
MYSQL_USER: drupaltestbot
37+
MYSQL_PASSWORD: drupaltestbotpw
38+
POSTGRES_DB: drupaltestbot
39+
POSTGRES_USER: drupaltestbot
40+
POSTGRES_PASSWORD: drupaltestbotpw
41+
CI_PARALLEL_NODE_INDEX: $CI_NODE_INDEX
42+
CI_PARALLEL_NODE_TOTAL: $CI_NODE_TOTAL
43+
44+
.with-database: &with-database
45+
name: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB:production
46+
alias: database
47+
48+
.with-chrome: &with-chrome
49+
name: $_CONFIG_DOCKERHUB_ROOT/chromedriver:production
50+
alias: chrome
51+
entrypoint:
52+
- chromedriver
53+
- "--no-sandbox"
54+
- "--log-path=/tmp/chromedriver.log"
55+
- "--verbose"
56+
- "--whitelisted-ips="
57+
58+
.phpunit-artifacts: &phpunit-artifacts
59+
artifacts:
60+
when: always
61+
expire_in: 6 mos
62+
reports:
63+
junit: ./sites/default/files/simpletest/*.xml
64+
paths:
65+
- ./sites/default/files/simpletest
66+
67+
.setup-webroot: &setup-webserver
68+
before_script:
69+
- ln -s $CI_PROJECT_DIR /var/www/html/subdirectory
70+
- cp $CI_PROJECT_DIR/.gitlab-ci/.htaccess-parent /var/www/html/.htaccess
71+
- sudo service apache2 start
72+
73+
.get-simpletest-db: &get-simpletest-db
74+
- |
75+
# Assume SQLite unless we have another known target.
76+
export SIMPLETEST_DB=sqlite://localhost/$CI_PROJECT_DIR/sites/default/files/db.sqlite
77+
[[ $_TARGET_DB == mysql* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
78+
[[ $_TARGET_DB == mariadb* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
79+
[[ $_TARGET_DB == pgsql* ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB
80+
- echo "SIMPLETEST_DB = $SIMPLETEST_DB"
81+
82+
.prepare-dirs: &prepare-dirs
83+
- mkdir -p ./sites/default/files ./sites/default/files/simpletest ./build/logs/junit
84+
- chown -R www-data:www-data ./sites ./build/logs/junit /var/www/
85+
- sudo -u www-data git config --global --add safe.directory $CI_PROJECT_DIR
86+
87+
.install-drupal: &install-drupal
88+
- sudo -u www-data /usr/local/bin/drush si -y --db-url=$SIMPLETEST_DB --clean-url=0 --account-name=admin --account-pass=drupal [email protected]
89+
- sudo -u www-data /usr/local/bin/drush vset simpletest_clear_results '0'
90+
- sudo -u www-data /usr/local/bin/drush vset simpletest_verbose '1'
91+
- sudo -u www-data /usr/local/bin/drush en -y simpletest
92+
93+
.run-tests: &run-tests
94+
script:
95+
- *get-simpletest-db
96+
- *prepare-dirs
97+
- *install-drupal
98+
# We need to pass this along directly even though it's set in the environment parameters.
99+
- sudo -u www-data php ./scripts/run-tests.sh --color --concurrency "$CONCURRENCY" --url "$SIMPLETEST_BASE_URL" --verbose --fail-only --all --xml "$CI_PROJECT_DIR/sites/default/files/simpletest" --ci-parallel-node-index $CI_PARALLEL_NODE_INDEX --ci-parallel-node-total $CI_PARALLEL_NODE_TOTAL
100+
101+
.run-test-only-tests: &run-test-only-tests
102+
script:
103+
- *get-simpletest-db
104+
- *prepare-dirs
105+
- *install-drupal
106+
- export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}
107+
- git fetch -vn --depth=50 "$CI_MERGE_REQUEST_PROJECT_URL" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
108+
- |
109+
echo "ℹ️ Changes from ${TARGET_BRANCH}"
110+
git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only
111+
echo "1️⃣ Reverting non test changes"
112+
if [[ $(git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --diff-filter=DM --name-only|grep -Ev '.test$'|grep -v .gitlab-ci|grep -v scripts/run-tests.sh) ]]; then
113+
git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --diff-filter=DM --name-only|grep -Ev '.test$'|grep -v .gitlab-ci|grep -v scripts/run-tests.sh|while read file;do
114+
echo "↩️ Reverting $file"
115+
git checkout refs/heads/${TARGET_BRANCH} -- $file;
116+
done
117+
fi
118+
echo "2️⃣ Deleting new files"
119+
if [[ $(git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --diff-filter=A --name-only|grep -Ev '.test$'|grep -v .gitlab-ci|grep -v scripts/run-tests.sh) ]]; then
120+
git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --diff-filter=A --name-only|grep -Ev '.test$'|grep -v .gitlab-ci|grep -v scripts/run-tests.sh|while read file;do
121+
echo "🗑️️ Deleting $file"
122+
git rm $file
123+
done
124+
fi
125+
echo "3️⃣ Running test changes for this branch"
126+
if [[ $(git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only|grep -E '.test$') ]]; then
127+
git diff ${CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only|grep -E ".test$"|while read file;do
128+
sudo -u www-data php ./scripts/run-tests.sh --color --concurrency "$CONCURRENCY" --url "$SIMPLETEST_BASE_URL" --verbose --fail-only --xml "$CI_PROJECT_DIR/sites/default/files/simpletest/test-only" --file "$file"
129+
done
130+
fi
131+
132+
################
133+
# Jobs
134+
#
135+
# Jobs define what scripts are actually executed in each stage.
136+
################
137+
138+
'⚡️ PHPUnit Unit':
139+
<<: [ *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
140+
stage: 🗜️ Test
141+
parallel: 3
142+
services:
143+
- <<: *with-database
144+
- <<: *with-chrome
145+
variables:
146+
<<: *test-variables
147+
CONCURRENCY: "$CONCURRENCY"
148+
KUBERNETES_CPU_REQUEST: "16"
149+
150+
'🩹 Test-only changes':
151+
<<: [ *phpunit-artifacts, *setup-webserver, *run-test-only-tests, *default-job-settings ]
152+
stage: 🗜️ Test
153+
when: manual
154+
interruptible: true
155+
allow_failure: true
156+
variables:
157+
<<: *test-variables
158+
services:
159+
- <<: *with-database
160+
- <<: *with-chrome

CHANGELOG.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Drupal 7.99, 2023-12-06
2+
-----------------------
3+
- Various security improvements
4+
- Various bug fixes, optimizations and improvements
5+
16
Drupal 7.98, 2023-06-07
27
-----------------------
38
- Various security improvements

INSTALL.sqlite.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SQLITE REQUIREMENTS
33
-------------------
44

55
To use SQLite with your Drupal installation, the following requirements must be
6-
met: Server has PHP 5.3 or later with PDO, and the PDO SQLite driver must be
6+
met: Server has PHP 5.6 or later with PDO, and the PDO SQLite driver must be
77
enabled.
88

99
SQLITE DATABASE CREATION

0 commit comments

Comments
 (0)