Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipelines get triggered unexpectedly

Naveen Gabriel October 22, 2024

While raising an PR from development to test, the pipeline for development gets executed. It shouldn't happen right. As i understood only commit on specific branches runs the pipeline under branches .

Any idea why development branch gets trigger when a Pr is raised from development to test and how to avoid it ?

 

pipelines:

  pull-requests:

    revert-*:

      - step: *build-test-sonarcloud

      - step: *check-quality-gate-sonarcloud

    feature/*:

      - step: *build-test-sonarcloud

      - step: *check-quality-gate-sonarcloud

    bugfix/* :

      - step: *build-test-sonarcloud

      - step: *check-quality-gate-sonarcloud




  branches:

    development:

      - step: *deploy




    test:

      - step:

          <<: *deploy

          deployment: staging

          name: Deploy to staging server for testing

          script:

          - <<: *deploy-script

            variables:

              <<: *deploy-variables

              SSH_USER: $STAGING_SSH_USER

              SERVER: $STAGING_SERVER_ADDR
     

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2024

Hi Naveen,

The pipeline for the development branch should only get executed when there are new commits on the branch, if someone manually triggers it, or if there is a schedule. Pipelines can be manually triggered from the UI (on the Pipelines page of a repo there is an option Run pipeline) or via an API call.

Have you raised additional PRs with development as the source branch? And does the development branch pipeline get executed every time you raise such a PR?

One thing to check is the content of the bitbucket-pipelines.yml in the development branch. Is it the same as the one you have posted there, or is there an additional definition for pull-requests based on the development branch?

If you cannot consistently reproduce, did someone perhaps push commits to the development branch around the same time you created the PR? Or did they trigger the branch pipeline manually?

If you can consistently reproduce this every time you raise a PR with development as a source branch, another thing to check is the webhooks on this repo. Have you set up any webhooks that get triggered when a PR is created? If such a webhook exists that sends a request to your server, does your server then perhaps trigger the pipeline with an API call?

Kind regards,
Theodora

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2024

Hi @Naveen Gabriel

I can't tell from your description but my guess is that there a push been done to development in some step your are doing when raising the PR. You should be able to tell by looking the pipeline logs.

Depending on what you are trying to achieve you might also want check out our Flowie Smart Pipelines which give you greater control over triggering your pipelines.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events