Skip to content
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

[IngestPipelineSimulation] Typing error on exported type #2647

Open
tonyghiani opened this issue Mar 3, 2025 · 0 comments
Open

[IngestPipelineSimulation] Typing error on exported type #2647

tonyghiani opened this issue Mar 3, 2025 · 0 comments

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

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

No branches or pull requests

2 participants