Skip to content

[8.19](backport #49836) Move Paths from beat.Beat to beat.Info#50185

Open
mergify[bot] wants to merge 3 commits into8.19from
mergify/bp/8.19/pr-49836
Open

[8.19](backport #49836) Move Paths from beat.Beat to beat.Info#50185
mergify[bot] wants to merge 3 commits into8.19from
mergify/bp/8.19/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 backport conflicts There is a conflict in the backported pull request labels 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/8.19/pr-49836
Your branch is up to date with 'origin/8.19'.

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/rm <file>..." as appropriate to mark resolution)
	both modified:   x-pack/osquerybeat/beater/osquerybeat.go
	deleted by us:   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

@mergify mergify bot requested review from belimawr and leehinman and removed request for a team April 17, 2026 10:18
@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/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)

@elasticmachine
Copy link
Copy Markdown
Contributor

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

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

This comment has been minimized.

@github-actions

This comment has been minimized.

Remove osquerybeat_status_test.go which was incorrectly brought in by
the backport and references features not available on 8.19
(osquerydFactory, osqd.Runner, WaitForStop, beatmonitoring).
@github-actions
Copy link
Copy Markdown
Contributor

TL;DR

Buildkite 44328 is failing due to an unresolved cherry-pick in osquerybeat: conflict markers are still present, and a test file from the forward-port was included even though 8.19 does not have libbeat/beatmonitoring. Resolve the osquerybeat conflict and drop/adapt the incompatible test file in this backport.

Remediation

  • Resolve x-pack/osquerybeat/beater/osquerybeat.go by removing conflict markers and keeping the intended 8.19-compatible backport content.
  • Remove x-pack/osquerybeat/beater/osquerybeat_status_test.go from this backport (or rewrite it to avoid libbeat/beatmonitoring, which is not present on 8.19).
  • Re-run:
    • pre-commit run --all-files
    • make -C x-pack/dockerlogbeat check update && make check-no-changes
Investigation details

Root Cause

This is a backport conflict resolution issue (not infra):

  1. pre-commit fails on unresolved merge markers in x-pack/osquerybeat/beater/osquerybeat.go.

    • x-pack/osquerybeat/beater/osquerybeat.go:86 contains <<<<<<< HEAD
    • x-pack/osquerybeat/beater/osquerybeat.go:91 contains =======
    • x-pack/osquerybeat/beater/osquerybeat.go:111 contains >>>>>>> 184a91bf6 ...
  2. check/update fails because x-pack/osquerybeat/beater/osquerybeat_status_test.go imports github.com/elastic/beats/v7/libbeat/beatmonitoring (x-pack/osquerybeat/beater/osquerybeat_status_test.go:18), but 8.19 does not contain libbeat/beatmonitoring/monitoring.go.

Evidence

check for merge conflicts................................................Failed
x-pack/osquerybeat/beater/osquerybeat.go:86: Merge conflict string '<<<<<<<' found
x-pack/osquerybeat/beater/osquerybeat.go:91: Merge conflict string '=======' found
x-pack/osquerybeat/beater/osquerybeat.go:111: Merge conflict string '>>>>>>>' found
go: finding module for package github.com/elastic/beats/v7/libbeat/beatmonitoring
go: downloading github.com/elastic/beats v7.6.2+incompatible
... module github.com/elastic/beats@latest found (v7.6.2+incompatible), but does not contain package github.com/elastic/beats/v7/libbeat/beatmonitoring
make: *** [Makefile:122: check-no-changes] Error 1

Verification

Not run locally in this detective workflow; conclusion is based on deterministic Buildkite failures plus PR diff inspection.

Follow-up

After resolving the osquerybeat conflict and removing/adapting the incompatible test file, these three failing jobs should clear; if anything remains, it should be a separate issue.


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 is still failing on this backport, but the failure mode has changed: merge-conflict markers are gone, and the current blocker is lint violations (forbidigo + staticcheck) in the files touched by the Paths migration. Fix those violations in the touched files, then re-run lint.

Remediation

  • Replace forbidden global logger/path usage in the flagged files:
    • logp.L / logp.NewLogger → pass *logp.Logger through call paths
    • paths.Paths / paths.InitPaths → use the per-beat paths instance (beat.Info.Paths / passed *paths.Path) already being migrated in this PR
  • Address staticcheck findings in changed files:
    • libbeat/beat/beat.go:98 (QF1003: use tagged switch on info.ManagedMode)
    • heartbeat/beater/heartbeat.go:196 and metricbeat/beater/metricbeat.go:278 (SA1019 deprecation of Manager.Start)
  • Re-run golangci-lint for the branch (or push and let this workflow re-run).
Investigation details

Root Cause

This is not an Actions infrastructure issue. The golangci-lint step fails due to code-level lint violations in files changed by this backport.

Evidence

##[error]heartbeat/beater/heartbeat.go:76:3: use of `logp.L` forbidden ... (forbidigo)
##[error]libbeat/cmd/instance/beat.go:771:17: use of `paths.Paths` forbidden ... (forbidigo)
##[error]libbeat/beat/beat.go:98:3: QF1003: could use tagged switch on info.ManagedMode (staticcheck)
##[error]heartbeat/beater/heartbeat.go:196:12: SA1019: b.Manager.Start is deprecated ... (staticcheck)
##[error]metricbeat/beater/metricbeat.go:278:12: SA1019: b.Manager.Start is deprecated ... (staticcheck)
##[error]issues found

Validation

  • Not run locally in this detective workflow; diagnosis is from the failed Actions job logs.

Follow-up

  • The prior detective report on this PR focused on unresolved conflict markers. In this run those markers are no longer the blocker; the blocker is now the lint set above.

What is this? | From workflow: PR Actions Detective

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

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