Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 9, 2025

What does this PR do?

Refactors how the agent packaging target downloads binaries. The intent is to make it possible to cache the binaries locally and avoid having to redownload them. See #9133 for the full context.

The PR consists of the following changes:

  • The download function now always gets a target path as an input, so it doesn't need to create it on its own conditionally.
  • We use standard library functions for the download, so we don't need to pass the content as a string, and can instead write it directly to the target file, saving memory.
  • Remove some unused functions.

Why is it important?

This makes the download code more maintainable and more performant. It also unlocks further packaging improvements.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

How to test this PR locally

Related issues


This is an automatic backport of pull request #9218 done by [Mergify](https://mergify.com).

* Clean up artifact download code in packaging

* Drop some unused functions

* Fix linter warnings

* Move http body closing to the inner download function

(cherry picked from commit 05f62c2)
@mergify mergify bot requested a review from a team as a code owner September 9, 2025 12:38
@mergify mergify bot added the backport label Sep 9, 2025
@mergify mergify bot requested review from blakerouse and kaanyalti and removed request for a team September 9, 2025 12:38
@mergify mergify bot added the backport label Sep 9, 2025
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Sep 9, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@swiatekm swiatekm enabled auto-merge (squash) September 9, 2025 12:41
@elastic-sonarqube
Copy link

@swiatekm swiatekm merged commit e504884 into 9.0 Sep 9, 2025
22 checks passed
@swiatekm swiatekm deleted the mergify/bp/9.0/pr-9218 branch September 9, 2025 14:21
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @swiatekm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants