-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix(app): simplify discovery state to avoid stale IPs and health data #6193
Conversation
Switches the app to a newer implementation of the Discovery Client with improved state management Closes #5985
Codecov Report
@@ Coverage Diff @@
## edge #6193 +/- ##
=======================================
Coverage ? 79.26%
=======================================
Files ? 199
Lines ? 18395
Branches ? 0
=======================================
Hits ? 14581
Misses ? 3814
Partials ? 0
Continue to review full report at Codecov.
|
I have a strong suspicion that additional changes to the ap's |
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.
Tested - working as intended
After testing on various Balena robots (both pre-3.3 and post-3.3) I pushed the following changes to fix observed issues:
|
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.
LGTM!
Tested everything except balena migrations. Worked as expected.
Overview
This PR switches the app to a newer implementation of the Discovery Client with improved state management to:
Closes #5985, closes #5250
Changelog
Review requests
summary of changes
This PR boils down to 3 fundamental changes:
discovery-client
app-shell/src/discovery.js
to use the new Discovery Client's APIapp/src/discovery
to use the new shape of robots returned by the new DCold state
Array<Service>
to the app, where:This state shape ended combining too many concerns and we ended up losing information that led to stale data bugs.
new state
Array<DiscoveryClientRobot>
, where:DiscoveryClientRobot
DiscoveryClientRobot
contains a list of IP addresses and each IP's current health statusaddresses
array (which is the address the DC thinks is most connectable) and merges it into the object returned by the selectorService.ok
can be replaced withDiscoveryClientRobot.healthStatus === HEALTH_STATUS_OK
testing
A fair amount of smoke testing is important for this PR. It's the culmination of a lot of work and we've got a lot of fun edge cases that our discovery system interacts with:
The following checklist is a grab bag of things that need to keep working that this switchover touches. See this Discovery Client test plan for a set of instructions on how to test each of these items
Important to note: This PR changes the format of the app's
discovery.json
cache file. If you run this PR, it will migrate your file to the new format. If you then open the app on an older version, it will appear as though your cache has been cleared because of the migration. Everything should, however, continue to function.Risk assessment
Medium. The app's discovery system is a critical piece of connectivity. The following steps were taken to mitigate risk: