-
Notifications
You must be signed in to change notification settings - Fork 42
Convert site to use inline python instead of relying on manual script to generate decision point examples #683
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
Convert site to use inline python instead of relying on manual script to generate decision point examples #683
Conversation
now provided at site build time using inline python
inline examples are now down with inline python in markdown
sei-vsarvepalli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal but warning in pedantic seems to indicate that Decision Point Values are expected to be "list" and not "tuple"
| _dp.values = tuple(values) |
SSVC/src/ssvc/decision_points/cvss/helpers.py
Line 101 in 1bb5050
| _dp.values = tuple(values) |
Changing the above two lines in CVSS from "tuple" to "list" - causes the warnings to go away. I have not thoroughly reviewed the scripts but just going after the warnings I saw in "Checks" tab
that say
src/test/test_schema.py::MyTestCase::test_decision_point_group_validation
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/pydantic/main.py:477: UserWarning: Pydantic serializer warnings:
Expected `list[SsvcDecisionPointValue]` but got `tuple` with value `(SsvcDecisionPointValue(k...entation for details.'))` - serialized value may not be as expected
```
Fixed in f7ffc29 |
sei-vsarvepalli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good.
This PR:
doctools.pyin favor of direct inline python in the markdown that runs at site deploy time. This change ensures that examples in the site are always the latest available version of any given decision point.doctools.pyas follows:data/json/decision_points/**/*.jsonfilesdocs/_generated/**/*.mdsince these are replaced by the aforementioned inline pythonVERSIONSto contain an ordered tuple of all decision point versions defined in a fileLATESTto be the most recent version of the decision point (last item in theVERSIONStuple)