[buddypress-trac] [BuddyPress Trac] #9210: Review the way we load 12.0.0 deprecated code
buddypress-trac
noreply at wordpress.org
Tue Aug 6 03:23:54 UTC 2024
#9210: Review the way we load 12.0.0 deprecated code
-------------------------------------------------+-------------------------
Reporter: imath | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 14.1.0
Component: Core | Version: 14.0.0
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests dev- |
feedback has-testing-info |
-------------------------------------------------+-------------------------
Changes (by emaralive):
* keywords: has-patch has-unit-tests dev-feedback => has-patch has-unit-
tests dev-feedback has-testing-info
Comment:
@imath
cc: @espellcaste (it appears that you have been requested to review PR
352)
I did a cursory review of the history for the handling/loading of
**deprecated functions** going back to #8687 in an attempt to gain a
better understanding of the strategy to "**''don't load deprecated
functions for new installs''**" and the jury is still out in deliberation
(to be reviewed in greater detail, when time permits). Notwithstanding the
deliberation, it was agreed upon during the last **dev-chat** (July 31,
2024) to continue loading 12.0 deprecated functions for "new installs"
until BP 16.0.0. Furthermore, there should be a documented "**Deprecation
Policy**" so that individuals don't have to dig through tickets to find
rhyme and reason for why things are done the way they are done in regard
to **deprecation**.
Additionally, I ran some ad hoc tests against the
**{{{bp_get_deprecated_functions_versions()}}}** function both with and
without the patch/PR 352 and the results are as follows:
== Without Patch
**$current_major_version = 14.0**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 14.0 || 12.0 || ✔️ ||
|| 12.0 || 12.0, 14.0 || ✔️ ||
|| 11.0 || 12.0, 14.0 || ✔️ ||
|| 0 || 12.0, 14.0 || ✔️ ||
[[br]]
**$current_major_version = 15.0**
**{{{NOTE}}}: The {{{$deprecated_functions_versions}}} array was amended
to include {{{15.0}}}**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 15.0 || 12.0 || ✔️ ||
|| 14.0 || 15.0 || ❌ ||
|| 12.0 || 14.0, 15.0 || ❌ ||
|| 11.0 || 14.0, 15.0 || ❌ ||
|| 0 || 14.0, 15.0 || ❌ ||
[[br]]
== With Patch/PR 352
**$current_major_version = 14.0**
**{{{NOTE}}}: Test for upgrade from {{{11.0}}} fails with fatal error in
live situation**
{{{
Fatal error: Cannot redeclare bp_core_create_root_component_page()
(previously declared in /wp-content/plugins/buddypress/bp-
core/deprecated/12.0.php:554) in /wp-content/plugins/buddypress/bp-
core/deprecated/12.0.php on line 554
}}}
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 14.0 || 12.0 || ✔️ ||
|| 12.0 || 12.0, 14.0 || ✔️ ||
|| **11.0** || **12.0, 12.0, 14.0** || ❌ ||
|| 0 || 12.0, 14.0 || ✔️ ||
[[br]]
**$current_major_version = 15.0**
**{{{NOTE}}}: The {{{$deprecated_functions_versions}}} array was amended
to include {{{15.0}}}**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 15.0 || 0.0 || ❌ ||
|| 14.0 || 12.0, 15.0 || ❌ ||
|| 12.0 || 12.0, 14.0, 15.0 || ✔️ ||
|| 11.0 || 12.0, 14.0, 15.0 || ✔️ ||
|| 0 || 14.0, 15.0 || ❌ ||
[[br]]
Given the previous results, I decided to simplify the
**{{{bp_get_deprecated_functions_versions()}}}** function by adding a
filter hook **{{{bypass_bp_source_subdirectory_check}}}** so that a
development version can replicate the loading of deprecated functions the
same as non-development versions, e.g., production, and simplified the
code for determining which deprecated functions to include. The following
are the test results for the "Proposed New Patch" (see attached proposed-
new-9210.01.patch)
== With Proposed New Patch
**$current_major_version = 14.0**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 14.0 || 12.0 || ✔️ ||
|| 12.0 || 12.0, 14.0 || ✔️ ||
|| 11.0 || 12.0, 14.0 || ✔️ ||
|| 0 || 12.0, 14.0 || ✔️ ||
[[br]]
**$current_major_version = 15.0**
**{{{NOTE}}}: The {{{$deprecated_functions_versions}}} array was amended
to include {{{15.0}}}**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 15.0 || 12.0 || ✔️ ||
|| 14.0 || 12.0, 14.0, 15.0 || ✔️ ||
|| 12.0 || 12.0, 14.0, 15.0 || ✔️ ||
|| 11.0 || 12.0, 14.0, 15.0 || ✔️ ||
|| 0 || 12.0, 14.0, 15.0 || ✔️ ||
[[br]]
**$current_major_version = 16.0**
**{{{NOTE}}}: The {{{$deprecated_functions_versions}}} array was amended
to include {{{16.0}}}**
||= **$initial_version** =||= **bp_get_deprecated_functions_versions()**
=||= **passed** =||
|| 16.0 || 0.0 || ✔️ ||
|| 15.0 || 15.0, 16.0 || ✔️ ||
|| 14.0 || 15.0, 16.0 || ✔️ ||
|| 12.0 || 15.0, 16.0 || ✔️ ||
|| 11.0 || 15.0, 16.0 || ✔️ ||
|| 0 || 15.0, 16.0 || ✔️ ||
[[br]]
In conclusion, I don't rely on unit tests for a variety of reasons, just
to name a few:
* Do they run to verify the intended change works as intended?
* If they run do they provide enough coverage to detect faults?
I don't know the answers to these questions because, I'm not set-up to
create, run nor verify the accuracy of unit tests.
This brings up testing in general at the ticket level, e.g., unit tests
(if applicable), manual tests, etc., we don't include a test plan,
typically a detailed test report (based off of the test plan) is not
included and we don't have documentation that outlines/details the ticket
process.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9210#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list