From 9ed3bb2f70c813a410d6df2b99eda91bb1351d3b Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Wed, 15 Jul 2020 16:56:44 +0100 Subject: [PATCH 1/2] os download: Improve warning message re default balenaOS version Change-type: patch --- lib/utils/cloud.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/utils/cloud.ts b/lib/utils/cloud.ts index b433a9c1..27d5c830 100644 --- a/lib/utils/cloud.ts +++ b/lib/utils/cloud.ts @@ -130,9 +130,7 @@ export async function downloadOSImage( console.info(`Getting device operating system for ${deviceType}`); if (!OSVersion) { - console.warn( - 'Using default OS version: the latest stable version, or the latest version for pre-release devices', - ); + console.warn('OS version not specified: using latest stable version'); } OSVersion = OSVersion From 7eb398c6ef6c50c98189aa17e0156fa4f67d0bc6 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Wed, 15 Jul 2020 17:05:39 +0100 Subject: [PATCH 2/2] devices supported: Rename 'BETA' to 'NEW' in verbose output Change-type: patch --- doc/cli.markdown | 2 +- lib/actions-oclif/devices/supported.ts | 14 ++++++++------ tests/commands/device/supported.spec.ts | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/cli.markdown b/doc/cli.markdown index 8f7dbc05..29077a6a 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -710,7 +710,7 @@ same as '--application' List the supported device types (like 'raspberrypi3' or 'intel-nuc'). The --verbose option adds extra columns/fields to the output, including the -"STATE" column whose values are one of 'beta', 'released' or 'discontinued'. +"STATE" column whose values are one of 'new', 'released' or 'discontinued'. However, 'discontinued' device types are only listed if the '--discontinued' option is used. diff --git a/lib/actions-oclif/devices/supported.ts b/lib/actions-oclif/devices/supported.ts index 708c70d4..4b964a5e 100644 --- a/lib/actions-oclif/devices/supported.ts +++ b/lib/actions-oclif/devices/supported.ts @@ -22,7 +22,6 @@ import Command from '../../command'; import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; import { CommandHelp } from '../../utils/oclif-utils'; -import { isV12 } from '../../utils/version'; interface FlagsDef { discontinued: boolean; @@ -38,7 +37,7 @@ export default class DevicesSupportedCmd extends Command { List the supported device types (like 'raspberrypi3' or 'intel-nuc'). The --verbose option adds extra columns/fields to the output, including the - "STATE" column whose values are one of 'beta', 'released' or 'discontinued'. + "STATE" column whose values are one of 'new', 'released' or 'discontinued'. However, 'discontinued' device types are only listed if the '--discontinued' option is used. @@ -98,11 +97,14 @@ export default class DevicesSupportedCmd extends Command { } const fields = options.verbose ? ['slug', 'aliases', 'arch', 'state', 'name'] - : isV12() - ? ['slug', 'aliases', 'arch', 'name'] - : ['slug', 'name']; + : ['slug', 'aliases', 'arch', 'name']; deviceTypes = _.sortBy( - deviceTypes.map((d) => _.pick(d, fields) as Partial), + deviceTypes.map((d) => { + const picked = _.pick>(d, fields); + // 'BETA' renamed to 'NEW' + picked.state = picked.state === 'BETA' ? 'NEW' : picked.state; + return picked; + }), fields, ); if (options.json) { diff --git a/tests/commands/device/supported.spec.ts b/tests/commands/device/supported.spec.ts index 773adb06..afbd5be7 100644 --- a/tests/commands/device/supported.spec.ts +++ b/tests/commands/device/supported.spec.ts @@ -58,7 +58,7 @@ describe('balena devices supported', function () { // Discontinued devices should be filtered out from results expect(lines.some((l) => l.includes('DISCONTINUED'))).to.be.false; - // Experimental devices should be listed as beta + // Experimental devices should be listed as new expect(lines.some((l) => l.includes('EXPERIMENTAL'))).to.be.false; expect(lines.some((l) => l.includes('NEW'))).to.be.true;