Skip to content

filebeat: remove redundant beatPaths parameters#49842

Open
orestisfl wants to merge 2 commits intoelastic:mainfrom
orestisfl:filebeat-use-info-paths
Open

filebeat: remove redundant beatPaths parameters#49842
orestisfl wants to merge 2 commits intoelastic:mainfrom
orestisfl:filebeat-use-info-paths

Conversation

@orestisfl
Copy link
Copy Markdown
Contributor

@orestisfl orestisfl commented Apr 1, 2026

Proposed commit message

filebeat: remove redundant beatPaths parameters

Several filebeat functions and types accepted both beat.Info and a
separate *paths.Path: fileset factories, the module registry,
PluginFactory, openStateStore, and the default-inputs Init
functions. Now that Info carries Paths, drop the duplicate parameter
everywhere and use info.Paths (or beatInfo.Paths) instead.

Checklist

  • 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.

Disruptive User Impact

None. Internal API change only.

How to test this PR locally

Related issues

@orestisfl orestisfl added refactoring Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-active-all Automated backport with mergify to all the active branches skip-changelog labels Apr 1, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

🤖 GitHub comments

Just comment with:

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

@orestisfl orestisfl force-pushed the filebeat-use-info-paths branch from 2fbb8ea to 7f84b30 Compare April 1, 2026 11:39
@orestisfl orestisfl linked an issue Apr 1, 2026 that may be closed by this pull request
@orestisfl orestisfl force-pushed the filebeat-use-info-paths branch from 7f84b30 to 8fdfb6d Compare April 1, 2026 12:32
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

TL;DR

All 6 failed Buildkite jobs are failing before packaging starts because the PR cannot be auto-merged with main (content conflict in filebeat/beater/filebeat.go). Rebase/merge main into this branch and resolve that conflict, then rerun CI.

Remediation

  • Rebase orestisfl:filebeat-use-info-paths onto current main (or merge main) and resolve filebeat/beater/filebeat.go.
  • While resolving, keep compatibility with current main APIs/signatures in this file (for example around PluginFactory, fileset.NewModuleRegistry, fileset.NewSetupFactory, and path usage), then re-apply only the intended PR change.
  • Validate by rerunning the same Buildkite packaging jobs after pushing the rebased branch.
Investigation details

Root Cause

This is a mergeability failure (branch drift), not a packaging/runtime failure. In all failed jobs, Buildkite’s repo post-checkout hook attempts to create a PR merge branch and exits on the same conflict:

  • filebeat/beater/filebeat.go

The conflicting area aligns with large divergence between current main and PR versions in that file, including import/signature/call-site changes (e.g., around lines 51, 81, 116, 200, 431 in main view and corresponding PR hunks).

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/43403
  • Affected jobs (all 6):
    • Filebeat: Packaging Linux
    • Filebeat: Packaging arm64
    • x-pack/filebeat: Packaging Linux
    • x-pack/filebeat: Packaging arm64
    • x-pack/filebeat: Packaging Linux amd64 FIPS
    • x-pack/filebeat: Packaging Linux arm64 FIPS
  • Key log excerpt (repeated across all failed logs):
Auto-merging filebeat/beater/filebeat.go
CONFLICT (content): Merge conflict in filebeat/beater/filebeat.go
Automatic merge failed; fix conflicts and then commit the result.
--- Merge failed: 1
Error: running "repository post-checkout" shell hook: ... exited with status 1

Verification

  • Local analysis run: compared origin/main:filebeat/beater/filebeat.go vs PR head version and confirmed substantial conflicting hunks.
  • Build/test commands were not run because failure occurs during Buildkite merge preparation, before packaging/test execution.

Follow-up

After rebase conflict resolution, rerun the same Buildkite packaging matrix to confirm the failure is cleared.

Note

🔒 Integrity filtering filtered 1 item

Integrity filtering activated and filtered the following item during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.


What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Now that Paths lives in beat.Info, functions that already receive
Info no longer need a separate paths parameter. This removes the
redundant parameter from fileset factories, module registry,
default-inputs Init, openStateStore, and the PluginFactory type.
@orestisfl orestisfl force-pushed the filebeat-use-info-paths branch from c8a1d37 to 07c7fb6 Compare April 17, 2026 10:31
@orestisfl orestisfl marked this pull request as ready for review April 17, 2026 10:49
@orestisfl orestisfl requested a review from a team as a code owner April 17, 2026 10:49
@orestisfl orestisfl requested review from belimawr and rdner April 17, 2026 10:49
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cc361101-a7b2-4284-8957-4fc28b813df7

📥 Commits

Reviewing files that changed from the base of the PR and between 184a91b and 07c7fb6.

📒 Files selected for processing (15)
  • filebeat/autodiscover/builder/hints/logs.go
  • filebeat/beater/filebeat.go
  • filebeat/beater/store.go
  • filebeat/beater/store_test.go
  • filebeat/fileset/factory.go
  • filebeat/fileset/modules.go
  • filebeat/fileset/modules_integration_test.go
  • filebeat/fileset/modules_test.go
  • filebeat/fileset/setup.go
  • filebeat/input/default-inputs/inputs.go
  • x-pack/filebeat/input/default-inputs/inputs.go
  • x-pack/filebeat/input/default-inputs/inputs_aix.go
  • x-pack/filebeat/input/default-inputs/inputs_darwin.go
  • x-pack/filebeat/input/default-inputs/inputs_other.go
  • x-pack/filebeat/input/default-inputs/inputs_windows.go

📝 Walkthrough

Walkthrough

This change refactors path parameter handling across the Filebeat codebase by removing explicit *paths.Path arguments from function signatures and instead accessing paths via beat.Info.Paths. Affected functions include NewModuleRegistry, NewFactory, NewSetupFactory, openStateStore, and the PluginFactory type. The Init functions in default-inputs plugins were updated to drop the path parameter. All call sites were adjusted to construct beat.Info with embedded paths or access info.Paths directly. Test files and implementations were correspondingly updated to use the new signatures.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@elastic elastic deleted a comment from mergify Bot Apr 17, 2026
Copy link
Copy Markdown
Member

@rdner rdner left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

Copy link
Copy Markdown
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

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

Thanks! I have been getting some linter failures on changes that touch some of these files, because of the global paths lint. I'm glad it's fixed.

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

Labels

backport-active-all Automated backport with mergify to all the active branches refactoring skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[beatreceiver] move paths object into Beat.Info

4 participants