Skip to content

Commit

Permalink
Merge branch '4.4-dev' into activate_send_email
Browse files Browse the repository at this point in the history
  • Loading branch information
MacJoom committed Mar 22, 2023
2 parents f6a26c3 + 74d4465 commit 3edd0e6
Show file tree
Hide file tree
Showing 246 changed files with 3,309 additions and 10,445 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
before_test:
# Run openldap docker image
- ps: docker pull bitnami/openldap:2.6.3
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\Codeception\_data\certs:/certificates --env LDAP_ADMIN_USERNAME=admin --env LDAP_ADMIN_PASSWORD=adminpassword --env LDAP_USERS=customuser --env LDAP_PASSWORDS=custompassword --env LDAP_ENABLE_TLS=yes --env LDAP_TLS_CERT_FILE=/certificates/openldap.crt --env LDAP_TLS_KEY_FILE=/certificates/openldap.key --env LDAP_TLS_CA_FILE=/certificates/CA.crt --env BITNAMI_DEBUG=true --env LDAP_CONFIG_ADMIN_ENABLED=yes --env LDAP_CONFIG_ADMIN_USERNAME=admin --env LDAP_CONFIG_ADMIN_PASSWORD=configpassword -d bitnami/openldap:2.6.3
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\certs:/certificates --env LDAP_ADMIN_USERNAME=admin --env LDAP_ADMIN_PASSWORD=adminpassword --env LDAP_USERS=customuser --env LDAP_PASSWORDS=custompassword --env LDAP_ENABLE_TLS=yes --env LDAP_TLS_CERT_FILE=/certificates/openldap.crt --env LDAP_TLS_KEY_FILE=/certificates/openldap.key --env LDAP_TLS_CA_FILE=/certificates/CA.crt --env BITNAMI_DEBUG=true --env LDAP_CONFIG_ADMIN_ENABLED=yes --env LDAP_CONFIG_ADMIN_USERNAME=admin --env LDAP_CONFIG_ADMIN_PASSWORD=configpassword -d bitnami/openldap:2.6.3
# Database setup for MySQL via PowerShell tools
- >
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
Expand Down
74 changes: 15 additions & 59 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
- name: certificates
path: /certificates
commands:
- cp -v tests/Codeception/_data/certs/* /certificates/
- cp -v tests/certs/* /certificates/

- name: composer
image: joomlaprojects/docker-images:php8.2
Expand Down Expand Up @@ -179,6 +179,7 @@ steps:
image: node:current-alpine
commands:
- npm run lint:js
- npm run lint:testjs

- name: prepare_system_tests
depends_on:
Expand All @@ -188,75 +189,33 @@ steps:
- name: cypress-cache
path: /root/.cache/Cypress
commands:
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/cypress\\/output/' codeception.yml
- mv cypress.config.dist.js cypress.config.js
- php libraries/vendor/bin/codecept build
- npx cypress install
- npx cypress verify

- name: phpmin-api-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql mysqli mysql jos_

- name: phpmin-api-postgres
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres pgsql postgres jos_

- name: phpmax-api-mysql
depends_on:
- phpmin-api-mysql
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax mysqli mysql phpmax_

- name: phpmax-api-postgres
depends_on:
- phpmin-api-mysql
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpmax pgsql postgres phpmax_

- name: phpmin-system-mysql
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
- prepare_system_tests
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql mysqli mysql
- bash tests/System/drone-system-run.sh "$(pwd)" cmysql mysqli mysql

- name: phpmin-system-postgres
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
- prepare_system_tests
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres
- bash tests/System/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres

- name: phpmax-system-mysql
depends_on:
Expand All @@ -269,7 +228,7 @@ steps:
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql
- bash tests/System/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql

- name: phpmax-system-postgres
depends_on:
Expand All @@ -282,7 +241,7 @@ steps:
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres
- bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres

- name: phpmin-system-mysql8
depends_on:
Expand All @@ -295,19 +254,20 @@ steps:
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8 mysqli mysql8
- bash tests/System/drone-system-run.sh "$(pwd)" cmysql8 mysqli mysql8

- name: phpmax-system-mysql8
depends_on:
- phpmin-system-mysql8
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8max mysqli mysql8
- bash tests/System/drone-system-run.sh "$(pwd)" cmysql8max mysqli mysql8

- name: artifacts-system-tests
image: joomlaprojects/docker-images:packager
Expand All @@ -318,10 +278,6 @@ steps:
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
- phpmin-api-postgres
environment:
FTP_USERNAME:
from_secret: ftpusername
Expand All @@ -334,7 +290,7 @@ steps:
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
- rclone config create artifacts ftp host ci.joomla.org user $FTP_USERNAME port 21 pass $FTP_PASSWORD
- rclone mkdir artifacts:$PLUGIN_DEST_DIR
- rclone copy tests/cypress/output/ artifacts:$PLUGIN_DEST_DIR
- rclone copy tests/System/output/ artifacts:$PLUGIN_DEST_DIR
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://ci.joomla.org$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
Expand Down Expand Up @@ -433,7 +389,7 @@ steps:
path: /reference
when:
branch:
- 4.3-dev
- 4.4-dev

---
kind: pipeline
Expand Down Expand Up @@ -497,6 +453,6 @@ trigger:

---
kind: signature
hmac: c9d665d46d44aaa66798ce2e9bf7122e7824ba6dd5ebe4a4e7aff05e4e7c7816
hmac: 3457679ef0cd23bde8dd9900016aba663a279aa0c32049c8e37db56676cadd38

...
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ libraries/src/Updater/* @rdeutz @zero-24

# Automated Testing
tests/* @hackwar
tests/Codeception/* @rdeutz
tests/javascript/* @rdeutz
tests/Unit/* @rdeutz
.appveyor.yml @rdeutz @hackwar
.drone.yml @rdeutz @hackwar
codeception.yml @rdeutz @hackwar
phpunit.xml.dist @rdeutz @hackwar
phpunit-pgsql.xml.dist @rdeutz @hackwar

Expand Down
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@

# Test Related Files
/phpunit.xml
selenium.log
composer.phar
/test-install
/.phpunit.result.cache
/tests/Codeception/acceptance.suite.yml
/tests/Codeception/_output/
/tests/Codeception/api.suite.yml


# Vendor directory handling
Expand Down Expand Up @@ -103,10 +99,10 @@ RoboFile.ini
/media/com_media/css/mediamanager.min.css.map

#cypress
/tests/cypress/output/screenshots
!/tests/cypress/output/screenshots/.gitkeep
/tests/cypress/output/videos
!/tests/cypress/output/videos/.gitkeep
/tests/System/output/screenshots
!/tests/System/output/screenshots/.gitkeep
/tests/System/output/videos
!/tests/System/output/videos/.gitkeep
cypress.config.js

# WebAuthn FIDO metadata cache
Expand Down
30 changes: 30 additions & 0 deletions administrator/components/com_admin/postinstall/htaccesssetce.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file contains post-installation message handling for notifying users of a change
* in the default .htaccess file regarding setting the Content-Encoding header.
*/

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Notifies users of a change in the default .htaccess file regarding setting the Content-Encoding header
*
* This check returns true regardless of condition.
*
* @return boolean
*
* @since 4.2.9
*/
function admin_postinstall_htaccesssetce_condition()
{
return true;
}
17 changes: 13 additions & 4 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ protected function updateManifestCaches()
$extensions = ExtensionHelper::getCoreExtensions();

// If we have the search package around, it may not have a manifest cache entry after upgrades from 3.x, so add it to the list
if (File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')) {
if (is_file(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')) {
$extensions[] = ['package', 'pkg_search', '', 0];
}

Expand Down Expand Up @@ -6543,6 +6543,11 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/plugins/finder/tags/tags.php',
// From 4.3.0-beta3 to 4.3.0-beta4
'/layouts/joomla/content/categories_default_items.php',
// From 4.3.0-beta4 to 4.3.0-rc1
'/administrator/components/com_guidedtours/src/Helper/GuidedtoursHelper.php',
'/libraries/vendor/voku/portable-ascii/build/docs/base.md',
'/libraries/vendor/voku/portable-ascii/build/generate_docs.php',
'/libraries/vendor/voku/portable-ascii/build/generate_max_key_length.php',
];

$folders = [
Expand Down Expand Up @@ -7923,13 +7928,17 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/components/com_contact/layouts',
// From 4.2.x to 4.3.0-alpha1
'/libraries/vendor/paragonie/sodium_compat/dist',
// From 4.3.0-beta4 to 4.3.0-rc1
'/libraries/vendor/voku/portable-ascii/build/docs',
'/libraries/vendor/voku/portable-ascii/build',
'/administrator/components/com_guidedtours/src/Helper',
];

$status['files_checked'] = $files;
$status['folders_checked'] = $folders;

foreach ($files as $file) {
if ($fileExists = File::exists(JPATH_ROOT . $file)) {
if ($fileExists = is_file(JPATH_ROOT . $file)) {
$status['files_exist'][] = $file;

if ($dryRun === false) {
Expand Down Expand Up @@ -7967,8 +7976,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
* but an update has put the files back. In that case it exists even if they don't believe in it!
*/
if (
!File::exists(JPATH_ROOT . '/administrator/components/com_search/search.php')
&& File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')
!is_file(JPATH_ROOT . '/administrator/components/com_search/search.php')
&& is_file(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')
) {
File::delete(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Add post-installation message about setting the Content-Encoding header in .htaccess
--
INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
SELECT `extension_id`, 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccesssetce.php', 'admin_postinstall_htaccesssetce_condition', '4.2.9', 1 FROM `#__extensions` WHERE `name` = 'files_joomla';

0 comments on commit 3edd0e6

Please sign in to comment.