added function to handle visualizers errors#1741
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1741 +/- ##
===========================================
+ Coverage 66.75% 74.78% +8.02%
===========================================
Files 95 328 +233
Lines 3706 11286 +7580
Branches 519 1236 +717
===========================================
+ Hits 2474 8440 +5966
- Misses 941 2337 +1396
- Partials 291 509 +218
... and 138 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
0ssigeno
left a comment
There was a problem hiding this comment.
Other than two very minor thing, i really love the decorator.
We can improve it to actually return the same object that the function is decorating (meaning not always a VisualizableTitle), but other than nice work!
| # def generate_field1(value): | ||
| # ... | ||
| # in case the generation of the field will raise an error | ||
| # this will handle it allowing to render the other components |
There was a problem hiding this comment.
I would like you to add something regarding this in the official docs where we explain how to write a visualizer too
* added function to handle visualizers errors * doc update
* added CopyToClipboardButton * adjusted copy_text field and visualizer tests * added function to handle visualizers errors (#1741) * added function to handle visualizers errors * doc update * More status mgmt (#1740) * More status mgmt Signed-off-by: 0ssigeno <[email protected]> * Black Signed-off-by: 0ssigeno <[email protected]> * Minor fixes Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fix migrations Signed-off-by: 0ssigeno <[email protected]> * Fix migrations Signed-off-by: 0ssigeno <[email protected]> * Prettier Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> --------- Signed-off-by: 0ssigeno <[email protected]> * updated frontend dependencies * Visualizer connected to playbook (#1755) * Start Signed-off-by: 0ssigeno <[email protected]> * More stuff Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fix Signed-off-by: 0ssigeno <[email protected]> * Fix Signed-off-by: 0ssigeno <[email protected]> * Blake Signed-off-by: 0ssigeno <[email protected]> * Visualizer config points only to a single playbook, not many Signed-off-by: 0ssigeno <[email protected]> * Fix migration Signed-off-by: 0ssigeno <[email protected]> * Fix tests Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fix post review Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Blake Signed-off-by: 0ssigeno <[email protected]> * little adjustments * Blake Signed-off-by: 0ssigeno <[email protected]> * Unused migration Signed-off-by: 0ssigeno <[email protected]> * Fix page order Signed-off-by: 0ssigeno <[email protected]> * Fix migration Signed-off-by: 0ssigeno <[email protected]> * Fix Signed-off-by: 0ssigeno <[email protected]> --------- Signed-off-by: 0ssigeno <[email protected]> Co-authored-by: Matteo Lodi <[email protected]> * adjusted order in docs * added link to HackinBo presentation * Bump ossf/scorecard-action from 2.1.2 to 2.2.0 (#1763) Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.2.0. - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](ossf/scorecard-action@e38b190...08b4669) --- updated-dependencies: - dependency-name: ossf/scorecard-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.2.1 to 3.3.3 in /requirements (#1764) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.2.1 to 3.3.3. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](pre-commit/pre-commit@v3.2.1...v3.3.3) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix captcha (#1761) * Fix captcha Signed-off-by: 0ssigeno <[email protected]> * Fix backend Signed-off-by: 0ssigeno <[email protected]> * fix frontend * Fix environments Signed-off-by: 0ssigeno <[email protected]> * Fix Signed-off-by: 0ssigeno <[email protected]> * black * Fix deepsource Signed-off-by: 0ssigeno <[email protected]> --------- Signed-off-by: 0ssigeno <[email protected]> Co-authored-by: Daniele Rosetti <[email protected]> * Fix waiting Signed-off-by: 0ssigeno <[email protected]> * Pivot framework (#1739) * Pivot Signed-off-by: 0ssigeno <[email protected]> * More stuff Signed-off-by: 0ssigeno <[email protected]> * More stuff Signed-off-by: 0ssigeno <[email protected]> * Typo Signed-off-by: 0ssigeno <[email protected]> * Pivot Signed-off-by: 0ssigeno <[email protected]> * Minor fixes Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Update tests/pivot_manager/test_views.py Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com> * Update tests/pivot_manager/test_views.py Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com> * Update api_app/pivots_manager/models.py Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com> * Fix post review Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * More fixes and tests Signed-off-by: 0ssigeno <[email protected]> * More fixes Signed-off-by: 0ssigeno <[email protected]> * Minor fixes Signed-off-by: 0ssigeno <[email protected]> * deepsource Signed-off-by: 0ssigeno <[email protected]> * typo * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Blake Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Fixes Signed-off-by: 0ssigeno <[email protected]> * Manage files Signed-off-by: 0ssigeno <[email protected]> * Fix test Signed-off-by: 0ssigeno <[email protected]> --------- Signed-off-by: 0ssigeno <[email protected]> Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com> Co-authored-by: Matteo Lodi <[email protected]> * set USE_RECAPTCHA as False by default * collapsed job metadata in job result (#1754) * collapsed jobInfoCard in jobResult * adjusted UncontrolledTooltip message * added collapse test * Fix Signed-off-by: 0ssigeno <[email protected]> * Frontend improvements (#1772) * fixed status * changed size for children elements * removed test * test modify * added small * improved small value * fixed frontend tests * prettier * Fix migrations Signed-off-by: 0ssigeno <[email protected]> * added CopyToClipboardButton * adjusted copy_text field and visualizer tests * added VisualizerTooltip component + adjusted tests * removed redundant default arguments * adjusted tooltip position + tests * fix * adjested buttons * fixed tests --------- Signed-off-by: 0ssigeno <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Daniele Rosetti <[email protected]> Co-authored-by: Simone Berni <[email protected]> Co-authored-by: Daniele Rosetti <[email protected]> Co-authored-by: Matteo Lodi <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 0ssigeno <[email protected]> Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com>
Description
Added a decorator to handle the exception and render a placeholder. In this way we avoid to break all the UI for a single component
Type of change
Please delete options that are not relevant.
Checklist
develop_monkeypatch()was used in its class to apply the necessary decorators.test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook inplaybook_config.json.Black,Flake,Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors.Important Rules