Skip to content

Conversation

@vladmu
Copy link
Contributor

@vladmu vladmu commented Nov 18, 2020

Fixes #337

Risk

This PR makes minor API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior

Unit Tests

Added unit tests cover [SDL 0269] New vehicle data ClimateData changes

Core Tests

  • each of the properties in the struct of ClimateData can be received from the HMI
  • subscribing and unsubscribing to the HMI's ClimateData works
  • the application can receive updates via OnVehicleData RPCs.

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/A
Enhancements
  • New struct ClimateData
  • Added required getters/setters in related RPC classes
Bug Fixes
  • N/A

Tasks Remaining:

  • N/A

CLA

@vladmu
Copy link
Contributor Author

vladmu commented Nov 18, 2020

@santhanamk the PR is ready for Ford review.

Copy link

@santhanamk santhanamk left a 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;
}

/**

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 ().

Copy link
Contributor Author

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;

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;

Copy link
Contributor Author

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();

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)

Copy link
Contributor Author

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.');

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.');

Copy link
Contributor Author

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.');

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.');

Copy link
Contributor Author

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);

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.

Copy link
Contributor Author

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');

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.

Copy link
Contributor Author

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;

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

Copy link
Contributor Author

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)

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.

Copy link
Contributor Author

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);

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.

Copy link
Contributor Author

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.

@vladmu
Copy link
Contributor Author

vladmu commented Nov 25, 2020

@santhanamk I processed all your comments. Please re-review.

Copy link

@santhanamk santhanamk left a 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.

@vladmu vladmu marked this pull request as ready for review December 1, 2020 15:15
@vladmu
Copy link
Contributor Author

vladmu commented Dec 1, 2020

@santhanamk, thank you for the approval! @crokita, Ford approved this PR, please review.

@jordynmackool
Copy link

jordynmackool commented Dec 10, 2020

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:

  1. Please avoid removing sections from the PR template as all the information requested is needed.
  2. Please provide the Core branch/PR that this was tested against.

Once this PR is fully tested, tag me and Livio will review. Thank you!

@vladmu
Copy link
Contributor Author

vladmu commented Dec 11, 2020

Hi @jordynmackool ,

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.

  1. Please provide the Core branch/PR that this was tested against.

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
Only unit tests coverage was included in the testing plan, as defined in the description, therefore no Core branch/PR provided. For processing your request correctly we appreciate your help regarding the definition of what kind of tests with Core you're expecting here.

  1. Please avoid removing sections from the PR template as all the information requested is needed.

It seems not all sections could be relevant to code changes provided, should we use N/A to mark those sections instead of removing?

@jordynmackool
Copy link

jordynmackool commented Dec 11, 2020

Hi @vladmu,
All previous PRs should have not been merged unless they were tested against Core or the HMI (if applicable). Testing the PR branch against Core ensures that the feature as a whole works, not just the PR itself.

If an item in the template is not applicable, please mark it as N/A so we know that it was considered. We just updated the PR template to align with the other libraries so we are all on the same page in the future.

@vladmu
Copy link
Contributor Author

vladmu commented Dec 11, 2020

Hi @vladmu,
All previous PRs should have not been merged unless they were tested against Core or the HMI (if applicable). Testing the PR branch against Core ensures that the feature as a whole work, not just the PR itself.

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?

@crokita
Copy link
Contributor

crokita commented Dec 11, 2020

@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.

@vladmu
Copy link
Contributor Author

vladmu commented Dec 11, 2020

@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.

@crokita
Copy link
Contributor

crokita commented Dec 14, 2020

@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.

@vladmu
Copy link
Contributor Author

vladmu commented Dec 18, 2020

@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.

@renonick87
Copy link
Contributor

@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
@vladmu
Copy link
Contributor Author

vladmu commented Jan 26, 2021

@renonick87 done, please review.

const JSON_WINDOWSTATUS = this.windowStatus.getParameters();

this.climateData = new VehicleDataResult()
.setDataType(VehicleDataType.VEHICLEDATA_CLIMATEDATA);
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@renonick87 renonick87 left a 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.

@vladmu
Copy link
Contributor Author

vladmu commented Jan 26, 2021

@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.

@renonick87
Copy link
Contributor

@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.

@vladmu
Copy link
Contributor Author

vladmu commented Feb 1, 2021

@renonick87 we've updated the branch with the latest develop, please approve.

Copy link
Contributor

@renonick87 renonick87 left a 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.

@renonick87
Copy link
Contributor

@vladmu Please fix the merge conflicts on this PR and then I can merge it.

…ew_vehicle_data_climateData

# Conflicts:
#	tests/Test.js
@BogMW
Copy link
Contributor

BogMW commented Feb 10, 2021

@renonick87 all conflicts were fixed.

@renonick87 renonick87 merged commit 76f054e into smartdevicelink:develop Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDL 0269] New vehicle data ClimateData

6 participants