robust-rosin / robust

A dataset of 200+ bugs in the Robot Operating System for BugZoo
30 stars 10 forks source link

[WIP] Fix schema #359

Closed hsd-dev closed 4 years ago

hsd-dev commented 4 years ago

Fixes most of the issues with the schema.

Though this doesn't allow automating fixing the bug files in any way. Porting to yamale. See https://github.com/robust-rosin/robust/issues/355

gavanderhoorn commented 4 years ago

Ha, CI is actually working:

/scripts/yamale.bug:33:13: [error] no new line character at the end of file (new-line-at-end-of-file)

;)

hsd-dev commented 4 years ago

YAML schema seems to be complete. Will run the validator on the bugs and will get the most commonly occurring values.

gavanderhoorn commented 4 years ago

Ping @ipa-hsd: could you update us on the status of this PR?

hsd-dev commented 4 years ago

Command:

find ../ -name "*.bug" | xargs -I {} ./validate.sh {}

Example out of the script (it checks for all bug files at once):

Error validating data '../universal_robot/fc95a19/fc95a19.bug' with './robust.yaml'

    bug.package: 'ros-industrial/universal_robot/ur_driver' is not a list.
    bug.languages: 'None' is not a list.
    bug.time-reported: '2014-10-10 (02:34)' is not a date.
    bug.time-reported: '2014-10-10 (02:34)' is not a null.
    bug.trace: 'None' is not a str.
    fix.repo: 'https://github.com/ros-industrial/universal_robot/' is not a regex match.
    fix.languages.0: 'Python' not in ('python', 'cmake', 'C++', 'package.xml', 'launch.xml', 'msg', 'srv', 'xacro', 'urdf', 'robot specific')
    fix.time: '2014-11-03 (16:30)' is not a date.
    fix.time: '2014-11-03 (16:30)' is not a null.
    time-machine: Required field missing
    bugzoo: Required field missing
hsd-dev commented 4 years ago

@wasowski the new commits added addresses https://github.com/robust-rosin/robust/issues/370

hsd-dev commented 4 years ago

The taxonomy notes the time is in the format 2017-12-31 (23:59). Changed the time to Z-notation UTC timestamp in https://github.com/robust-rosin/robust/pull/359/commits/56c54eb86fd9c1ab53497c2127b3dddc1aa99478. With the earlier format the validation fails.

For my ref:

awk '/time:/ && /\)$/ {gsub(/\(|\)/,"");str=$2" "$3; gsub(str, $2"T"$3":00Z")}1' "$file"
gavanderhoorn commented 4 years ago

The timestamps should actually be in ISO 8601 format.

I believe what you have (now) is in that format, but just wanted to mention the "official" name.

gavanderhoorn commented 4 years ago

Note btw: I'm not sure you can just use the awk command you have to rewrite all timestamp to UTC time like that. If the author of the bug description file is in another timezone, you'll have to convert the timestamps to UTC (ie: subtract delta-t from UTC, etc).

Just changing the format is not going to result in correct timestamps.

Having incorrect timestamps will lead to the time-machine using incorrect rosdistro state, etc.

ChrisTimperley commented 4 years ago

It's probably worth adding a particular version of yamale to scripts/requirements.txt. E.g., yamale==3.0.4.

hsd-dev commented 4 years ago

As per https://github.com/robust-rosin/robust/pull/376#discussion_r507543091, dropped https://github.com/robust-rosin/robust/commit/0c4670703dfd75ccd4e25e0333b639c3e229917d

hsd-dev commented 4 years ago

@gavanderhoorn @ChrisTimperley please take a look now.

hsd-dev commented 4 years ago

addressed the inline comments by @gavanderhoorn. Merging this PR.

ChrisTimperley commented 4 years ago

Bit of a pet peeve, sorry, but remember to squash and rebase next time so that we maintain a sensible commit history on master 👍🏻