Manual trigger for steps running in parallel

Issue #16650 open
Viktor Dlouhy
created an issue
- step:
      name: Step 0
      script:
          - echo "Automatic step 0";
- parallel:
      - step:
            name: Step 1
            script:
              - echo "Automatic step 1";
      - step:
            name: Step 2
            trigger: manual
            script:
              - echo "I need to click the button to execute Step 2";
      - step:
            name: Step 3
            script:
              - echo "Automatic step 3";

Comments (17)

  1. Viktor Dlouhy reporter

    The idea is that since it runs in parellel, the steps dont block each other as they normally do in the serial execution. Meaning Step 3 would be still executed even Step 2 was not triggered (in example above). That would be huge improvement for us. The ideal case for us would be following.

    - step:
          name: Install Project
          script:
              - mvn install
    - parallel:
          - step:
                name: Frontend Tests 
                script:
                  - npm run test
          - step:
                name: Backend Tests
                script:
                  - mvn integration-test -Dfilter=*IntegrationTest
          - step:
                name: Webtests
                trigger: manual
                script:
                  - mvn integration-test -Dfilter=*WebTest
          - step:
                name: Deploy
                trigger: manual
                deployment: test
                script:
                  - mvn deploy
    

    Where the arguments for having steps triggered manully are:

    • webtest consume huge amount of time, we dont want to run them every commit
    • it should be possible to trigger deploy step no matter the result of tests

    Another example might extended deployment possibilities

    - step:
          name: Install Project
          script:
              - mvn install
    - parallel:
          - step:
                name: Deploy - Test
                trigger: manual
                deployment: test
                script:
                  - ssh...
          - step:
                name: Deploy - Test & Clean DB
                trigger: manual
                deployment: test
                script:
                  - ssh...
          - step:
                name: Deploy - Production
                trigger: manual
                deployment: production
                script:
                  - ssh...
    

    Where the arguments for having steps triggered manually are:

    • sometimes I want to be able to deploy to test
    • sometimes I want to be able to deploy to production (without deploying to test)
  2. Aneita Yang staff
    • changed status to open

    Hey @Viktor Dlouhy,

    Thanks for getting back to me - it's super helpful understanding your use case for this feature. We currently don't have any plans to support manual steps within parallel groups anytime soon, but I'll open this ticket up for future consideration and so other users can express their interest in seeing the same thing.

    The use case you've described also touches on deployment steps within a parallel group. This is something that we don't support today either - can you please raise a separate feature request for that if it's something that you're interested in? That'll allow us to keep track of the two requests separately.

    In the meantime, you might be able to use custom pipelines to achieve the same result. You can create a custom pipeline for your webtests and choose when you want to run them and for which commits. Your bitbucket-pipelines.yml file will then look something like this:

    pipelines:
      default:
        - step:
            name: Install Project
            script:
              - mvn install
        - parallel:
            - step:
                name: Frontend Tests 
                script:
                  - npm run test
            - step:
                name: Backend Tests
                script:
                  - mvn integration-test -Dfilter=*IntegrationTest
        - step:
            name: Deploy
            trigger: manual
            deployment: test
            script:
              - mvn deploy
      custom:
        webtests:
            - step:
                name: Install project
                script:
                  - mvn install
            - step:
                name: Webtests
                trigger: manual
                script:
                  - mvn integration-test -Dfilter=*WebTest
    
  3. Sam Weston

    We desperately need this feature to make deployments with bitbucket pipelines workable. As it stands I'm having to keep jenkins around for this use case.

    I want to be able to select from a list of environments to deploy to and only select one e.g. deploy to test without going to dev first.

    Thanks

  4. Nathan Probst

    We also really want this feature. Instead of thinking of this as adding manual triggers to parallel steps, one could think of it as adding "optional, skippable" steps. This is our use-case. In fact, another way to achieve the same goal would be to add an "optional" flag to steps which would allow the pipeline to bypass an un-triggered (or failed) step.

  5. Horace Keung

    Came across this issue as well today. After running my test, I would like to be able to choose between deploying to staging or production, or maybe both at the same time manually.

  6. drak15

    We frantically require this element to make organizations with bitbucket pipelines serviceable. As it stands I'm keeping jenkins around for this utilization case.

    I need to have the capacity to choose from a rundown of conditions to send to and just select one e.g. send to test without going to dev first. HostGator DreamHost Bluehost

  7. Alex B

    +1

    We switched to bitbucket pipelines from Jenkins pipelines and definitely missing the ability to make step optional or skip. Adding trigger: manual would be at least some kind of workaround.

  8. Maxim Karavaev

    +1 It could also solve another limitation of the Deployment variants amount. For example, we have 3 Test environments and 1 Staging. After building a feature branch I would like to manually choose a test environment for deployment. It could probably be a parallel 3-steps block with the manual triggers

    - parallel:
          - step:
                name: deploy to test1 env
                trigger: manual
                script:
                  - echo "deploy test1";
          - step:
                name: deploy to test2 env
                trigger: manual
                script:
                  - echo "deploy test2";
          - step:
                name: deploy to test3 env
                trigger: manual
                script:
                  - echo "deploy test3";
    
  9. Petr Peller

    We want to be able to deploy independently to various environments. Right now we can only deploy to prod after deploy to staging is done. This is especially bad if you want to deploy an urgent hotfix.

    Manual trigger for parallel steps would be greatly appreciated.

  10. Nikunj Undhad

    Is it possible to trigger complete parallel step itself manual or event that is not possible? Something like

    pipelines:
      default:
        - step:
            name: Install Project
            script:
              - mvn install
        - parallel:
            trigger: manual
            - step:
                name: Deployment to Dev
                script:
                  - Dev deploy script
            - step:
                name: Deployment to QA-Perf
                script:
                  - QA-Perf deploymet script
    
  11. Alistair Hey

    @Nikunj Undhad To do the above i added a manual step before my parrallel step that blocks the running of parallel step:

          - step: # Manual step for non-PR branches and non-master
              name: Run E2E tests?
              image: alpine:latest
              trigger: manual
              script:
                - echo "GO GO GO"
    
          - parallel:
              - step: *APP-BuildDocker
              - step: *API-BuildDocker
    
  12. Bartosz Lobejko

    +1 This feature would be really handy for the case when you have 3 different steps for: code, upload files and database. This would allow choosing which step you need to synchronise between Staging and Production.

  13. Log in to comment