Skip to content

RANGER-5687: Add feature flag to artifacts for RANGER-5628#1073

Merged
dineshkumar-yadav merged 23 commits into
apache:masterfrom
fmorg-git:RANGER-5687
Jul 20, 2026
Merged

RANGER-5687: Add feature flag to artifacts for RANGER-5628#1073
dineshkumar-yadav merged 23 commits into
apache:masterfrom
fmorg-git:RANGER-5687

Conversation

@fmorg-git

@fmorg-git fmorg-git commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

It was requested to add a feature flag for the work in RANGER-5628. This ticket adds it.

The flag is configured as follows in ranger-admin-site.xml:

<property>
<name>ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition</name>
<value>true</value>
</property>

This code is mostly generated with Cursor with some manual edits by me.

https://issues.apache.org/jira/browse/RANGER-5687

How was this patch tested?

smoke test locally with ozone and ranger with ranger flag off and on

… on resource policy, then flag is off, ui hangs

(cherry picked from commit e25cdb00df8ca54a75bb998863ede76e8d52148f)
ramackri pushed a commit that referenced this pull request Jul 15, 2026
Use ranger.servicedef.enableOzoneActionPolicy as the sole feature flag,
propagated via service-def option to Admin UI, plugin, inline/STS paths,
and J10065 patch filtering. Matches master PR #1073 approach for ranger-2.9.

Co-authored-by: Cursor <cursoragent@cursor.com>
ramackri pushed a commit that referenced this pull request Jul 15, 2026
Use ranger.servicedef.enableOzoneActionPolicy as the sole feature flag,
propagated via service-def option to Admin UI, plugin, inline/STS paths,
and J10065 patch filtering. Matches master PR #1073 approach for ranger-2.9.

Co-authored-by: Cursor <cursoragent@cursor.com>
ramackri pushed a commit that referenced this pull request Jul 15, 2026
Use ranger.servicedef.enableOzoneActionPolicy as the sole feature flag,
propagated via service-def option to Admin UI, plugin, inline/STS paths,
and J10065 patch filtering. Matches master PR #1073 approach for ranger-2.9.
(cherry picked from commit d06e4049a352ee3caad45a561098a7031ada557f)
@ramackri
ramackri self-requested a review July 15, 2026 05:56
Move enableOzoneActionPolicy handling out of RangerInlinePolicyEvaluator
into RangerOzoneAuthorizer, including legacy session-policy sanitization
and a unit test for flag-off behavior with embedded grant actions.
Comment thread agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java Outdated
…ges.

Use ServiceDefUtil.getBooleanValue in plugin-ozone and security-admin per PR review, and revert agents-common ozone-specific additions.
@fmorg-git

Copy link
Copy Markdown
Contributor Author

hi @ramackri - thanks for helping address the comments by @mneethiraj. I tested these changes locally with Ozone and Ranger smoke tests and they look good to me. So if they look good to Ranger team and there are no more outstanding comments, please go ahead. Thanks!

ramackri pushed a commit that referenced this pull request Jul 16, 2026
Use ranger.servicedef.enableOzoneActionPolicy as the sole feature flag,
propagated via service-def option to Admin UI, plugin, inline/STS paths,
and J10065 patch filtering. Matches master PR #1073 approach for ranger-2.9.
ramackri pushed a commit that referenced this pull request Jul 16, 2026
…ges.

Rebase onto ranger-2.9 and use ServiceDefUtil.getBooleanValue in plugin-ozone and security-admin per PR #1073 review (615d632).
@fimugdha
fimugdha requested a review from rameeshm July 16, 2026 08:11
Rename enableOzoneActionPolicy to enableActionMatcherInPoliciesCondition and
admin config to ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition.
Non-ozone service defs always get false; ozone reads site config.
Addresses PR review from fimugdha.
@kumaab

kumaab commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@fmorg-git, please ensure to add the feature flag in dev-support/ranger-docker and test it in docker based environments.

Fabian Morgan and others added 4 commits July 16, 2026 16:15
On upgrade, sync enableActionMatcherInPoliciesCondition from admin config into ozone def_options only, alongside existing policyConditions updates for action-matches.
Wire RANGER_OZONE_ENABLE_ACTION_MATCHER into ranger-docker so admin setup
reads the flag before J10065 runs, fix the def_options constant, and update
patch unit tests after E2E validation on Mac with fresh Postgres installs.
@ramackri

Copy link
Copy Markdown
Contributor

@fmorg-git, please ensure to add the feature flag in dev-support/ranger-docker and test it in docker based environments.

@kumaab Addressed this

@fmorg-git

Copy link
Copy Markdown
Contributor Author

hi all, something appears to be wrong. I just tried my Ozone/Ranger smoke tests with the feature flag set to true, but it is not working now (this used to work before). So something with the changes between the last time I said it was working and now seems to be different. I updated with the new name ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition but it still doesn't work.

ramk added 2 commits July 17, 2026 12:56
Stale def_options from an earlier J10065 run or the pre-rename enableOzoneActionPolicy
option could override ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition,
hiding action-matches in Admin UI and ozone authorizer even when the flag was set true.

Admin config is now authoritative when serving the ozone service-def, and action-matches
is restored from the embedded def when enabled but missing from DB.
}

dbOzoneServiceDef.setPolicyConditions(embeddedPolicyConditions);
final boolean enableActionMatcherInPoliciesCondition = RangerAdminConfig.getInstance().getBoolean(RangerServiceDefService.PROP_ENABLE_ACTION_MATCHER_IN_POLICIES_CONDITION, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are changes in PatchForOzoneServiceDefPolicyConditionUpdate_J10065.java necessary, given RangerServiceDefService.java handles service-def updates based on feature-flag while retrieving the service-def from the database? If no additional cases are handled here, I suggest reverting changes in PatchForOzoneServiceDefPolicyConditionUpdate_J10065.java.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated to revert - e220c42. Also updated the README.md accordingly.

The renamed enableActionMatcherInPoliciesCondition option and admin runtime
overlay make enableOzoneActionPolicy obsolete for 3.0.
@ramackri

Copy link
Copy Markdown
Contributor

@fmorg-git, please ensure to add the feature flag in dev-support/ranger-docker and test it in docker based environments.

Done

@ramackri

Copy link
Copy Markdown
Contributor

hi all, something appears to be wrong. I just tried my Ozone/Ranger smoke tests with the feature flag set to true, but it is not working now (this used to work before). So something with the changes between the last time I said it was working and now seems to be different. I updated with the new name ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition but it still doesn't work.
@fmorg-git
You this issue got fixed (admin config wins over stale DB),

@ramackri

Copy link
Copy Markdown
Contributor

hi all, something appears to be wrong. I just tried my Ozone/Ranger smoke tests with the feature flag set to true, but it is not working now (this used to work before). So something with the changes between the last time I said it was working and now seems to be different. I updated with the new name ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition but it still doesn't work.

Fixed

Fabian Morgan added 2 commits July 17, 2026 18:42
…IN_POLICIES_CONDITION to PROP_ENABLE_ACTION_MATCHER_IN_POLICIES_CONDITION_FOR_OZONE

@mneethiraj mneethiraj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest replacing changes in dev-support/ranger-docker with an update in Ranger admin setup processing of install.properties, to support configuration
FF_ENAB_OZONE_ACTION_MATCHES_CONDITION mapped to ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition in the generated ranger-admin-site.xml.

@fmorg-git

Copy link
Copy Markdown
Contributor Author

I suggest replacing changes in dev-support/ranger-docker with an update in Ranger admin setup processing of install.properties, to support configuration
FF_ENAB_OZONE_ACTION_MATCHES_CONDITION mapped to ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition in the generated ranger-admin-site.xml.

updated - d4343e5

@fmorg-git
fmorg-git requested a review from mneethiraj July 19, 2026 21:42

@fimugdha fimugdha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Lets wait to get a review vote from @mneethiraj.

@fimugdha

Copy link
Copy Markdown
Contributor

LGTM. Lets wait to get a review vote from @mneethiraj.

PR was not refreshed, we already have a vote from him.

@dineshkumar-yadav
dineshkumar-yadav merged commit 37b6e02 into apache:master Jul 20, 2026
4 checks passed
@fmorg-git

Copy link
Copy Markdown
Contributor Author

Thanks all for the review and merge.

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.

6 participants