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

Cleanup: Remove unused/underused API from the beats feature package #34974

Merged
merged 15 commits into from
Mar 30, 2023

Conversation

faec
Copy link
Contributor

@faec faec commented Mar 30, 2023

This is entirely an internal cleanup, it should have no functional change.

Most of the code in libbeat/feature is unused. That package defines a global registry of plugins and features that lets callers register arbitrary factories that can be queried under appropriate namespaces. It was originally intended as an interim step in library migration (see the somewhat poignant 5-year-old comment // Registry is the global plugin registry, this variable is meant to be temporary...), but many of its features were never used and after some recent cleanups its only remaining client is Functionbeat (which still only uses a small part of its functionality, relying mostly on functionbeat-specific extensions in x-pack/functionbeat/function/provider).

This PR removes the unused parts of the package and clarifies/simplifies the code that is still used. A reasonable followup might be to move the remaining API entirely into Functionbeat, which has unique use cases for it that have grown beyond the original package, however I wanted to do an in-place cleanup first to simplify code review.

@faec faec added cleanup Team:Elastic-Agent Label for the Agent team labels Mar 30, 2023
@faec faec requested a review from a team as a code owner March 30, 2023 11:13
@faec faec self-assigned this Mar 30, 2023
@faec faec requested review from ycombinator and leehinman and removed request for a team March 30, 2023 11:13
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 30, 2023
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 30, 2023
@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @faec? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 30, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-30T11:27:42.422+0000

  • Duration: 85 min 53 sec

Test stats 🧪

Test Results
Failed 0
Passed 26092
Skipped 1969
Total 28061

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@faec faec merged commit 790b97e into elastic:main Mar 30, 2023
@faec faec deleted the registry-cleanup branch March 30, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants