Forums

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

Pipeline condition changeset only takes last commit into account

Cristian Lopez February 17, 2022

Hello team!

 

currently we are facing a weird behavior. Although the documentation says that all commits are taken into account when evaluating the pull request files, it is currently using only the last commit.

 

I just figured this out because we use conditions for all our steps, after updated the bitbucket-pipelines.yml file, all steps were skipped (which does not make sense because several conditions passes). The way to get expected steps executed is to squash all pull request commits into one.

 

Sorry if this is not the best place to ask / report.

1 answer

1 accepted

0 votes
Answer accepted
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 21, 2022

Hi Cristian,

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I would like to inform you that this is a good place to ask/report.

Can you let me know what's in your bitbucket-pipelines.yml configuration, please? With this configuration which I have, the builds were executed correctly and even the previous commits were taken into account:

image: atlassian/default-image:3
pipelines:
pull-requests:
'**': #this runs as default for any branch not elsewhere defined
- step:
script:
- echo "test"
condition:
changesets:
includePaths:
- "potato/*.xml"

 Please let us know, we're here to help.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Cristian Lopez February 21, 2022

Hi Norbert, nice to meet you too!

 

the configuration you asked is:

 

image: node:12.22.6

 

Thanks for checking

Cristian Lopez February 21, 2022

I have also check this doc piece, but didn't find anything relevant as we are just using an official image.

 

Let me know what other info can I provide to tackle this!

Cristian Lopez February 21, 2022

FYI - I have updated the main pipeline image to use the one in your example and did not fix the behavior (it is still using only the last commit, skipping all the steps)

Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 22, 2022

Hi Cristian,

I've only received the image:XXXXXX part from your configuration, would it be possible for you to post the whole bitbucket-pipelines.yml file (masking the confidential information)? I'd like to review your configuration as it would help me figure it out, what could go wrong.

Thank you!

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Cristian Lopez February 22, 2022

hey Norbert,

 

when reducing our pipeline to the minimum (and comparing each thing with documentation) I realize we are using 'branches' in pipelines instad of 'pull-requests'.

 

Thx for reaching out!

Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2022

You're welcome Cristian, I'm glad to hear your issue is resolved :)

Have a good day ahead and stay safe!

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Mariusz Dullak
Contributor
January 29, 2025

I know it is an ancient ticket, but this was what google returned on search, so it might help others.

 

We are using merge commit strategy (git merge --no-ff)

I am wondering what does it exactly mean that only the last commit is considered on branches.

If I have a setup where the only way to get new stuff to develop is through PR, when the PR is open I can act depending on what was changed.

Now when this PR is merged to develop (without squasing) will my changeset condition evaluate ALL changes or just the last commit from the whole PR?

 

To clarify what I am trying to achieve:

I have a repo which contains 5 different microservices that are working together. They make sense only together so they are in a single repo.

Now depending whenever the change is in service1 folder or service2 folder ... or common folder, I want to rebuild only the services which are affected by the change.

So if I have PR with 3 commits being merged to develop, can I use changesets with includePath to detect what I need to rebuild (let's assume that each commit affects different service)?

 

Do I understand correctly that this will work only when my merge strategy is --no-ff or --squash

Like Truong Tran likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events