chore(deps): update kibana-openapi-spec digest to 5c49938#2031
chore(deps): update kibana-openapi-spec digest to 5c49938#2031elastic-renovate-prod[bot] merged 5 commits intomainfrom
Conversation
|
|
|
5f52058 to
992924a
Compare
992924a to
c4adf87
Compare
4ae0d93 to
78d102e
Compare
6dacf63 to
9d6248b
Compare
9d6248b to
ac66e6d
Compare
ac66e6d to
1779612
Compare
1779612 to
cb77618
Compare
There was a problem hiding this comment.
🟢 Low
When model.Kafka is unknown (not null), the code enters the if block at line 499 and calls typeutils.ObjectTypeAs, which returns nil for unknown values. Line 501 then dereferences nil (*kafkaObj), causing a panic. The check should use typeutils.IsKnown(model.Kafka) instead of !model.Kafka.IsNull().
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file internal/fleet/output/models_kafka.go around line 499:
When `model.Kafka` is unknown (not null), the code enters the `if` block at line 499 and calls `typeutils.ObjectTypeAs`, which returns `nil` for unknown values. Line 501 then dereferences `nil` (`*kafkaObj`), causing a panic. The check should use `typeutils.IsKnown(model.Kafka)` instead of `!model.Kafka.IsNull()`.
Evidence trail:
- internal/fleet/output/models_kafka.go lines 499-501 (REVIEWED_COMMIT): shows `if !model.Kafka.IsNull()` check followed by dereference of `*kafkaObj`
- internal/utils/typeutils/tfsdk.go lines 282-290: `ObjectTypeAs` returns `nil` when `!IsKnown(value)` (i.e., when value is unknown)
- internal/utils/typeutils/schema.go lines 33-35: `IsKnown` returns `!value.IsNull() && !value.IsUnknown()`, confirming unknown values are not considered known
Edited/Blocked NotificationRenovate 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. |
…wrappers (#260842) ## Summary Follow up to [#258986](#258986) to fix duplicated SSL/shipper struct definitions and `anyOf` catchall union wrappers for Kafka conditional fields. This PR: - extracts shared SSL and shipper objects into standalone schemas with `meta:{id}` - output variants reference a single `$ref` component - replaces the four `schema.conditional()` Kafka fields (`compression_level`, `connection_type`, `username`, `password`) with `schema.maybe()` - produces clean OAS output - moves cross-field validation to the service layer in `output.ts`, matching the existing pattern for `compression_level` clearing - allowlists breaking changes in OAS api contracts check The net result is 27 fewer generated Go types and ~1,500 fewer lines in the bundled OAS. On the provider side, this eliminates the ~450 lines of adapter code added in [PR#2031](elastic/terraform-provider-elasticstack#2031). Relates to #228077 #### Breaking changes The contract checker flags 352 changes across 3 fleet output endpoints. None of these change runtime API behavior — they're all OAS representation improvements that only affect code generators consuming the spec. - **SSL/shipper `object` → `$ref`**: oasdiff can't resolve through `$ref`, so it reports type changes and "removed" sub-properties. The actual data shapes are identical. - **Kafka fields became optional**: `schema.conditional()` → `schema.maybe()` is strictly more permissive. Service layer now enforces the same cross-field constraints. - **Kafka field types narrowed**: the old `schema.conditional()` produced `anyOf: [array, boolean, number, object, string]` catchalls. Now they're the correct specific types (`number`, `string`, etc.). <details> <summary>How to test this</summary> 1. Run the output model and service tests: ``` node scripts/jest x-pack/platform/plugins/shared/fleet/server/types/models/output.test.ts node scripts/jest x-pack/platform/plugins/shared/fleet/server/services/output.test.ts ``` All 7 model tests and 99 service tests should pass. 2. Run the contract checker for both distributions: ``` node scripts/check_api_contracts.js --distribution stack node scripts/check_api_contracts.js --distribution serverless ``` Both should report all breaking changes allowlisted. 3. Verify OAS snapshot changes by inspecting the diff on `oas_docs/output/kibana.yaml`: - `output_ssl` and `output_shipper` each appear once as component definitions, referenced via `$ref` from all output variants - Kafka `compression_level` is `type: number`, `connection_type` is `type: string` with enum, `username` and `password` are `nullable: true, type: string` — no `anyOf` catchalls </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks | Risk | Severity | Likelihood | Mitigation | |---|---|---|---| | Loosened Kafka field validation at schema level | Low | Low | Service layer enforces the same cross-field rules. Existing service tests (99/99) pass. | | Shared SSL/shipper `$ref` changes OAS structure | Low | None observed | Data shape is identical. TF provider codegen produces cleaner types with no regressions. | Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR contains the following updates:
574644c->5c49938Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
Note
Update Fleet output models to use new kbapi enum types from digest 5c49938
5c49938, which renames enum types for Elasticsearch, Kafka, and Logstash outputs.outputSSLAPIModelintermediary struct with per-output-type conversion methods, replacing directkbapi.NewOutputSsl/kbapi.UpdateOutputSslusage.fromAPImethods — absent SSL now yields a null/empty Terraform object value.ConnectionType,Username,Password, andCompressionLevel, with diagnostic collection on conversion errors.agent_features_disable_policy_change_acks_enabledfield to the advanced settings API payload struct in models_advanced_settings.go.Changes since #2031 opened
Macroscope summarized 023c164.