-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Ingest Manager] Ensure at least default Error handling on all routes #77975
[Ingest Manager] Ensure at least default Error handling on all routes #77975
Conversation
@elasticmachine merge upstream |
await supertest | ||
.post(`/api/ingest_manager/agent_policies/INVALID_POLICY_ID/copy`) | ||
.set('kbn-xsrf', 'xxxx') | ||
.send({ | ||
name: 'Copied policy', | ||
description: '', | ||
}) | ||
.expect(500); | ||
.expect(404); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 400
make sense here 👍
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚀
…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 <[email protected]> * Add import missed by backport script Co-authored-by: Elastic Machine <[email protected]>
…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 <[email protected]> # 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
defaultIngestErrorHandler
introduced 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
500
to404
.I'm not sure if any more are needed/desired. There are tests for
defaultIngestErrorHandler
which sure the advertised behavior.Any non-default logic is still run before
defaultIngestErrorHandler
is called.For maintainers