-
Notifications
You must be signed in to change notification settings - Fork 914
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 ROS message migration rule tool #996
Fix ROS message migration rule tool #996
Conversation
fixes CORE-6641 Consider the following scenario for a message G with the following versions: G0 -- rule.bmr --> G1 -- auto-generated rule --> G3 where G3 is the CURRENT msg, and G2 is the BAG message that needs migration. We need to check for a migration rule like this first: G2 --> G3 instead of the backwards ones that were generated before this bug fix: G2 --> G1 Note that the 'lazy' check to valid the rules in the make_update_rule method makes that rule pass initially, but later it fails because there's no rule for the sub fields.
refs CORE-6641 Checking the sub rules are also valid we allow to check for different positions in the chain for the BAG message we need to migrate, because we don't really know where it should go, and the 'lazy' check for valid in the make_update_rule method makes the suggested rules pass almost always, so we can easily get a rule in the wrong place that later would fail because there are no rules for the sub fields.
I've never created or even used bag migration rules, so I haven't a clue what's going on here, despite the effort at explaining the problem and this solution. Is there some way that the bag migration tests could be modified to illustrate the problem, so that we have a failing test corrected by this patch? |
@mikepurvis I didn't know about those test, although I'm happy to see that something is exercising this code. Upstream (publicly) only two package use rules, and they're only for one generation/change. I need to look into those tests and add one for the use case they didn't covered. It'd take me some time to get it done. |
@dirk-thomas it seems you wrote most of those tests, could you please orient me on writing a new one that exercise the use case fixed on this PR? |
I've figured out myself what's needed to test this corner case. Essentially, the Therefore, I need to create a new generation However, I'd need access to upload new .bag files for the new For now I'd put the new .bag files in the repo, inside the |
@efernandez Atm we don't have a way to provide access to other people. I can upload additional files to download.ros.org. Please either send me the bag files by email or post some links where I can download them. |
@dirk-thomas OK, thanks. I'd upload the .bag files somewhere and paste the links here. Once you upload the .bag files I'd update the links on the I'm still working on creating the .bag files and setting up the new tests. I hope to finish either EOD today or tomorrow. |
Description of the buggy corner case not handled on the rosbag migration tool
Consider the following scenario for a message G with the following versions:
where
G3
is the current msg, andG2
is the bag message that needs migration.We need to check for a migration rule like this first:
instead of the backwards ones that were generated before this bug fix:
Note that the lazy check to mark the rules as valid in the
make_update_rule
(see https://github.com/clearpathrobotics/ros_comm/blob/kinetic-devel-cpr/tools/rosbag/src/rosbag/migration.py#L1123) method makes that rule pass initially, but later it fails because there's no rule for the sub fields.This has been adapted from the commit clearpathrobotics@ec8ec37 description.
Improvement to the validation check for the rules
The other commit clearpathrobotics@97fdf48 simply allows to improve the lazy check in
make_update_rule
and therefore allows to find a better placement/position for the message to be migrated inside of the chain rules. This helps to avoid marking rules as valid, that later would fail because there's no rule for the sub fields. The more precise check that fails later happens at the sub fields level, and there's already a comment on the code that suggest that the way this is handled should be improved (see https://github.com/clearpathrobotics/ros_comm/blob/kinetic-devel-cpr/tools/rosbag/src/rosbag/migration.py#L307).This replaces clearpathrobotics#10
I recommend installing this chrome add-on to have a better diff: https://chrome.google.com/webstore/detail/github-diff-whitespace/lhbcdehjihmbiafeodkfnbndleijnnhp
FYI @mikepurvis @dirk-thomas @afakihcpr