opensearch-project / security

🔐 Secure your cluster with TLS, numerous authentication backends, data masking, audit logging as well as role-based access control on indices, documents, and fields
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
180 stars 263 forks source link

Refactor Role Mappings REST API test #4450

Closed willyborankin closed 4 days ago

willyborankin commented 2 weeks ago

Description

Refactor Role Mappings REST API test

Issues Resolved

partial fix #4166

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.

willyborankin commented 2 weeks ago

So far it has a cherry-picked commit from #4433 for roles integration test. With fixes for tests

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.23%. Comparing base (962eafa) to head (1bf451f). Report is 6 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/opensearch-project/security/pull/4450/graphs/tree.svg?width=650&height=150&src=pr&token=rBpySfQXMt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)](https://app.codecov.io/gh/opensearch-project/security/pull/4450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) ```diff @@ Coverage Diff @@ ## main #4450 +/- ## ========================================== - Coverage 65.27% 65.23% -0.05% ========================================== Files 313 313 Lines 22057 22061 +4 Branches 3563 3563 ========================================== - Hits 14398 14391 -7 - Misses 5888 5896 +8 - Partials 1771 1774 +3 ``` | [Files](https://app.codecov.io/gh/opensearch-project/security/pull/4450?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [.../security/dlic/rest/api/RolesMappingApiAction.java](https://app.codecov.io/gh/opensearch-project/security/pull/4450?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fopensearch%2Fsecurity%2Fdlic%2Frest%2Fapi%2FRolesMappingApiAction.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-c3JjL21haW4vamF2YS9vcmcvb3BlbnNlYXJjaC9zZWN1cml0eS9kbGljL3Jlc3QvYXBpL1JvbGVzTWFwcGluZ0FwaUFjdGlvbi5qYXZh) | `94.11% <75.00%> (-2.76%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/opensearch-project/security/pull/4450/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)
DarshitChanpura commented 1 week ago

@willyborankin Would you take a look at the code-cov failures?

willyborankin commented 1 week ago

@willyborankin Would you take a look at the code-cov failures?

same as for #4465. codecov/patch shows wrong info about hidden/reserved properties, since they covered in the AbstractConfigEntityApiIntegrationTest Now it is different. Not sure that it shows right info

willyborankin commented 1 week ago

@willyborankin Would you take a look at the code-cov failures?

~same as for #4465. codecov/patch shows wrong info about hidden/reserved properties, since they covered in the AbstractConfigEntityApiIntegrationTest~ Now it is different. Not sure that it shows right info

Interesting: codecov/project/plugin — 64.97% (-0.04%) compared to 962eafa the coverage failed on 0.04% :-) mm not sure that such difference should affect the check

opensearch-trigger-bot[bot] commented 4 days ago

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/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4450-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6dedfb455766601b1fdee8e5334cd0905bfe2ed2
# Push it to GitHub
git push --set-upstream origin backport/backport-4450-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x

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