spdx / spec-parser

automagically process the specification
Apache License 2.0
6 stars 14 forks source link

spec-parser run reports errors but exits with `0` #80

Open maxhbr opened 10 months ago

maxhbr commented 10 months ago

The current spec parser reports an error but does still exit with EXIT_SUCCESS. See for example https://github.com/spdx/spdx-3-model/actions/runs/7118823989/job/19382571564#step:5:25 with the log:

 > Run cd spec-parser
WARNING : External property restrictions aren't yet handled properly, they are added to the description of the class.
WARNING : skipping ../model/Core/Properties/_property.md
WARNING : skipping ../model/Core/Vocabularies/_vocab.md
WARNING : External property restrictions aren't yet handled properly, they are added to the description of the class.
WARNING : External property restrictions aren't yet handled properly, they are added to the description of the class.
WARNING : External property restrictions aren't yet handled properly, they are added to the description of the class.
WARNING : External property restrictions aren't yet handled properly, they are added to the description of the class.
WARNING : Overwriting out_dir `/tmp/spec-parser.out`
ERROR   : Invalid Nature attribute in metadata `None`
goneall commented 10 months ago

In looking at the code, the spec-parser continues to run after the "Error".

Perhaps these are just warnings?

If they are indeed errors - should we stop processing and flag the error?

For the CI, I think it would be useful to report these as errors.

It looks like the methods that log the error all return a None value.

If we want to continue execution rather than raise an exception, we can change the return value to an integer which would be a return code - 0 being success. Then can then be used to set the system level return code.

@zvr @maxhbr - if you agree with the above and would like some help, I can write a PR.