Ensure protected branches audit event even if cache refresh fails
What does this MR do and why?
We had an issue where a protected branch was successfully destroyed, yet no audit event was present.
We were not able to reproduce the issue locally, as the happy path successfully results in an audit event being logged.
It was noticed that, if a cache refresh was to fail, we could end up in this state where the protected branch was deleted and no audit event was logged.
This change rescues runtime errors around the cache refresh to prevent this hypothetical from occurring
resolves: #363509 (closed)
How to set up and validate locally
not really applicable. CI passing is a good enough test. Potentially
- remove added
rescuecode - run specs, see failure
- add back new code
- run specs, see success
more details can be seen in the notes in the linked issue
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.