Skip to content
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

[Logs UI] Set streamLive false in URL state when arriving from link-to #56329

Merged
merged 12 commits into from
Feb 7, 2020

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Jan 29, 2020

Summary

Closes #55652

Removes the streamLive param from the log position URL state whenever it's false, and only adds it back in when it's true.

Forces the streamLive param to false when replacing a link-to search string in the logs stream URL.

This fixes a flaky test.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@Zacqary Zacqary added failed-test A test failure on a tracked branch, potentially flaky-test v8.0.0 Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Jan 29, 2020
@Zacqary Zacqary requested a review from a team January 29, 2020 18:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-test-triage (failed-test)

@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 29, 2020

@elasticmachine merge upstream

@afgomez afgomez self-requested a review January 30, 2020 08:28
Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking out loud.

I understand the reason why this test was flaky was because the streamLive parameter in the URL sometimes was false, and sometimes wasn't there, and the test was only covering the false case.

streamLive is a 3-state boolean (true, false, and not-there). In practice false and not-there have the same effect so we can remove one of them.

This PR removes false leaving only two states: true and not-there. I think that makes it a bit harder to reason about it that if it had true and false as valid states.

I haven't dug into the code, but I think that could be made with this change.

-const mapToStreamLiveUrlState = (value: any) => (typeof value === 'boolean' ? value : undefined);	
+const mapToStreamLiveUrlState = (value: any) => (typeof value === 'boolean' ? value : false);

Maybe you tried that already and it didn't work correctly because sometimes it wasn't being called in the right order during initialisation and the test was still flaky, but I think it might be worth a try. Otherwise I can go ahead and approve the PR

@weltenwort
Copy link
Member

I would agree that we should prefer true/false as the two states in the URL. I wonder why the value passed to mapToStreamLiveUrlState seems to not be a boolean in the first place 🤔 maybe the cleaner fix would be to ensure that it is by making sure the source of that value is false by default and that false always gets passed down.

@afgomez
Copy link
Contributor

afgomez commented Jan 30, 2020

I would agree that we should prefer true/false as the two states in the URL. I wonder why the value passed to mapToStreamLiveUrlState seems to not be a boolean in the first place

I think that happens on page load, when the URL has no values.

@Zacqary Zacqary changed the title [Logs UI] Remove streamLive false from URL state [Logs UI] Set streamLive false in URL state when arriving from link-to Jan 30, 2020
@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 30, 2020

Just pushed another approach, I think this should actually fix it for real.

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Perfect!

@Zacqary
Copy link
Contributor Author

Zacqary commented Feb 6, 2020

@elasticmachine merge upstream

@Zacqary
Copy link
Contributor Author

Zacqary commented Feb 6, 2020

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@elastic elastic deleted a comment from kibanamachine Feb 6, 2020
@Zacqary Zacqary merged commit 13944fa into elastic:master Feb 7, 2020
Zacqary added a commit to Zacqary/kibana that referenced this pull request Feb 7, 2020
elastic#56329)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Zacqary added a commit to Zacqary/kibana that referenced this pull request Feb 7, 2020
elastic#56329)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Feb 7, 2020
elastic#56329)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Zacqary added a commit that referenced this pull request Feb 7, 2020
#56329) (#57115)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Zacqary added a commit that referenced this pull request Feb 7, 2020
#56329) (#57114)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 9, 2020
…t-state

* upstream/master: (96 commits)
  top nav ts arg support (elastic#56984)
  [SIEM][detection engine] Limit network rules to filebeat source semantics (elastic#57130)
  Add docs for alerting and action settings (elastic#57035)
  Add Test to Verify Endpoint App Landing Page (elastic#57129)
  Update `markdown-to-jsx` (`6.9.3` → `6.11.0`) and `url-parse` (`1.4.4` → `1.4.7`) dependencies. (elastic#57126)
  chore(NA): removes use of parallel option in the terser minimizer (elastic#57077)
  [ML] New Platform server shim: update file data visualizer routes to use new platform router (elastic#56972)
  Specifying valid licenses for the Graph feature (elastic#55911)
  [APM][docs] Add troubleshooting for non-indexed fields (elastic#54948)
  [ML] DF Analytics creation: update schema definition for create route (elastic#56979)
  Remove Kibana a11y guide in favor of EUI (elastic#57021)
  [Logs UI] Set streamLive false in URL state when arriving from link-to (elastic#56329)
  [docs] Fix spaces api example json (elastic#50411)
  Add new config for filebeat index name (elastic#56920)
  [Metrics-UI] Fix toolbar popover for metrics table row (elastic#56796)
  Saved Objects testing (elastic#56965)
  Disabled categorization stats validation (elastic#57087)
  [Rollups] Server NP migration (elastic#55606)
  [Metrics UI] Limit group by selector to only 2 fields (elastic#56800)
  fix auto closing new vis modal when navigating to lens or when navigating away with browser history (elastic#56998)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 9, 2020
* master: (96 commits)
  top nav ts arg support (elastic#56984)
  [SIEM][detection engine] Limit network rules to filebeat source semantics (elastic#57130)
  Add docs for alerting and action settings (elastic#57035)
  Add Test to Verify Endpoint App Landing Page (elastic#57129)
  Update `markdown-to-jsx` (`6.9.3` → `6.11.0`) and `url-parse` (`1.4.4` → `1.4.7`) dependencies. (elastic#57126)
  chore(NA): removes use of parallel option in the terser minimizer (elastic#57077)
  [ML] New Platform server shim: update file data visualizer routes to use new platform router (elastic#56972)
  Specifying valid licenses for the Graph feature (elastic#55911)
  [APM][docs] Add troubleshooting for non-indexed fields (elastic#54948)
  [ML] DF Analytics creation: update schema definition for create route (elastic#56979)
  Remove Kibana a11y guide in favor of EUI (elastic#57021)
  [Logs UI] Set streamLive false in URL state when arriving from link-to (elastic#56329)
  [docs] Fix spaces api example json (elastic#50411)
  Add new config for filebeat index name (elastic#56920)
  [Metrics-UI] Fix toolbar popover for metrics table row (elastic#56796)
  Saved Objects testing (elastic#56965)
  Disabled categorization stats validation (elastic#57087)
  [Rollups] Server NP migration (elastic#55606)
  [Metrics UI] Limit group by selector to only 2 fields (elastic#56800)
  fix auto closing new vis modal when navigating to lens or when navigating away with browser history (elastic#56998)
  ...
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Feb 10, 2020
elastic#56329)

* [Logs UI] Remove streamLive false from URL state

* Force false livestream boolean from link-to

* Update type def

* Update snapshots

* Fix snapshot typo

* Fix snapshot again

* Fix node test snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.6.0 v8.0.0
Projects
None yet
4 participants