Skip to content

Conversation

salome-voltz
Copy link
Collaborator

@salome-voltz salome-voltz commented Aug 26, 2025

Context

Some error code return by the API are not detected as such by ggshield. As a result, the UI displays "No secret have been found", while the scan failed and the files were not processed. This is misleading.

Examples:

CleanShot 2025-07-18 at 12 24 28@2x
CleanShot 2025-07-18 at 12 20 52@2x(1)

What has been done

  • Extend handle_api_error case list to handle "Source not found" error, and 5xx errors
  • Fix a bug in handle_scan_chunk_error to display the correct error when the source is not found

Validation

  • Run ggshield secret scan path --source-uuid b84b3f32-08df-448e-b49f-11186b003e73 <path> (fake UUID) and ensure the UI displays the expected result. Especially, "No secret have been found" should not be displayed:
image

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.

@salome-voltz salome-voltz requested a review from a team as a code owner August 26, 2025 15:28
Copy link

codecov bot commented Aug 26, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.95%. Comparing base (ef7aa67) to head (07b3633).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
ggshield/core/errors.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1126      +/-   ##
==========================================
- Coverage   91.99%   91.95%   -0.05%     
==========================================
  Files         144      144              
  Lines        6162     6166       +4     
==========================================
+ Hits         5669     5670       +1     
- Misses        493      496       +3     
Flag Coverage Δ
unittests 91.95% <80.00%> (-0.05%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@salome-voltz salome-voltz self-assigned this Aug 27, 2025
@salome-voltz salome-voltz force-pushed the salomevoltz/scrt-5746-ggshield-secret-scan-still-shows-scanning-even-if-theres-an branch 2 times, most recently from b3d357e to bb0499f Compare August 27, 2025 11:18
@salome-voltz salome-voltz force-pushed the salomevoltz/scrt-5746-ggshield-secret-scan-still-shows-scanning-even-if-theres-an branch from bb0499f to 07b3633 Compare August 27, 2025 11:18
@salome-voltz salome-voltz enabled auto-merge August 27, 2025 11:25
@salome-voltz salome-voltz merged commit 998953f into main Aug 27, 2025
29 of 31 checks passed
@salome-voltz salome-voltz deleted the salomevoltz/scrt-5746-ggshield-secret-scan-still-shows-scanning-even-if-theres-an branch August 27, 2025 11:29
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.

2 participants