豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

[9.3](backport #49836) Move Paths from beat.Beat to beat.Info#50186

Open
mergify[bot] wants to merge 4 commits into9.3from
mergify/bp/9.3/pr-49836
Open

[9.3](backport #49836) Move Paths from beat.Beat to beat.Info#50186
mergify[bot] wants to merge 4 commits into9.3from
mergify/bp/9.3/pr-49836

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Apr 17, 2026

Proposed commit message

Move Paths from beat.Beat to beat.Info

Paths describe the filesystem locations a beat is configured to use
(home, config, data, logs). They are set once at startup and never
change — the same kind of instance metadata as Name, Version, or ID.

Moving Paths into beat.Info makes them available everywhere Info is
already passed, which removes the need to thread a separate
*paths.Path argument through many call chains.

This PR just moves the field in the correct struct, see dependent PRs for work to remove redundant function parameters.

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

Dependent PRs

The following PRs build on this change to remove redundant *paths.Path parameters from functions that already receive beat.Info:

Paths describe the filesystem locations a beat is configured to use
(home, config, data, logs). They are set once at startup and never
change — the same kind of instance metadata as Name, Version, or ID.

Moving Paths into beat.Info makes them available everywhere Info is
already passed, which removes the need to thread a separate
*paths.Path argument through many call chains.

(cherry picked from commit 184a91b)

# Conflicts:
#	x-pack/osquerybeat/beater/osquerybeat.go
#	x-pack/osquerybeat/beater/osquerybeat_status_test.go
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 17, 2026
@mergify mergify bot requested review from a team as code owners April 17, 2026 10:18
@mergify mergify bot added the backport label Apr 17, 2026
@mergify mergify bot requested review from leehinman and removed request for a team April 17, 2026 10:18
@mergify mergify bot requested a review from khushijain21 April 17, 2026 10:18
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Apr 17, 2026
@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Apr 17, 2026

Cherry-pick of 184a91b has failed:

On branch mergify/bp/9.3/pr-49836
Your branch is up to date with 'origin/9.3'.

You are currently cherry-picking commit 184a91bf6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   filebeat/beater/filebeat.go
	modified:   heartbeat/beater/heartbeat.go
	modified:   libbeat/beat/beat.go
	modified:   libbeat/beat/info.go
	modified:   libbeat/cmd/export/ilm_policy.go
	modified:   libbeat/cmd/export/template.go
	modified:   libbeat/cmd/instance/beat.go
	modified:   libbeat/cmd/test/output.go
	modified:   metricbeat/beater/metricbeat.go
	modified:   winlogbeat/beater/winlogbeat.go
	modified:   x-pack/libbeat/cmd/instance/beat.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x-pack/osquerybeat/beater/osquerybeat.go
	both modified:   x-pack/osquerybeat/beater/osquerybeat_status_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

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

@github-actions github-actions bot added refactoring Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Linux Platform Linux Platform Team in Security Solution Team:Security-Windows Platform Windows Platform Team in Security Solution skip-changelog labels Apr 17, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 17, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform)

@mergify mergify bot mentioned this pull request Apr 17, 2026
2 tasks
@github-actions
Copy link
Copy Markdown
Contributor

TL;DR

This Buildkite failure is caused by code issues in the backport, not CI flakiness: unresolved cherry-pick conflict markers in x-pack/osquerybeat and one remaining b.Paths usage in filebeat after moving paths to beat.Info.

Remediation

  • Resolve the cherry-pick conflict hunks in:
    • x-pack/osquerybeat/beater/osquerybeat.go
    • x-pack/osquerybeat/beater/osquerybeat_status_test.go
      Remove all <<<<<<<, =======, >>>>>>> markers and keep the intended merged code.
  • Update filebeat/beater/filebeat.go:498 from b.Paths to b.Info.Paths in the autodiscover.NewAutodiscover(...) call.
  • Re-run:
    • pre-commit run --all-files
    • make -C filebeat check update
Investigation details

Root Cause

  1. Unresolved merge conflicts committed in PR head (backport conflict artifacts):

    • x-pack/osquerybeat/beater/osquerybeat.go contains <<<<<<< HEAD / >>>>>>> 184a91bf6...
    • x-pack/osquerybeat/beater/osquerybeat_status_test.go contains multiple conflict-marker hunks.
  2. Incomplete API migration in filebeat:

    • libbeat/beat/beat.go removed Beat.Paths.
    • Most references were migrated to b.Info.Paths, but filebeat/beater/filebeat.go:498 still passes b.Paths, causing compile/vet failure.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/44304
  • Job/step: Auditbeat: Run pre-commit
    • check for merge conflicts................................................Failed
    • x-pack/osquerybeat/beater/osquerybeat_status_test.go:89: Merge conflict string '<<<<<<<' found
  • Job/step: x-pack/osquerybeat: Run check/update
    • beater/osquerybeat_status_test.go:89:1: expected declaration, found '<<'
    • beater/osquerybeat.go:89:1: syntax error: unexpected <<, expected expression
  • Job/step: Filebeat: Run check/update (also mirrored in x-pack/filebeat and x-pack/libbeat)
    • beater/filebeat.go:495:6: b.Paths undefined (type *beat.Beat has no field or method Paths)

Verification

  • Reproduced locally on repo checkout by compiling package:
    • go test ./filebeat/beater -run TestDoesNotExist
    • Fails with: filebeat/beater/filebeat.go:498:6: b.Paths undefined (type *beat.Beat has no field or method Paths)

Follow-up

After resolving the two osquerybeat conflict files and the remaining filebeat b.Paths call, this should unblock both the pre-commit failures and the check/update vet failures.


What is this? | From workflow: PR Buildkite Detective

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

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

TL;DR

golangci-lint failed on lint (ubuntu-latest) due to newly introduced linter violations (forbidigo + staticcheck) in this backport. Update those call sites (logger/paths usage and deprecated manager start call) and re-run CI.

Remediation

  • Replace forbidden logger/path usages reported by lint:
    • heartbeat/beater/heartbeat.go (logp.L, logp.NewLogger)
    • libbeat/cmd/instance/beat.go (logp.NewLogger, paths.Paths, paths.InitPaths)
    • winlogbeat/beater/winlogbeat.go (logp.NewLogger)
    • x-pack/libbeat/cmd/instance/beat.go (paths.Paths)
  • Address deprecated manager start calls flagged by staticcheck:
    • heartbeat/beater/heartbeat.go:196
    • metricbeat/beater/metricbeat.go:278
  • Re-run the golangci-lint workflow after these edits.
Investigation details

Root Cause

The failing job is not a merge-conflict failure anymore; it is a lint failure from golangci-lint in this workflow run. The backport introduces/changes lines that trigger repository forbid rules (global logger/path APIs) plus deprecation warnings treated as lint failures.

Evidence

  • Workflow: https://github.com/elastic/beats/actions/runs/24563202869
  • Job/step: lint (ubuntu-latest)golangci-lint
  • Key log excerpt:
    • heartbeat/beater/heartbeat.go:76:3: use of logp.L forbidden ... (forbidigo)
    • heartbeat/beater/heartbeat.go:349:76: use of logp.NewLogger forbidden ... (forbidigo)
    • libbeat/cmd/instance/beat.go:769:17: use of paths.Paths forbidden ... (forbidigo)
    • libbeat/cmd/instance/beat.go:1509:12: use of paths.InitPaths forbidden ... (forbidigo)
    • heartbeat/beater/heartbeat.go:196:12: SA1019: b.Manager.Start is deprecated ... (staticcheck)
    • metricbeat/beater/metricbeat.go:278:12: SA1019: b.Manager.Start is deprecated ... (staticcheck)

Validation

  • Not run locally; diagnosis is based on the failing workflow job logs.

Follow-up

This is materially different from the previous detective comment (which was about merge-conflict markers). Once the reported lint violations are fixed, this specific workflow should proceed past the current failure point.


What is this? | From workflow: PR Actions Detective

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

@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Apr 20, 2026

This pull request has not been merged yet. Could you please review and merge it @orestisfl? 🙏

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

Labels

backport conflicts There is a conflict in the backported pull request refactoring skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Security-Linux Platform Linux Platform Team in Security Solution Team:Security-Windows Platform Windows Platform Team in Security Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants