fix e2e tag paging, bump fallback versions

This commit is contained in:
Ron Rennick 2021-08-19 11:02:30 -03:00
parent c364a13c71
commit 36563390bc
3 changed files with 20 additions and 15 deletions

View File

@ -8,6 +8,9 @@
- `downloadZip( fileUrl, downloadPath )` downloads a plugin zip file from a remote location to the provided path. - `downloadZip( fileUrl, downloadPath )` downloads a plugin zip file from a remote location to the provided path.
- Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository. - Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository.
- Added `DEFAULT_TIMEOUT_OVERRIDE` that allows passing in a time in milliseconds to override the default Jest and Puppeteer timeouts. - Added `DEFAULT_TIMEOUT_OVERRIDE` that allows passing in a time in milliseconds to override the default Jest and Puppeteer timeouts.
- Fix latest version tag search paging logic
- Bump PHP fallback version to 7.4.22
- Bump MariahDB fallback version to 10.6.4
# 0.2.2 # 0.2.2

View File

@ -19,7 +19,7 @@ if [[ $1 ]]; then
if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
export DC_PHP_VERSION=$TRAVIS_PHP_VERSION export DC_PHP_VERSION=$TRAVIS_PHP_VERSION
else else
export DC_PHP_VERSION="7.4.9" export DC_PHP_VERSION="7.4.22"
fi fi
if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
@ -28,7 +28,7 @@ if [[ $1 ]]; then
if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION
else else
export DC_MARIADB_VERSION="10.5.5" export DC_MARIADB_VERSION="10.6.4"
fi fi
if [[ $1 == 'up' ]]; then if [[ $1 == 'up' ]]; then

View File

@ -84,21 +84,23 @@ function findLatestVersion( image, nameSearch ) {
// Repeat the requests until we've read as many pages as necessary. // Repeat the requests until we've read as many pages as necessary.
const paginationFn = function ( result ) { const paginationFn = function ( result ) {
// We can save on unnecessarily loading every page by short-circuiting when if ( result.latestTag ) {
// the number of days between the first recorded version and the // We can save on unnecessarily loading every page by short-circuiting when
// one from this page becomes excessive. // the number of days between the first recorded version and the
const lastUpdate = Date.parse( result.latestTag.last_updated ); // one from this page becomes excessive.
if ( ! earliestUpdated ) { const lastUpdate = Date.parse( result.latestTag.last_updated );
earliestUpdated = lastUpdate; if ( ! earliestUpdated ) {
} else { earliestUpdated = lastUpdate;
const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 ); } else {
if ( daysSinceEarliestUpdate > 15 ) { const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 );
result.isLastPage = true; if ( daysSinceEarliestUpdate > 15 ) {
result.isLastPage = true;
}
} }
}
if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) { if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) {
latestVersion = result.latestTag.semver; latestVersion = result.latestTag.semver;
}
} }
if ( ! result.isLastPage ) { if ( ! result.isLastPage ) {