-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Break circular ref in NetworkRequest #346
Conversation
Do we want to keep it as |
we'll definitely want to be able to save artifacts, for things like re-running new audits or new scoring approaches over CI data as far back as the artifacts needed for the audit were available. We will need to be more careful with serializing some of our artifacts. For |
I also just remembered the critical network chains are already not serializable directly due to them containing circular references, so attempting to fully solve this with a simple layer over |
It seems util.inspect's output is not json parsable, I'm guessing because Eventually, when we start working on the use case of using past gather data to run audits, we should write serializers and deserializers for all artifacts that comes from third party or has circular referencing issues. |
good catch
yeah, this is where I was starting to get to as well. We could ease the transition by just For this PR: the serialized artifacts are currently useless except for debugging, so this change seems fine to unbreak that. Do you want to add a |
I added it as a separate test because it felt wrong to always enable saveArtifacts in the other test, but I wish it didn't take 10 seconds. |
yeah, I really wanted to avoid adding another 10 second test. The existing test is for running with |
Ah I feel less bad if I think of it as a smoke test. |
0b2b645
to
f0e55c2
Compare
LGTM! |
This fixes #345, at least for now.
A more future-proof solution would be to use something like this: https://www.npmjs.com/package/json-stringify-safe. Although I do wonder if we should remove the option of saving artifacts altogether.