-
Notifications
You must be signed in to change notification settings - Fork 41
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
Dump configuration in the results directory #226
Conversation
scan_error_count = scan_error_count + 1 | ||
else: | ||
logging.info(f"scanner: '{name}' completed successfully") | ||
try: |
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.
Added a try/catch block to handle any unhandled exceptions, ensuring that the configuration dump is done
I might be missing something obvious, but it's not clear to me why we would want to dump more than one config file. Wouldn't the only version we would be interested in be the version that is used at runtime? I.e. the rendered config, including any env var substitutions |
The main reason is to distinguish between configuration provided by the end-user, hardcoded default values, and values from environment variables. This way, if we want to test only the user-provided configuration, we can do so. For example, If environment variables are already interpolated into the config (they would be retrieved directly from the config rather than from the environment variables), we may not be testing the exact user configuration, and the same applies to default values. That said, I don't have a strong opinion on this approach. I also see the convenience of having everything in a single file for easier troubleshooting. Perhaps we could have a configuration file with everything interpolated, while also including the environment variables and default values separately for reference. What do you think ? |
Superseded by: #227 |
This pull request introduces two new methods for exporting configuration data to YAML files. The configuration is dumped after the scanners are executed since some scanners modify the configuration at runtime. Additionally, if a default configuration file exists, it is also loaded to ensure we capture all relevant data. There are three different configurations files: