google / google/site-kit-wp

Remove the `setupFlowRefreshPhase4` feature flag

Open
#13,530 0 comments 0 reactions 0 assignees View on GitHub
P0 Type: Enhancement
Dominant language
JavaScript
Stars
1.4k
Forks
383
Avg merge
4d 12h
Merged PRs (30d)
80

Description

## Feature Description

The Setup Flow Refresh phase 4 feature has been successfully launched. We should strip out the feature flag from the codebase, and remove related unused code.

---------------

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

## Acceptance criteria

- The `setupFlowRefreshPhase4` feature flag, all references to it, and all execution paths that are taken when the flag is false are removed from the codebase.
- Legacy tests and stories are removed.
- No regressions are introduced to the new setup flow.

## Implementation Brief

- [ ] Remove `setupFlowRefreshPhase4` from `feature-flags.json` and the feature-flag documentation in `docs/context/js/feature-flags.md`.
- [ ] In `includes/Plugin.php`, remove the Phase 4 entry from the setup-flow feature-force-enablement logic and update the related docblock so only `setupFlowRefresh` remains.
- [ ] In `includes/Core/Authentication/Google_Proxy.php`, always append the Phase 4 setup URL parameters (`service_version=v3` and `steps=5`) and always apply the setup URL parameter filter.
- [ ] In `includes/Core/Authentication/Setup.php`, always mark the key metrics widget area as hidden when handling the OAuth setup redirect, removing the Phase 4 conditional and its unused imports if applicable.
- [ ] In `includes/Modules/Analytics_4.php`, make the Phase 4 Analytics setup behavior unconditional and remove the associated feature-flag dependency.
- [ ] In the shared JavaScript components and utilities that currently call `useFeature( 'setupFlowRefreshPhase4' )` or `isFeatureEnabled( 'setupFlowRefreshPhase4' )`, keep the Phase 4 branch as the default behavior and remove the legacy branch: activation, key metrics setup, settings, welcome modal, store error notices, setup splash and view-only setup, Analytics activation/setup widgets, notifications, and insufficient-permissions error descriptions.
- [ ] In `assets/js/components/setup/SetupUsingProxyWithSignIn/` and `assets/js/components/setup/SetupUsingProxyViewOnly/`, remove legacy splash rendering, legacy layout/header behavior, Phase 4 feature props, and notification feature metadata while preserving the refreshed setup flow and its existing navigation/error handling.
- [ ] In `assets/js/googlesitekit/notifications/register-defaults.js`, register the refreshed setup notifications without a `setupFlowRefreshPhase4` feature constraint.
- [ ] Remove Phase 4-only feature configuration from Storybook stories, and delete legacy stories that exist solely to represent the flag-disabled setup flow; retain and rename scenarios as needed so the remaining stories describe the default refreshed experience.

## Test Coverage

- Update PHP integration tests in `tests/phpunit/integration/Core/Authentication/Google_ProxyTest.php` and `tests/phpunit/integration/Modules/Analytics_4Test.php` to remove Phase 4 enablement and assert the refreshed behavior unconditionally.
- Update JavaScript tests for activation, setup splash/view-only setup, welcome modal, store error notices, Analytics audience setup widgets, insufficient-permissions descriptions, dashboard/admin bar widgets, and Search Console setup consumers to remove feature setup and cover the default Phase 4 paths.
- Remove tests whose only purpose is to verify the legacy behavior when `setupFlowRefreshPhase4` is disabled; merge any still-relevant assertions into the corresponding unconditional refreshed-flow tests rather than creating duplicate cases.
- Remove Phase 4 feature parameters from test fixtures and Storybook stories, delete obsolete legacy story/test files, and update snapshots or visual regression references only when the refreshed default output changes.
- Run the affected Jest and PHPUnit test files, lint the changed source and test files, and verify with a repository-wide search that no `setupFlowRefreshPhase4` references remain outside generated or historical test artifacts.

## QA Brief

*

## Changelog entry

*

Contributor guide

Open the contributing guide

Research direction

Start with a repository-wide search for setupFlowRefreshPhase4, then inspect feature-flags.json, docs/context/js/feature-flags.md, the listed PHP files, and the setup JavaScript components. Run the affected Jest and PHPUnit files before and after the changes. Done means refreshed behavior is unconditional, legacy tests and stories are removed, lint passes, and no remaining references exist outside allowed generated or historical artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
analytics, authentication, backend, frontend, testing, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.