Skip to content

feat: Add XML schema validation (Fixes #1507) #1544

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

Merged
merged 51 commits into from
Mar 30, 2022

Conversation

anthonyharrison
Copy link
Contributor

No description provided.

anthonyharrison and others added 30 commits May 27, 2020 12:55
Copy link
Contributor

@BreadGenie BreadGenie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't conventional commits follow type: commit message instead of [type] commit message?

Comment on lines 112 to 114
# Demonstrate that validation of XML file against schema results in no data
# if file does not match schema or if xml data is parsed against wrong type of sbom
# (indicated by validate being set to False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to use docstrings instead of comments according to PEP8.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BreadGenie - Thanks I have fixed my conventional commits formatting error and I will; update comments to PEP8 convention later and resubmit pull request

@anthonyharrison anthonyharrison changed the title [feat] Add XML schema validation (Fixes #1507) feat: Add XML schema validation (Fixes #1507) Jan 25, 2022
Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was also affected by my bad CI update. Could you rebase to origin/main so I'm sure the tests are running correctly in CI?

@anthonyharrison
Copy link
Contributor Author

@terriko Is this failure another NVD access issue ? I can't get it to fail on the copy on my local machine.

@terriko
Copy link
Contributor

terriko commented Feb 2, 2022

Looks like the defaults PR caused a conflict with this one. Sorry! But yes, I think the failure in longtests was due to NVD rate limit. If I could only make it through my PRs and get to the point of fixing stuff myself... I think I'll have have to prioritize the CI NVD Key enablement later this week.

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2022

Codecov Report

Merging #1544 (58c7497) into main (84715ba) will increase coverage by 1.90%.
The diff coverage is 81.73%.

@@            Coverage Diff             @@
##             main    #1544      +/-   ##
==========================================
+ Coverage   81.44%   83.35%   +1.90%     
==========================================
  Files         290      291       +1     
  Lines        5811     5859      +48     
  Branches      957      963       +6     
==========================================
+ Hits         4733     4884     +151     
+ Misses        856      754     -102     
+ Partials      222      221       -1     
Flag Coverage Δ
longtests 83.35% <81.73%> (+1.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cve_bin_tool/checkers/xml2.py 88.63% <ø> (+27.27%) ⬆️
cve_bin_tool/version_scanner.py 76.95% <60.00%> (+0.64%) ⬆️
cve_bin_tool/sbom_manager/spdx_parser.py 87.15% <66.66%> (-1.53%) ⬇️
cve_bin_tool/sbom_manager/cyclonedx_parser.py 84.78% <88.88%> (+3.38%) ⬆️
cve_bin_tool/cli.py 72.48% <100.00%> (+2.75%) ⬆️
cve_bin_tool/sbom_manager/__init__.py 94.91% <100.00%> (-3.34%) ⬇️
cve_bin_tool/sbom_manager/swid_parser.py 87.50% <100.00%> (+1.78%) ⬆️
cve_bin_tool/validator.py 100.00% <100.00%> (ø)
test/test_sbom.py 100.00% <100.00%> (ø)
cve_bin_tool/nvd_api.py 75.00% <0.00%> (-9.49%) ⬇️
... and 10 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@Molkree
Copy link
Contributor

Molkree commented Feb 7, 2022

Failure on CVE scan is probably due to the extra newline in requirements.csv, @anthonyharrison

@terriko
Copy link
Contributor

terriko commented Mar 2, 2022

I think this is ready to go, but it's still failing more tests than main is (main is only failing quiet_mode). I've updated the branch to main and hopefully that should clean up the problem?

@terriko
Copy link
Contributor

terriko commented Mar 10, 2022

Pinging @anthonyharrison -- looks like we've got a version conflict that looks beyond what I should be resolving in the web interface.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs conflict in version_scanner resolved.

@terriko terriko linked an issue Mar 23, 2022 that may be closed by this pull request
@terriko
Copy link
Contributor

terriko commented Mar 24, 2022

@anthonyharrison I've taken a stab at resolving the merge conflict (it was some type checking stuff) but it looks like I broke something. (edit: looks like the tests finally ran, but some things definitely broke. I'm going to re-run a few of them because it's unclear to me why documentation, for example, didn't pass.)

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the tests are happy again. Thanks!

@terriko terriko merged commit 09ad0cc into intel:main Mar 30, 2022
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 this pull request may close these issues.

Add XML Schema validation to places we use XML
6 participants