Skip to content

[IngestPipelineSimulation] Typing error on exported type #2647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tonyghiani opened this issue Mar 3, 2025 · 2 comments · May be fixed by elastic/elasticsearch-specification#4292
Open

Comments

@tonyghiani
Copy link

tonyghiani commented Mar 3, 2025

🐛 Bug report

📓 Summary

In Kibana, we use the IngestPipelineSimulation type to manipulate response values from the POST /_ingest/pipeline/_simulate API.

First issue is about naming, the IngestPipelineSimulation represents the property IngestSimulateDocumentResult.processor_results, which is a bit misleading since it's not the result of the whole pipeline, but represent a single processor result. Maybe something IngestPipelineProcessorResult would fit better.

We want to run guards against the status property, and it is currently set to WatcherActionStatusOptions, which seems wrong as we don't get types for the right status (e.g. skipped).

Would be great to fix the type to get the expected status mapping that comes from the ES implementation.

To reproduce

const processorResult: IngestPipelineSimulation = {
  status: 'skipped', // Type '"skipped"' is not assignable to type 'WatcherActionStatusOptions | undefined'.ts(2322)
};

Expected behavior

const processorResult: IngestPipelineSimulation = {
  status: 'skipped' // ✅ Valid value
};

Node.js version

Any version

@elastic/elasticsearch version

v9.0.0-alpha

Operating system

macOs

Any other relevant environment information

No response

@JoshMock
Copy link
Member

Hey @tonyghiani. I just opened a PR on the spec repo to fix this type. Once that merges it should show up in the next patch or minor release of the client.

@tonyghiani
Copy link
Author

Great, thanks @JoshMock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants