itsallcode / openfasttrace

Open source requirement tracing suite
GNU General Public License v3.0
100 stars 21 forks source link

ReqM2 importer cannot match linksto ids without type integrated into the id (which is valid ReqM2) #350

Open insi-eb opened 1 year ago

insi-eb commented 1 year ago

Description

if the ReqM2 importer sees something like the following:

<specobjects doctype="src">
    <specobject>
      <id>/path/to/some/file.cpp</id>
      <status>approved</status>
      <sourcefile>/path/to/some/file.cpp</sourcefile>
      <sourceline>13</sourceline>
      <version>1</version>
      <providescoverage>
        <provcov>
          <linksto>swdd.some_specobject_id</linksto>
          <dstversion>1</dstversion>
        </provcov>
      </providescoverage>
    </specobject>
</specobjects>

it emits a warning

WARNING: Name 'swdd.some_specobject_id' does not match legacy name pattern '(\p{Alpha}+)(?:~\p{Alpha}+)?:(\p{Alpha}[\w-](?:.\p{Alpha}[\w-])*+)': using artifact type 'unknown'.

and tries to match linkage to an unknown~swdd.some_specobject_id specobject, which of course doesn't exist and therefore fails the tracing graph.

The ReqM2 is valid based on the specification - you do not have to include the type in linksto items.

Steps to Reproduce

see above

Expected behavior

linksto ID is matched based just on the id, not id/type combination. this could be controlled by command-line flag (sth. like "id_based_matching") to avoid problems with non-ReqM2-using tracing projects which might use the same id in different types with the current matching.

Environment

Additional context

n/a

redcatbear commented 1 year ago

Hi @insi-eb, OFT IDs always need an artifact type an ID without artifact type is incomplete. For formats that do not have the concept of an artifact you need to inject the artifact type from the side.

An example of how this can be done can be seen in https://github.com/itsallcode/openfasttrace-gradle#configuring-the-short-tag-importer where you can define path patterns for the TAG importer that automatically set the artifact type in case it is missing.

This is not yet a feature of the OFT core though. First we need #353 (central config) and then this feature could be extracted from the Gradle plugin. We don't have a lot of time on our hands at the moment, so your help would be appreciated.