Skip to content

[6.0] Chunked download for the Joomla Update process #43489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: 6.0-dev
Choose a base branch
from

Conversation

MacJoom
Copy link
Contributor

@MacJoom MacJoom commented May 19, 2024

Please read the instructions carefully! Needs a new Joomla Installation and access to the joomla files (no Patch Tester)

Summary of Changes

  • Introduce a new download process, first checks for the availability of the download source with a configurable timeout, gets filesize at the same time
  • Does a chunked download (disabled by default, see options in update component)
  • Fixes problem that only the first mirror was used - thanks to @Septdir
  • Logs the download source, logs chunked download

Based on the #39280 from @nikosdion - thank you!

Testing Instructions

Cannot be tested using Patch Tester as there are NPM resources changed and need the joomla package to build (use prebuilt packages)
You need access to your joomla installation (e.g. FTP)

  • Download the prebuild package under the checks below.
  • Install Joomla
  • Configure the options in the Update Component under Fine-tuning (Chunked downloads is disabled by default), the timeout in seconds for the first call to the downloadsite can be set there.
  • Test with Chunked downloads disabled and enabled, try out different chunk sizes
  • Manually modify libraries/src/Version.php: Set public const MINOR_VERSION = 1
    this way an update to 5.1.0 stable will be proposed since EXTRA_VERSION is on alpha1-dev (if not set it to alpha1-dev)
    you cannot update to 5.2.0 versions since there are no packages yet.

For experts only:
You can simulate an unavailable downloadserver with a setting in /etc/hosts of your server:
0.0.0.1 s3-us-west-2.amazonaws.com
and/or
0.0.0.1 objects.githubusercontent.com

REMEMBER: Your installation will be overwritten by the update! After the update your site will be on 5.1!

Actual result BEFORE applying this Pull Request

  • Update sometimes fails because download may timeout
  • Update sometimes fails because download fails on unavailable mirror

Expected result AFTER applying this Pull Request

  • Update works as before
  • Chunked download may fix problems with slow downloads

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@MacJoom MacJoom requested review from rdeutz and zero-24 as code owners May 19, 2024 12:51
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.2-dev labels May 19, 2024
@MacJoom MacJoom closed this May 19, 2024
@Septdir
Copy link
Contributor

Septdir commented May 19, 2024

That restoring mirrors is not enough just removing unset.
If you want to restore their work, check out my PR.
There the very principle of working with mirrors was updated. And it’s not about timeout, of course, it’s needed to exclude non-working servers, but it doesn’t affect the very principle of receiving a link.

@MacJoom
Copy link
Contributor Author

MacJoom commented May 19, 2024

That restoring mirrors is not enough just removing unset. If you want to restore their work, check out my PR. There the very principle of working with mirrors was updated. And it’s not about timeout, of course, it’s needed to exclude non-working servers, but it doesn’t affect the very principle of receiving a link.

Ok thanks - i will look into it further. However in my tests i have all the expected download servers in the array.

@MacJoom MacJoom reopened this May 19, 2024
@Septdir
Copy link
Contributor

Septdir commented May 20, 2024

Another option is to completely abandon the iteration over all mirrors and give users the choice of which mirror to download from.

For example, I could choose Github on my end, while someone else might keep Amazon. Someone else might choose the third mirror.

Such an approach would eliminate the need to iterate through mirrors and give users the option.
"If the download fails, try switching the mirror in the settings."
A list of mirrors, just a select box with preset values.

This way, you can comfortably attempt to implement chunks while reducing the script execution time.

MacJoom and others added 2 commits May 21, 2024 10:45
*
* @return void
*
* @since 2.5.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 2.5.4
* @since __DEPLOY_VERSION__

/**
* Start the installation of the new Joomla! version
*
* @return void
*
* @since 2.5.4
*/
public function install()
public function install(): void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public function install(): void
public function install()

b/c break

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component's not subject to b/c policy?

@MacJoom MacJoom marked this pull request as draft May 26, 2024 18:06
@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev September 2, 2024 08:51
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.2] Chunked download for the Joomla Update process [5.3] Chunked download for the Joomla Update process Sep 2, 2024
@Hackwar Hackwar removed the PR-5.2-dev label Sep 3, 2024
@zero-24 zero-24 removed their request for review September 15, 2024 20:23
@HLeithner HLeithner changed the base branch from 5.3-dev to 6.0-dev March 4, 2025 17:20
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 6.0-dev.

@HLeithner HLeithner changed the title [5.3] Chunked download for the Joomla Update process [6.0] Chunked download for the Joomla Update process Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@MacJoom MacJoom moved this to Draft in PR Cleanup May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.0-dev
Projects
Status: Draft
Development

Successfully merging this pull request may close these issues.

9 participants