Skip to content

Remove rrmPolicyViolations feature flag #12232

@hussain-t

Description

@hussain-t

Feature Description

The rrmPolicyViolations feature flag should be removed and all feature-flagged code should be made unconditional to launch the RRM Policy Violations feature.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The rrmPolicyViolations feature flag is removed from the codebase.
  • All feature-flagged code is made unconditional — the RRM policy violation functionality (notifications, settings, synchronization, debug fields, and module status) is always active.
  • No references to the rrmPolicyViolations feature flag remain in any source or test files.
  • All existing tests continue to pass, and tests are updated to remove feature flag enabling/disabling where applicable.
  • Storybook stories no longer specify rrmPolicyViolations in their features parameter.

Implementation Brief

  • In feature-flags.json:
    • Remove rrmPolicyViolations from the feature flags array.

PHP changes

  • In includes/Modules/Reader_Revenue_Manager/Settings.php:
    • Remove the Feature_Flags::enabled( 'rrmPolicyViolations' ) check in get_default() and always include contentPolicyStatus in the defaults.
    • Remove the Feature_Flags::enabled( 'rrmPolicyViolations' ) check in get_sanitize_callback() and always sanitize contentPolicyStatus.
  • In includes/Modules/Reader_Revenue_Manager/Synchronize_Publication.php:
    • Remove the Feature_Flags::enabled( 'rrmPolicyViolations' ) check in synchronize_publication_data() and always synchronize contentPolicyStatus.
  • In includes/Modules/Reader_Revenue_Manager.php:
    • Remove the Feature_Flags::enabled( 'rrmPolicyViolations' ) check in register() and always clear dismissed policy violation notifications on publication change.
    • Remove the Feature_Flags::enabled( 'rrmPolicyViolations' ) check in get_debug_fields() and always include the content policy state debug field.

JavaScript changes

  • In assets/js/modules/reader-revenue-manager/index.js:
    • Remove the feature flag condition around the SettingsStatusComponent registration and always register it.
    • Remove the featureFlag: 'rrmPolicyViolations' property from both policy violation notification definitions in the NOTIFICATIONS array.
  • In assets/js/modules/reader-revenue-manager/datastore/settings.js:
    • Remove the feature flag check in validateCanSubmitChanges() and always validate contentPolicyStatus.
  • In assets/js/modules/reader-revenue-manager/datastore/publications.js:
    • Remove the feature flag check in the selectPublication action and always set contentPolicyStatus.
  • In assets/js/modules/reader-revenue-manager/datastore/base.js:
    • Remove the feature flag condition and always include 'contentPolicyStatus' in the settingSlugs array.
  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsForm.js:
    • Remove the useFeature( 'rrmPolicyViolations' ) hook usage and always render the PolicyViolationSettingsNotice component.
  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsView.js:
    • Remove the useFeature( 'rrmPolicyViolations' ) hook usage and always render the PolicyViolationSettingsNotice component.

Storybook updates

  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsView.stories.js:
    • Remove features: [ 'rrmPolicyViolations' ] from the WithPolicyViolationPending, WithPolicyViolationActive, and WithPolicyViolationExtreme stories.
  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.stories.js:
    • Remove features: [ 'rrmPolicyViolations' ] from the WithPolicyViolationPending, WithPolicyViolationActive, and WithPolicyViolationExtreme stories.
  • In assets/js/components/settings/SettingsActiveModules.stories.js:
    • Remove features: [ 'rrmPolicyViolations' ] from the WithRRMActionNeeded story.
  • Update visual regression reference images as needed.

Test Coverage

  • In tests/phpunit/integration/Modules/Reader_Revenue_Manager/SettingsTest.php:
    • Remove the enable_feature( 'rrmPolicyViolations' ) calls and merge the feature-flag-specific test cases into the main test cases.
  • In tests/phpunit/integration/Modules/Reader_Revenue_ManagerTest.php:
    • Remove the enable_feature( 'rrmPolicyViolations' ) calls and make the policy-violation-related test cases unconditional.
  • In tests/phpunit/integration/Modules/Reader_Revenue_Manager/Synchronize_PublicationTest.php:
    • Remove the enable_feature( 'rrmPolicyViolations' ) call and make the synchronization test unconditional.
  • In assets/js/modules/reader-revenue-manager/datastore/settings.test.js:
    • Remove the feature flag enabling/disabling and update tests to always include contentPolicyStatus behavior.
  • In assets/js/modules/reader-revenue-manager/datastore/publications.test.js:
    • Remove the feature flag enabling and make contentPolicyStatus tests unconditional.

QA Brief

  • Verify that rrmPolicyViolations no longer appears in Tester plugin.
  • Connect RRM with a publication that has a policy violation. Without enabling any feature flags, verify:
    • A policy violation notification banner appears on the dashboard (warning for pending/active, error for extreme).
    • The Settings view and edit modes show the Policy Violation settings notice.
    • The Connected Services list shows an "Action needed" badge for RRM.
    • The Site Health debug info includes a "Content policy state" field.
  • With a publication that has no policy violation, verify that none of the above notices/badges appear.
  • Complete the full RRM setup flow and verify it succeeds without errors.

Changelog entry

  • Remove the rrmPolicyViolations feature flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module: RRMReader Revenue Manager module related issuesP0High priorityTeam MIssues for Squad 2Type: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions