VersionCheck - Get more nuanced messages from latest.civicrm.org
authorTim Otten <totten@civicrm.org>
Wed, 18 Apr 2018 00:41:11 +0000 (17:41 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 18 Apr 2018 17:39:42 +0000 (10:39 -0700)
commit887903781c97c9ce6906642f456a57ae630df92a
tree6271a849bebc1cec2509ef5831d3bed27b587192
parente7a0106fa9ec4bd617ca898e0b62a0453ea395e0
VersionCheck - Get more nuanced messages from latest.civicrm.org

Overview
----------------------------------------
Get fully-formed upgrade messages from `latest.civicrm.org`. This allows us to convey more nuanced information about available upgrades.
It also allows us to iterate more quickly on how releases are presented (e.g. adding hyperlinks to the blog/changelog, highlighting
important changes, introducing the in-between status `deprecated`).

Before
----------------------------------------
The `VersionCheck` helper sends a request to `latest.civicrm.org` with `format=json` to get a list of all available versions.

Then it digests the information and presents any messages in the `CRM_Utils_Check` layer.

After
----------------------------------------
The `VersionCheck` helper sends a request to `latest.civicrm.org` with `format=summary` to get a list of displayable messages.

Then it presents any messages in the `CRM_Utils_Check` layer.

Technical Details
----------------------------------------

* Because patch-releases are allowed mid-month, this patch also reduces the TTL from 7 days to 3 days.
* Test coverage is reduced here (`civicrm-core`), but it's improved a lot elsewhere (`latest.civicrm.org`).
* In `VersionCheck`, it makes a few contract changes (which have been evaluated by grepping for stale references circa 4.7.31). Specifically:
    * Add `getVersionMessages()`
    * Remove unnecessary members `$localMajorVersion`, `getMajorVersion()`, `isNewerVersionAvailable()`, `checkBranchForNewVersion()`
    * Change the content of `versionInfo`. It's still a cache of the web-service response, but now it's a list of displayable messages (rather than a list of all versions).
CRM/Utils/Check/Component/Env.php
CRM/Utils/VersionCheck.php
tests/phpunit/CRM/Utils/versionCheckTest.php