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

[Data Explorer] Fix missing field error from taking down the page #5626

Merged

Conversation

ashwin-pc
Copy link
Member

Description

If an index pattern is created programatically using saved object API but a corresponding index does not exist for the pattern, discover throws a full page error that blocks the app from being used. This change still displays the error but allows the user to continue using the app to make other changes and remedy the situation.

Issues Resolved

closes #5625

Screenshot

Before:

Screenshot 2023-12-18 at 12 48 00 PM

After:
Screenshot 2023-12-18 at 12 48 59 PM

Testing the changes

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

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4d57b8a) 67.02% compared to head (460ab95) 66.97%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5626      +/-   ##
==========================================
- Coverage   67.02%   66.97%   -0.05%     
==========================================
  Files        3294     3294              
  Lines       63296    63298       +2     
  Branches    10066    10067       +1     
==========================================
- Hits        42422    42395      -27     
- Misses      18434    18437       +3     
- Partials     2440     2466      +26     
Flag Coverage Δ
Linux_1 35.24% <ø> (ø)
Linux_2 ?
Linux_3 ?
Linux_4 ?
Windows_1 35.27% <ø> (ø)
Windows_2 55.14% <ø> (+<0.01%) ⬆️
Windows_3 43.89% <ø> (-0.01%) ⬇️
Windows_4 35.34% <ø> (-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.

manasvinibs
manasvinibs previously approved these changes Dec 18, 2023
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
AMoo-Miki
AMoo-Miki previously approved these changes Dec 18, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Comment on lines +30 to +36
try {
return data.search.aggs.createAggConfigs(indexPattern, visStateAggs);
} catch (error) {
// Just display the error to the user but continue to render the rest of the page
data.search.showError(error as Error);
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

A test to cover this section is preferred.

@ashwin-pc ashwin-pc merged commit 28c1fbb into opensearch-project:main Dec 19, 2023
67 checks passed
@ananzh ananzh added discover for discover reinvent bug Something isn't working backport 2.11 backport 2.x labels Jan 26, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 26, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
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 Jan 26, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
manasvinibs pushed a commit that referenced this pull request Jan 30, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
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 Jan 30, 2024
) (#5747)

* Handle missing fields error

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
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>
manasvinibs pushed a commit that referenced this pull request Jan 31, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
manasvinibs pushed a commit that referenced this pull request Jan 31, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
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 Feb 7, 2024
)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ashwin-pc pushed a commit that referenced this pull request Feb 7, 2024
) (#5748)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this pull request Feb 7, 2024
) (#5828)

* Handle missing fields error

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
(cherry picked from commit 28c1fbb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x bug Something isn't working discover for discover reinvent distinguished-contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [Discover] Missing field in index pattern throws whole page error
7 participants