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

Unhandled Exception when Importing Doors Projec in ReqIF #1935

Open
stellarpower opened this issue Aug 9, 2024 · 2 comments
Open

Unhandled Exception when Importing Doors Projec in ReqIF #1935

stellarpower opened this issue Aug 9, 2024 · 2 comments
Milestone

Comments

@stellarpower
Copy link

Requirements software is new to me, so am limited in how much useful information I can provide. I'm simply looking to visualise the data in an export I've been provided.

2 ❯ strictdoc import reqif --reqif-enable-mid sdoc '/ProjectFromDoors/ReqIFv10.reqif' output.sdoc
Step 'Import' start.
Traceback (most recent call last):
  File "/...//bin/strictdoc", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/cli/main.py", line 200, in main
    raise exc
  File "/...//lib/python3.12/site-packages/strictdoc/cli/main.py", line 195, in main
    _main(parallelizer)
  File "/...//lib/python3.12/site-packages/strictdoc/cli/main.py", line 117, in _main
    import_action.do_import(import_reqif_config, project_config)
  File "/...//lib/python3.12/site-packages/strictdoc/helpers/timing.py", line 18, in wrap
    result = func(*args, **kw)
             ^^^^^^^^^^^^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/core/actions/import_action.py", line 31, in do_import
    reqif_documents: List[SDocDocument] = ReqIFImport.import_from_file(
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/backend/reqif/reqif_import.py", line 45, in import_from_file
    documents: List[SDocDocument] = converter.convert_reqif_bundle(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/backend/reqif/p01_sdoc/reqif_to_sdoc_converter.py", line 76, in convert_reqif_bundle
    document = P01_ReqIFToSDocConverter._create_document_from_reqif_specification(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/backend/reqif/p01_sdoc/reqif_to_sdoc_converter.py", line 121, in _create_document_from_reqif_specification
    grammar_element: GrammarElement = P01_ReqIFToSDocConverter.create_grammar_element_from_spec_object_type(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/...//lib/python3.12/site-packages/strictdoc/backend/reqif/p01_sdoc/reqif_to_sdoc_converter.py", line 283, in create_grammar_element_from_spec_object_type
    raise NotImplementedError(attribute) from None
NotImplementedError: SpecAttributeDefinition(attribute_type = SpecObjectAttributeType(...), identifier = "_d8bc2b92-7a0f-455b-aea7-8aefe398aa5f_ABSOLUTENUMBER", datatype_definition = "_b5e1292d-cde6-473e-be3d-9b138e1add56", xml_node = _Element(...), description = "System Attribute", last_change = "2024-08-07T19:17:17", long_name = "ReqIF.ForeignID", editable = True, default_value_definition_ref = NoneType(...), default_value = NoneType(...), multi_valued = NoneType(...))

Don't know if this belongs in the ReqIF package or as part of strictdoc proper; feel free to move if appropriate. I guess if this is an unsupported feature, at the least it'd be nice to catch it and then print a user-readable message explaining what feature isn't supported.

Thanks

@stanislaw
Copy link
Collaborator

stanislaw commented Aug 23, 2024

Hi @stellarpower,

The ReqIF conversion is not an easy task, and from time to time, there is always a user who has something in their ReqIF that we have previously not seen. From looking at the error location, it is most likely that your file has numeric spec attribute definitions (for example, of type INTEGER or REAL), and this is not handled by StrictDoc yet.

The error message could be improved indeed. In order to fix this issue for your case, I would need a good MRE ReqIF example that you are using with StrictDoc. Is there a chance you could send me an anonymized ReqIF example without any sensitive data but still the one that reproduces this issue?

@stanislaw stanislaw added this to the 2024-Q3 milestone Aug 23, 2024
@stellarpower
Copy link
Author

Thanks, and totally understood. Standards are great except when they aren't standardised and just a free-for-all.

Interestingly I'm not seeing the same problems when reading in the file programatically using the python package. This is where the anonymisation script is helpful ;)

ReqIFv10 - Anonymised.reqif.txt

This may not be entirely minimal, but it's a small dummy project export from Doors anyway and you know what you're looking for. I did see those numeric definitions before so expect that's probably it. Don't know why they exist TBH, needing to specify what a boolean or a string is within the requirements and assign it a UUID seems a bit excessive to me. But ours (well, mine) is not to question why!

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants