Skip to content
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

Add default behavior to ggshield secret ignore #960

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

salome-voltz
Copy link
Collaborator

@salome-voltz salome-voltz commented Sep 12, 2024

Context

Command ggshield secret ignore had no default behavior.

What has been done

Default behavior is now : ggshield secret ignore MATCH to ignore a secret using its hash. There is also an optional option --name to name the secret in the gitguardian.yaml.

Validation

  • Get a secret hash
  • Run ggshield secret ignore MATCH --name NAME
  • The secret and its name are added to the gitguardian.yaml

PR check list

  • As much as possible, the changes include tests (unit and/or functional)
  • If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry (see doc/dev/getting-started.md). If the changes do not affect the end user, then the skip-changelog label has been added to the PR.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.65%. Comparing base (5a57931) to head (ef6bb9d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
+ Coverage   91.54%   91.65%   +0.10%     
==========================================
  Files         178      178              
  Lines        7372     7383      +11     
==========================================
+ Hits         6749     6767      +18     
+ Misses        623      616       -7     
Flag Coverage Δ
unittests 91.65% <100.00%> (+0.10%) ⬆️

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.

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.

Minor remarks, looks good overall.

ggshield/cmd/secret/ignore.py Outdated Show resolved Hide resolved
ggshield/cmd/secret/ignore.py Outdated Show resolved Hide resolved
tests/unit/cmd/test_ignore.py Outdated Show resolved Hide resolved
tests/unit/cmd/test_ignore.py Outdated Show resolved Hide resolved
@salome-voltz salome-voltz force-pushed the salomevoltz/add-ignore-hash-cmd branch 3 times, most recently from 14ed6f0 to b1050a6 Compare September 13, 2024 12:54
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.

2 minor remarks. Feel free to merge once they are fixed.

ggshield/cmd/secret/ignore.py Outdated Show resolved Hide resolved
ggshield/cmd/secret/ignore.py Outdated Show resolved Hide resolved
@salome-voltz salome-voltz merged commit ee57c1a into main Sep 13, 2024
28 checks passed
@salome-voltz salome-voltz deleted the salomevoltz/add-ignore-hash-cmd branch September 13, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants