-
Notifications
You must be signed in to change notification settings - Fork 295
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
Remove unifiedDashboard feature flag and unused code #5047
Comments
Just to highlight here, that Zero Data States will not be rolled out to 100% of users until May 9 at the earliest, so is it a little premature to get this in Sprint 74, should this perhaps be done in Sprint 75 once it has been launched to 100% of people for at least 2 weeks? |
I think there's a fair bit of work in this issue, so it won't hurt to get started early. I don't think it'll introduce too many conflicts, and we can wait to actually merge it if it's ready early 🙂 |
Following on from the discussion we had about splitting this into two tickets, I have reviewed the feature flags in question and don't see any problem with splitting this to two, which should be implemented in sequence, i.e. first remove I'd suggest we create a new story for |
@techanvil that sounds good to me, especially since ZDS is still rolling out – let's not block the removal of |
@techanvil thanks for the comprehensive IB! This looks like it covers about everything, just a few points to address:
The
For any entrypoints that we remove, these should also be removed in Webpack as well as their asset definitions in |
Thanks @aaemnnosttv -
I can't see where
Thanks for pointing this out - I have added a corresponding point to the IB 👍 |
@techanvil looks like you are correct, I thought this was used by IB ✅ |
QA update ✅Verified:
|
Feature Description
With the Unified Dashboard epic complete, we should remove its feature flag and unused code from the repo.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
unifiedDashboard
feature flag should be removed, and all code that relies onunifiedDashboard === false
should be removed./wp-admin/admin.php?page=googlesitekit-module-analytics
) and accompanying JS code should be removed as it is no longer in use once Unified Dashboard is the default.Implementation Brief
Before removing the feature flag from production code, force-enable the flag and fix (or remove) the failing tests. Then, remove the feature flag and related code. Additional tests may be removed as part of this process.
Following this approach should provide a bit more certainty that the removal of the feature flag from production code doesn't break anything.
Fix / Remove Tests
To force enable the flag, patch the JS function
isFeatureEnabled
and the PHP methodFeature_Flags::enabled
, as seen here:site-kit-wp/assets/js/features/index.js
Lines 33 to 39 in e5cb521
site-kit-wp/includes/Core/Util/Feature_Flags.php
Lines 40 to 47 in e5cb521
At the time of writing the test failures comprise:
E2E tests
8 test failures across the following 4 files (see example run):
6 of these tests (spanning the first two files) are failing because they are trying to reference the old
URLSearchWidget
component, and will need to be updated to exercise the new search bar. The failing test inadmin-bar.test.js
expects to navigate to the old Entity Dashboard, and needs updating to look for a DOM element present on the new version instead. The failing test indashboard-date-range.test.js
is trying to exercise the legacy Module Dashboard and can be removed.PHPUnit
3 failing tests, over 3 files, each in the
test_register
test (see example run):Each of these has the same cause,
$this->register_screen_hook();
being no longer invoked once theunifiedDashboard
feature flag is removed. They can be fixed by removing the check for the screen ingooglesitekit_module_screens
.Ultimately, the
googlesitekit_module_screens
filter will no longer be used so all references togooglesitekit_module_screens
in thetest_register
tests can in fact be removed, and thetest_register_unified_dashboard
tests can also be removed.JS Tests
15 failing across 6 files (see example run):
Of these, four files have tests that specifically test for the case where
unifiedDashboard
is not enabled. These can be removed; the files also contain tests whereunifiedDashboard
is enabled and these can be cleaned up a bit to reflect this is now the default/only case. These files are:The remaining two files test components which have conditional behaviour relating to the
unifiedDashboard
flag and the tests should be updated accordingly. These files are:Remove Feature Flag
unifiedDashboard
fromfeature-flags.json
.At the time of writing that entails (as entry points):
includes/
tests/phpunit/
tests/e2e
assets/js
(excluding tests and stories: there are no story files that reference this feature flag)assets/js
(as mentioned above under Fix Tests)Remove Module Screens and Legacy Widgets
PHP:
Module_With_Screen_Trait
and all code that is only used by or in conjunction with this class. For example all references togooglesitekit_module_screens
,Permissions::VIEW_MODULE_DETAILS
andModule::prepare_info_for_js
can be removed.JS:
assets/js/googlesitekit-module.js
and all components / styles that are only used by this entry point and not shared elsewhere.googlesitekit-module
entry point fromwebpack.config.js
and remove theScript
instance forgooglesitekit-module
fromincludes/Core/Assets/Assets.php
.screenWidgetContext
and related code.registerWidgetArea
. For each of these areas, remove the area and examine the widget components registered to that area viaregisterWidget
. For each of these components, check whether it's still being used by a non-legacy context/area, and delete the component if it's no longer in use.Storybook
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: