Workflows seem incomplete

workflow
2.0

#1

Firstly, I think there is some documentation lacking in regard to workflows: for one, there’s nothing stating when a particular workflow is run. Are they all run all the time? That’s my assumption, but there’s nothing in the documentation to back it up.

Secondly, I’d also like to have the option to filter out which workflows are run, much like the steps within them. For instance, if I have the following scenario:

  • prerelease_workflow
    • build
    • prerelease_step1
    • prerelease_step2
    • prerelease_step3
  • release_workflow
    • build
    • release_step1
    • release_step2
    • release_step3

…it’s really cumbersome to set up the filters for each job, when really the filters should be per-workflow. Does this make sense?


#2

I’m in agreement.

Take the Branch-Level Job Execution section in the documentation. This is what makes more sense to me:

workflows:
  version: 2
  test:
    filter:
      branches:
        except:
          - development
          - staging
          - pre_prod
    jobs:
      - test
  development_deploy:
    filter:
      branches:
        only: development
    jobs:
      - test
      - deploy_development
          requires:
            - test
  staging_deploy:
    filter:
      branches:
        only: staging
    jobs:
      - test
      - deploy_staging
          requires:
            - test
  pre_prod_deploy:
    filter:
      branches:
        only: pre_prod
    jobs:
      - test
      - deploy_pre_prod
          requires:
            - test

Even that seems overly cumbersome, though.


Git Tag Feedback
#3

Thank you so much for the feedback. Currently, if you have added Workflows config in your branch and you push a commit to that branch, we will trigger a Workflow run. We will add that information to our docs.

We will definitely consider filtering Workflows in our next config update.

Thank you so much for trying out Workflows.


#4

Hi, guys.
Have a question about branch-level job execution in workflows.
Is it possible to use regexp to filter branches in workflows? I tried but doesn’t work.

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - deploy:
          filters:
            branches:
              only:
                - staging
                - production
                - release/.*
          requires:
            - build

#5

Yes, it is: surround the regex with slashes.


#6

Filtering workflows is really needed. Without it, you’re forced to repeat the filter in all first-level jobs in a workflow.


#7

Is there any ETA or way to track (Issue tracker?) when are owner/tag filters are going to be available? That’s the inly thing preventing me upgrade. I assume these are WiP as they are CircleCI classic features.


#8

I am frankly shocked and amazed that 2.0 was released without additional filtering and multiple workflows. I actually expected that the beta will last much longer. I hope that we’ll see a 2.1 soon.


#9

Is there an ETA on when workflows can be filtered by branch/tag? It seems remarkable that you can’t do this right now; it’s such an obvious use case, more so I would think than needing to branch/tag filter on the job within a workflow. Given the yaml file below, how can I run the test job on one branch filter and run build and deploy jobs on a different branch filter?

version: 2
jobs:
  build:
    docker:
      image: golang:1.8
    working_directory: /go/src/github.com/owner/project
    steps:
      - checkout
      - run: go get -v -t -d ./...
      - run: ./build.sh
  test:
    docker:
      image: golang:1.8
    steps:
      - checkout
      - run: ...stuff...
  
  deploy:
    machine: true
    steps:
      - checkout
      - ...stuff...

#10

We have added a way to filter for git tags and branches at a job level. https://circleci.com/docs/2.0/workflows/#branch-level-job-execution.
https://circleci.com/docs/2.0/workflows/#git-tag-job-execution

We will definitely add support for filtering at a workflow level. Thank you all for your feedback.


#11

Lack of branch filtering for workflows is also a roadblock for me. I need to run an additional job for some branches, and this job needs to run before all others. I can’t filter the job and make other jobs depend on it, because if the first job is never run, others will not run either. With branch filtered workflows I would be able to just create a separate workflow for those specific branches. Looking forward to this feature.


#12