Merge branch 'QA_5_2'

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-02-19 13:58:34 +01:00
commit a2e2ef9501
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
3 changed files with 52 additions and 23 deletions

View File

@ -58,7 +58,6 @@ while [ $# -gt 0 ] ; do
git branch ci
branch="ci"
fi
version="${VERSION_SERIES}+ci"
;;
--help)
echo "Usages:"
@ -96,11 +95,18 @@ while [ $# -gt 0 ] ; do
shift
done
if [ -z "$version" -o -z "$branch" ] ; then
echo "Branch and version have to be specified!"
if [ -z "$branch" ]; then
echo "Branch must be specified!"
exit 1
fi
if [ -z "$version" -a $do_ci -eq 0 ]; then
echo "Version must be specified!"
exit 1
fi
kit_prefix="phpMyAdmin-$version"
# Checks whether remote branch has local tracking branch
ensure_local_branch() {
if ! git branch | grep -q '^..'"$1"'$' ; then
@ -339,15 +345,22 @@ VERSION_FILE=libraries/classes/Version.php
# Keep in sync with update-po script
fetchReleaseFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::VERSION;"
SUFFIX="${1:-}"
php -r "define('VERSION_SUFFIX', '$SUFFIX'); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::VERSION;"
}
fetchVersionSeriesFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::SERIES;"
php -r "define('VERSION_SUFFIX', ''); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::SERIES;"
}
VERSION_FROM_FILE="$(fetchReleaseFromFile)"
VERSION_SERIES_FROM_FILE="$(fetchVersionSeriesFromFile)"
if [ $do_ci -eq 1 ]; then
VERSION_FROM_FILE="$(fetchReleaseFromFile '+ci')"
version="${VERSION_FROM_FILE}"
fi
if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then
echo "This script can not handle ${VERSION_SERIES_FROM_FILE} version series."
echo "Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch."
@ -355,9 +368,10 @@ if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then
exit 1;
fi
echo "The actual configured release is: $(fetchReleaseFromFile)"
echo "The actual configured release is: $VERSION_FROM_FILE"
echo "The actual configured release series is: $VERSION_SERIES_FROM_FILE"
if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
if [ $do_ci -eq 0 -a $do_daily -eq 0 ] ; then
cat <<END
Please ensure you have incremented rc count or version in the repository :
@ -378,16 +392,16 @@ END
if [ "$do_release" != 'y' ]; then
exit 100
fi
echo "The actual configured release is now: $(fetchReleaseFromFile)"
fi
echo "The actual configured release is now: $(fetchReleaseFromFile)"
# Create working copy
mkdir -p release
git worktree prune
workdir=release/phpMyAdmin-$version
workdir_name=phpMyAdmin-$version
workdir=release/$workdir_name
if [ -d $workdir ] ; then
echo "Working directory '$workdir' already exists, please move it out of way"
echo "Working directory '$workdir' already exists, please move it out of the way"
exit 1
fi
@ -407,6 +421,11 @@ if [ $do_daily -eq 1 ] ; then
echo '* setting the version suffix for the snapshot'
sed -i "s/'versionSuffix' => '.*'/'versionSuffix' => '+$today_date.$git_head_short'/" libraries/vendor_config.php
php -l libraries/vendor_config.php
# Fetch it back and refresh $version
VERSION_FROM_FILE="$(fetchReleaseFromFile "+$today_date.$git_head_short")"
version="${VERSION_FROM_FILE}"
echo "The actual configured release is: $VERSION_FROM_FILE"
fi
# Check release version
@ -430,9 +449,10 @@ if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
fi
# Cleanup release dir
LC_ALL=C date -u > RELEASE-DATE-${version}
LC_ALL=C date -u > RELEASE-DATE-$version
# Building documentation
echo "* Running sphinx-build (version: $(sphinx-build --version))"
echo "* Generating documentation"
LC_ALL=C make -C doc html
find doc -name '*.pyc' -print0 | xargs -0 -r rm -f
@ -579,11 +599,11 @@ cd ..
for kit in $KITS ; do
echo "* Building kit: $kit"
# Copy all files
name=phpMyAdmin-$version-$kit
cp -r phpMyAdmin-$version $name
name=$kit_prefix-$kit
cp -r $workdir_name $name
# Cleanup translations
cd phpMyAdmin-$version-$kit
cd $name
./scripts/lang-cleanup.sh $kit
# Remove tests, source code,...
@ -655,12 +675,12 @@ for kit in $KITS ; do
done
# Cleanup
rm -r phpMyAdmin-${version}
rm -r $workdir_name
git worktree prune
# Signing of files with default GPG key
echo "* Signing files"
for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$version-*.xz ; do
for file in $kit_prefix-*.gz $kit_prefix-*.zip $kit_prefix-*.xz ; do
if [ $do_sign -eq 1 ] ; then
gpg --detach-sign --armor $file
fi
@ -669,7 +689,7 @@ for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$versi
done
if [ $do_daily -eq 1 ] ; then
cat > phpMyAdmin-${version}.json << EOT
cat > $kit_prefix.json << EOT
{
"date": "`date --iso-8601=seconds`",
"commit": "$git_head"

View File

@ -26,11 +26,11 @@
<td>
<div class="row">
<span class="d-flex align-items-center col-4">{% trans 'Enter:' %}</span>
<input type="password" name="pma_pw" id="text_pma_change_pw" size="10" class="textfield col-6" spellcheck="false">
<input type="password" name="pma_pw" id="text_pma_change_pw" size="10" class="textfield col-6" spellcheck="false" autocomplete="new-password">
</div>
<div class="row mt-2">
<span class="d-flex align-items-center col-4">{% trans 'Re-type:' %}</span>
<input type="password" name="pma_pw2" id="text_pma_change_pw2" size="10" class="textfield col-6" spellcheck="false">
<input type="password" name="pma_pw2" id="text_pma_change_pw2" size="10" class="textfield col-6" spellcheck="false" autocomplete="new-password">
</div>
</td>
<td class="col-2">

View File

@ -1044,10 +1044,14 @@ class ConfigTest extends AbstractTestCase
*/
public function testGetTempDir(): void
{
$this->object->set('TempDir', sys_get_temp_dir() . DIRECTORY_SEPARATOR);
$dir = realpath(sys_get_temp_dir());
$this->assertDirectoryExists($dir);
$this->assertDirectoryIsWritable($dir);
$this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR);
// Check no double slash is here
$this->assertEquals(
sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'upload',
$dir . DIRECTORY_SEPARATOR . 'upload',
$this->object->getTempDir('upload')
);
}
@ -1056,10 +1060,15 @@ class ConfigTest extends AbstractTestCase
* Test for getUploadTempDir
*
* @group file-system
* @depends testGetTempDir
*/
public function testGetUploadTempDir(): void
{
$this->object->set('TempDir', realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR);
$dir = realpath(sys_get_temp_dir());
$this->assertDirectoryExists($dir);
$this->assertDirectoryIsWritable($dir);
$this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR);
$this->assertEquals(
$this->object->getTempDir('upload'),