Enable "Container Scanning" with merge request fails with unhelpful error message
Summary
Clicking on "Container Scanning" -> "Enable with a merge request" on /-/security/configuration
fails with error dialog Something went wrong. Please refresh the page, or try again later.
In my case it's a commit message format rule that causes the error which is exposed in the GraphQL response, but not in the UI:
{"data":{"configureContainerScanning":{"successPath":null,"errors":["13:update reference: running pre-receive hooks: GitLab: Commit message does not follow the pattern 'DEVIM-\\d+.+'."],"__typename":"ConfigureContainerScanningPayload"}}}
This can be treated as bug in case the message format is not supposed to block enabling with a merge request
OR
as a request to improve feedback for the user which might not (want to) figure out the application feedback in the browser network tab.
Steps to reproduce
- Go to a project which doesn't have Container scanning enabled: https://gitlab.com/your/project/-/security/configuration
- Click on the "Enable with a merge request" in the "Container scanning" section
What is the current bug behavior?
Error snackbar
What is the expected correct behavior?
Opening of merge request like it works without a commit message format rule. I have not done this yet, but I have no reason to believe that no MR is opened.
OR
Provide a helpful error message, like "The configured commit message pattern 'pattern' does not allow configuration with a merge request. [Some useful tip how to enable anyway, like disable it temporarily]"
Also: There should be no branch set-dependency-scanning-config-[n]
without commit left in the repo in case the MR creation fails.