Skip to content

Conversation

@gg-mmill
Copy link
Contributor

@gg-mmill gg-mmill commented Oct 14, 2024

What has been done

Refactor how secret scan parameters are passed around: pass the SecretConfig around, instead of discrete args (both to the scanner, and in output handlers).

Validation

There should be no functional change.

@gg-mmill gg-mmill force-pushed the mmillet/pass_config_around branch 2 times, most recently from b7a8bac to 7ee194c Compare October 14, 2024 12:35
@codecov
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.58%. Comparing base (56f53ee) to head (d4af106).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #982      +/-   ##
==========================================
+ Coverage   91.49%   91.58%   +0.08%     
==========================================
  Files         180      180              
  Lines        7597     7605       +8     
==========================================
+ Hits         6951     6965      +14     
+ Misses        646      640       -6     
Flag Coverage Δ
unittests 91.58% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gg-mmill gg-mmill self-assigned this Oct 14, 2024
@gg-mmill gg-mmill force-pushed the mmillet/pass_config_around branch from 7ee194c to 382c3c8 Compare October 14, 2024 13:46
@gg-mmill gg-mmill force-pushed the mmillet/pass_config_around branch 4 times, most recently from 084299e to dd27878 Compare October 14, 2024 14:17
@gg-mmill gg-mmill requested a review from agateau-gg October 14, 2024 14:28
@gg-mmill gg-mmill force-pushed the mmillet/pass_config_around branch from dd27878 to 1b2bd9a Compare October 14, 2024 14:34
@gg-mmill gg-mmill changed the title chore: pass config around instead of discrete args chore: pass secret config around instead of discrete args Oct 15, 2024
Copy link
Collaborator

@agateau-gg agateau-gg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor remark, looks good otherwise.

def __init__(
self, show_secrets: bool = False, ignore_known_secrets: bool = False
) -> None:
def __init__(self, *args: Any, **kwargs: Any) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not fond of this because it prevents type-hinting checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removing the __init__ method entirely. The only impact is that verbose could be set to True, while unused by the SecretGitLabWebUIOutputHandler, but that doesn't seem like a real issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I copy the other arguments in the SecretGitLabWebUIOutputHandler ?

@gg-mmill gg-mmill requested a review from agateau-gg October 24, 2024 13:15
Copy link
Collaborator

@agateau-gg agateau-gg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@agateau-gg agateau-gg merged commit bc77a6a into main Oct 25, 2024
28 checks passed
@agateau-gg agateau-gg deleted the mmillet/pass_config_around branch October 25, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants