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

fix(ui): removed buildActiveQuery func to prevent queries from being reset when timeranges are selected. #16404

Merged
merged 3 commits into from
Jan 6, 2020

Conversation

asalem1
Copy link
Contributor

@asalem1 asalem1 commented Jan 3, 2020

Closes #16369

Problem

Calling buildActiveQuery after SET_BUILDER_TAG_VALUES was resetting the query whenever the timerange was being set

Solution

The rationale for calling the buildActiveQuery on SET_BUILDER_TAG_VALUES was to ensure that:

it's to build the query when grouping and selecting fields

This seems to already be occurring whenever a query is drafted and is unnecessary. Since this change had originally broken an e2e explorer test, removing this line passes the test.

One key metric to ensure that this is in fact a stable solution would be to:

look at switching between filtering and grouping in the query builder

  • CHANGELOG.md updated with a link to the PR (not the Issue)

@asalem1 asalem1 requested review from hoorayimhelping, a team and desa January 3, 2020 19:21
@@ -349,8 +349,7 @@ describe('DataExplorer', () => {
})
})

// todo: investigate flakiness of this test: https://github.com/influxdata/influxdb/issues/16330
describe.skip('raw script editing', () => {
describe('raw script editing', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

i think the failures that were revealed with this action being dispatched are masking a deeper problem. i have another pr that is handling this: #16392.

did you run these e2e tests a few times to make sure they're reliable in ci? i'm kind of curious about the reliability of them. i could get this test to pass every time locally, and sometimes on ci.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hoorayimhelping I did run them a few times but I have no problem skipping them here in favor of your PR

Copy link
Contributor

Choose a reason for hiding this comment

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

@asalem1 I think they're okay to be run now, I have what I think is the fix in master. I was more curious about the root cause of this issue - I'm having a hard time figuring out why removing buildActiveQuery had an effect on these tests and I was wondering if you found anything out in your digging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hoorayimhelping aw, I see. Truthfully, I'm not sure I fully comprehend why the test was failing when that line was added, and why it's no longer failing. I imagine that there are unintended consequences to the functionality of the utility function that may have been effecting the query builder / script editor that we are currently unaware of.

@ghost ghost requested review from drdelambre and removed request for a team January 4, 2020 01:42
@asalem1 asalem1 changed the title fix(ui): removed buildActiveQuery func to prevent queries from being reset when timeranges are selected. Fixed broken test that was being skipped fix(ui): removed buildActiveQuery func to prevent queries from being reset when timeranges are selected. Jan 6, 2020
@@ -349,7 +349,7 @@ describe('DataExplorer', () => {
})
})

describe('raw script editing', () => {
describe.skip('raw script editing', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
describe.skip('raw script editing', () => {
describe('raw script editing', () => {

@hoorayimhelping
Copy link
Contributor

@asalem1 this is good to merge after removing the skip

@asalem1 asalem1 merged commit 96dcdb0 into master Jan 6, 2020
alexpaxton pushed a commit that referenced this pull request Jan 9, 2020
…reset when timeranges are selected. (#16404)

fix(ui): removed buildActiveQuery func to prevent queries from being reset when timeranges are selected. Fixed broken test that was being skipped
@mark-rushakoff mark-rushakoff deleted the timerange-query-reset branch April 16, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query disappears in data explorer when changing time range
2 participants