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

Add getMetadataFields to MapperService #13819

Merged
merged 3 commits into from
May 24, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented May 24, 2024

Description

This PR adds a method to the MapperService to get the full list of metadata fields.

This is needed in the security plugin to remove dependence on a static list maintained here: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/configuration/SecurityFlsDlsIndexSearcherWrapper.java#L41-L59

The primary list is maintained in IndicesModules.getBuiltInMetadataFields, but this class is marked as @internal and not meant to be referenced by plugins.

Related Issues

Related to opensearch-project/security#4349

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • API changes companion pull request created.
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@reta reta added the backport 2.x Backport to 2.x branch label May 24, 2024
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link
Contributor

✅ Gradle check result for 622dc08: SUCCESS

Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.62%. Comparing base (b15cb0c) to head (b5cbb78).
Report is 306 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13819      +/-   ##
============================================
+ Coverage     71.42%   71.62%   +0.20%     
- Complexity    59978    61300    +1322     
============================================
  Files          4985     5063      +78     
  Lines        282275   288028    +5753     
  Branches      40946    41710     +764     
============================================
+ Hits         201603   206294    +4691     
- Misses        63999    64789     +790     
- Partials      16673    16945     +272     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

❌ Gradle check result for e404fa9: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for b5cbb78: SUCCESS

@reta reta merged commit 8883e62 into opensearch-project:main May 24, 2024
28 of 29 checks passed
@opensearch-trigger-bot
Copy link
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/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-13819-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8883e62a8f3d862739250cff1eb8d3d18680cfa2
# Push it to GitHub
git push --set-upstream origin backport/backport-13819-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

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

@reta
Copy link
Collaborator

reta commented May 24, 2024

@cwperks mind please backport to 2.x manually? thank you

cwperks added a commit to cwperks/OpenSearch that referenced this pull request May 24, 2024
* Add getMetadataFields to MapperService

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Unmodifiable Set

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 8883e62)
reta pushed a commit that referenced this pull request May 29, 2024
* Add getMetadataFields to MapperService (#13819)

* Add getMetadataFields to MapperService

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Unmodifiable Set

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 8883e62)

* Pass indexVersionCreated

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
parv0201 pushed a commit to parv0201/OpenSearch that referenced this pull request Jun 10, 2024
* Add getMetadataFields to MapperService

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Unmodifiable Set

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
kkewwei pushed a commit to kkewwei/OpenSearch that referenced this pull request Jul 24, 2024
…ject#13819) (opensearch-project#13822)

* Add getMetadataFields to MapperService (opensearch-project#13819)

* Add getMetadataFields to MapperService

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Unmodifiable Set

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 8883e62)

* Pass indexVersionCreated

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: kkewwei <kkewwei@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants