Allow to combine only:/except: arbitrarily

Problem to solve

Atm the rules how only: and except: work are very hard coded and make some workflows impossible. E.g. we want:

  • when working on feature branches, only jobs with matching changes: to run, but
  • for master and develop branches every job to be executed.

There seems to be no way to express this with existing syntax. The naive try

only:
    changes:
    - src/A/*
    refs:
    - develop
    - master

does not work because conditions are always combined with AND.

I would like some more generic approach where conditions can be combined freely within AND, OR and NOT expressions. E.g. example above could look like

condition:
    OR:
       changes:
       - src/A/*
       refs:
       - develop
       - master

With this, existing only: and except: can remain but is tranformed internally to

condition:
    AND:
        AND: <<: *only
        NOT:
            AND: <<: *except
Edited Aug 09, 2019 by Enrico Scholz
Assignee Loading
Time tracking Loading