Skip to content

Conversation

@mneethiraj
Copy link
Contributor

What changes were proposed in this pull request?

updated local policy source implementations to support loading from <serviceName>.json and <appId>_<serviceName>.json.

How was this patch tested?

updated unit tests to cover loading from both locations.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances local policy source implementations to support loading policies from both <serviceName>.json and <appId>_<serviceName>.json file naming patterns. This provides more flexible configuration options for different deployment scenarios.

Changes:

  • Introduced a new abstract class RangerPolicySource to consolidate common file suffix definitions and unimplemented methods
  • Updated LocalFolderPolicySource and EmbeddedResourcePolicySource to try loading from <serviceName> prefix first, falling back to <appId>_<serviceName> prefix if needed
  • Added comprehensive unit tests for both implementations covering all loading scenarios

Reviewed changes

Copilot reviewed 15 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
agents-common/src/main/java/org/apache/ranger/admin/client/RangerPolicySource.java New abstract base class defining file suffix constants and stub methods for policy source implementations
agents-common/src/main/java/org/apache/ranger/admin/client/LocalFolderPolicySource.java Updated to support dual prefix loading (serviceName and appId_serviceName) with fallback logic
agents-common/src/main/java/org/apache/ranger/admin/client/EmbeddedResourcePolicySource.java Updated to support dual prefix loading for embedded resources with improved error handling
agents-common/src/test/java/org/apache/ranger/admin/client/TestLocalFolderPolicySource.java New test class covering serviceName prefix, appId_serviceName prefix, and error scenarios
agents-common/src/test/java/org/apache/ranger/admin/client/TestEmbeddedResourcePolicySource.java New test class with equivalent coverage for embedded resource loading
agents-common/src/test/resources/admin.client/*.json Test resource files for both serviceName and appId_serviceName naming patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant