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

Issue 211 - Fix #239

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Issue 211 - Fix #239

merged 4 commits into from
Oct 15, 2024

Conversation

jordanVoss
Copy link
Contributor

In this PR I updated the two warning messages in the v21 shoulds.py file as outlined in Issue 211. I also tested it by running the validator against the file provided in that issue and confirming that the new messages were shown.

The full output of running the validator against the file is as follows:

    [!] Warning: bundle--fdd39a2e-b67c-11e3-bcc9-f01faf20d111: {103} Given ID value bundle--fdd39a2e-b67c-11e3-bcc9-f01faf20d111 is not a valid UUIDv4 ID.
    [!] Warning: malware--fdd60b30-b67c-11e3-b0b9-f01faf20d111: {103} Given ID value malware--fdd60b30-b67c-11e3-b0b9-f01faf20d111 is not a valid UUIDv4 ID.
    [!] Warning: malware--fdd60b30-b67c-11e3-b0b9-f01faf20d111: {216} The value contained in malware_types is permitted, but is not in the malware-type-ov vocabulary. vocabulary.
    [!] Warning: indicator--a932fcc6-e032-476c-a26f-cb970a5a1ade: {214} The value contained in indicator_types is permitted, but is not in the indicator-type-ov vocabulary. vocabulary.
    [!] Warning: indicator--a932fcc6-e032-476c-a26f-cb970a5a1ade: {303} Both the name and description properties SHOULD be present.
    [!] Warning: relationship--2f9a9aa9-108a-4333-83e2-4fb25add0463: {202} 'indicate' is not a suggested relationship type for 'indicator' objects.

@CLAassistant
Copy link

CLAassistant commented Oct 7, 2024

CLA assistant check
All committers have signed the CLA.

@rpiazza
Copy link
Contributor

rpiazza commented Oct 10, 2024

Look at the run for 3.11, which runs the linter. There is a failure.

Also, the warning message for relationships doesn't seem to be working, based on the output above.

"Warning: relationship--2f9a9aa9-108a-4333-83e2-4fb25add0463: {202} 'indicate' is not a suggested relationship type for 'indicator' objects."

@rpiazza
Copy link
Contributor

rpiazza commented Oct 14, 2024

Please look at the errors in the test run.

Additionally, You have changed the error messages in relationships_strict so they don't capture what is happening. There are three different errors, but basically, you just need to change the beginning of each error message to be:

'%s' is permitted, but not a suggested...."

But otherwise no other changes.

It might make sense to start from the original should.py file, and that will fix the errors in the test also.

@rpiazza
Copy link
Contributor

rpiazza commented Oct 15, 2024

Minor pre-commit lint error:

stix2validator/v21/shoulds.py:1710:26: W292 no newline at end of file

@rpiazza rpiazza merged commit 0abc03b into oasis-open:master Oct 15, 2024
9 checks passed
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.

3 participants