opendevstack / ods-core

The core of OpenDevStack - infrastructure setup based on Atlassian tools, Jenkins, Nexus, SonarQube and shared images
Apache License 2.0
47 stars 34 forks source link

Make git notes not trigger jenkins pipeline #1288

Closed ElfenB closed 2 months ago

ElfenB commented 4 months ago

Context: Bitbucket is generating ghost commits that have the commit message "Notes added by 'git notes add'" if git-notes is used (e.g. with semantic-release). To prevent Jenkins starting builds that will result in failure because there is nothing to build, the build should be stopped when those commits are coming in.

BraisVQ commented 4 months ago

@ElfenB after a little test this change does not seems to break anything on component pipeline and makes git notes changes not trigger it. But as release manager makes commits into the repositories, git notes is likely to break it... The push action is being blocked by remote repository

ElfenB commented 4 months ago

Perhaps we could achieve a similar result by checking the ref that is provided from Bitbucket? I am getting builds like this:

image

If the namespace "refs/notes" would be ignored when building that would make more sense than ignoring a commit message? Because notes can't be built really because they are not pointing to some commit with code. So that is an error/bug anyways. @braisvq1996 What do you think?

ElfenB commented 4 months ago

@braisvq1996 As discussed, I adapted the logic it to match on the ref display-id instead of the commit message to be more open for different tools.

BraisVQ commented 4 months ago

thanks @ElfenB, I will test it out once I get some time for thsi

metmajer commented 3 months ago

@ElfenB, thanks for your contribution and the review, @oalyman. We will schedule this for the next possible release. We will also ensure that there are no side effects by executing our automated tests before the merge to master. You will not need to provide any automated tests for your implementation.

BraisVQ commented 3 months ago

@ElfenB @metmajer I managed to get some time to test it on my end and I did not find any issues but after the current release, we can run the whole set of e2e to be sure

metmajer commented 3 months ago

@braisvq1996 let's make sure this will be included in the next release possible

metmajer commented 3 months ago

@ElfenB please resolve the CHANGELOG.md conflict