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

[BUG][Data] Support for custom filters with heterogeneous data fields #5577

Merged

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Dec 6, 2023

Description

When enabling the advanced setting courier:ignoreFilterIfFieldNotInIndex Custom OpenSearch Query DSL filters could technically be applied to index patterns that map to indices that are not exactly the same. Since the custom query filter is a user input then users can really type anything that they need. Or any field that they know is present but we do not know for sure.

Therefore, we can check if the id which is the index pattern title to check if we should apply the filter or not.

⚠️ Bug impacts: 1.0-1.3., 2.0-2.11, and 3.0 ⚠️

Issues Resolved

#5581
I believe issue:
#5423

Should closed as that is expected functionality.

Screenshot

Request before:
Screenshot 2023-12-06 at 2 16 05 AM

Request after:
Screenshot 2023-12-06 at 2 19 56 AM

Testing the changes

Using the sample data web logs and created a data table.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
opensearch-project#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla force-pushed the kavilla/custom_filter_matches_index branch from 036b6f6 to 8551434 Compare December 6, 2023 10:43
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2e7a2ba) 66.93% compared to head (fd418fc) 66.98%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5577      +/-   ##
==========================================
+ Coverage   66.93%   66.98%   +0.04%     
==========================================
  Files        3293     3293              
  Lines       63285    63287       +2     
  Branches    10061    10062       +1     
==========================================
+ Hits        42362    42394      +32     
+ Misses      18459    18453       -6     
+ Partials     2464     2440      -24     
Flag Coverage Δ
Linux_1 35.24% <0.00%> (-0.01%) ⬇️
Linux_2 55.21% <0.00%> (?)
Linux_3 43.78% <100.00%> (?)
Linux_4 35.34% <0.00%> (?)
Windows_1 35.27% <0.00%> (-0.01%) ⬇️
Windows_2 55.17% <0.00%> (-0.01%) ⬇️
Windows_3 43.80% <100.00%> (+<0.01%) ⬆️
Windows_4 35.34% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ananzh
ananzh previously approved these changes Dec 6, 2023
@ananzh
Copy link
Member

ananzh commented Dec 6, 2023

Issue Resolve #5423

@ananzh ananzh added the v2.12.0 label Dec 6, 2023
Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
@joshuarrrr
Copy link
Member

What do we think about backporting this to 1.3?

@kavilla
Copy link
Member Author

kavilla commented Dec 7, 2023

What do we think about backporting this to 1.3?

i think so

@kavilla
Copy link
Member Author

kavilla commented Dec 7, 2023

Verified newest commit locally.

@kavilla kavilla merged commit 805400d into opensearch-project:main Dec 7, 2023
74 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 7, 2023
…#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 7, 2023
…#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 7, 2023
…#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
Alankarsharma pushed a commit to Alankarsharma/OpenSearch-Dashboards that referenced this pull request Dec 8, 2023
…opensearch-project#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
opensearch-project#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Alankarsharma <[email protected]>
ananzh pushed a commit that referenced this pull request Dec 12, 2023
…#5577) (#5585)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this pull request Dec 12, 2023
…#5577) (#5583)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 13, 2023
…#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ananzh pushed a commit that referenced this pull request Dec 13, 2023
…#5577) (#5584)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 805400d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
zhyuanqi pushed a commit to zhyuanqi/OpenSearch-Dashboards that referenced this pull request Jan 8, 2024
…opensearch-project#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
opensearch-project#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
zhyuanqi pushed a commit to zhyuanqi/OpenSearch-Dashboards that referenced this pull request Jan 8, 2024
…opensearch-project#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
opensearch-project#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
zhyuanqi pushed a commit to zhyuanqi/OpenSearch-Dashboards that referenced this pull request Jan 8, 2024
…opensearch-project#5577)

* [BUG][Data] Support for custom filters with heterogeneous data fields

When enabling the advanced setting `courier:ignoreFilterIfFieldNotInIndex`
Custom OpenSearch Query DSL filters could technically be applied to index
patterns that map to indices that are not exactly the same. Since the
custom query filter is a user input then users can really type anything
that they need. Or any field that they know is present but we do not know
for sure.

Therefore, we can check if the id which is the index pattern title to check
if we should apply the filter or not.

Issue resolved:
https://github.com/opensearch-project/dashboards-visualizations/issues/281

I believe issue:
opensearch-project#5423

Should closed as that is expected functionality.

Signed-off-by: Kawika Avilla <[email protected]>

* [Cleanup] utilize the same helper function

Originally when implementing the fix the historical comment caused concern about
potential breaking changes.

But after discussion, we decided it is more clear to consolidate the helper functions.

Signed-off-by: Kawika Avilla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants