Displaying Warning Messages from Pre-receive Hook in GitLab UI

Hello everyone,

I’m currently working on implementing a pre-receive hook in GitLab to display warning messages when certain conditions are met. Specifically, I’d like to display a warning message when a project is nearing its storage quota limit.

I’ve successfully configured the pre-receive hook to display warning messages using the appropriate format (e.g., prefixing the message with “GL-HOOK-ERR:”). However, I’ve noticed that the warning messages only appear in the GitLab UI when there is an actual error, rather than simply displaying the warning and allowing the process to continue.

Ideally, I’d like the warning message to be displayed in the GitLab UI without halting the entire process, similar to how error messages are displayed. This would allow users to be informed about the quota limit approaching without disrupting their workflow.

Has anyone encountered a similar requirement before or have any suggestions on how to achieve this? I’ve explored various approaches, but haven’t found a solution yet.

Any insights or guidance would be greatly appreciated.

Thank you for your assistance!

Best regards,