Skip to content

[9.3](backport #49838) idxmgmt: remove redundant beatPaths parameter#50249

Merged
orestisfl merged 7 commits into
9.3from
mergify/bp/9.3/pr-49838
Apr 28, 2026
Merged

[9.3](backport #49838) idxmgmt: remove redundant beatPaths parameter#50249
orestisfl merged 7 commits into
9.3from
mergify/bp/9.3/pr-49838

Conversation

@mergify

@mergify mergify Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

idxmgmt: remove redundant beatPaths parameter

NewESClientHandler and NewFileClientHandler accepted both beat.Info
and *paths.Path. Now that Info carries Paths, drop the separate
argument and pass info.Paths to the downstream template loaders.

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

NewESClientHandler and NewFileClientHandler accepted both beat.Info
and *paths.Path. Now that Info carries Paths, drop the separate
argument and pass info.Paths to the downstream template loaders.

(cherry picked from commit 8b7236f)

# Conflicts:
#	libbeat/cmd/export/ilm_policy.go
#	libbeat/cmd/export/template.go
#	libbeat/cmd/instance/beat.go
@mergify mergify Bot requested a review from a team as a code owner April 22, 2026 08:41
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Apr 22, 2026
@mergify mergify Bot requested review from belimawr and faec and removed request for a team April 22, 2026 08:41
@mergify

mergify Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 8b7236f has failed:

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

You are currently cherry-picking commit 8b7236f25.
  (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:   libbeat/idxmgmt/client_handler.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   libbeat/cmd/export/ilm_policy.go
	both modified:   libbeat/cmd/export/template.go
	both modified:   libbeat/cmd/instance/beat.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 22, 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!)
  • /test : Run the Buildkite pipeline.

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 22, 2026
@elasticmachine

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

Buildkite is failing for all affected pipelines because this backport branch still contains unresolved merge-conflict markers in libbeat/cmd/*, and after resolving those, the backported idxmgmt change still references info.Paths on 9.3 where beat.Info does not expose that field. Resolve the conflict hunks and keep the 9.3-compatible path handling to unblock CI.

Remediation

  • Resolve conflict markers in:
    • libbeat/cmd/export/ilm_policy.go
    • libbeat/cmd/export/template.go
    • libbeat/cmd/instance/beat.go
  • For 9.3 compatibility, do not use info.Paths in libbeat/idxmgmt/client_handler.go; keep/use explicit beat paths argument (or equivalent 9.3-compatible source) because beat.Info on this branch does not provide Paths.
  • Re-run the failing steps (Run pre-commit, Run check/update) after the above edits.
Investigation details

Root Cause

The failures are code-level and come from an incomplete/conflicting backport state:

  1. Unresolved merge conflicts in PR files (detected by pre-commit and go parser):

    • libbeat/cmd/export/ilm_policy.go:48,50,52
    • libbeat/cmd/export/template.go:50,52,54
    • libbeat/cmd/instance/beat.go:693,695,697,1141,1143,1145
  2. API mismatch on 9.3 after applying idxmgmt signature changes:

    • libbeat/idxmgmt/client_handler.go now uses info.Paths
    • Build logs show compile/vet errors:
      • ../libbeat/idxmgmt/client_handler.go:67:75: info.Paths undefined (type beat.Info has no field or method Paths)
      • ../libbeat/idxmgmt/client_handler.go:81:111: info.Paths undefined (type beat.Info has no field or method Paths)

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/44602
  • Job/step examples:
    • Packetbeat: Run pre-commit
    • Packetbeat: Run check/update
    • Libbeat: Run check/update
  • Key log excerpts:
    • check for merge conflicts...Failed
    • libbeat/cmd/export/ilm_policy.go:48: Merge conflict string '<<<<<<<' found
    • cmd/export/ilm_policy.go:48:1: expected statement, found '<<'
    • ../libbeat/idxmgmt/client_handler.go:67:75: info.Paths undefined (type beat.Info has no field or method Paths)

Verification

  • Not run locally in this workflow context; conclusions are from Buildkite job logs plus PR branch file inspection.

Follow-up

If helpful, cherry-pick only the conflict-resolved, 9.3-compatible variant of this change (without the beat.Info.Paths dependency) and rerun /test.


What is this? | From workflow: PR Buildkite Detective

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

@mergify

mergify Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mergify

mergify Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/9.3/pr-49838 upstream/mergify/bp/9.3/pr-49838
git merge upstream/9.3
git push upstream mergify/bp/9.3/pr-49838

@orestisfl orestisfl requested review from a team as code owners April 28, 2026 11:49
# Conflicts:
#	libbeat/cmd/export/ilm_policy.go
#	libbeat/cmd/export/template.go
#	libbeat/cmd/instance/beat.go
@orestisfl orestisfl force-pushed the mergify/bp/9.3/pr-49838 branch from d06b3f9 to eb44981 Compare April 28, 2026 12:00

@orestisfl orestisfl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Backport, build verified locally after merging upstream/9.3

@orestisfl orestisfl enabled auto-merge (squash) April 28, 2026 12:17
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

golangci-lint failed in lint (ubuntu-latest) on forbidigo violations introduced in libbeat/cmd/instance/beat.go (use of logp.NewLogger, paths.Paths, and paths.InitPaths). Replace those with the branch-approved patterns and rerun the lint workflow.

Remediation

  • Update libbeat/cmd/instance/beat.go to remove forbidden APIs:
    • libbeat/cmd/instance/beat.go:188 (logp.NewLogger(...))
    • libbeat/cmd/instance/beat.go:770 (paths.Paths)
    • libbeat/cmd/instance/beat.go:1510 (paths.InitPaths(...))
  • Re-run golangci-lint (or rerun the failed workflow run) after applying those edits.
Investigation details

Root Cause

The failing step is golangci-lint in job lint (ubuntu-latest). Lint fails on forbidigo checks in libbeat/cmd/instance/beat.go, so the job exits with issues found.

Evidence

  • Workflow: https://github.com/elastic/beats/actions/runs/25051535617
  • Job/step: lint (ubuntu-latest) / golangci-lint
  • Key log excerpt:
    • ##[error]libbeat/cmd/instance/beat.go:188:5: use of \logp.NewLogger` forbidden because "accept a *logp.Logger as a parameter instead of creating one with logp.NewLogger" (forbidigo)`
    • ##[error]libbeat/cmd/instance/beat.go:769:17: use of \paths.Paths` forbidden because "use a per-beat *paths.Path instance instead of the global paths.Paths" (forbidigo)`
    • ##[error]libbeat/cmd/instance/beat.go:1509:12: use of \paths.InitPaths` forbidden because "use a per-beat *paths.Path instance instead of the global paths.InitPaths" (forbidigo)`
    • ##[error]issues found

Validation

  • Not run locally in this workflow context; diagnosis is based on the failed job logs for run 25051535617.

Follow-up

The previous detective report on this PR flagged a different failure (info.Paths undefined). This run is a new/later failure class (forbidigo) and needs the API usage cleanup above.


What is this? | From workflow: PR Actions Detective

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

@orestisfl orestisfl merged commit 4a634eb into 9.3 Apr 28, 2026
193 of 196 checks passed
@orestisfl orestisfl deleted the mergify/bp/9.3/pr-49838 branch April 28, 2026 14:08
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants