[Ingest Manager] Ensure at least default Error handling on all routes#77975
[Ingest Manager] Ensure at least default Error handling on all routes#77975jfsiii merged 4 commits intoelastic:masterfrom jfsiii:update-happy-path-error-handlers
Conversation
|
@elasticmachine merge upstream |
| description: '', | ||
| }) | ||
| .expect(500); | ||
| .expect(404); |
There was a problem hiding this comment.
This is consistent with what we do elsewhere, and I prefer 4xx over 500 here, but we can easily keep the 500 behavior if that's desired.
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…routes (#77975) (#78086) * [Ingest Manager] Ensure at least default Error handling on all routes (#77975) * res.customError -> defaultIngestErrorHandler * Missed a variable rename in prior commit * copying an invalid policy will 404; not 500 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * Add import missed by backport script Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…routes (#77975) (#78088) * [Ingest Manager] Ensure at least default Error handling on all routes (#77975) * res.customError -> defaultIngestErrorHandler * Missed a variable rename in prior commit * copying an invalid policy will 404; not 500 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/ingest_manager/server/routes/agent/acks_handlers.ts # x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts # x-pack/plugins/ingest_manager/server/routes/agent_policy/handlers.ts # x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts # x-pack/plugins/ingest_manager/server/routes/settings/index.ts # x-pack/test/ingest_manager_api_integration/apis/agent_policy/agent_policy.ts * Remove any 7.x references to *_policy vs *_config * 404, not 500, on invalid id
|
Hi @jfsiii We have gone through the ticket and observed it required DEV_Validation to test the ticket . Please let us know if anything is missing from our end. |
|
@rahulgupta-qasource I don't know what DEV_Validation is. Are you unable to make GET and POST requests to the /api/fleet/* endpoints? |
|
@jfsiii hi. I can chime in, we're implementing process as we go - thanks for the support. :) This DEV_Validate label is a carry over from process the QA team had with other teams. It's use was intended to specify the test team believed it was beyond regular test duty (usually beyond the ability of the test team to handle it without more input and possibly without more expertise developed). It was used to indicate that and to close the loop back that the dev team would handle it or elaborate further on what we shall do. Allow me to follow through now: The QA validation we've done over the 7.9.3 build shows that the merge was sane and we can call the testing side done as I see it. Very happy to discourse any topic or specific item about this pr or test need and to figure out how to assign any further test work. I know we have an OAS api file in Kibana, we can use that to do manual review if we think it is warranted. The test team understands Postman usage to make API calls, but Rahul has not specifically done much API tests until now so it will include some ramp up time and discourse about which APIs need coverage. |
|
@EricDavisX Thanks for the explanation. I'm lacking context for why I was pinged about this, but I'm not asking for any different testing here. Let me know if you need anything from me, but I'm fine leaving this closed and covered by our existing approach(es). |
Summary
Fixes the error logging & HTTP status code portions of #66688 for all routes by using the
defaultIngestErrorHandlerintroduced in #74409/setup&/epm/*were implemented in #74409Now the handlers look roughly like:
Checklist
Delete any items that are not applicable to this PR.
Update one test a1939d3 to reflect the change in result from
500to404.I'm not sure if any more are needed/desired. There are tests for
defaultIngestErrorHandlerwhich sure the advertised behavior.Any non-default logic is still run before
defaultIngestErrorHandleris called.For maintainers