Skip to content

SPP errors should never cause git push to fail

Problem to solve

Secret Push Protection (SPP) currently operates on the critical path for git push operations. However, if SPP encounters an exception during execution, it can potentially block the entire push operation from completing successfully. This creates a critical reliability issue since:

  1. SPP failures should never prevent legitimate code from being pushed
  2. Blocking the push operation due to SPP exceptions disrupts developer workflow
  3. This behavior makes SPP a potential single point of failure for all code submissions

We need to ensure that any exceptions thrown by SPP are properly handled and logged, but never prevent the underlying git push operation from completing successfully. SPP should operate as a non-blocking advisory system rather than a hard blocker when it encounters internal errors.

Proposed solution

Add exception handling around the SPP code to prevent failures from blocking git pushes:

  1. Wrap the SPP execution in a rescue block to catch any exceptions
  2. Log the error details for debugging and monitoring
  3. Show a clear message to the user that SPP encountered an error but their push completed successfully

This keeps SPP from becoming a blocker when it has internal problems. Users can still push their code, and we'll have error data to fix issues.

Edited by 🤖 GitLab Bot 🤖