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

Support the concept of applicable versions #202

Open
hoangtungdinh opened this issue Nov 7, 2024 · 0 comments
Open

Support the concept of applicable versions #202

hoangtungdinh opened this issue Nov 7, 2024 · 0 comments
Labels
isState:New A new issue that needs to be classified to a type. isType:Feature An issue that adds new features to the project.
Milestone

Comments

@hoangtungdinh
Copy link
Collaborator

hoangtungdinh commented Nov 7, 2024

Is your feature request related to a problem? Please describe.

During the implementation of the OpenDrive Checker Bundle, the following use cases arose that are currently not supported by the QC Framework

  1. A rule should no longer be applied after a certain version. For example, the rule asam.net:xodr:1.7.0:junctions.connection.one_connection_element should only be applied for OpenDrive 1.7.0 and not for OpenDrive 1.8.0 and higher. (Related topic: False positive in check_asam_xodr_junctions_connection_one_connection_element with OpenDRIVE 1.8 qc-opendrive#117)
  2. A rule can be applied to a lower version defined by the definition setting in rule UID. For example, the rule asam.net:xodr:1.7.0:junctions.connection.one_connection_element can also be applied to OpenDrive 1.6.0.

Currently, the version in which a rule can be applied is only defined by the definition setting in the rule UID, which only defines the version lower bound and does not cover the two use cases above.

Describe the solution you'd like

Introduces the concept of applicable versions, which allows the specification of additional upper bounds and alternative lower bounds for versions. The applicable versions can be defined for a specific implementation of a checker. From this discussion, an initial concept and implementation for applicable versions was introduced in the OpenDrive Checker Bundle, which can then be promoted to a framework-level concept.

Applicable Version from OpenDrive Checker Bundle

The APPLICABLE_VERSIONS variable can be used to define additional constraints on the versions of the input files that a rule supports, in addition to the definition setting in the rule UID. It can be specified in the same way as the Python Version Specifiers. For example:

APPLICABLE_VERSIONS = "<1.8.0"
APPLICABLE_VERSIONS = ">=1.6.0"
APPLICABLE_VERSIONS = "<1.8.0,>=1.6.0"

The specification consists of a series of version clauses, separated by commas. The comma is equivalent to a logical "AND" operator: a candidate version must match all given version clauses in order to match the applicable versions as a whole.

The applicable versions only supports versions of in the full semantic form major.minor.patch. Elision of minor or patch elements are not supported. For example, 1.7.0rc1 and 1.7 are not supported, but 1.7.0 is supported.

The applicable versions only supports the following comparison operators.

  • < smaller than (upper bound)
  • <= smaller or equal than (upper bound)
  • > greater than (lower bound)
  • >= greater or equal than (lower bound)

The definition setting in rule UID and the applicable versions together define the versions of the input file in which a rule can be applied. For example, let's consider a rule UID for ASAM OpenDRIVE asam.net:xodr:1.6.0:*. The definition setting in this case is 1.6.0.

  1. If no applicable versions is specified, a rule will be applied starting from the definition setting version, up to the most recent one.

    • For the example, if the APPLICABLE_VERSIONS variable does not exist, then the rule is applied to OpenDRIVE versions 1.6.0, 1.6.1, 1.7.0, 1.8.0: the internal representation of the version specifier is >=1.6.0.
  2. If the applicable versions is specified, and defines only upper bounds, then the definition setting defines the lower bound

    • For the example, if APPLICABLE_VERSIONS = "<1.8.0", then the rule is applied to OpenDRIVE versions 1.6.0, 1.6.1, 1.7.0: the internal representation of the version specifier is >=1.6.0,<1.8.0.
  3. If the applicable versions is specified, and defines at least one lower bound, then the definition setting is ignored. Only the lower bounds defined in the applicable versions are taken into account.

    • For the example, if APPLICABLE_VERSIONS = ">=1.5.0", then the rule is applied to OpenDRIVE versions 1.5.0, 1.6.0, 1.6.1, 1.7.0, 1.8.0: the internal representation of the version specifier is >=1.5.0.
Case Number Example Rule APPLICABLE_VERSIONS Internal Representation File versions to be checked
1 asam.net:xodr:1.6.0:* "" ">=1.6.0" 1.6.0, 1.6.1, 1.7.0, 1.8.0
2 asam.net:xodr:1.6.0:* "<1.8.0" ">=1.6.0,<1.8.0" 1.6.0, 1.6.1, 1.7.0
3 asam.net:xodr:1.6.0:* ">=1.5.0" ">=1.5.0" 1.5.0, 1.6.0, 1.6.1, 1.7.0, 1.8.0

Notes

The applicable versions concept can be supported by an executor implementation of asam-qc-baselib in future releases.

@hoangtungdinh hoangtungdinh added the isType:Feature An issue that adds new features to the project. label Nov 7, 2024
@andreaskern74 andreaskern74 added this to the Wish List milestone Nov 7, 2024
@andreaskern74 andreaskern74 added the isState:New A new issue that needs to be classified to a type. label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
isState:New A new issue that needs to be classified to a type. isType:Feature An issue that adds new features to the project.
Projects
None yet
Development

No branches or pull requests

2 participants