rubysec / ruby-advisory-db

A database of vulnerable Ruby Gems
https://rubysec.com
Other
1.02k stars 219 forks source link

[Pre537] Automate patched_versions conversion from GHSA to ruby-advisory-db #648

Closed jasnow closed 1 year ago

jasnow commented 1 year ago

Automate patched_versions conversion from GHSA to ruby-advisory-db.

postmodern commented 1 year ago

There isn't an easy way to parse and preserve the additional YAML comments. That would require using YAML.parse which returns a raw node tree of the YAML data, which is much harder to work with, merging in the new data and dumping the YAML nodes back out to the file.

An alternative approach would be to use an ERB template to render the advisory file, and properly format all YAML data. It might also be a good idea to create a separate Advisory class which represents the contents of the YAML file that could be used for loading the data and rendering the output. This might also require pulling in additional libraries to handle word-wrapping.

jasnow commented 1 year ago

patched_version and unaffected_versions Use Cases for Testing:

jasnow commented 1 year ago

664 provide automated patched_versions creation in lib/github_advisory_sync.rb script so I'm go to close this issue.

If additional items come up in the future, we can open new issues/PRs for them.