Skip to content
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

Create many tiny artifacts for faster download #2951

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Nov 14, 2024

And not escaping the constraints many systems have on /tmp size. If someone installs multiple php versions at once, we still download the full package.

The full package also remains available for offline installations of multiple targets for now.

@bwoebi bwoebi requested a review from a team as a code owner November 14, 2024 11:11
@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.21%. Comparing base (1f33697) to head (a9501c4).
Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2951   +/-   ##
=========================================
  Coverage     72.21%   72.21%           
  Complexity     2529     2529           
=========================================
  Files           136      136           
  Lines         14452    14452           
  Branches        991      991           
=========================================
  Hits          10436    10436           
  Misses         3472     3472           
  Partials        544      544           
Flag Coverage Δ
appsec-extension 68.57% <ø> (ø)
tracer-php 73.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f33697...a9501c4. Read the comment docs.

@bwoebi bwoebi force-pushed the bob/tiny-artifacts branch 2 times, most recently from 177c467 to 3a1188d Compare November 14, 2024 15:09
And not escaping the constraints many systems have on /tmp size.
If someone installs multiple php versions at once, we still download the full package.

The full package also remains available for offline installations of multiple targets for now.

Signed-off-by: Bob Weinand <[email protected]>
@bwoebi bwoebi force-pushed the bob/tiny-artifacts branch from 3a1188d to 37efa3b Compare November 14, 2024 17:24
@@ -1444,12 +1492,18 @@ function download($url, $destination)
curl_setopt($ch, CURLOPT_NOPROGRESS, false);
$progress_counter = 0;
$return = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 404) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks weird to me.
IIUC, at the first download attempt (for a specific version), if curl is installed, we are going to try only with curl.
Then at the second attempt (full package), this could create an infinite loop if github (or a proxy or whatever) returns a 404.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right, I messed that up.

Copy link
Collaborator Author

@bwoebi bwoebi Nov 15, 2024

Choose a reason for hiding this comment

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

Wrapped in if($retry), looks good now?

Copy link
Contributor

@iamluc iamluc left a comment

Choose a reason for hiding this comment

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

nit: IMHO, download should always return a boolean, and the retry or exit logic handled by the caller.

@bwoebi bwoebi merged commit 0743066 into master Nov 15, 2024
705 of 743 checks passed
@bwoebi bwoebi deleted the bob/tiny-artifacts branch November 15, 2024 16:22
@github-actions github-actions bot added this to the 1.5.0 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants