opensearch-project / opensearch-migrations

Migrate, upgrade, compare, and replicate OpenSearch clusters with ease.
https://aws.amazon.com/solutions/implementations/migration-assistant-for-amazon-opensearch-service/
Apache License 2.0
39 stars 29 forks source link

Optimize the regex parser for InvalidResponse #1034

Closed peternied closed 1 month ago

peternied commented 1 month ago

Description

Rather than using a backtracking pattern which could have performance impact, switch to using explict character ranges which work for json path seperated with periods.

Mitigates sonar lint rule java:S5852 [1]

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.55%. Comparing base (d5f5be6) to head (39e67ae). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1034 +/- ## ============================================ - Coverage 80.55% 80.55% -0.01% Complexity 2735 2735 ============================================ Files 365 365 Lines 13611 13611 Branches 941 941 ============================================ - Hits 10965 10964 -1 Misses 2068 2068 - Partials 578 579 +1 ``` | [Flag](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1034/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [gradle-test](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1034/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `78.58% <100.00%> (-0.01%)` | :arrow_down: | | [python-test](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1034/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `90.11% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

peternied commented 1 month ago

Needed to retry the gradle tests, created Flaky Test: WorkCoordinatorTest.testAcquireLeaseForQuery [1]