Skip to content
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(v3.7.x): fix unexpected behavior related to available_ecu_ids #290

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

Bodong-Yang
Copy link
Member

Description

This PR fixes an unexpected implementation details which prevents the available_ecu_ids for actually behaving as expected.

This is caused by:

  1. ota_client_stub module merges the available_ecu_ids from sub ECU's status response.
  2. ecu_info parsing logic has an implicit implementation detail for backward compatibility, which when available_ecu_ids is not defined in the ecu_info.yaml, add this ECU id into this field.

The above effectively disabling the functionality of available_ecu_ids, unless the corresponding ECU contacts that don't need OTA also being commented out in ecu_info.yaml.

With this PR, now the available_ecu_ids field should work as expected, and the behavior aligns with the documentation, which only available_ecu_ids from the main ECU is respected.

@Bodong-Yang Bodong-Yang added the bug Something isn't working label Apr 21, 2024
@Bodong-Yang Bodong-Yang merged commit f73c6d0 into v3.7.x Apr 21, 2024
3 checks passed
@Bodong-Yang Bodong-Yang deleted the fix/v3.7.x/available_ecu_ids branch April 21, 2024 15:16
Bodong-Yang added a commit to Bodong-Yang/ota-client that referenced this pull request Apr 21, 2024
commit f73c6d0
Author: Bodong Yang <[email protected]>
Date:   Mon Apr 22 00:16:45 2024 +0900

    fix(v3.7.x): not merging available_ecu_ids from child ECUs status resp again (tier4#290)

    This PR fixes an unexpected implementation details which prevents the available_ecu_ids for actually behaving as expected.

    This is caused by:
    * ota_client_stub module merges the available_ecu_ids from sub ECU's status response.
    * ecu_info parsing logic has an implicit implementation detail for backward compatibility, which when available_ecu_ids is not defined in the ecu_info.yaml, add this ECU id into this field.

    The above effectively disabling the functionality of available_ecu_ids, unless the corresponding ECU contacts that don't need OTA also being commented out in ecu_info.yaml.

    With this PR, now the available_ecu_ids field should work as expected, and the behavior aligns with the documentation, which only available_ecu_ids from the main ECU is respected.
Copy link
Contributor

Coverage

Coverage Report
FileStmtsMissCoverMissing
otaclient/app
   __init__.py00100% 
   __main__.py330%16–19
   common.py3753291%63, 193, 208, 283–285, 295, 304–306, 412, 424, 543–547, 635, 637, 669–671, 673, 699–702, 707, 711–715, 741–742
   configs.py760100% 
   downloader.py2714484%68, 81–82, 297, 302, 306, 324–325, 375–379, 398–408, 429–447, 456, 531–533, 549, 569–587
   errors.py1130100% 
   interface.py17476%32, 43, 47, 51
   log_setting.py55787%39–40, 52, 54, 65–67
   main.py29293%43–44
   ota_client.py39814963%55–56, 76, 182–206, 243–246, 258–274, 284–287, 292–330, 372–375, 380–387, 400–423, 429–432, 461–485, 499–506, 513, 516–522, 569–572, 580, 616, 621–643, 703–719, 730–746, 757, 776, 787–788, 805, 824, 828–829, 844
   ota_client_call.py38684%42–44, 80–82
   ota_client_service.py27389%55–57
   ota_client_stub.py39010872%76–81, 89–97, 101–123, 128–137, 140–147, 155–160, 197–199, 204, 240, 265, 268, 271, 375, 401, 403, 429, 479, 536, 606–607, 646, 665–676, 680–694, 698–701, 754, 841–850, 880–927, 930
   ota_metadata.py3153190%145, 150, 186–187, 197–201, 213, 271, 304–306, 323–326, 406, 409, 417–419, 432, 441–446, 719–730
   ota_status.py14286%34, 42
   update_stats.py105298%160, 170
otaclient/app/boot_control
   __init__.py40100% 
   _cboot.py28914251%81–89, 98–111, 117–120, 124, 131, 135, 139, 143–147, 151–155, 162–174, 177–220, 226, 229, 232, 235, 238, 241, 244, 247–248, 251–252, 255–259, 262–263, 278, 281, 315, 332–335, 348–351, 361–364, 372, 411, 428–431, 440–443, 448–450, 459–465, 468, 475, 505–508, 547–550, 555–566, 571–577
   _common.py36914361%63–72, 81–82, 86–87, 95–96, 107–108, 113–118, 123–128, 137, 146, 150, 154, 158, 172–175, 185–189, 194, 198, 208–212, 220–232, 243–247, 251–255, 267–269, 281–283, 294–308, 318–339, 358–374, 391–402, 410–416, 511–521, 580–581, 635, 639–640, 643, 651–654, 710–711, 714, 728–736, 751–752, 826–829, 850–853, 866–867, 876
   _errors.py471960%43–69, 89–90
   _grub.py40411472%216, 264–267, 273–277, 314–315, 322–346, 355–361, 370–376, 455–461, 513, 519, 545, 567–572, 587–589, 618–628, 683–689, 708–711, 736–739, 762–765, 807, 813, 833–836, 848, 851, 854, 857, 861–863, 881–884, 912–915, 920–928, 933–941
   _rpi_boot.py26712553%84–86, 92–147, 171–173, 179–181, 194–196, 202–204, 217–242, 247, 251, 255, 259, 293, 323, 326–328, 336, 345–348, 358–361, 365–372, 412–414, 456–460, 479–482, 487, 490, 511–514, 519–527, 532–540, 554–557, 563–565, 568
   configs.py420100% 
   firmware.py31584%60, 62, 73–75
   protocol.py28582%53, 57, 61, 65, 73
   selecter.py392633%44–69, 77–94
otaclient/app/create_standby
   __init__.py12558%28–34
   common.py2164579%72, 75–76, 80–93, 139, 187–195, 198–201, 205, 216, 290–298, 310, 354–359, 375–376, 390–394, 419–420
   interface.py19384%55, 59, 63
   rebuild_mode.py89199%104
otaclient/app/proto
   __init__.py31390%37, 44–45
   _common.py4194988%85, 163, 170, 182–184, 203, 208, 219, 256, 262, 267, 298, 302, 306, 363, 380, 403, 464, 471, 474, 494, 501, 503, 529, 535, 538, 540, 565, 571, 574, 576, 605, 609, 611, 625, 642, 670, 673, 677, 680, 708, 714, 761–766, 797
   _ota_metafiles_wrapper.py841385%37, 40–42, 112–116, 122–125
   _otaclient_v2_pb2_wrapper.py2763787%87, 90–93, 132, 175, 183, 197, 207, 210–213, 258, 261, 264–265, 285, 305, 385, 452, 505, 513–515, 519–522, 525–530, 551, 559, 573, 581, 595
   streamer.py43881%32, 47, 65–66, 71, 80–81, 99
   wrapper.py40100% 
otaclient/ota_proxy
   __init__.py46393%86, 90, 94
   __main__.py22220%16–79
   _consts.py150100% 
   cache_control.py68494%71, 91, 113, 121
   config.py180100% 
   db.py1461590%75, 81, 103, 113–116, 145–147, 166, 199, 208–209, 229, 258, 300
   errors.py100100% 
   orm.py1151190%37, 91, 96, 101, 107, 113, 140–141, 154, 231, 235
   ota_cache.py4047581%95–96, 215, 226, 253–255, 275, 291–294, 317–330, 359–363, 379, 440–441, 483–484, 554, 567–570, 620, 639–640, 672–673, 684, 721–728, 735–736, 741–743, 747, 756, 803, 811–813, 892–895, 899–903, 917–934, 965, 971, 998, 1027–1029
   server_app.py1383972%75, 78, 84, 100, 102, 161–170, 212–243, 256–266, 292–298, 312–314, 320–322
   utils.py23196%31
TOTAL5944130678% 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant