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

[AUTHZ] Check generated policy file in test suite #4677

Closed

Conversation

bowenliang123
Copy link
Contributor

@bowenliang123 bowenliang123 commented Apr 7, 2023

Why are the changes needed?

  • add ut to check generated Ranger policy file in Authz policy file generation #4585
  • manually activated genpolicy profile in CI builds, as the property based activation not auto-triggered as expectedly with property ranger.version=2.4.0 set in project parent pom
  • Support regenerated policy file within the same test suite, by running
    KYUUBI_UPDATE=1 build/mvn clean test -pl :kyuubi-spark-authz_2.12 -Dtest=none -DwildcardSuites=org.apache.kyuubi.plugin.spark.authz.gen.PolicyJsonFileGenerator -Pgenpolicy

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@github-actions github-actions bot added kind:infra license, community building, project builds, asf infra related, etc. module:authz module:extensions module:spark labels Apr 7, 2023
@bowenliang123 bowenliang123 marked this pull request as ready for review April 7, 2023 15:25
@bowenliang123 bowenliang123 changed the title Check generated policy file in test suite [AUTHZ] Check generated policy file in test suite Apr 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2023

Codecov Report

Merging #4677 (a372bdf) into master (d7532c5) will increase coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #4677      +/-   ##
============================================
+ Coverage     57.92%   57.95%   +0.03%     
  Complexity       13       13              
============================================
  Files           580      580              
  Lines         32218    32220       +2     
  Branches       4304     4304              
============================================
+ Hits          18663    18674      +11     
+ Misses        11761    11757       -4     
+ Partials       1794     1789       -5     

see 10 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines -336 to -341
<activation>
<!-- activated when Ranger version is identical to required-->
<property>
<name>ranger.version</name>
<value>2.4.0</value>
</property>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here removes the property-based activation introduced previously in #4585, since it's not activated with ranger.version set in project parent pom in value 2.4.0 (which requires more investigation in profile mechanism).

cc @yikf

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for ping me, So do we have to specify the profile manually now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and the profile name changed to gen-policy.

@github-actions github-actions bot added the kind:documentation Documentation is a feature! label Apr 10, 2023
@bowenliang123 bowenliang123 self-assigned this Apr 11, 2023
@bowenliang123 bowenliang123 added this to the v1.8.0 milestone Apr 11, 2023
@bowenliang123 bowenliang123 deleted the authz-check-policy-gen branch April 13, 2023 08:09
@bowenliang123
Copy link
Contributor Author

Thanks, merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:build kind:documentation Documentation is a feature! kind:infra license, community building, project builds, asf infra related, etc. module:authz module:extensions module:spark
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants