-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Synthetics] Only return 404 if screenshot_ref is truly not present
#215241
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
[Synthetics] Only return 404 if screenshot_ref is truly not present
#215241
Conversation
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
fkanout
left a comment
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.
code review only, LGTM
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
dominiqueclarke
left a comment
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.
LGTM
|
Starting backport for target branches: 9.0 |
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <[email protected]> (cherry picked from commit 74f87d9)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <[email protected]>
…resent (#215241) (#215726) # Backport This will backport the following commits from `main` to `9.0`: - [[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)](#215241) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-24T14:50:18Z","message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0"],"title":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present","number":215241,"url":"https://github.com/elastic/kibana/pull/215241","mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215241","number":215241,"mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}}]}] BACKPORT--> Co-authored-by: Justin Kambic <[email protected]>
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <[email protected]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <[email protected]> (cherry picked from commit 74f87d9)
…resent (#215241) (#218136) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)](#215241) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-24T14:50:18Z","message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0"],"title":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present","number":215241,"url":"https://github.com/elastic/kibana/pull/215241","mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/215726","number":215726,"state":"MERGED","mergeCommit":{"sha":"349e4472ee62edd72cd062bb2635cb563f61168b","message":"[9.0] [Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241) (#215726)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[Synthetics] Only return 404 if `screenshot_ref` is truly not present\n(#215241)](https://github.com/elastic/kibana/pull/215241)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Justin Kambic <[email protected]>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215241","number":215241,"mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <[email protected]>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}}]}] BACKPORT-->
Summary
Right now we return a 404 anytime that the data we're looking for on the
screenshot_refroute is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data.Instead, we first check if the data returned from Elasticsearch is
null, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response.