Skip to content

[8.19] (backport #9092) Remove unnecessary http requests for artifacts during packaging #9109

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

Merged
merged 1 commit into from
Jul 25, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 23, 2025

What does this PR do?

This PR makes two changes to reduce the number of unnecessary HTTP requests for artifacts when packaging:

  1. It fixes retries. We now only retry on actually retryable HTTP response codes.
  2. When downloading a snapshot version, it tries the snapshot registry first.

Why is it important?

These changes reduce the run time of SNAPSHOT=true EXTERNAL=true mage package by around 25% for a single platform. In my testing, this went from around 4m 20s to around 3m 30s.

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

Run EXTERNAL=true SNAPSHOT=true mage package.

Related issues


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

* Fix retries when resolving artifact urls

When packaging, several different artifact sources are checked in
sequence. If the artifact was not present, the resolver would retry the
404 response, wasting time for no benefit. Fix this.

* Check snapshot resolver first for snapshot versions

(cherry picked from commit 6531a3f)
@mergify mergify bot added the backport label Jul 23, 2025
@mergify mergify bot requested a review from a team as a code owner July 23, 2025 16:16
@mergify mergify bot requested review from rubenruizdegauna and removed request for a team July 23, 2025 16:16
@mergify mergify bot added the backport label Jul 23, 2025
@mergify mergify bot requested a review from straistaru July 23, 2025 16:16
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog chore Tasks that just need to be done, they are neither bug, nor enhancements labels Jul 23, 2025
@elasticmachine
Copy link
Collaborator

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

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 23, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @swiatekm

Copy link

@swiatekm swiatekm merged commit 5360291 into 8.19 Jul 25, 2025
22 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.19/pr-9092 branch July 25, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport chore Tasks that just need to be done, they are neither bug, nor enhancements skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants