-
-
Notifications
You must be signed in to change notification settings - Fork 382
[GSK-1528] Refactor issue rendering to decouple from templating #1313
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
[GSK-1528] Refactor issue rendering to decouple from templating #1313
Conversation
GSK-1528 Refactor issue rendering to decouple from templating
Refactor the issue rendering, moving from the jinja templates to the issue objects. Each issue should provide standardized attributes that we can use to create the issue info that will be used for both HTML templates and markdown, csv export. |
|
Fine about strings.
dumping into file doesn't seem to be supported @mattbit: https://github.com/Giskard-AI/giskard/blob/c5e0f262ccf453e95c7934f2be418b660e61364b/python-client/giskard/scanner/report.py#L55 |
whoops! |
|
@rabah-khalek well spotted, I added the markdown file export and a couple of tests to ensure this is covered for both html and markdown. |
…-decouple-from-templating
|
I think it looks great now! I have no other format requests. I will however review the PR more carefully tomorrow and submit a review, thanks!.
|
|
I thought at first skipping a row per each vulnerability type is a nice touch, but I don't feel strongly about it. WDYT @mattbit ?
|
Looks good in your example but I think it would really depend on how the table is rendered… I would stick with no separator. If you want we can create separate tables per issue type. |
|
I think it'll be nice to have a Performance vulnerabilities
Spurious Correlation vulnerabilities
|
@rabah-khalek Your wish is granted! 613fa92 |
…-decouple-from-templating
|
Look at that! it makes me want to wrap up the gh cicd action. Thanks @mattbit Performance issues (10)
Robustness issues (1)
Overconfidence issues (5)
Spurious Correlation issues (3)
|
rabah-khalek
left a comment
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.
overall LGTM, just a few small suggestions.
python-client/giskard/scanner/calibration/overconfidence_detector.py
Outdated
Show resolved
Hide resolved
python-client/giskard/scanner/calibration/overconfidence_detector.py
Outdated
Show resolved
Hide resolved
python-client/giskard/scanner/calibration/underconfidence_detector.py
Outdated
Show resolved
Hide resolved
…-decouple-from-templating
andreybavt
left a comment
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.
generally looks good for a high level review, I left 1 comment
| "Cramer's V": "test_cramer_v", | ||
| "Mutual information": "test_mutual_information", | ||
| "Theil's U": "test_theil_u", | ||
| "cramer": "test_cramer_v", |
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.
in places like this can you reference a test function itself, not just it's name? It'll be difficult to remember to modify these strings in case we do automatic test method renaming
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 it was done like this to only import the tests lazily (this will only be called on generate_test_suite). I kept this in the current refactoring, tests are initialized lazily. (We wanted to minimize the big imports of testing as far as I understood.)
In principle these functions are part of our public API (testing), so I exclude the option of a light-hearted renaming.
…-decouple-from-templating
…-decouple-from-templating
|
there're some minor code smells to be silenced |
right, i need to fix this |
|
Kudos, SonarCloud Quality Gate passed! |
Description
The purpose of this PR is to simplify the classes that inherit from the
Issueclass used for displaying scan results. We aim to make these classes more minimalistic by reducing the number of properties and adding asummaryproperty for better visualization and serialization.Additionally, this PR combines all templates linked to a single type of issue into a single one called
default.html.Lastly, we have created basic templates with markdown to enable seamless integration of Giskard Scan results with other applications.
Related Issue
GSK-1528 (available on Linear)