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

[2.x] Deprecate 'Whitelist' classes in package 'org.opensearch.painless.spi' and create alternative 'Allowlist' classes #4101

Conversation

tlfeng
Copy link
Collaborator

@tlfeng tlfeng commented Aug 2, 2022

Description

To support inclusive language, the whitelist terminology is going to be replaced by allowlist in the code base.

Issues Resolved

A part of issue #1683

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

Tianli Feng added 6 commits August 2, 2022 14:48
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng added enhancement Enhancement or improvement to existing feature or request deprecate v2.2.0 backport 2.2 Backport to 2.2 branch labels Aug 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

Tianli Feng added 6 commits August 2, 2022 19:30
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
…ld be final

Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #4101 (6f77583) into 2.x (3bf01e9) will increase coverage by 0.16%.
The diff coverage is 74.12%.

❗ Current head 6f77583 differs from pull request most recent head 50ade46. Consider uploading reports for the commit 50ade46 to get more accurate results

@@             Coverage Diff              @@
##                2.x    #4101      +/-   ##
============================================
+ Coverage     70.45%   70.62%   +0.16%     
- Complexity    56513    56749     +236     
============================================
  Files          4540     4554      +14     
  Lines        272326   272705     +379     
  Branches      40017    40048      +31     
============================================
+ Hits         191860   192587     +727     
+ Misses        64360    64047     -313     
+ Partials      16106    16071      -35     
Impacted Files Coverage Δ
...a/org/opensearch/gradle/test/DistroTestPlugin.java 0.00% <ø> (ø)
...nsearch/painless/spi/AllowlistInstanceBinding.java 0.00% <0.00%> (ø)
...va/org/opensearch/painless/spi/WhitelistClass.java 100.00% <ø> (ø)
...opensearch/painless/spi/WhitelistClassBinding.java 57.14% <ø> (ø)
...va/org/opensearch/painless/spi/WhitelistField.java 50.00% <ø> (ø)
...nsearch/painless/spi/WhitelistInstanceBinding.java 57.14% <ø> (ø)
...a/org/opensearch/painless/spi/WhitelistMethod.java 100.00% <ø> (ø)
...rg/opensearch/common/settings/ClusterSettings.java 91.89% <ø> (ø)
...index/fielddata/ordinals/GlobalOrdinalMapping.java 77.27% <ø> (ø)
...search/index/fielddata/ordinals/MultiOrdinals.java 60.60% <0.00%> (ø)
... and 528 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

@tlfeng tlfeng removed the v2.2.0 label Aug 4, 2022
@kartg kartg removed the backport 2.2 Backport to 2.2 branch label Aug 8, 2022
@tlfeng
Copy link
Collaborator Author

tlfeng commented Aug 11, 2022

After the incomplete attempt to provide alternative allowlist APIs as well as keeping the existing whitelist APIs in this PR, I decided not to deprecate the whitelist APIs before replacing them with allowlist APIs in a future major version.
We will post a plan for the version of removing whitelist APIs. Developers can keep using the existing whitelist APIs till the further notice.

The impact of the plugin developers is likely be minor, if making as breaking change instead of deprecated in advance.
There are 2 plugins (alerting and k-NN) in opensearch-project organization using the whitelist Java APIs, and the affected APIs of them are:

 public Map<ScriptContext<?>, List<Whitelist>> getContextWhitelists()
 -> public Map<ScriptContext<?>, List<Allowlist>> getContextAllowlists()
 
org.opensearch.painless.spi.Whitelist -> Allowlist
org.opensearch.painless.spi.WhitelistLoader -> AllowlistLoader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecate enhancement Enhancement or improvement to existing feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants