-
Notifications
You must be signed in to change notification settings - Fork 12
[SDL 0269] New vehicle data ClimateData #350
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
[SDL 0269] New vehicle data ClimateData #350
Conversation
|
@santhanamk the PR is ready for Ford review. |
santhanamk
left a comment
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.
Hi @vladmu . Code looks good. I have given some feedback. Please see if you need to make those changes.
Some changes I suggested are optional, and are out of scope of this PR. You don't have to make those changes if you dont want to. They are very minor changes. I have marked those as "Optional".
| return VehicleDataType._MAP.VEHICLEDATA_CLIMATEDATA; | ||
| } | ||
|
|
||
| /** |
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.
Are you able to apply this history tag to VEHICLEDATA_EXTERNTEMP?
<history> <element name="VEHICLEDATA_EXTERNTEMP" since="2.0" until="X.x" /> </history>
I think you may just need to add * @since SmartDeviceLink 2.0.0 * @deprecated in SmartDeviceLink 7.1.0
around line 110 above static get VEHICLEDATA_EXTERNTEMP ().
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 is possible, but I'm not sure we need to add something here manually. The code you see is a result of the code generator tool.
| const Grid = SDL.rpc.structs.Grid; | ||
| const WindowStatus = SDL.rpc.structs.WindowStatus; | ||
| const Temperature = SDL.rpc.structs.Temperature; | ||
|
|
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.
Can you setup the ClimateData struct?
on line 28, you can add const ClimateData = SDL.rpc.structs.ClimateData;
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 in d1e6617
| .setValueParam(Test.GENERAL_NUMBER); | ||
|
|
||
| const JSON_TEMPERATURE = Test.JSON_TEMPERATURE = GENERAL_TEMPERATURE.getParameters(); | ||
|
|
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.
You can instantiate the ClimateData objects (GENERAL_CLIMATE_DATA and JSON_CLIMATE_DATA) around line 429. It would be something similar to lines 402-406 for the Window State setup (GENERAL_WINDOW_STATE and JSON_WINDOW_STATE)
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 in d1e6617
| Validator.assertNotNullUndefined(enumVehicledataFuellevelState, 'VEHICLEDATA_FUELLEVEL_STATE returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataFuelconsumption, 'VEHICLEDATA_FUELCONSUMPTION returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataExterntemp, 'VEHICLEDATA_EXTERNTEMP returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataClimatedata, 'VEHICLEDATA_FUELCONSUMPTION returned null.'); |
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.
line 90 should be Validator.assertNotNullUndefined(enumVehicledataClimatedata, 'VEHICLEDATA_CLIMATEDATA returned null.');
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 in d1e6617
| Validator.assertNotNullUndefined(enumVehicledataFuelconsumption, 'VEHICLEDATA_FUELCONSUMPTION returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataExterntemp, 'VEHICLEDATA_EXTERNTEMP returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataClimatedata, 'VEHICLEDATA_FUELCONSUMPTION returned null.'); | ||
| Validator.assertNotNullUndefined(enumVehicledataExterntemp, 'VEHICLEDATA_CLIMATEDATA returned null.'); |
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.
line 91 should be Validator.assertNotNullUndefined(enumVehicledataExterntemp, 'VEHICLEDATA_EXTERNTEMP returned null.');
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 in d1e6617
|
|
||
| // Valid Tests | ||
| Validator.validateVehicleDataResult(this.stabilityControlsStatus, testStabilityControlsStatus); | ||
| Validator.validateVehicleDataResult(this.vehicleDataResult, testHandsOffSteering); |
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.
Optional: On line 84 you can change vehicleDataResult to handsOffSteering.
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.
Based on previous experience, it is better to avoid changes not related to PR. Will add if PMs request this in the review.
| // structs | ||
| const VehicleDataResult = SDL.rpc.structs.VehicleDataResult; | ||
|
|
||
| const BaseRpcTests = require('./BaseRpcTests'); |
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.
Optional: On line 24 you could change this.vehicleDataResult to this.handsOffSteering.
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.
Based on previous experience, it is better to avoid changes not related to PR. Will add if PMs request this in the review.
| const FunctionID = SDL.rpc.enums.FunctionID; | ||
| const MessageType = SDL.rpc.enums.MessageType; | ||
| const VehicleDataType = SDL.rpc.enums.VehicleDataType; | ||
|
|
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.
Optional: On line 26 you could change JSON_VEHICLEDATARESULT to JSON_HANDSOFFSTEERING
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.
Based on previous experience, it is better to avoid changes not related to PR. Will add if PMs request this in the review.
| this.createMessage = function () { | ||
| return new UnsubscribeVehicleDataResponse() | ||
| .setStabilityControlsStatus(this.stabilityControlsStatus) | ||
| .setHandsOffSteering(this.vehicleDataResult) |
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.
Optional: On line 45 you can change vehicleDataResult to handsOffSteering.
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.
Based on previous experience, it is better to avoid changes not related to PR. Will add if PMs request this in the review.
|
|
||
| // Valid Tests | ||
| Validator.validateVehicleDataResult(this.stabilityControlsStatus, testStabilityControlsStatus); | ||
| Validator.validateVehicleDataResult(this.vehicleDataResult, testHandsOffSteering); |
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.
Optional: On line 84 you can change vehicleDataResult to handsOffSteering.
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.
Based on previous experience, it is better to avoid changes not related to PR. Will add if PMs request this in the review.
|
@santhanamk I processed all your comments. Please re-review. |
santhanamk
left a comment
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.
Hi @vladmu . I reviewed the code review changes, and the code looks good. Thanks.
|
@santhanamk, thank you for the approval! @crokita, Ford approved this PR, please review. |
|
Hi @vladmu and @santhanamk, since the core PR for this feature is not complete, it seems that this PR would have not been tested fully. To ensure the review process goes smoothly:
Once this PR is fully tested, tag me and Livio will review. Thank you! |
|
Hi @jordynmackool ,
I would be thankful if you could describe what you mean under full testing here in the border of the current proposal? Previous similar work did not require any additional testing except unit tests. Please see #258
It seems not all sections could be relevant to code changes provided, should we use |
|
Hi @vladmu, If an item in the template is not applicable, please mark it as |
Thank you @jordynmackool , Do you have the instructions on how to test RPC changes in mobile libraries with Core? Should we develop additional applications for this? What exactly you mean under "testing RPC changes against Core"? What result is acceptable by you as "fully tested RPC changes" except unit tests? Do you have "a definition of done" for such work? |
|
@vladmu Hello. I can provide some clarity on what would be expected for a PR like this. Since this PR introduces a new set of vehicle data, I would expect testing against an HMI which supports this new data, and checking that each of the properties in the struct of ClimateData can be received from the HMI. I would also expect a check that subscribing and unsubscribing to the HMI's ClimateData works and that the application can receive updates via OnVehicleData RPCs. |
Hi @crokita , Thank you for the explanation, but as far as we understand, that's impossible without creating at least minimal testing application which could provide described functions and allow to get and analyze the result. Do you have tools for such testing without creating the additional app? Or creating testing application for each RPC PRs is expected and is a part of the proposal implementation? Then we will need to extent timelines and effort to fit your expectations. |
|
@vladmu Ah. With regards to testing, this current sdl_hmi PR and core PR would be of interest: smartdevicelink/sdl_hmi#468, and smartdevicelink/sdl_core#3586 We tend to rely on other projects for their implementations to be ready before we're able to do testing with feature PRs. |
…ew_vehicle_data_climateData
|
@jordynmackool @crokita the description was fixed to include all sections from the template and the code was tested against the Core and HMI (corresponded links also included in the description). Please review. |
|
@vladmu Please run the generator again with the latest changes to the RPC spec PR. Please also merge in the develop branch and resolve any merge conflicts. |
…ew_vehicle_data_climateData # Conflicts: # tests/Test.js # tests/node/rpc/messages/GetVehicleDataResponseTests.js # tests/node/rpc/messages/GetVehicleDataTests.js # tests/node/rpc/messages/OnVehicleDataTests.js # tests/node/rpc/messages/SubscribeVehicleDataResponseTests.js # tests/node/rpc/messages/SubscribeVehicleDataTests.js # tests/node/rpc/messages/UnsubscribeVehicleDataResponseTests.js # tests/node/rpc/messages/UnsubscribeVehicleDataTests.js
|
@renonick87 done, please review. |
| const JSON_WINDOWSTATUS = this.windowStatus.getParameters(); | ||
|
|
||
| this.climateData = new VehicleDataResult() | ||
| .setDataType(VehicleDataType.VEHICLEDATA_CLIMATEDATA); |
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.
The indentation for line 43 is incorrect. It has an indentation of 10 spaces but it should be 12 spaces.
| const JSON_WINDOWSTATUS = this.windowStatus.getParameters(); | ||
|
|
||
| this.climateData = new VehicleDataResult() | ||
| .setDataType(VehicleDataType.VEHICLEDATA_CLIMATEDATA); |
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.
The indentation for line 43 is incorrect. It has an indentation of 10 spaces but it should be 12 spaces.
renonick87
left a comment
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.
@vladmu This looks good for the most part. See the comments regarding indentation. In the future, please use the command npm run lint to ensure all contributions pass lint validation.
|
@renonick87 thank you for the review. We use lint if possible, but it is less useful for now because it shows 9 problems (5 errors, 4 warnings) in parts not related to current code changes. Therefore those 2 indentations were missed over the process of merging the conflict. Fixed, please review. |
|
@vladmu We'll be looking to fix those linter problems that you're seeing in a future PR so hopefully that will no longer be an issue. Everything else looks good here. If you can pull in develop to resolve the merge conflicts then I can approve this PR. |
…ew_vehicle_data_climateData
|
@renonick87 we've updated the branch with the latest develop, please approve. |
renonick87
left a comment
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.
Marking this PR as approved. Will hold off on merging it until its respective rpc_spec PR, smartdevicelink/rpc_spec#299, is merged.
|
@vladmu Please fix the merge conflicts on this PR and then I can merge it. |
…ew_vehicle_data_climateData # Conflicts: # tests/Test.js
|
@renonick87 all conflicts were fixed. |
Fixes #337
Risk
This PR makes minor API changes.
Testing Plan
Unit Tests
Added unit tests cover [SDL 0269] New vehicle data ClimateData changes
Core Tests
Core version / branch / commit hash / module tested against: smartdevicelink/sdl_core#3586
HMI name / version / branch / commit hash / module tested against: smartdevicelink/sdl_hmi#468
Summary
Applied [SDL 0269] New vehicle data ClimateData changes
Changelog
Breaking Changes
N/AEnhancements
ClimateDataBug Fixes
N/ATasks Remaining:
N/ACLA