Pipelines created through UI cannot reference pipelines through config repo as Upstream Pipeline

40 views
Skip to first unread message

Tina Boyce

unread,
Aug 8, 2024, 10:47:57 AM8/8/24
to go-cd
I came across an interesting behaviour and I was wondering if this is already known or expected, or is it a bug?

I've created 3 pipelines:
  • child (through UI)
  • parent (in my git repo, imported by config repo setting)
  • parent-mkII (through UI)
Screenshot 2024-08-09 at 12.09.26 AM.png

I then went into the "child" pipeline setting > Materials > Add Material and in the Upstream Stage drop-down, the only given options was "parent-mkII"
Screenshot 2024-08-09 at 12.13.05 AM.png

This is not an isolated incident and what prompted me to start investigating was when I brought down gocd server a few times when I used the gocd api to deploy pipelines where the request body config referenced a pipeline that was deployed through the config repo.

The server error message was very similar every time, it was "Error: Pipeline 'from-config-repo' does not exist. It is used from pipeline 'from-api'.". However, it works fine if a pipeline is from the config repo referencing another pipeline from config repo.

Chad Wilson

unread,
Aug 8, 2024, 10:57:35 AM8/8/24
to go...@googlegroups.com
Hiya Tina

I believe it is intentional that you cannot (normally) reference a config repo pipeline from a manually created pipeline (that otherwise sits in the config.xml).

https://github.com/gocd/gocd/issues/10667 has some discussion/explanation of this, along with https://github.com/gocd/gocd/issues/1133#issuecomment-109785886 and https://github.com/gocd/gocd/issues/1133#issue-77045258

However it sounds like an oversight or bug that the API is allowing you to do this (and take down the server). I do not know if that is intentional, but I suspect now - and really the API should be consistent with the UI in matters of "safety" such as this. Would probably be worthwhile raising an issue to investigate the inconsistency and try and fix the API validation if at all possible.

-Chad

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/8c35ce75-e0e4-4532-82d3-10d40ba303a3n%40googlegroups.com.

Aravind SV

unread,
Aug 8, 2024, 12:32:27 PM8/8/24
to go...@googlegroups.com
Yes, you're right Chad. That is not intentional. I suspect the API is using the "merged" config to do its validation, instead of using the representation of the config XML. It is an oversight / bug.

Cheers,
Aravind

Tina Boyce

unread,
Aug 8, 2024, 8:37:42 PM8/8/24
to go...@googlegroups.com
Thank you Chad and Aravind for the quick helpful response.

I'll look into the API pipeline referencing a config repo pipeline further, get it easily reproduced and then raise the issue with the findings.

Tina Boyce

unread,
Aug 9, 2024, 9:45:39 AM8/9/24
to go-cd
Reply all
Reply to author
Forward
0 new messages