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

[Fleet] Fix package archive bug + reenable Endpoint tests #143120

Merged
merged 10 commits into from
Oct 14, 2022

Conversation

kpollich
Copy link
Member

@kpollich kpollich commented Oct 11, 2022

Summary

Fixes failing endpoint tests - cc @kevinlog

@hop-dev @criamico - I tracked down the issue causing endpoint tests to fail to this chunk of code. As it stands, we are always querying EPR to fetch the archive buffer for a given package, even if it's already installed.

This means that bundled packages (which don't define a download property as they're ArchivePackage records in code) were failing to fetch from EPR. We were querying a URL like localhost:12345undefined and throwing 502's during package policy creation with an Error: Invalid URL thrown.

I've pushed up a workaround here where we "fill in" the downwload property on these packages, but I don't think this will work in all situations (namely APM, where the bundled package name is dynamic based on the stack version). Is there a way to fetch these archive buffer objects from the cache instead of always querying from EPR via getResponseStream?

@kpollich
Copy link
Member Author

@elasticmachine merge upstream

@kpollich kpollich self-assigned this Oct 14, 2022
@kpollich kpollich marked this pull request as ready for review October 14, 2022 13:06
@kpollich kpollich requested review from a team as code owners October 14, 2022 13:06
@kpollich
Copy link
Member Author

@elasticmachine merge upstream

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 14, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kpollich kpollich added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 14, 2022
@kpollich kpollich changed the title [Do not merge] Reenable endpoint tests to debug in CI [Fleet] Fix package archive bug + reenable Endpoint tests Oct 14, 2022
Copy link
Contributor

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this

@criamico
Copy link
Contributor

Is there a way to fetch these archive buffer objects from the cache instead of always querying from EPR via getResponseStream?

I had a similar question in my original PR but unfortunately I didn't realise that it would break the install (for some reason I had no tests failing in the branch).
I think that we need to find a way to source the archiveBuffer from the cache as you said. We can file a separate ticket for it to find a robust solution.

@kpollich
Copy link
Member Author

@elasticmachine merge upstream

@kpollich kpollich enabled auto-merge (squash) October 14, 2022 16:45
Copy link
Contributor

@kevinlog kevinlog left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for fixing this!

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests / Home page Agents Quick Start Install Fleet Server

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kpollich

@kpollich kpollich merged commit d9d10f2 into elastic:main Oct 14, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2022
…3120)

* Reenable endpoint tests to debug in CI

* Revert removal of skip in trusted apps

* Try enabling Fleet debug logs

* Fix missing archive path in bundled packages

* Remove Fleet debug logs in endpoint tests

* Reenable endpoint suites

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit d9d10f2)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.5

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 14, 2022
…143398)

* Reenable endpoint tests to debug in CI

* Revert removal of skip in trusted apps

* Try enabling Fleet debug logs

* Fix missing archive path in bundled packages

* Remove Fleet debug logs in endpoint tests

* Reenable endpoint suites

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit d9d10f2)

Co-authored-by: Kyle Pollich <[email protected]>
@kpollich kpollich deleted the re-enable-endpoint-tests branch October 17, 2022 12:29
This was referenced Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.5.0 v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants