-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update overall status computed field #1629
Conversation
fa4d04f
to
a014b6f
Compare
3cd6a06
to
090e21a
Compare
b108b8e
to
37c506a
Compare
src/translations/v6/v6.ts
Outdated
'When', | ||
[ | ||
'Or', | ||
[ | ||
'In', | ||
['ReferencedField', 'device', 'status'], | ||
['EmbeddedText', 'Ordered'], | ||
['EmbeddedText', 'Preparing'], | ||
], | ||
[ | ||
'And', | ||
['Not', ['ReferencedField', 'device', 'is online']], | ||
[ | ||
'Equals', | ||
['ReferencedField', 'device', 'status'], | ||
['EmbeddedText', 'Shipped'], | ||
], | ||
], | ||
], | ||
['ToLower', ['ReferencedField', 'device', 'status']], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also drop these non-used & already dropped HoD states, rather re-adding them?
['EmbeddedText', 'Post-Provisioning'], | ||
]; | ||
// This check does not double check heartbeat state as it is already checked from isOverallOffline which runs before | ||
export const hasPartialConnectivity: OrNode = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about v so that vpn disabled&off & heartbeat timeout gives reduced-functionality?
-- In an ideal world:
partial = CASE
WHEN vpn disabled
THEN heartbeat = timeout
ELSE (vpn on & heartbeat != online) || (vpn off & heartbeat = online,timeout)
=>
partial = CASE
WHEN heartbeat = timeout THEN True
ELSE (vpn enabled && vpn on & heartbeat IN offline)
|| (vpn off & heartbeat = online && vpn enabled)
approximately => (so that we push `vpn enabled` later and reduce the cases that it needs to be checked)
partial = CASE
WHEN heartbeat = timeout THEN True
ELSE (vpn on & heartbeat IN offline)
|| (vpn off & heartbeat = online && vpn enabled)
=>
partial =
|| heartbeat = timeout
|| (vpn on & heartbeat IN offline/unknown)
|| (vpn off & heartbeat = online && vpn enabled)
=>
partial =
|| heartbeat = timeout
|| (vpn on & heartbeat != online)
|| (vpn off & heartbeat = online && vpn enabled)
@@ -55,12 +56,69 @@ export const isPostProvisioning: EqualsNode = [ | |||
['ReferencedField', 'device', 'provisioning state'], | |||
['EmbeddedText', 'Post-Provisioning'], | |||
]; | |||
|
|||
const VPNConfigEnabled: NotEqualsNode = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about?
const VPNConfigEnabled: NotEqualsNode = [ | |
const isVpnEnabled: NotEqualsNode = [ |
'In', | ||
['ReferencedField', 'device', 'api heartbeat state'], | ||
['EmbeddedText', 'online'], | ||
['EmbeddedText', 'timeout'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker: Should we add the same check in the overall_progress
(and add a v6 translation)?
I kind of can see the use case of showing a progress bar in a reduced-functionality device... so just checking whether this was discussed.
We would effectively just need to change
[
'When',
[
'NotIn',
['ReferencedField', 'device', 'api heartbeat state'],
['EmbeddedText', 'online'],
['EmbeddedText', 'timeout'],
],
// Otherwise if the device is offline but has previously been online we return no info
['Null'],
],
to
[
'When',
isOverallOffline,
// Otherwise if the device is offline but has previously been online we return no info
['Null'],
],
Not a blocker though, since we can change it later.
acc0816
to
b5a2656
Compare
Pull request was converted to draft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets also change the commit message to something that makes clear that this only about /resin and doesn't affect v6
"Update the overall_status computed field in the unversioned model" or
"Update the overall_status computed field in the resin model" or
"Update the overall_status computed field for the future v7 model"
test/24_device_additions.ts
Outdated
restTitle: string, | ||
deviceName: string, | ||
) => { | ||
it(`should have "${overallStatus}" ${restTitle}`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it(`should have "${overallStatus}" ${restTitle}`, async () => { | |
it(`should have overall_status = "${overallStatus}" ${restTitle}`, async () => { |
or
it(`should have "${overallStatus}" ${restTitle}`, async () => { | |
it(`should have an overall_status of "${overallStatus}" ${restTitle}`, async () => { |
Change-type: minor
b5a2656
to
3f8ab5c
Compare
Change-type: minor
See: https://balena.zulipchat.com/#narrow/stream/346007-balena-io.2FbalenaCloud/topic/Server.20side.20device.20list.20-.20cycle.202
See: https://balena.fibery.io/favorites/Work/Project/414