Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: python
python: ["2.7"]
python:
- "2.7"
- "3.6"
cache: pip
install: pip install yamllint
script: "find . -type f -name *.bug | xargs yamllint -f parsable -c .yamllint.yml"
38 changes: 29 additions & 9 deletions kobuki/e964bbb/e964bbb.bug
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,48 @@ classification: "CWE-682: Incorrect Calculation #PHYSICAL"
keywords: ['differential drive', 'velocity', 'driver', 'movement']
system: kobuki
severity: error
links:
links: []
failure-codes:
- PROGRAMMING:CALCULATIONS
fault-codes:
- SYSTEM:UNINTENDED-BEHAVIOUR
- SYSTEM:MOTION
bug:
phase: runtime
specificity: robotics-specific
architectural-location: application-specific code
application: mobile robot
task: differential drive
task: locomotion
subsystem: driver
package: yujinrobot/kobuki/kobuki_driver
languages: null
package:
- yujinrobot/kobuki/kobuki_driver
languages:
- C++
detected-by: developer
reported-by: contributor
issue: https://github.com/yujinrobot/kobuki/issues/227
time-reported: 2013-02-22T09:09:21Z
reproducibility: always
trace:
trace: N/A
fix:
repo: https://github.com/yujinrobot/kobuki
hash: e964bbb8700fb1a9b95c0cfe5a44d43321294d4f
pull-request: null
license: ['BSD']
fix-in: ['kobuki_driver/src/driver/diff_drive.cpp']
pull-request: N/A
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: we don't use null any more for this then? Or was that too ambiguous (as in: could also mean we just haven't bothered to look for one)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure in general, but for this specific case, the commit was not part of any PR. So N/A might be more suitable here.

license:
- 'BSD'
fix-in:
- 'kobuki_driver/src/driver/diff_drive.cpp'
languages:
- C++
time: 2013-02-25 (09:31)
time: 2013-02-25T09:31:00Z
time-machine:
ros_distro: hydro
ros_pkgs:
- kobuki_driver
datetime: 2013-02-22T09:09:21Z
bugzoo:
is-build-failure: false
bug-commit: 7404126181d60ac20ebfddefba64405af58d3434
fix-commit: e964bbb8700fb1a9b95c0cfe5a44d43321294d4f
fork-urls:
- https://github.com/robust-rosin/kobuki
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ requests>=2.19.1
docker>=3.5.0
packaging~=19.0
bugzoo>=2.1.27
yamale==3.0.4
10 changes: 5 additions & 5 deletions scripts/robust.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@
"items" : {
"type" : "string",
"minLength" : 5,
"pattern" : "^([a-z0-9A-Z_]+)(/[a-z0-9A-Z_]+){2}$"
"pattern" : "^([a-z0-9A-Z-]+)(/[a-z0-9A-Z_]+){2}$"
},
"description" : "A list of packages involved. Each entry should specify the project, the repository, and the package, for example: 'ros-industrial/universal_robot/ur_bringup'"
},
"languages" : {
"type" : "array",
"items" : { "enum" : [ "python", "cmake", "C++", "package.xml",
"launch.xml", "msg", "srv", "xacro", "urdf" ] },
"launch.xml", "msg", "srv", "xacro", "urdf", "robot specific" ] },
"description" : "A list of the languages involved in the failure. N/A if the error is not explicitly reported by the language infrastructure. Avoid a generic XML tag (all files in ROS have some known schema, and let's try to narrow it down when writing). Also the language should be N/A if the bug is not reported by the language infrastructure (so if the error is in package.xml but a C++ compiler fails then the language is 'C++' here, not 'package.xml'. The latter is listed under the fix. If the error is not reported by a language infrastructure, but for instance wrong behavior is discovered in simulation, then do not put a language in). For this reason it should be fairly unusual to have more than one language listed here."
},
"detected-by" : {
Expand Down Expand Up @@ -160,7 +160,7 @@
"repo" : {
"type" : "string",
"minLength" : 3,
"pattern" : "^(https://github\\.com/[a-zA-Z0-9_]+/[a-zA-Z0-9_]+)$",
"pattern" : "^(https://github\\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_]+)$",
"description" : "URI reference to repository where the bug was fixed."
},
"hash" : {
Expand All @@ -173,7 +173,7 @@
"pull-request" : {
"type" : "string",
"minLength" : 1,
"pattern" : "(^(https://github\\.com/[a-zA-Z0-9_]+/[a-zA-Z0-9_]+/pull/[0-9]+)?$)|(^N/A$)",
"pattern" : "(^(https://github\\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_]+/pull/[0-9]+)?$)|(^N/A$)",
"description" : "URI for pull request that fixed the bug. N/A if no pull request (for instance direct commit)."
},
"license" : {
Expand All @@ -195,7 +195,7 @@
"type" : "array",
"items" : {
"enum" : [ "python", "cmake", "C++", "package.xml", "launch.xml",
"msg", "srv", "xacro", "urdf" ]
"msg", "srv", "xacro", "urdf", "robot specific" ]
},
"description" : "The languages involved in fixing the bug. (See list of conventions for naming languages under bug/language)."
},
Expand Down
75 changes: 75 additions & 0 deletions scripts/robust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
id: str(min=7, max=7)
title: str(min=1, max=160)
description: str(min=1)
classification: str(min=1)
keywords: list(str(min=1, max=80))
system: str(min=1, max=40)
severity: enum("error", "warning", "convention-violation", "bad-smell",
"minor-issue", "not-a-bug")
links: list(regex("^(http)s?://([A-Z0-9])?"))
failure-codes: list(enum("BAD-SMELL", "ROS-SPECIFIC", "NAMING-TYPOS", "COPYPASTA", "DEFAULTS",
"CONFIG:PARAM", "CONFIG:REMAPPING", "CONFIG:ARGS", "CONFIG:CONSTANTS", "CONFIG:ENCODING", "CONFIG:NAMESPACE", "CONFIG:TOPIC",
"BDO:BUILD", "BDO:DEPENDENCY", "BDO:ORCHESTRATION",
"CONCURRENCY:NO-SYNC", "CONCURRENCY:BAD-SYNC", "CONCURRENCY:TIMING", "CONCURRENCY:SIGNALS",
"EVOLUTION:LANGUAGE", "EVOLUTION:LIBRARY", "EVOLUTION:PACKAGE", "EVOLUTION:DEPRECATION", "EVOLUTION:ROBOT", "EVOLUTION:FIRMWARE", "EVOLUTION:DOCS", "EVOLUTION:PATHS",
"PROGRAMMING:LOGIC", "PROGRAMMING:CALCULATIONS", "PROGRAMMING:CONTROL-FLOW", "PROGRAMMING:MISSING-FEATURE", "PROGRAMMING:VALIDATION", "PROGRAMMING:UNINITIALISED", "PROGRAMMING:BROKEN-CONTRACT", "PROGRAMMING:RESOURCES", "PROGRAMMING:DATATYPE", "PROGRAMMING:UNUSED", "PROGRAMMING:PATH", "PROGRAMMING:STRING-FORMATTING", "PROGRAMMING:COMPILER-ERROR",
"MODELS:ROBOT", "MODELS:WORLD", "MODELS:TRANSFORMATIONS",
"SYSTEMS:OS", "SYSTEMS:HARDWARE", "SYSTEM:FIRMWARE", "SYSTEMS:CONFIG"))
fault-codes: list(enum("WARNING", "UNKNOWN", "HARMLESS", "MISLEADING", "NONE",
"SYSTEM:LIVENESS", "SYSTEM:UNINTENDED-BEHAVIOUR", "SYSTEM:PERFORMANCE", "SYSTEM:NONE", "SYSTEM:PHYSICAL", "SYSTEM:MOTION", "SYSTEM:SIMULATION",
"SOFTWARE:BUILD", "SOFTWARE:RUNTIME", "SOFTWARE:NETWORK", "SOFTWARE:UX", "SOFTWARE:CONCURRENCY", "SOFTWARE:PERFORMANCE"))
bug: include('_bug')
fix: include('_fix')
time-machine: include('_time-machine')
bugzoo: include('_bugzoo')

---

_bug:
phase: enum("build", "deployment", "runtime", "does not apply", "unknown")
specificity: enum("general issue", "robotics-specific", "ROS-specific",
"application-specific")
architectural-location: enum("application-specific code", "platform code", "N/A")
application: any(str(min=1), null())
task: enum("perception", "localization", "planning", "manipulation", "locomotion",
"human-robot interaction", "simulation", "diagnostics", "SLAM",
"N/A")
subsystem: str(min=1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an enum?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean the subsystem. I think we should definitely make sure that consistent names and spelling is used, otherwise, I think it is of secondary importance, whether it is an enum or not. If you make it enum it is easier for you to detect divergences. The cost is that the scheme has to be changed whenever a new value pops up. I think this is a price that is entirely acceptable. So if you prefer to let yamale control it, just go ahead.

package: list(regex("^([a-z0-9A-Z-]+)(/[a-z0-9A-Z_]+){2}$"))
languages: list(enum("python", "cmake", "C++", "package.xml",
"launch.xml", "msg", "srv", "xacro", "urdf", "robot specific"))
detected-by: enum("build system", "compiler", "code scanning tool",
"assertions", "runtime detection", "runtime crash",
"testing violation", "developer", "user")
reported-by: enum("guest user", "contributor", "member developer",
"automatic", "unreported")
issue: any(regex("^((https://github\\.com/[a-zA-Z0-9_]+/[a-zA-Z0-9_]+/issues/[0-9]+)?)$"), str("N/A"))
time-reported: any(date(), null())
reproducibility: str()
trace: str(min=1)
reproduction: any(str(min=1), null(), required=False)

_fix:
repo: regex("^(https://github\\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_]+)$")
hash: include('_hash')
pull-request: regex("(^(https://github\\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_]+/pull/[0-9]+)?$)|(^N/A$)")
license: list(enum("BSD", "GPLv3", "LGPLv3"))
fix-in: list(str(min=1))
languages: list(enum("python", "cmake", "C++", "package.xml", "launch.xml",
"msg", "srv", "xacro", "urdf", "robot specific"))
time: any(date(), null())

_time-machine:
ros_distro: enum("noetic", "melodic", "lunar", "kinetic", "jade", "indigo",
"hydro", "groovy", "fuerte", "electric", "diamondback")
ros_pkgs: list(str(min=1))
datetime: date()

_bugzoo:
is-build-failure: any('true', 'false')
bug-commit: include('_hash')
fix-commit: include('_hash')
fork-urls: list(regex("^(https://github\\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_]+)$"))


_hash: regex("^[0-9a-f]{40}$")
8 changes: 2 additions & 6 deletions scripts/validate.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/bin/bash

# usage: ./validate.sh bugid.bug
#
# install: https://github.com/any-json/any-json
# install: https://github.com/jessedc/ajv-cli

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCHEMA="${DIR}/robust.json"
VALIDATOR="${DIR}/yamale_validator.py"
echo Checking schema compliance for $1
any-json --input-format=yaml $1 | ajv --verbose --errors=text -s ${SCHEMA} -d /dev/stdin 2>&1 >/dev/null | sed "s/\/dev\/stdin/File $1/"
python3 ${VALIDATOR} $1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does our CI setup guarantee Python 3 is installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add that, just so we keep things working/consistent.

Just checked and the current .travis.yml actually specifies 2.7.

39 changes: 39 additions & 0 deletions scripts/yamale_validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-

# Import Yamale and make a schema object:
import sys
import os
import yamale
import datetime
from yamale.validators import DefaultValidators, Validator

class Date(Validator):
""" Custom Date validator """
tag = 'date'

def _is_valid(self, value):
return isinstance(value, datetime.date)

validators = DefaultValidators.copy() # This is a dictionary
validators[Date.tag] = Date

dir_here = os.path.dirname(__file__)
schema_path = os.path.join(dir_here, 'robust.yaml')
data_path = os.path.join(dir_here, 'yamale.bug')

schema = yamale.make_schema(schema_path, validators=validators)

# Create a Data object
data = yamale.make_data(sys.argv[1])

# Validate data against the schema. Throws a ValueError if data is invalid.
try:
yamale.validate(schema, data)
print('Validation success! 👍')
except yamale.YamaleError as e:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle errors in each field

print('Validation failed!\n')
for result in e.results:
print("Error validating data '%s' with '%s'\n\t" % (result.data, result.schema))
for error in result.errors:
print('\t%s' % error)
sys.exit(1)
4 changes: 2 additions & 2 deletions universal_robot/a58f4b5/a58f4b5.bug
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ classification: |
keywords: ['meta-package', 'catkin']
system: universal_robot
severity: error
links: http://www.ros.org/reps/rep-0127.html | https://github.com/catkin/catkin_tools/issues/370#issuecomment-219157118
links: [http://www.ros.org/reps/rep-0127.html, https://github.com/catkin/catkin_tools/issues/370#issuecomment-219157118]
bug:
phase: build
specificity: ROS-specific
architectural-location: platform code
application: null
task: null
subsystem: driver
package: ros-industrial/universal_robot/ur10_moveit_config | ros-industrial/universal_robot/ur3_moveit_config | ros-industrial/universal_robot/ur5_moveit_config
package: [ros-industrial/universal_robot/ur10_moveit_config, ros-industrial/universal_robot/ur3_moveit_config, ros-industrial/universal_robot/ur5_moveit_config]
languages: package.xml
detected-by: build system
reported-by: unreported
Expand Down