backdrop-issues
backdrop-issues copied to clipboard
[DX] Telemetry: Capture Backdrop version(s) and if upgraded from Drupal
This could help us with issues like #4512, but also with determining how many sites are once-off builds, or regularly being maintained/updated.
It would also be helpful to capture whether the site was an upgrade from Drupal. That could be useful when troubleshooting upgrade issues/paths etc.
...this could be implemented as a set of a couple of config values in system.core.json (something like initial_version and upgrade_from_drupal).
Another use case for capturing the initial version during installation (or upgrade from D7): https://github.com/backdrop-contrib/services/issues/5
I think we should also capture the current version of Backdrop (I'm surprised not only that this wasn't already the case, but that there isn't an existing issue for this).
So that makes this issue about:
- Backdrop version when installed
- Upgrade from Drupal (or not)
- Current Backdrop version
E.g. I'm finally getting around to installing Telemetry on my Backdrop sites, and they're not running the latest version...
I think we should also capture the current version of Backdrop (I'm surprised not only that this wasn't already the case, but that there isn't an existing issue for this).
We have "current version" information already as part of usage stats. See bottom of this page. @BWPanda - Is this what you are looking for?
https://backdropcms.org/project/usage/backdrop
Yes, but I think it should be part of the Telemetry data. If we ever want to start using it programmatically, it'd be nice to have it all in the one place.
update_fix_requirements() has recently been brought to my attention:
Perform Drupal 7.x to Backdrop 1.x updates that are required for update.php to function properly.
This function runs when update.php is run the first time for Backdrop 1.x, even before updates are selected or performed. It is important that if updates are not ultimately performed that no changes are made which make it impossible to continue using the prior version.
This seems like a good place to hook into for making a note of the fact that this is a D7 -> Backdrop upgrade. Not sure if we could still grab the exact D7 version (or if we really care to do that in the first place). I think I might take a stab at it.
Here's a PR that just adds the current Backdrop version (because that was easy to do): https://github.com/backdrop/backdrop/pull/4108 Adding the other info is a bit trickier since we don't store that anywhere yet...

I agree that the Backdrop version is valuable info and should be part of our Telemetry (as well as the traditional usage stats).
Adding the other info is a bit trickier since we don't store that anywhere yet...
Yep, we don't. Should we open a separate issue for that? It might need a little discussion. Please note: currently the Telemetry module isn't enabled on upgrades from Drupal, so we might not even get that information.
The way I see this working is Backdrop stores the version in a constant when it's installed, and also whether it's an upgrade from D7 in another constant. Then, if/when Telemetry is enabled, it can send those values.
So it would be stored in the "state" table.
- Version on install (similar to install_time in includes/install.core.inc)
- Whether upgraded or freshly installed (defaults to the latter, overwritten somewhere early in system.install?)
@BWPanda I'm assuming you prefer to do everything here in this issue?
I'm assuming you prefer to do everything here in this issue?
Unsure... If those things have the potential to hold us up, perhaps it'd be better to merge the current PR now so at least it's done. On the other hand, this issue was opened with those things in mind specifically, so I feel like we'd be hijacking this issue if we did that...
If those things have the potential to hold us up, perhaps it'd be better to merge the current PR now so at least it's done.
Currently I don't see how or why this would hold us up here. If that happens, we could still move that to a follow-up.
@BWPanda - Have you decided if you want to add the other items or just get this one into CORE and create follow-up issues? No sense and leaving this work hanging.
This looks like a great idea to capture Telemetry data on sites upgraded from Drupal to Backdrop.
The recent work on #6633 has prompted me to work on this issue here as well.