-
Notifications
You must be signed in to change notification settings - Fork 111
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
[RSDK-448] Add Partial Start option to robot config #1617
[RSDK-448] Add Partial Start option to robot config #1617
Conversation
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.
generally looks good but would like the logs to be more informative/different level
also there are a few more cases in the ticket which should be covered by the tests - you should add those |
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.
we should also add more tests and create a ticket for adding disable_partial_start to the config proto
config/config.go
Outdated
@@ -46,6 +46,10 @@ type Config struct { | |||
// If false, it's for creating a robot via the RDK library. This is helpful for | |||
// error messages that can indicate flags/config fields to use. | |||
FromCommand bool `json:"-"` | |||
|
|||
// DisablepartialStart ensures that a robot will only start when all the components, |
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.
nit: DisablepartialStart -> DisablePartialStart
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.
fixed the nit, added the two test cases in the AC of the story and added the proto story https://viam.atlassian.net/browse/RSDK-918
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.
minor nits but lgtm otherwise
robot/impl/local_robot_test.go
Outdated
test.That(t, ok, test.ShouldBeFalse) | ||
|
||
r.Reconfigure(ctx, goodConfig) | ||
// Test Component Error |
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.
nit: these aren't errors anymore?
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.
fixed the comments
robot/impl/local_robot_test.go
Outdated
Cloud: &config.Cloud{}, | ||
} | ||
// Test Component Error | ||
noBase, err := r.ResourceByName(base.Named("test")) |
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.
nit: over here too. we can also use base.FromRobot(r, "test")
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.
changed it
|
We want to allow robots to start even if one component does not pass config validation. We want this to be the default behavior for robots so the new disablepartialstart cofig field is set to false by default and does not need to be added to the config. if a user wishes to disable this behavior they can set disablepartialstart to true in the robot config.