-
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
Fix banner not being displayed on login page #140688
Fix banner not being displayed on login page #140688
Conversation
Pinging @elastic/kibana-core (Team:Core) |
@@ -23,7 +23,7 @@ export class BannersPlugin implements Plugin<{}, {}, {}, BannerPluginStartDepend | |||
{ chrome, uiSettings, http }: CoreStart, | |||
{ screenshotMode }: BannerPluginStartDependencies | |||
) { | |||
if (!screenshotMode.isScreenshotMode()) { | |||
if (!(screenshotMode?.isScreenshotMode() ?? false)) { |
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.
Not strictly necessary, but I took the opportunity to change the screenshotMode dependency from required to optional, given it felt way more logical that way.
@@ -35,7 +35,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { | |||
serverArgs: [ | |||
...kibanaFunctionalConfig.get('kbnTestServer.serverArgs'), | |||
'--xpack.banners.placement=top', | |||
'--xpack.banners.textContent="global banner text"', | |||
'--xpack.banners.textContent=global_banner_text', |
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.
With @wayneseymour, we encountered inconsistencies between local and CI envs: on CI, somehow passing cli arguments with white spaces has an issue, causing the escaping to not be properly handled.
E.g
'--xpack.banners.textContent="global banner text"',
was effectively setting the value to "global
After some unsuccessful attempts to work around it, I pragmatically removed whitespaces from the test text.
cc @elastic/kibana-operations as that could be something you may want to look into. AFAIK after taking a look, it seems this is the only place in all FTR test suites were we're passing some full text parameter as a CLI arg (also, as already mentioned, this works fine on local env)
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.
@jbudz it looks like the issue is https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/bin/scripts/kibana#L29. When I open that script in VSCode shellcheck says that the ${@}
at the end of that line is going to cause "re-splitting", which is why this only seems to happen on CI (On CI we run a distributable while we use source locally)
https://www.shellcheck.net/wiki/SC2068
Wrapping that in double quotes fixes the issue for me:
before:
proc [kibana] ARGV: [..."--xpack.banners.placement=top","--xpack.banners.textContent=\"global","banner","text\"",...]
after:
proc [kibana] ARGV: [..."--xpack.banners.placement=top","--xpack.banners.textContent=\"global banner text\"",...]
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.
ftr_configs.yml
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
* Fix banner not being displayed on login page * fix and re-enable banner FTR tests * revert commit to config file * add unit test * don't use whitespace for cli config value Co-authored-by: Tre <wayne.seymour@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit b86cef5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
* Fix banner not being displayed on login page * fix and re-enable banner FTR tests * revert commit to config file * add unit test * don't use whitespace for cli config value Co-authored-by: Tre <wayne.seymour@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit b86cef5) Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
This PR missed the 8.4.2 release, so I have updated the labels to reflect this. |
Summary
Fix #140307
Related to #135783