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

[Backport 2.x] Fix object empty check and minor perf issue in query editor extensions #7140

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

@opensearch-trigger-bot opensearch-trigger-bot bot commented Jul 1, 2024

Backport b85e177 from #7077.

Changelog

  • skip

#7077)

Follow up for #7034, this PR
- addresses #7034 (comment)
- addresses #7034 (comment)
- fixes render order
   - QueryEditorExtensions requires the container divs to be mounted first,
but in the previous implementation, extensions will be mounted first and
it relied on rerendering of queryEditorTopRow. Moving them into query
editor fixes the render order and ensures refs are set.

@AMoo-Miki I didn't use the object check `'[object Object]' !== Object.prototype.toString.call(configMap)`. I don't know what access user has, but if an attacker can arbitrarily alter `configMap`, the code will still break with something like
```tsx
        configMap={
          new Proxy(
            {},
            {
              ownKeys(target) {
                throw new Error('Accessing keys is not allowed.');
              },
            }
          )
        }
```

Given that our code creates the config map here, I think relying on static type check is enough, but feel free to comment if otherwise.
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/7f0e39eb9809c95b98069cc971611edc2cbbc62b/src/plugins/data/public/ui/ui_service.ts#L31

Signed-off-by: Joshua Li <joshuali925@gmail.com>
(cherry picked from commit b85e177)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Jul 1, 2024

❌ Invalid Changelog Heading

The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.59%. Comparing base (353f509) to head (6ea7117).
Report is 2 commits behind head on 2.x.

Additional details and impacted files
@@           Coverage Diff           @@
##              2.x    #7140   +/-   ##
=======================================
  Coverage   67.59%   67.59%           
=======================================
  Files        3446     3446           
  Lines       67908    67908           
  Branches    11027    11027           
=======================================
  Hits        45904    45904           
  Misses      19341    19341           
  Partials     2663     2663           
Flag Coverage Δ
Linux_1 33.13% <ø> (ø)
Linux_2 55.23% <ø> (ø)
Linux_3 45.28% <100.00%> (-0.02%) ⬇️
Linux_4 35.02% <ø> (ø)
Windows_1 33.15% <ø> (ø)
Windows_2 55.18% <ø> (ø)
Windows_3 45.29% <100.00%> (ø)
Windows_4 35.02% <ø> (ø)

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.

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Jul 1, 2024
@kavilla kavilla merged commit e52a5fe into 2.x Jul 1, 2024
69 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocut Skip the changelog verification check on backports discover-next Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.16.0 valued-contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants