backdrop-issues icon indicating copy to clipboard operation
backdrop-issues copied to clipboard

[DX] Telemetry: Capture Backdrop version(s) and if upgraded from Drupal

Open klonos opened this issue 5 years ago • 16 comments

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.

klonos avatar Aug 12 '20 08:08 klonos

...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).

klonos avatar Aug 12 '20 08:08 klonos

Another use case for capturing the initial version during installation (or upgrade from D7): https://github.com/backdrop-contrib/services/issues/5

klonos avatar Apr 14 '21 23:04 klonos

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

ghost avatar Jan 06 '22 10:01 ghost

E.g. I'm finally getting around to installing Telemetry on my Backdrop sites, and they're not running the latest version...

ghost avatar Jan 06 '22 10:01 ghost

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

stpaultim avatar Jan 07 '22 05:01 stpaultim

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.

ghost avatar Jan 07 '22 07:01 ghost

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.

klonos avatar Feb 11 '22 06:02 klonos

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...

image

ghost avatar Jun 25 '22 03:06 ghost

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.

indigoxela avatar Jun 25 '22 13:06 indigoxela

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.

ghost avatar Jun 25 '22 20:06 ghost

So it would be stored in the "state" table.

  1. Version on install (similar to install_time in includes/install.core.inc)
  2. 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?

indigoxela avatar Jun 26 '22 08:06 indigoxela

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...

ghost avatar Jun 26 '22 08:06 ghost

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.

indigoxela avatar Jun 26 '22 08:06 indigoxela

@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.

stpaultim avatar Sep 22 '22 02:09 stpaultim

This looks like a great idea to capture Telemetry data on sites upgraded from Drupal to Backdrop.

izmeez avatar May 23 '24 15:05 izmeez

The recent work on #6633 has prompted me to work on this issue here as well.

klonos avatar Jul 03 '24 01:07 klonos