Search code examples
python-3.xbuildbot

Can a Triggerable Scheduler use a change filter, or can a Trigger build step be conditional on a property?


I would like to determine which schedulers to trigger depending on the branch name, from inside the build factory - if that's possible.

Essentially I have a builder that is doing all the common build steps to compile package etc, and then has a bunch of trigger steps that trigger a bunch of tests (via triggerable schedulers).

However, I would like to configure the type of tests that get started (eg which schedulers are triggered) to depend on the branch name. So far I've tried to add the change_filter arg to my Triggerable scheduler, but it seems that it doesn't accept that argument. I guess that makes sense because it supposed to be Triggered, so maybe it doesn't care about using a change filter. That seems a bit strange though because Dependent schedulers do accept this kwarg.

So far the correct way to set this up is not clear to me.

I guess my questions are really:

  • Is there a way to use renderables / properties to decide which schedulers to trigger (based on the branch name for example)?
  • Is there a better way to do this? Perhaps create separate schedulers for the build that apply the change filter I need and have a build factory that triggers the correct tests, but that's not very DRY.

Solution

  • I came back to leave this here in case it might help someone with a tricky buildbot setup.

    I solved this by making all of the dependent schedulers (for specific types of tests) into triggerable schedulers. Then I created main build schedulers for each subset of tests, each with a change filter and regex for the branches that should undergo that subset of tests. Finally, I created the buildfactory for each main scheduler by passing it only the triggerable schedulers for the test that that specific type of main scheduler should run.

    For my current use case, this works great!