spdx / spdx-spec

The SPDX specification in MarkDown and HTML formats.
https://spdx.github.io/spdx-spec/
Other
288 stars 137 forks source link

Check examples are now failing #912

Closed goneall closed 5 months ago

goneall commented 5 months ago

The check examples CI is failing with the following errors:

3s
Run for f in $(grep -l '```json' docs/annexes/*.md); do
Checking docs/annexes/getting-started.md
ok -- validation done
The following files were checked:
  temp.json
Validation Report
Conforms: True
Checking docs/annexes/including-security-information-in-SPDX.md
Several files failed to parse.
  FailedFileLoadError: Failed to parse temp.json
    in "/home/runner/.local/lib/python3.[1](https://github.com/spdx/spdx-spec/actions/runs/8680882204/job/23802420044?pr=904#step:6:1)0/site-packages/check_jsonschema/instance_loader.py", line 48
    >>> data: t.Any = self._parsers.parse_data_with_path(

    caused by

    JSONDecodeError: Extra data: line 44 column 1 (char [17](https://github.com/spdx/spdx-spec/actions/runs/8680882204/job/23802420044?pr=904#step:6:18)46)
      in "/home/runner/.local/lib/python3.10/site-packages/check_jsonschema/parsers/__init__.py", line 92
      >>> return loadfunc(data)
goneall commented 5 months ago

This was caused the the additional check added in PR #906

goneall commented 5 months ago

@JPEWdev - Did you intend for the additional checks to be added in PR #906? Perhaps we can just revert those changes?

licquia commented 5 months ago

The failure is caused by sorta-malformed JSON in docs/annexes/including-security-information-in-SPDX.md. I say "sorta" because the JSON snippets in that file are not portions of a single JSON document with intervening explanation, but multiple more-or-less complete standalone JSON documents. This results in a file which does not even parse as proper JSON, much less an RDF graph. The error message points at the line immediately after the first JSON snippet from the file ends, where the second snippet starts.

I recommend that we not look for documents to parse with grep, and instead list them specifically. I will post a PR to this effect shortly.