Wrap IPv6 address in brackets [ ] if needed#36
Merged
laoneo merged 13 commits intojoomla-projects:mainfrom Oct 20, 2024
Merged
Conversation
Update README overview commands (joomla-projects#20)
merge from head repository
Added skip tour (joomla-projects#27)
Improve README (joomla-projects#30)
merge head repository joomla-projects/joomla-cypress
This is one puzzle piece for joomla/joomla-cms#43902
If a port number is provided, wrap IPv6 addresses with square brackets [ ].
* Update README.md Correcting image file name * Use absolute URL to see image in NPM README too
dfb99c9 to
f5455d5
Compare
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the
installJoomlacustom command, ensure square brackets are added around an IPv6 address provided in the Cypress config'sdb_hostfield before to use it in the Joomla Web Installer'shost namefield. This should only be done if it is an IPv6 address, the address is not already enclosed in square brackets, and for PostgreSQL if port number is used.Needed as a puzzle piece for joomla/joomla-cms#43902.
See the Problem
The problem is shown in using JBT >= 1.1.15 (fixed IP-addresses, defaults to unpatched). Notes for this first chapter 'See the problem':
postgresnot the (new)pgdriver. To see the problem it doesn't matter, as the Web Installer is using PHP driver.base_url, not testing Cypress custom database commands, only doing the installation step with Joomla Web Installer.jbt_madbIP address and default port inbranch_44/cypress.config.mjsfile:MySQL (PDO)and host fieldfd00::12is usedPostgreSQL (PDO)driver. Manual configurejbt_pgIP addressfd00:13inbranch_44/cypress.config.mjsfile:PostgreSQL (PDO)and host fieldfd00::13(w/o square brackets!) is usedSummary: In the Cypress System Tests during the installation step (using the Joomla Web Installer), IPv6 addresses currently work only with PostgreSQL. IPv6 addresses are not functional for MariaDB and MySQL, whether using the MySQLi or PDO drivers. Using a non-standard port with IPv6 addresses does not work for any database.
Test this PR Isolated
Testing this
joomla-cypress-36PR without any other patches with all used Joomla CMS branches.👉 For 5.1-dev this updates joomla-cypress from 1.0.3 to 1.1.1 - which is a good idea anyway
jbt_madbIP address and default port in all five branchescypress.config.mjsfiles and verify:MySQL (PDO)and host field[fd00::12]is usedMySQLi,fd00::12MySQL (PDO),fd00::11MySQLi,fd00::11PostgreSQL (PDO),fd00::13fd00::13is usedSummary:
joomla-cypress-36for all five database variants.🎉 Fun fact - this were 30 times the Joomla installation step (5 branches on create + 5 branches x 5 database variants). 🎉
IPv6 with Port Number
Additional patches to see IPv6 addresses working with non-default port for the installation step (PHP database driver), the System Tests (JS database driver used with the custom database commands) and PostgreSQL JS driver are:
Unfortunately, without manually resolving the merge conflicts, all these changes could not be applied to every branch. However, it was possible for the 4.4-dev branch (but in using framework 3) with the follwoing sequence:
pgdriver, as the patch needs npm clean install afterwards:fd00::7and port4712, which is forwarded to MariaDB:[fd00::7]:4712in host fieldMySQLi,fd00::7,4712MySQL (PDO),fd00::7,4711MySQLi,fd00::7,4711PostgreSQL (PDO),fd00::7,4713Summary: ✅ IPv6 addresses can be used in Joomla Web Installer durin the System Tests installation step (PHP driver) and in the System Tests specs with custom database commands (using the JS driver) for all five database variants, including with non-default port numbers. All PRs work independently, and none make the situation worse. The implementation for joomla/joomla-cms#43902 is completed 😄
Complete Testing
To complete joomla/joomla-cms#43902 with all six PRs installed, it needs to be tested that hostname only, hostname with port, IPv6 address only, IPv4 address only and IPv4 address with port still work as expected.
Testing Hostname Only
jbt_madbin host fieldMySQLi,jbt_madb,''MySQL (PDO),jbt_mysql,''MySQLi,jbt_mysql,''PostgreSQL (PDO),jbt_pg,''IPv6 Address Only
As this is always the same procedure, it is automated in bash:
Afterward, the logs are checked for errors:
[fd00::11],[fd00::12]orfd00::13(for PostgreSQL w/o square brackets) in Web Installer host fieldIPv4 Address Only
IPv4 addresses with the default port work the same way. Since the network setup uses a dual-stack configuration with IPv6, no new installation is required. The test is once again automated with:
Afterward, again the logs are checked for errors:
10.0.0.11in Web Installer host fieldHostname and Port Number
Same procedure, using Cypress container id hostname
9a7562bf16dcand port forwardings:Afterward, again the logs are checked for errors:
9a7562bf16dc:4711in Web Installer host fieldjbt_cypressas the hostname for the Cypress container failed with PostgreSQL:could not translate host name "jbt_cypress:4713" to addressThe reason is that underscores are not valid characters in hostnames.
As a result, JBT will need to update all hostnames. e.g. from
jbt_cypress→jbt-cypress😱IPv4 Address and Port Number
Same procedure, using Cypress container IPv4 address
10.0.0.7and the port forwardings:Afterward, again the logs are checked for errors:
10.0.0.7:4711in Web Installer host field