-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Simplify skipArchive
behaviour for input packages
#141671
Conversation
Pinging @elastic/fleet (Team:Fleet) |
1a62057
to
2307948
Compare
skipArchive
behaviour for input packages
Yes I just saw your comment and was leaving a similar one. I think we need to review the whole flow and understand what we need to modify. |
Are we moving to getting all information from the archive every time, or just at install time? If it's every time then I think |
I think the @criamico was for the install time, but it will probably be a good improvement to not call the registry when building the agent policy too, (it will remove a risk of failure here) |
@nchaulet @hop-dev |
8508774
to
e1909c8
Compare
ff231d8
to
7ceb230
Compare
7ceb230
to
4162afd
Compare
@criamico I have been back and forth on the scope of this change! And I am basically back where I started. Please read the PR description for a more in depth explanation! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for investigating further into this, it's not an easy flow.
I left a minor comment, overall LGTM 👍
// We need to get input only packages from source to get all fields | ||
// see https://github.com/elastic/package-registry/issues/864 | ||
if (packageInfo && packageInfo.type !== 'input') { | ||
if (registryInfo && skipArchive && registryInfo.type !== 'input') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: isn't this the same as skipArchive && registryInfo.type !== 'input'
?
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Closes #137751
Input packages always have to get their package info from the archive, as they contain fields in their manifest that the package registry API does not return. These fields are needed to create the package policy so we need to get info from the archive even when using the GET package info API (as opposed to just at install time)
Previously, I was ensuring that input packages get their information from the archive by using (unintuitively) the skipArchive flag, which meant we went to the registry to get the packageInfo, then checked if it was an input package, and if so we go and get the info from the archive.
This PR simplifies that behaviour by always attempting to get the info from the registry first, regardless of skipArchive, then deciding whether to skip the archive.
I have also added integration tests for input packages:
Does this conflict with #142353 "rely on package content during installation"?
This changes the behaviour for get package info, we still rely on the archive for installation. However, we should move to not using the registry at all for the get info API to unblock #131609, but this will be more work, and maybe need some work on the EPR side, I have created an issue for this #143198