-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(report interface): add reporting interface call after report #2948
Conversation
a8e17fc
to
18daf43
Compare
Codecov Report
@@ Coverage Diff @@
## master #2948 +/- ##
========================================
Coverage 86.26% 86.26%
========================================
Files 551 559 +8
Lines 17652 17910 +258
========================================
+ Hits 15227 15450 +223
- Misses 2425 2460 +35
... and 22 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
prowler/lib/check/check.py
Outdated
lib = os.environ["PROWLER_REPORT_LIB_PATH"] | ||
outputs_module = importlib.import_module(lib) | ||
curstom_report_interface = getattr(outputs_module, "report") |
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.
I think you have to handle more than a generic Exception
here not to abort the execution if the "PROWLER_REPORT_LIB_PATH"
is not present or if the import
or getattr
fails.
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.
Since the general report
function is imported always we actually want Prowler to exit the execution if something wrong happens there
68acad2
to
18daf43
Compare
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.
Smart move!
Context
We need to have a more flexible custom report interface to suit our needs
Description
Import the custom report interface after
report
native function has been performedLicense
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.