Conditional allow_failures for Travis Build Stages

I’ve looked through a lot of docs and GH issues for allow_failures and it does not seem very dynamic. It would be nice to be able to apply allow_failures based upon a condition rather than just matching keys, ie

" When matching jobs against the definitions given in allow_failures , all conditions in allow_failures must be met exactly, and all the keys in allow_failures element must exist in the top level of the build matrix"

Therefore, a syntax similar to the stage condition syntax would be useful

jobs:
  allow_failures:
    - name: Allow Failures
    - name: Only Feature Branch Allow Failures
      if: branch != master
  include:
    - stage: Test (Allow Failures)
      name: Allow Failures
      script: exit 1
    - name: Only Feature Branch Allow Failures
    - stage: Deploy
      name: Deploy
      script: echo "DEPLOY FOR $TRAVIS_BRANCH"

@dtothefp sorry, i’ve missed your question here …

the feature you’re looking for has been in production for a while: https://docs.travis-ci.com/user/conditional-builds-stages-jobs#conditionally-allowing-jobs-to-fail … but hasn’t been documented on this page https://docs.travis-ci.com/user/customizing-the-build#rows-that-are-allowed-to-fail.

i have added https://github.com/travis-ci/docs-travis-ci-com/pull/2685/files to address that.

here is a config that produces the expected matrices on the branches master and other: https://github.com/svenfuchs/test-2/blob/master/.travis.yml

is this the behavior you expect?

Imprint