Git resource: infinite loop with [ci skip]


#1

In this pipeline, when viewed via the web UI it would show that git resource check was pulling in the latest commit with [ci skip] and then running, causing an infinite loop. Unfortunately the project cannot be open sourced and so I can’t share exact details. But here is how the resource is defined, with only names changed:

resources:

- name: git-myrepo
  type: git
  source:
    uri: git@github.com:org/myrepo.git
    branch: test/concourse
    private_key: |
      ((key-github))

Then the task would:

  • clone that repo locally
  • increment a version number in a file
  • git commit with “[ci skip]” in the message

And then the pipeline would put: git-myrepo (the same resource that was referenced with get).

  - put: git-myrepo
    params:
      repository: git-myrepo-incremented

Then the a new build would get fired automatically (and incorrectly) by concourse:

A very strange thing about this pipeline in an infinite loop - it’s almost exactly a replica of another pipeline that does not infinite loop (just the git repo and an in-repo file path are different).

I tried hijacking the resource check and when I manually ran check, it would return an empty array, which is strange. I would expect it to return an array of size 1, containing the last commit without “[ci skip]”? But still, concourse should not be continuing the pipeline if an empty array is returned, right?

The behavior of a similar pipeline working fine, and the hijack not showing explanatory behavior, seemed like somehow the concourse check system (not the resource?) got into a bad state. Is this possible? I don’t really know what is happening under the hood.

I’ve deleted the pipeline and recreated it, I am getting the same result - infinite loops. Each time the input is the git commit from the previous build’s output.


#2

Splitting the single git repo into 2 separate “in” and “out” repos does seem to mitigate the problem. As suggested in this issue: https://github.com/concourse/git-resource/issues/18