Skip to content

Conversation

@ahouseholder
Copy link
Contributor

@ahouseholder ahouseholder commented Feb 17, 2025

This PR:

  • resolves Replace doctools.py with embedded python examples #431
  • resolves Acuity ramp uses out-of-date Safety Impact decision point in example text #539
  • eliminates site dependency on doctools.py in 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.
  • changes doctools.py as follows:
    • only generates the data/json/decision_points/**/*.json files
    • do not generate docs/_generated/**/*.md since these are replaced by the aforementioned inline python
  • Applies a consistent usage of VERSIONS to contain an ordered tuple of all decision point versions defined in a file
  • Applies a consistent usage of LATEST to be the most recent version of the decision point (last item in the VERSIONS tuple)

@ahouseholder ahouseholder added content/semantic Changes to the semantic content of the SSVC documentation enhancement New feature or request tools Software Tools tech/environment Project environment, deployment, CI, etc. python Pull requests that update Python code labels Feb 17, 2025
@ahouseholder ahouseholder added this to the 1Q25 milestone Feb 17, 2025
@ahouseholder ahouseholder self-assigned this Feb 17, 2025
@ahouseholder ahouseholder changed the title Feature/convert doctools to inline Convert site to use inline python instead of relying on manual script to generate decision point examples Feb 17, 2025
@ahouseholder ahouseholder marked this pull request as draft February 17, 2025 19:14
@ahouseholder ahouseholder marked this pull request as ready for review February 17, 2025 19:36
Copy link
Contributor

@sei-vsarvepalli sei-vsarvepalli left a 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)

_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
    ```

@ahouseholder
Copy link
Contributor Author

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)

_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

Copy link
Contributor

@sei-vsarvepalli sei-vsarvepalli left a comment

Choose a reason for hiding this comment

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

All looks good.

@ahouseholder ahouseholder merged commit 256cfcf into CERTCC:main Feb 18, 2025
2 checks passed
@ahouseholder ahouseholder deleted the feature/convert_doctools_to_inline branch February 25, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content/semantic Changes to the semantic content of the SSVC documentation enhancement New feature or request python Pull requests that update Python code tech/environment Project environment, deployment, CI, etc. tools Software Tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Acuity ramp uses out-of-date Safety Impact decision point in example text Replace doctools.py with embedded python examples

2 participants