Raw error message on missing gitlab publish parameters
Current situation
When asking to publish a quality-gate result to gitlab in a non MR context and without providing manually MR credentials, the opentf-ctl displays a "not so nice" error.
ERROR:root:Cannot post results to GitLab, missing mandatory parameters: project, target, target-id.
This is only a minor error since this does not break the pipeline, if the quality gate is met,c.f. pipeline demo 1108569048.
But this may still polute logs in a CI environnemnt trying with the same "CI job" to compute quality gate on the default branch and in a MR.
A possible workaround is to duplicate job desciption to pass extra parameters to the cli in the contexte of a MR. A workaround example can be seen here.
Yet this is a bit cumbersome to use "eval" in the pipeline descriptor just to provide fallback mechanism to avoid error log messages.
Desired outcome
Provide a fall back mechanism in the case of a parameter "--plugin gitlab:xxx" being provided but not the other mandatory ones (MR ids,etc...). On such mechanisme could be to log a "nicer" message, suche as :
Publishing results to GitLab... Aborting no MR to publish to.