Hello, On Wed, Jul 6, 2016 at 2:10 AM, <[email protected]> wrote:
> Maybe I'm missing something here.... > The Stage definitions screen has an option 'Fetch Materials' (Perform > material updates or checkouts) which I thought should update the materials > whenever that stage was triggered. > As I mentioned, the pipeline is triggered by an upstream pipeline, I only > need its materials to be updated and this is not happening for some reason. > In fact, this seems to work fine (without polling) in all pipelines which > are triggered manually (clicking on the 'Trigger' button). Only, in this > case, the pipeline is being triggered by an upstream pipeline. > Since most of my pipelines are triggered manually, I thought I'd save the > overhead of polling the git repositories and just have them update when the > pipeline is triggered. > So, basically, one needs to set all materials in gocd to be polled and > blacklist the ones which should not be triggered automatically? > Yes, I'd go for turning on polling and use blacklist (and from 16.6.0, whitelist too). To answer your question about why manual trigger works: There are multiple concepts here, which is what makes it hard to understand. Let me try and explain quickly, with an image: [image: Inline image 2] Given the above, here are some cases: - At time 10:00 AM: Commit g1-c2 happens on g1. Result: Pipeline does not trigger, because the material is fully blacklisted. But, the server sees that commit and will change its latest known commit to g1-c2. - At time 10:05 AM: Commit g2-c2 happens on g2. All changes in the commit affect only misc/abc/README.txt and misc/def/hello.txt Result: Pipeline does not trigger, because path misc/**/* is blacklisted. But, the server sees that commit and will change its latest known commit to g2-c2. - At time 10:10 AM: Commit g3-c2 happens on g3. Result: Pipeline does not trigger, because polling is turned off (and the server does not see that commit at all). - At time 10:15 AM: Commit g4-c2 happens on g4. Result: Pipeline triggers - with g1-c2, g2-c2, *g3-c1* and g4-c2. Since polling is turned off, g3-c2 has not been seen. - At time 10:20 AM: Commit g2-c3 happens on g2. Changes in the commit affect misc/abc/README.txt *and* src/test.rb Result: Pipeline triggers - with g1-c2, g2-c3, g3-c1 and g4-c2. This is because src/test.rb does not match the blacklist misc/**/*. - At time 10:25 AM: Pipeline is manually forced (click on "Play" button) Result: Pipeline triggers - with g1-c2, g2-c3, *g3-c2* and g4-c2. A manual trigger will forcibly update every material it knows of to the latest revision and triggers the pipeline. Remember that all of the decisions about which materials to use for a pipeline trigger are done on the GoCD server side. That's how it can maintain consistency upon reruns, etc. The "Fetch materials" option affects only the agent side. It's an option which allows the agent to not fetch / checkout / clone the materials at all, when run. By this time, the server has already decided which materials to use. The agent cannot control it. The "Fetch materials" being false should only be used in cases where you don't care about the material at all. In some cases, you just want a timer trigger for a pipeline and then you decided to fetch some artifact from somewhere and do something with it. In those cases, you don't care about the material that caused this pipeline to trigger. That's when you'd turn off "Fetch materials". In all my years of working on GoCD, I haven't really had to turn it off. Hope that helps. Cheers, Aravind -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
