kata-containers / ci

Kata Containers CI
http://jenkins.katacontainers.io/view/CI%20Status/
Apache License 2.0
13 stars 34 forks source link

jobs-builder: fix CC jobs triggers #536

Closed wainersm closed 1 year ago

wainersm commented 1 year ago

On commit e2005a9642a82c it was added a mechanism to trigger SEV jobs that actually broke all triggers of all CC jobs. The XML generated is like below (with line breaks):

<allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin>
      <triggerPhrase>
.*(\n|^|\s)/(re)?test(-ubuntu)?(-sev)?(\n|$|\s)+.*
</triggerPhrase>
      <skipBuildPhrase>.*\[skip\W+ci\].*</skipBuildPhrase>
      <onlyTriggerPhrase>true</onlyTriggerPhrase>

With this fix it will generate the XML correctly, trimming line breaks and spaces.

Fixes #531 Signed-off-by: Wainer dos Santos Moschetta wainersm@redhat.com

wainersm commented 1 year ago

Tested locally, it seems to produce the correct XML now:

$ jenkins-jobs test jobs tests-CCv0-ubuntu-20.04_sev-x86_64-CC_SEV_CRI_CONTAINERD_K8S-PR 2>/dev/null | grep triggerPhrase
      <triggerPhrase>.*(\n|^|\s)/(re)?test(-ubuntu)?(-sev)?(\n|$|\s)+.*</triggerPhrase>
$ jenkins-jobs test jobs tests-CCv0-ubuntu-20.04-x86_64-CC_CRI_CONTAINERD_K8S-PR 2>/dev/null | grep triggerPhrase
      <triggerPhrase>.*(\n|^|\s)/(re)?test(-ubuntu)?(\n|$|\s)+.*</triggerPhrase>

Without the fix, for example:

$ jenkins-jobs test jobs tests-CCv0-ubuntu-20.04-x86_64-CC_CRI_CONTAINERD_K8S-PR 2>/dev/null | grep triggerPhrase
      <triggerPhrase>
</triggerPhrase>