-
Notifications
You must be signed in to change notification settings - Fork 506
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
feat: pull updates from mirror with --use-mirror
flag
#2811
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2811 +/- ##
==========================================
- Coverage 82.29% 82.00% -0.30%
==========================================
Files 651 655 +4
Lines 10254 10420 +166
Branches 1382 1409 +27
==========================================
+ Hits 8439 8545 +106
- Misses 1446 1505 +59
- Partials 369 370 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 18 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@b31ngd3v @terriko What is the reason for pulling data from mirror if more than 7 days old? Should we not make this an evironment variable (the default would be 7 days) so if we want to change the period (shorter or longer), we can esily doso. How does this change work in offline mode as the mirror won't be available? |
I'm not sure why 7 days either. What I was envisioning was more like this:
Maybe we could convert this PR to adding support for a flag for now? |
@terriko @anthonyharrison after fetching the data from mirror, should it incrementally update the database too? that should be the normal behavior when |
hi @terriko looks like the mirror-sandbox repo is private, can you make the repo public so that i can setup an example where you can fetch the data using the mirror? thanks. |
should be fixed now, sorry! |
@terriko i was trying to push the ci changes, then this happened also from the github ui, there is no merge button |
Sorry, I forgot that I hadn't set you as an admin on that repo. you should be able to do everything there now. You'll need to set up a new NVD API key for it and set it into secrets; I didn't want to re-use the one from the main repo. |
@terriko can you please enable this option? i'm unable to change it! thanks!! |
--use-mirror
flag
Wow, github permissions are weird. I had to change it in the org (the repo wouldn't let me change it either, just gave a no-entry icon🚫 ) but I think it may work now? |
@terriko @anthonyharrison I think this PR is ready! you can test it with |
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.
Minor nit about return codes, but this is looking really good!
For this PR to get merged I'd like to see:
- documentation of the new flag
- a test (We could use the sandbox mirror but it's probably better to use mock and have it get a fake updated cve for testing that can immediately be deleted)
For either this PR or a future one, I think we need to add and validate a jsonschema to make sure that the mirror data isn't garbage. I think we'll also be doing some fancier stuff with storing mirrors in the config file too, but that's definitely future PR material and not needed yet.
But yeah, I'm really excited to see this coming together. Let's get docs and tests at minimum and get it merged so people can try it out!
@terriko done! re-requesting review! thanks! |
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.
This looks good enough to merge! I think we'll be iterating and refactoring a bit to add some validation but this should be good enough to get started!
part of #2577