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

Check examples are now failing #912

Closed
goneall opened this issue Apr 14, 2024 · 3 comments · Fixed by #935
Closed

Check examples are now failing #912

goneall opened this issue Apr 14, 2024 · 3 comments · Fixed by #935
Milestone

Comments

@goneall
Copy link
Member

goneall commented Apr 14, 2024

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
Copy link
Member Author

goneall commented Apr 14, 2024

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

@goneall
Copy link
Member Author

goneall commented Apr 14, 2024

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

@kestewart kestewart added this to the 3.0 milestone Apr 14, 2024
@licquia
Copy link
Collaborator

licquia commented Apr 23, 2024

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.

licquia pushed a commit to licquia/spdx-spec that referenced this issue Apr 23, 2024
The check assumes that JSON example snippets are all parts of a single
JSON document that needs validating, but not all files are written
that way.  To avoid errors that have nothing to do with the
correctness of the examples, we should only check files which meet the
check's assumptions.

Fixes spdx#912.

Signed-off-by: Jeff Licquia <jeff@licquia.org>
goneall pushed a commit that referenced this issue Apr 23, 2024
The check assumes that JSON example snippets are all parts of a single
JSON document that needs validating, but not all files are written
that way.  To avoid errors that have nothing to do with the
correctness of the examples, we should only check files which meet the
check's assumptions.

Fixes #912.

Signed-off-by: Jeff Licquia <jeff@licquia.org>
bact pushed a commit to bact/spdx-spec that referenced this issue Apr 23, 2024
The check assumes that JSON example snippets are all parts of a single
JSON document that needs validating, but not all files are written
that way.  To avoid errors that have nothing to do with the
correctness of the examples, we should only check files which meet the
check's assumptions.

Fixes spdx#912.

Signed-off-by: Jeff Licquia <jeff@licquia.org>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
bact pushed a commit to bact/spdx-spec that referenced this issue Jun 10, 2024
The check assumes that JSON example snippets are all parts of a single
JSON document that needs validating, but not all files are written
that way.  To avoid errors that have nothing to do with the
correctness of the examples, we should only check files which meet the
check's assumptions.

Fixes spdx#912.

Signed-off-by: Jeff Licquia <jeff@licquia.org>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants