Skip to content

chore(deps): update module github.com/elastic/go-elasticsearch/v8 to v9 (8.19) - #8031

Open
elastic-renovate-prod[bot] wants to merge 2 commits into
8.19from
renovate/8.19-golang/major-elastic
Open

elastic-renovate-prod[bot] wants to merge 2 commits into
8.19from
renovate/8.19-golang/major-elastic

Conversation

@elastic-renovate-prod

@elastic-renovate-prod elastic-renovate-prod Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
github.com/elastic/go-elasticsearch/v8 require major v8.19.7 → v9.5.2

Release Notes

elastic/go-elasticsearch (github.com/elastic/go-elasticsearch/v8)

v9.5.2

Compare Source

Features

v9.5.1

Compare Source

Features

v9.5.0

Compare Source

Features

v9.4.3

Compare Source

Features

v9.4.2

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1515) (3845bb1)

v9.4.1

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1480) (86e8f65)

v9.4.0

Compare Source

⚠ BREAKING CHANGES
  • esutil: default Client to elasticsearch.NewBase in NewBulkIndexer
  • esapi: params previously typed *int on ~25 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.6

Compare Source

Features

v9.3.5

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1514) (f9640f0)

v9.3.4

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1479) (7d5b37e)

v9.3.3

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.2

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec df81426
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1313) (3b3dd1e)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1340) (a02272b)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1316) (d28cd9d)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1331) (f37f7d1)

v9.3.1

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1243) (3300e5d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1251) (9255720)
  • esutil: Propagate context timeout while closing bulk indexer (#​1254) (6a0b973)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1241) (0215eec)
  • Typed API: Add field-level nil checks during deserialisation (#​1225) (fc22640)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (fc22640)

v9.3.0

Compare Source

⚠ BREAKING CHANGES
  • Upgrade Go version from 1.23 to 1.24 (#​1137)
  • API: API methods and request fields that previously accepted a single string for resource identifiers (e.g., indices, names, IDs, routing, features) now require []string. Corresponding WithX helpers now accept variadic arguments (...string).
  • API: All ExpandWildcards request fields were changed from string to []string, and WithExpandWildcards helpers now accept variadic arguments (...string).
  • API: Routing parameters across document, search, and multi-document APIs were changed from string to []string, and related WithRouting helpers now accept variadic arguments (...string).
  • API: Duration-based parameters previously expressed as string now use time.Duration (e.g., KeepAlive, Interval, BucketSpan). Call sites must pass time.Duration values.
  • API: ML APIs using interface{} for start/end time parameters now require string values, removing support for arbitrary types.
  • API: Several top-level API methods now require []string instead of string for path parameters that support multiple resources (e.g., indices, templates, data streams, transforms, repositories, privileges).
  • API: MonitoringBulk was refactored: DocumentType support was removed, Interval is now time.Duration, and required parameters were added explicitly to the method signature.
  • API: Some WithX functional options changed between single-value and variadic forms to match API behaviour. Existing option usage may require updates.
  • API: Request struct fields were updated to reflect REST API semantics, including changes from string to []string and removal of deprecated fields. Direct struct initialization may require changes.
Features
  • API: Introduce strong typing for duration values (3c657da)
  • API: Support multi-value resource parameters (3c657da)
  • API: Support multiple resources per request (3c657da)
  • API: Update APIs to 9.3.0 (3c657da)
  • Expose FlushedMs metric in BulkIndexer (#​1191) (d67d0be)
  • Typed API: Add DenseVectorF32 and DenseVectorBytes types, improving indexing performance of dense vectors by up to 3x when used instead of a float32 array (f543b82)
  • Typed API: Update TypedAPI to latest elasticsearch-specification 9.3.0 (f543b82)
  • Upgrade Go version from 1.23 to 1.24 (#​1137) (05f15eb)
Bug Fixes
  • API: Align request structs with Elasticsearch REST spec (3c657da)
  • API: Align routing parameters with REST API (3c657da)
  • API: Correct functional option cardinality (3c657da)
  • API: Modernize MonitoringBulk API (3c657da)
  • API: Normalize expand_wildcards handling (3c657da)
  • API: Simplify ML time range parameters (3c657da)
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1162) (ab7b3bb)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1147) (e3e61d6)

v9.2.6

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1478) (e328483)

v9.2.5

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes
  • esapi: Regenerate esapi with *int64 for long-typed params (#​1421) (e30cdb6)
  • gen: Map spec long to *int64 for esapi params (#​1392) (ef6e458)
  • gen: Normalize date URL part and param types to string (#​1415) (a029ed0)
  • gen: Pass []string to DeleteIndexTemplate in test boilerplate (#​1423) (af25eed)
  • gen: Pass []string to DeletePrivileges in xpack test boilerplate (#​1424) (d603097)
  • gen: Support *int64 fields in gen-tests output (#​1418) (3a61210)

v9.2.4

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec 49022a2
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1312) (c680847)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1339) (0b34e21)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1315) (cf70e22)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1330) (f52219c)

v9.2.3

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1242) (71b0b0d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1250) (8537e89)
  • esutil: Propagate context timeout while closing bulk indexer (#​1253) (405af64)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1240) (755a9d3)
  • Typed API: Add field-level nil checks during deserialisation (#​1224) (59f268f)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (59f268f)

v9.2.2

Compare Source

Features
Bug Fixes
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1161) (5394405)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1201) (b5ceeee)

v9.2.1

Compare Source

Features
Bug Fixes

v9.2.0: 9.2.0

Compare Source

API

  • Updated APIs to 9.2.0

Typed API

v9.1.2

Compare Source

Features
Bug Fixes
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1200) (f32bfca)

v9.1.1

Compare Source

Features
Bug Fixes

v9.1.0: 9.1.0

Compare Source

API

  • Updated APIs to 9.1.0

Typed API

  • Update TypedAPI to latest elasticsearch-specification 9.1
  • This release introduces a new MethodAPI used by the TypedClient which makes the client friendlier for dead code elimination.
    Reducing the size of the client when only a subset of the APIs are used. The old API structure remains available for backward compatibility, but it is now deprecated.

v9.0.1: 9.0.1

Compare Source

API

  • Updated APIs to 9.0.4

Typed API

v9.0.0: 9.0.0

Compare Source

  • The client now requires Go 1.23 or later.

New

  • This release introduces an optional package for the TypedAPI named esdsl.
    It provides a domain-specific language (DSL) for building Elasticsearch queries in Go.
    The DSL is designed to simplify query construction, making it easier to build complex queries without writing raw JSON.
// create index
{
    // delete index if exists
    if existsRes, err := es.Indices.Exists("test").IsSuccess(context.Background()); err != nil {
        log.Println(err)
        return
    } else if existsRes {
        if ok, _ := es.Indices.Delete("test").IsSuccess(context.Background()); !ok {
            log.Fatalf("Error deleting index: %v\n", err)
        }
        log.Println("Index deleted:", "test")
    } else {
        log.Println("Index does not exist:", "test")
    }

    mappings := esdsl.NewTypeMapping().
        AddProperty("name", esdsl.NewTextProperty()).
        AddProperty("age", esdsl.NewIntegerNumberProperty())

    createRes, err := es.Indices.Create("test").Mappings(mappings).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    log.Printf("Index created: %#v\n", createRes)
}

// index document
{
    documents := []Document{
        {"Alice", 30},
        {"Bob", 25},
        {"Charlie", 35},
    }

    bulk := es.Bulk().Index("test")
    for _, document := range documents {
        err := bulk.IndexOp(types.IndexOperation{}, document)
        if err != nil {
            log.Println("Error indexing document:", err)
        }
    }
    bulkRes, err := bulk.Refresh(refresh.Waitfor).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if bulkRes.Errors {
        log.Println("Some documents failed to index")
        for _, item := range bulkRes.Items {
            for operationType, responseItem := range item {
                if responseItem.Error != nil {
                    log.Println("Operation:", operationType)
                    log.Println("Response:", responseItem)
                }
            }
        }
    }
    indexedDocs := 0
    for _, item := range bulkRes.Items {
        for _, responseItem := range item {
            if responseItem.Error == nil {
                indexedDocs++
            }
        }
    }

    log.Println("Documents indexed:", indexedDocs)
}

// calculate median age
{
    searchRes, err := es.Search().
        Index("test").
        Size(0).
        AddAggregation("median_age", esdsl.NewPercentilesAggregation().Field("age").Percents(50)).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    if agg, ok := searchRes.Aggregations["median_age"].(*types.TDigestPercentilesAggregate); ok {
        if val, ok := agg.Values.(map[string]interface{})["50.0"]; ok {
            log.Println("Median age:", val)
        }
    }
}

// search documents
{
    matchRes, err := es.Search().
        Index("test").
        Query(esdsl.NewBoolQuery().
            Must(esdsl.NewMatchQuery("name", "Alice")).
            Filter(esdsl.NewNumberRangeQuery("age").Gte(20).Lte(40))).
        Sort(esdsl.NewSortOptions().AddSortOption("age", esdsl.NewFieldSort(sortorder.Asc))).
        Size(10).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if matchRes.Hits.Total.Value > 0 {
        for _, hit := range matchRes.Hits.Hits {
            doc := Document{}
            err := json.Unmarshal(hit.Source_, &doc)
            if err != nil {
                log.Println("Error unmarshalling document:", err)
                continue
            }
            log.Printf("Document ID: %s, Name: %s, Age: %d\n", *hit.Id_, doc.Name, doc.Age)
        }
    } else {
        log.Println("No documents found")
    }
}

API

  • Updated APIs to 9.0.0

Typed API


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "on monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@elastic-renovate-prod elastic-renovate-prod Bot added automation backport-skip Skip notification from the automated backport with mergify dependency skip-changelog labels Oct 12, 2026
@elastic-renovate-prod
elastic-renovate-prod Bot requested a review from a team as a code owner October 12, 2026 19:30
@elastic-renovate-prod elastic-renovate-prod Bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Oct 12, 2026
@elastic-renovate-prod
elastic-renovate-prod Bot requested review from lorienhu and removed request for a team October 12, 2026 19:30
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Dependency Update Analysis

Summary: Updated Go module github.com/elastic/go-elasticsearch from v8.19.7 to v9.5.2 (major), including import-path migration from /v8 to /v9 across Fleet Server code; overall risk is low-to-moderate with no repo-specific breaking usage found.

Dependency: github.com/elastic/go-elasticsearch v8.19.7 → v9.5.2

Ecosystem: Go

Check Result
Breaking changes ✅ None found in this repo’s consumed interfaces after usage cross-check
Testable in PR ✅ Yes — Buildkite PR pipeline is enabled on commit in .buildkite/pull-requests.json (build_on_commit: true), and this PR touches Go source/manifests so skip-only-doc rules do not apply
Changelog highlights (v8.19.7 → v9.5.2)
  • v9.3.0 introduces major API-shape changes in generated client surfaces (notably string→[]string, some duration typing changes, and related option/signature updates).
  • v9.4.0 notes esapi long-typed params changing to *int64 and BulkIndexer default-client behavior changes.
  • v9.4.1 removes (*Client).ToTyped() (replace with elasticsearch.NewTypedFrom).
  • v9.5.2 is a Typed API spec refresh.

Security/CVE assessment:

  • Reviewed upstream release-note bodies for v9.0.0, v9.3.0, v9.4.0, v9.4.1, v9.5.2, and prior v8.19.7.
  • No CVE IDs, GHSA advisories, or explicit security-fix bulletins were listed for this update path.
  • Internal changes are primarily API typing/signature evolution and client/typed-api behavior fixes; these are compatibility-sensitive but do not indicate newly introduced security exposure for this repository’s current usage.
Usage in this repository
  • Manifest updates: go.mod, go.sum, NOTICE.txt, NOTICE-fips.txt.
  • Code usage surface: import-path migration from /v8 to /v9 across ~50 Go files under internal/pkg/.
  • Primary consumed interfaces:
    • elasticsearch.Client and elasticsearch.Config (client creation/config wiring)
    • esapi request/response types (index/search/mget/msearch/update-by-query/security APIs)
    • typed API enums/types used in check-in scripting (typedapi/types, scriptlanguage.Painless)
  • Representative touched modules: internal/pkg/es, internal/pkg/bulk, internal/pkg/apikey, internal/pkg/api, internal/pkg/file/*, internal/pkg/monitor, internal/pkg/ver, and test helpers under internal/pkg/testing/esutil.
Compatibility assessment
  • This is a major Go-module bump and correctly includes the required import-path migration (.../v8 → .../v9) throughout the codebase.
  • No remaining /v8 imports are present.
  • The known upstream breaking item around (*Client).ToTyped() removal is not used in this repository.
  • Fleet Server’s Go toolchain baseline (go 1.26.8 in go.mod) is above the v9 line’s minimum Go requirement, so toolchain compatibility is satisfied.
  • Net effect: broad but mechanical migration with no observed break against currently consumed APIs in this repo.

Labels Applied

  • oblt-aw/ai/merge-ready — overall risk is low-to-moderate, no repo-breaking usage detected, and PR-context validation is available via Buildkite PR pipeline.

What is this? | From workflow: Observability Agentic Workflow — Pull Request

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

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Automerge skipped

Automerge skipped this pull request because the changed files do not match any configured dependency collection.

If this update should be automerged, ask a maintainer to add or adjust a collection, or merge the pull request manually.

See Opt in or opt out for how to enable or disable Automerge collections on the Control Plane Dashboard.

Collections currently enabled for automerge: github-actions, pre-commit, vm-images

Changed files considered:

  • go.mod

  • go.sum

  • internal/pkg/api/handleEnroll.go

  • internal/pkg/api/handleEnroll_test.go

  • internal/pkg/api/handleFileDelivery.go

  • internal/pkg/api/handleUpload.go

  • internal/pkg/api/handleUpload_test.go

  • internal/pkg/apikey/apikey.go

  • internal/pkg/apikey/apikey_integration_test.go

  • internal/pkg/apikey/auth.go

  • internal/pkg/apikey/auth_test.go

  • internal/pkg/apikey/create.go

  • internal/pkg/apikey/invalidate.go

  • internal/pkg/bulk/engine.go

  • internal/pkg/bulk/helpers.go

  • internal/pkg/bulk/opApiKey.go

  • internal/pkg/bulk/opBulk.go

  • internal/pkg/bulk/opRead.go

  • internal/pkg/bulk/opSearch.go

  • internal/pkg/bulk/secret.go

  • …and 32 more

@github-actions

This comment has been minimized.

@elastic-renovate-prod

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@elastic-renovate-prod elastic-renovate-prod Bot changed the title Update module github.com/elastic/go-elasticsearch/v8 to v9 (8.19) chore(deps): update module github.com/elastic/go-elasticsearch/v8 to v9 (8.19) Nov 3, 2026
@mergify

mergify Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @elastic-renovate-prod[bot]? 🙏
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 renovate/8.19-golang/major-elastic upstream/renovate/8.19-golang/major-elastic
git merge upstream/8.19
git push upstream renovate/8.19-golang/major-elastic

@elastic-renovate-prod
elastic-renovate-prod Bot force-pushed the renovate/8.19-golang/major-elastic branch from 759dc29 to 8b366cd Compare November 7, 2026 21:44
Copilot AI balanced review requested due to automatic review settings November 7, 2026 21:44

Copilot AI 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.

🟡 Changes recommended

The v9 client upgrade leaves API calls that break compilation and sends compatibility headers rejected by supported Elasticsearch 8.19 clusters.

4 open issues
What changed in this PR

Updates Fleet Server’s Elasticsearch Go client from v8.19.7 to v9.5.2 on the 8.19 branch, switching client imports across runtime code and test utilities.

Changes:

  • Replaces the v8 module requirement and checksums with v9.5.2.
  • Migrates Elasticsearch client, request API, and typed API imports to /v9.
  • Updates corresponding imports in unit tests, integration tests, and shared helpers.
File Description
internal/​pkg/​ver/​check.go Switches compatibility checks to the v9 client.
internal/​pkg/​testing/​setup.go Updates test setup’s client import.
internal/​pkg/​testing/​esutil/​template.go Updates template helper’s client import.
internal/​pkg/​testing/​esutil/​index.go Updates index helper’s client import.
internal/​pkg/​testing/​esutil/​ilm.go Updates lifecycle helper’s client import.
internal/​pkg/​testing/​esutil/​esutil.go Switches response helpers to v9 request types.
internal/​pkg/​testing/​esutil/​datastream.go Updates data stream helper’s client import.
internal/​pkg/​testing/​esutil/​client.go Updates test client construction import.
internal/​pkg/​testing/​esutil/​bootstrap.go Updates bootstrap helper’s client import.
internal/​pkg/​testing/​bulk.go Updates bulk test helper’s client import.
internal/​pkg/​server/​fleet_secrets_integration_test.go Updates secrets integration test import.
internal/​pkg/​server/​fleet_integration_test.go Updates server integration test import.
internal/​pkg/​monitor/​subscription_monitor.go Updates subscription monitor’s client import.
internal/​pkg/​monitor/​monitor.go Updates policy and action monitor’s client import.
internal/​pkg/​gcheckpt/​checkpoint.go Switches checkpoint client and request imports.
internal/​pkg/​file/​uploader/​upload.go Updates uploader’s client import.
internal/​pkg/​file/​uploader/​es.go Switches upload storage client and request imports.
internal/​pkg/​file/​delivery/​es.go Switches delivery storage client and request imports.
internal/​pkg/​file/​delivery/​delivery.go Updates file delivery’s client import.
internal/​pkg/​file/​delivery/​delivery_test.go Updates delivery test client import.
internal/​pkg/​es/​info.go Updates cluster information client import.
internal/​pkg/​es/​delete.go Updates index deletion client import.
internal/​pkg/​es/​client.go Switches client construction to v9.
internal/​pkg/​es/​client_test.go Updates client and request imports in tests.
internal/​pkg/​dl/​migration.go Switches migration request types to v9.
internal/​pkg/​config/​output.go Switches output configuration to v9 client types.
internal/​pkg/​config/​output_test.go Updates output configuration test import.
internal/​pkg/​config/​output_nofips_test.go Updates non-FIPS TLS test import.
internal/​pkg/​config/​output_fips_test.go Updates FIPS TLS test import.
internal/​pkg/​checkin/​bulk.go Switches check-in script types and enums to v9.
internal/​pkg/​bulk/​setup_test.go Updates bulk test setup import.
internal/​pkg/​bulk/​secret.go Updates secret retrieval client import.
internal/​pkg/​bulk/​secret_limit_test.go Updates secret limit test import.
internal/​pkg/​bulk/​opSearch.go Switches bulk search request types to v9.
internal/​pkg/​bulk/​opRead.go Switches bulk read request types to v9.
internal/​pkg/​bulk/​opBulk.go Switches bulk write request types to v9.
internal/​pkg/​bulk/​opApiKey.go Switches API key request types to v9.
internal/​pkg/​bulk/​helpers.go Switches bulk helper request types to v9.
internal/​pkg/​bulk/​engine.go Updates bulk engine client and request imports.
internal/​pkg/​apikey/​invalidate.go Updates key invalidation client and request imports.
internal/​pkg/​apikey/​create.go Updates key creation client and request imports.
internal/​pkg/​apikey/​auth.go Updates authentication client and request imports.
internal/​pkg/​apikey/​auth_test.go Updates authentication test client import.
internal/​pkg/​apikey/​apikey.go Updates API key client and request imports.
internal/​pkg/​apikey/​apikey_integration_test.go Updates API key integration test import.
internal/​pkg/​api/​handleUpload.go Updates upload handler’s client import.
internal/​pkg/​api/​handleUpload_test.go Updates upload handler test import.
internal/​pkg/​api/​handleFileDelivery.go Updates file delivery handler’s client import.
internal/​pkg/​api/​handleEnroll.go Switches enrollment request types to v9.
internal/​pkg/​api/​handleEnroll_test.go Updates enrollment test client import.
go.sum Replaces v8 checksums with v9.5.2 checksums.
go.mod Requires Elasticsearch Go client v9.5.2.

Review effort: Balanced

Comment thread internal/pkg/es/client.go
"github.com/rs/zerolog"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"go.elastic.co/apm/v2"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/rs/zerolog"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
Comment thread go.mod
github.com/elastic/elastic-agent-client/v7 v7.18.1
github.com/elastic/elastic-agent-libs v0.47.0
github.com/elastic/go-elasticsearch/v8 v8.19.7
github.com/elastic/go-elasticsearch/v9 v9.5.2
Copilot AI balanced review requested due to automatic review settings November 7, 2026 21:48

Copilot AI 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.

🔵 Needs a closer look

The v9.5.2 migration leaves FleetSearch and ILM.PutLifecycle calls using incompatible signatures and removed WithBody helpers, preventing Fleet Server and the shared test utilities from compiling.

4 open issues

Review effort: Balanced

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Dependency Update Analysis

Summary: github.com/elastic/go-elasticsearch/v8 → v9.5.2 is a high-risk major Go API migration; this PR currently fails to build due incompatible v9 API call patterns.

Dependency: github.com/elastic/go-elasticsearch/v8 v8.19.7 → v9.5.2

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (details below)
Testable in PR ✅ Yes (.github/workflows/golangci-lint.yml + pre-commit.yml include pull_request)
Changelog highlights (v8.19.7 → v9.5.2)
  • v9.3.0 release notes include multiple breaking API changes (string→[]string, functional option/signature changes, duration type changes) and raised minimum Go/toolchain expectations (go 1.25 in v9.5.2 module go.mod; v8.19.7 was go 1.21).
  • v9.5.2 itself is small (typed API spec refresh).
  • CVE/security notes: no explicit CVE/GHSA entries found in the inspected release notes (v9.3.0, v9.5.2).
Usage in this repository
  • High usage surface: github.com/elastic/go-elasticsearch/v9 appears in 50 Go files / 60 matches across production modules (internal/pkg/api, apikey, bulk, es, monitor, file/*, dl, policy, server, etc.).
  • API usage includes elasticsearch.NewClient(...), many esapi.*Request calls, and typed API imports (internal/pkg/checkin/bulk.go).
Compatibility assessment
  • Build validation: go test ./... fails with concrete incompatibilities matching upstream breaking changes:
    • internal/pkg/monitor/monitor.go:421-422: FleetSearch call shape mismatch (WithBody no longer available in this form).
    • internal/pkg/testing/esutil/ilm.go:153-154: ILM.PutLifecycle signature mismatch and WithBody usage invalid.
  • This indicates migration is incomplete for v9 API signatures; production-impacting modules are affected.
  • Net: not merge-ready until API call sites are updated and full tests pass.

Labels Applied

No labels applied (overall risk: high, breaking changes currently impact this repo).


What is this? | From workflow: Observability Agentic Workflow — Pull Request

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Buildkite is failing for two concrete reasons: (1) check-ci detects stale NOTICE files after the Elasticsearch client major bump, and (2) package jobs fail to compile due a FleetSearch API mismatch after moving to go-elasticsearch/v9.

Remediation

  • Regenerate and commit notices after the dependency update (mage check:notice) so NOTICE.txt/NOTICE-fips.txt match go.mod.
  • Update internal/pkg/monitor/monitor.go (search() around lines 421-422 in CI logs) to the v9 FleetSearch call shape (body as positional io.Reader, remove WithBody).
  • Re-run check-ci plus one package build path (FIPS and non-FIPS) to confirm both failure classes are resolved.
Investigation details

Root Cause

  1. Dependency hygiene failure (check-ci): PR updates Elasticsearch Go client major version but corresponding notice files are not updated.
  2. Code/API break (package jobs): monitor.search() still invokes FleetSearch with v8-style options; v9 no longer supports WithBody and now expects an io.Reader positional argument.

Evidence

NOTICE-fips.txt: needs update
NOTICE.txt: needs update
Error: git update-index failure: running "git update-index --refresh" failed with exit code 1
  • Key excerpt (package logs):
internal/pkg/monitor/monitor.go:421:3: cannot use m.esCli.FleetSearch.WithContext(ctx) ... as io.Reader value in argument to m.esCli.FleetSearch
internal/pkg/monitor/monitor.go:422:23: m.esCli.FleetSearch.WithBody undefined (type esapi.FleetSearch has no field or method WithBody)

Verification

  • Reviewed all 4 failing job logs from /tmp/gh-aw/buildkite-logs/.
  • Local build/tests were not run in this detective pass (read-only triage scope).

Follow-up

  • I attempted to cross-check open flaky-test issues, but issue-listing results were filtered by repository integrity policy in this run; no reliable flaky mapping could be confirmed from accessible data.

What is this? | From workflow: Observability Agentic Workflow — Status

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

This branch has not been deployed

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

Labels

automation backport-skip Skip notification from the automated backport with mergify dependency oblt-aw/ai/merge-ready skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant