Skip to content

notifyBuildStatus: also take responsibility of making MR comments

Since gitlab-branch-source-plugin is hard-coded to comment that the build "failed" even when the build result is actually "UNSTABLE", we have no choice but to implement the MR comments in the code.

Thus, piggy-back on existing notifyBuildStatus() function and make it also post the same message to GitLab MR if the build comes from one. Since we probably don't want Telegram messages for every MR build, pass a new argument on when to notify Telegram group which defaults to true (so that rootfs-builder-debos can be updated later).

[1] https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/c5fd7effcc6b8715dcbf5ebd490851f901ed4172/src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabPipelineStatusNotifier.java#L197-L199

Bug: https://ubports.atlassian.net/browse/INFRA-62

Merge request reports