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 support for custom remediation messages #928

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fnareoh
Copy link
Collaborator

@fnareoh fnareoh commented Jul 1, 2024

Context

This MR adds the display of custom remediation messages defined in the gitguardian plateform.

What has been done

This MR relies on the changes on pygitguardian GitGuardian/py-gitguardian#111

And for a custom remediation message to be display in ggshield the instance has to expose the messages through the metadata endpoint (see internal MR).

Validation

This version of ggshield should be compatible with versions of the app that do not yet expose the remediation messages (current staging for example) with the metadata endpoint and a version that does (review app of the MR that exposes to the public api).

Set the right instance for example using the env variable GITGUARDIAN_INSTANCE and GITGUARDIAN_API_KEY the try the ggshield secret scan pre-commit after leaking a secret and ggshield secret scan pre-push after commiting a secret but I am not sure how to test the pre-receive :(

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.

@fnareoh fnareoh self-assigned this Jul 1, 2024
@fnareoh fnareoh marked this pull request as draft July 1, 2024 16:18
@fnareoh fnareoh changed the title Garancegourdel/scrt 4626 ggshield display custom remediation message in ggshield if Add support for custom remediatio messages Jul 1, 2024
@fnareoh fnareoh changed the title Add support for custom remediatio messages Add support for custom remediation messages Jul 2, 2024
@fnareoh fnareoh force-pushed the garancegourdel/scrt-4626-ggshield-display-custom-remediation-message-in-ggshield-if branch 3 times, most recently from b5b3250 to bc98683 Compare July 16, 2024 08:39
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.36%. Comparing base (ae78adc) to head (bc98683).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #928      +/-   ##
==========================================
+ Coverage   91.18%   91.36%   +0.17%     
==========================================
  Files         176      176              
  Lines        7252     7241      -11     
==========================================
+ Hits         6613     6616       +3     
+ Misses        639      625      -14     
Flag Coverage Δ
unittests 91.36% <100.00%> (+0.17%) ⬆️

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

@pierrelalanne pierrelalanne 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 fine otherwise 👍

@fnareoh fnareoh force-pushed the garancegourdel/scrt-4626-ggshield-display-custom-remediation-message-in-ggshield-if branch from 459eee6 to c12e2ad Compare July 19, 2024 14:35
@fnareoh fnareoh marked this pull request as ready for review July 19, 2024 14:37
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.

None yet

3 participants