Summarize latest deployment pipelines in MR comment

What does this MR do and why?

This MR introduce 2 new jobs that will be run during deployment pipelines. They are run in .pre & .post special stages, only for MRs.

Theses jobs will create a comment in the MR to post the status of the triggered pipelines, and a direct link to it.

To be able to post a comment in MR the script will use a guest token with minimal permission, this is required as the CI_JOB_TOKEN don't have access to the notes API.

Sometimes a race condition can happens if multiples pipelines are in autostart, in this case it can lead to the creation of multiple comments. Theses will be cleaned in the next update (when a new deployment start or when a deployment end)

By default it will update existing comment, to avoid spamming notification and keep the comment at the top of the MR

The comment contain a direct link in the title to the deployment-jobs pipeline (to easily start manual pipelines if needed) and a detailed view for each pipeline with the status of each jobs. The script do not display some of them that are not really relevant when they are in success (cleanup, runner creation etc...)

Related reference(s)

close #1911 (closed)

Test coverage

CI configuration

Below you can choose test deployment variants to run in this MR's CI.

Click to open to CI configuration

Legend:

Icon Meaning Available values
☁️ Infra Provider capd, capo, capm3
🚀 Bootstrap Provider kubeadm (alias kadm), rke2
🐧 Node OS ubuntu, suse
🛠️ Deployment Options light-deploy, oci, ha, misc
🎬 Pipeline Scenarios rolling-update, mgmt-rolling-update, k8s-upgrade, sylva-upgrade, sylva-upgrade-from-x.x.X, simple-update, preview, nightly
  • 🎬preview ☁️capd 🚀kadm 🐧ubuntu 🛠️oci

  • 🎬preview ☁️capo 🚀rke2 🐧suse

  • 🎬preview ☁️capm3 🚀rke2 🐧ubuntu

  • ☁️capd 🚀kubeadm 🛠️light-deploy 🐧ubuntu

  • ☁️capd 🚀rke2 🛠️oci,light-deploy 🐧suse

  • ☁️capo 🚀rke2 🛠️oci 🐧suse

  • ☁️capo 🚀kadm 🛠️oci 🐧ubuntu

  • ☁️capo 🚀rke2 🎬rolling-update 🛠️ha 🐧ubuntu

  • ☁️capo 🚀kadm 🎬k8s-upgrade 🐧ubuntu

  • ☁️capo 🚀rke2 🎬mgmt-rolling-update 🛠️ha,misc 🐧suse

  • ☁️capo 🚀rke2 🎬sylva-upgrade 🛠️misc 🐧ubuntu

  • ☁️capm3 🚀rke2 🐧suse

  • ☁️capm3 🚀kadm 🛠️oci 🐧ubuntu

  • ☁️capm3 🚀kadm 🎬mgmt-rolling-update 🛠️ha,misc 🐧ubuntu

  • ☁️capm3 🚀rke2 🎬k8s-upgrade 🐧suse

  • ☁️capm3 🚀kadm 🎬rolling-update 🛠️ha 🐧ubuntu

  • ☁️capm3 🚀rke2 🎬sylva-upgrade 🛠️misc,ha 🐧suse

  • ☁️capm3 🚀kadm 🎬rolling-update 🛠️ha 🐧suse

Global config for deployment pipelines

  • autorun pipelines
  • allow failure on pipelines

Notes:

  • Enabling autorun will make deployment pipelines to be run automatically without human interaction
  • Disabling allow failure will make deployment pipelines mandatory for pipeline success.
  • if both autorun and allow failure are disabled, deployment pipelines will need manual triggering but will be blocking the pipeline

Be aware: after configuration change, pipeline is not triggered automatically. Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.

Edited by Thomas Morin

Merge request reports

Loading