Skip to content

[9.0] [Console] Fix output for empty response body (#218104)#218185

Merged
kibanamachine merged 5 commits intoelastic:9.0from
kibanamachine:backport/9.0/pr-218104
Apr 17, 2025
Merged

[9.0] [Console] Fix output for empty response body (#218104)#218185
kibanamachine merged 5 commits intoelastic:9.0from
kibanamachine:backport/9.0/pr-218104

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

Fixes elastic#217433

## Summary

This PR fixes the Console output when the response body is an empty
string.

In elastic#199975, we made Console to
display an `OK` output if the status code is 200 but response body is
`null`. Previously, `POST
/_cluster/voting_config_exclusions?node_names=node` returned `null` and
so the output was correctly set to `OK` but now the response is an empty
string and this case isn't covered correctly. In this PR, we make sure
to perform the right check at the right point so that both `null` and
empty strings are covered.

The test that covers this scenario and had failures:
https://github.com/elastic/kibana/blob/7092e79157cb8abb229131a1607369324d10969f/src/platform/test/functional/apps/console/_console.ts#L258

To run the failing test with the new Es snapshots:

```
ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/8.19.0/archives/20250414-022022_f16f4ce6/manifest.json" node scripts/functional_tests_server.js --config ./src/platform/test/functional/apps/console/config.ts
```

and

```
ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/9.1.0/archives/20250414-021844_4ed1a000/manifest.json" node scripts/functional_test_runner.js  --config ./src/platform/test/functional/apps/console/config.ts --grep="Shows OK when status code is 200 but body is empty"
```

(cherry picked from commit 170651a)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Apr 14, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) April 14, 2025 22:12
@kibanamachine kibanamachine merged commit a7361cf into elastic:9.0 Apr 17, 2025
9 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #9 / dashboard app - group 4 dashboard listing page insights shows the insights panel and counts the views

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 185.7KB 185.7KB +9.0B

History

cc @ElenaStoeva

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

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants