-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix CVE feed: comply with the JSON feed specifications #75
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mtardy The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It seems that the fields are already translated at some points on the part that creates the real feed with the header, I'm not sure why it's useful to have these multiple versions and not have directly the whole header here. But anyway, it would require modifying (notice the commit hash starting with cafe ☕️):
I don't know the surely good reasons behind everything already being translated, but maybe we can simplify that? |
If we make this change, does the website then break? |
https://github.com/kubernetes/website/blob/cafe6d258c91c3814d83c0655c8c6354e3eade1c/layouts/_default/cve-feed.json is localized (using I reckon we could drop: [cve_json_external_url]
other = "external_url"
[cve_json_id]
other = "id"
[cve_json_summary]
other = "summary"
[cve_json_url]
other = "url" |
I think so! Then: |
I added the In theory, there is the |
Optional enhancement: find out when the issue title or issue description were last modified. Definitely something for a future PR (ie, not this one). I think it's possible. |
Good idea! Btw I think this fix was okay to include in this PR because |
This PR was closed in favor of PR #76. All the modifications and fixes were merged into that one. |
Fixes kubernetes/website#36808.
I simplified the code logically and added documentation on why it's parsing the way it's parsing.
Anecdotally I change all double quotes to single quotes.
I took some arbitrary decisions:
cve_id
into existing fieldid
;issue_url
into existing fieldurl
;cve_url
into existing fieldexternal_url
;_kubernetes_io
as custom extension;number
intoissue_number
for clarity.I didn't add it because it was maybe too much but it would be trivial to add optional fields
date_published
anddate_modified
using GitHub issues metadata.The CVE feed looks similar to this after the fix (I only used the two last CVEs for the example, note that the indention is not exact):
On a side and useless note, is it useful that the scripts output the JSON dumps? Otherwise, I think it would be more elegant that it just prints to STDOUT the result and that the other bash scripts
python3 script.py > the_file.json
. But this one is really a nit!