balena-io / balena-sdk

The SDK to make balena powered JavaScript applications.
https://www.balena.io/
Apache License 2.0
146 stars 46 forks source link

models.device.getOsVersion - Do not append variant for unified OS versions #1318

Open mtoman opened 1 year ago

mtoman commented 1 year ago

We removed the variant from the OS version string since meta-balena 2.85.0, however the change was not picked by all device types immediately so it is not safe to assume if version > 2.85.0: do_not_append_variant. We could maybe check that the built OS version string is valid before returning it.

Expected Behavior

models.device.getOsVersion does not append the variant if the actual OS version string does not include it.

Actual Behavior

The variant is appended blindly and returns e.g. 2.95.8+prod even though the actual OS version is 2.95.8.

Steps to Reproduce the Problem

  1. Provision a RPi4 with balenaOS 2.95.8
  2. balena.models.device.getOsVersion(uuid) returns 2.95.8+prod

Specifications

jellyfish-bot commented 1 year ago

[mtoman] This has attached https://jel.ly.fish/9d88a5dc-b534-485a-a720-9049085abaf4

thgreasi commented 1 year ago

@mtoman is 2.85.0 the first w/o a dev/prod for all DTs? Also, is there any such magic version for ESRs as well, that is also consistent across all DTs? The most appropriate way I can think atm is to actually make an async call to the API to figure out whether that version is a unified release or not :thinking: