Skip to content

Use JSON11 for handling long numerals#6915

Merged
AMoo-Miki merged 1 commit intoopensearch-project:mainfrom
AMoo-Miki:use-json11
Jun 5, 2024
Merged

Use JSON11 for handling long numerals#6915
AMoo-Miki merged 1 commit intoopensearch-project:mainfrom
AMoo-Miki:use-json11

Conversation

@AMoo-Miki
Copy link
Copy Markdown
Collaborator

@AMoo-Miki AMoo-Miki commented Jun 5, 2024

Description

Replaces the custom regex-based logic with an AST-based one from JSON11. Handling a sample that created 10K false-positives went from 90s to 200ms.

Issues Resolved

Fixes #6377

Changelog

  • skip

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 5, 2024

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 5, 2024

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Comment thread yarn.lock
dependencies:
yallist "^4.0.0"

minipass@^4.0.0:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was probably left off of another PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

need to rebase? or do you mean like we merged this and it shouldn't be there?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is a leftover from #6492

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.44%. Comparing base (2b8600d) to head (6cc3faf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6915      +/-   ##
==========================================
- Coverage   67.44%   67.44%   -0.01%     
==========================================
  Files        3444     3444              
  Lines       67849    67781      -68     
  Branches    11035    11023      -12     
==========================================
- Hits        45764    45714      -50     
+ Misses      19418    19401      -17     
+ Partials     2667     2666       -1     
Flag Coverage Δ
Linux_1 33.11% <20.00%> (+0.02%) ⬆️
Linux_2 55.04% <50.00%> (-0.09%) ⬇️
Linux_3 45.25% <100.00%> (-0.04%) ⬇️
Linux_4 34.85% <20.00%> (+0.03%) ⬆️
Windows_1 33.15% <20.00%> (+0.05%) ⬆️
Windows_2 55.00% <50.00%> (-0.09%) ⬇️
Windows_3 45.26% <100.00%> (-0.04%) ⬇️
Windows_4 34.85% <20.00%> (+0.03%) ⬆️

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.

Signed-off-by: Miki <miki@amazon.com>
},
"dependencies": {
"@opensearch-project/opensearch": "^2.6.0",
"@opensearch-project/opensearch": "^2.9.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Is it necessary we upgrade the client version?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. We need the version that uses JSON11

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 5, 2024

❌ Changeset File Must Not Exist With Skip Entry

Changeset file 6915.yml under folder changelogs/fragments must not exist if ##Changelog section in PR description includes a "skip" entry option. Please remove the changeset file and try again.

* SPDX-License-Identifier: Apache-2.0
*/

/* In JavaScript, a `Number` is a 64-bit floating-point value which can store 16 digits. However, the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huge +1 of the cleanup

Copy link
Copy Markdown
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

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

do you think we should run through the closed issues related to the other issues related to long numerals?

thinking we could probably open an issue like 'automate verifying these closed issues?'. i feel like it's particularily perf testing when we see these issues right?

@kavilla
Copy link
Copy Markdown
Member

kavilla commented Jun 5, 2024

oh weird i see a changelog fragment but i see skip in the pr description.

@AMoo-Miki AMoo-Miki merged commit 6a20742 into opensearch-project:main Jun 5, 2024
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6915-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6a2074249c92ec204bb7edff72f93a641da1385e
# Push it to GitHub
git push --set-upstream origin backport/backport-6915-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-6915-to-2.x.

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Jun 5, 2024
Signed-off-by: Miki <miki@amazon.com>

(cherry picked from commit 6a20742)
Signed-off-by: Miki <miki@amazon.com>
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Jun 5, 2024
Signed-off-by: Miki <miki@amazon.com>

(cherry picked from commit 6a20742)
Signed-off-by: Miki <miki@amazon.com>
@BionIT
Copy link
Copy Markdown
Contributor

BionIT commented Jun 5, 2024

Hi @AMoo-Miki This PR has failed backport, could you help to manual backport?

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Jun 7, 2024
(cherry picked from commit 6a20742)

Signed-off-by: Miki <miki@amazon.com>
ananzh pushed a commit that referenced this pull request Jun 7, 2024
(cherry picked from commit 6a20742)

Signed-off-by: Miki <miki@amazon.com>
@zhyuanqi zhyuanqi added the enhancement New feature or request label Jun 11, 2024
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Aug 14, 2024
…search-project#6970)

(cherry picked from commit 6a20742)

Signed-off-by: Miki <miki@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] opensearch-with-long-numerals blocks and times out from Discover page

5 participants