Closed agateau-gg closed 8 months ago
Attention: 65 lines
in your changes are missing coverage. Please review.
Comparison is base (
ae678cf
) 92.16% compared to head (be54ae0
) 91.58%. Report is 8 commits behind head on main.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This rather large (sorry) PR introduces
GGShieldUI
, an abstract class to represent the user-interface while scanning. It has two implementations:The
SecretScannerUI
already had a similar design: it now becomesScannerUI
because it works on Scannable, so it can be used by other verticals.GGShieldUI provides a few ways to show progress:
create_progress()
: very generic, returns a GGShieldProgress instance (another abstract class)create_scanner_ui()
: returns a ScannerUIcreate_message_only_scanner_ui()
: returns a ScannerUI, but without a progress bar. This is useful when the scanner UI is used as part of a larger scan. For example when scanning a commit-range, each commit scan goes through a ScannerUI, but there is only one single overall progress bar (created withcreated_progress()
).GGShieldUI also provides
display_*()
methods to show messages while a progress bar is visible, without them stepping on each others. This is already useful when showing errors while scanning, but is going to also be useful to show rate-limit warnings.Review
Best reviewed commit-by-commit.
First commit only continues porting more code to the
ctx_obj = ContextObj.get(ctx)
, because it's necessary to introduce GGShieldUI (ContextObj
gains aui
attribute storing the GGShieldUI instance).Second commit does the actual work.