clearcontainers / jenkins

Used to store the Jenkins based CI configuration files - both for backup, re-creation and history etc.
Apache License 2.0
3 stars 4 forks source link

Jenkins git setup breaks checkcommits #40

Closed jodh-intel closed 6 years ago

jodh-intel commented 6 years ago

I was just viewing the logs for a PR earlier and noticed this alarming message from checkcommits:

Found 0 commits between commit HEAD and branch master

I bit of digging shows that the problem is caused by our git setup. Assumine a runtime PR, Jenkins is essentially doing this:

pr=1234
go get github.com/clearcontainers/runtime

git fetch origin "pull/${pr}/head"
git checkout master
git reset --hard FETCH_HEAD
git rebase origin/master

After the above, there is only 1 branch - master so checkcommits cannot compare the PR branch with master, and therefore finds zero commits to check.

We need to change the git setup to be something like this:

pr=1234
go get github.com/clearcontainers/runtime

git fetch origin "refs/pull/$pr/head:PR_${pr}"
git checkout "PR_${pr}"

/cc @grahamwhaley, @sboeuf, @chavafg.

jodh-intel commented 6 years ago

The problem is the jenkins_job_build.sh setup script.

Closing this as it's now replaced by https://github.com/clearcontainers/tests/issues/876.