Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Linked repository change detection file pattern not working

Jonas Gucu January 12, 2023

Hi,

 

I have a linked repository with 3 folders in it.

I'd like to make 3 different build plans for those 3 folders.

I'm trying to make it so Bamboo only triggers build on pull request for Folder2, but no pattern works.

"Include only changes that matches to the following pattern"

Folder2/

/Folder2/

Folder/.*

Folder2*

 

etc, etc.

Is this feature just broken? What I doing wrong?
Should we use .yaml instead?

 

Thank you.

2 answers

0 votes
Jonas Gucu January 16, 2023

Hello, I still need help and support with this.

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 12, 2023

Hello @Jonas Gucu

Welcome to Atlassian Community!

You need to use a regular expression for that to work. E.g:

  • ^Folder2\/.*

The regex above will match any commits made to any files at any level from the "Folder2" folder.

More interesting examples here:

Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Jonas Gucu January 12, 2023

Hello,

This does not work.

I make changes to a file in Folder1, make a pull request, but the build for Folder2 gets triggered.

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2023

Hello @Jonas Gucu

Sorry to hear it is not working for you, but it does work if configured correctly.

You will have to review the repository and trigger settings on each Plan and confirm if they are all pointing to the same Repository in Bamboo.

If they all share the same repository and that repository has specific Change Detection options with include patterns, it should work.

Regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Jonas Gucu January 17, 2023

Hello again,

I double-checked everything.

There are 2 linked repositories pointing to the same bitbucket repository.

The repository contains 1 solution with 3 folders. The first two folders contain UI projects with other class library projects.

In one of my linked repositories I have written a Change detection option -> File pattern like the one you have written above ^Folder2\/.*


I checked plan configurations for both repositories. Both of them have triggers, look at the appropriate linked repository and "Create plan branch" is set to "When pull request is created".

 

I change a class file in Folder1, make a Pull Request and BOTH of the plans get triggered, even though the second plan has a file pattern that should only trigger when something in Folder2 gets changed.

 

So it does not work. Can you suggest what else I should check? Is this something wrong with Bamboo version, or configuration, or anything else?

 

We are using "Atlassian Bamboo version 8.0.0 build 80008 - 29 Jul 21".

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2023

Hello @Jonas Gucu

Thank you for the detailed explanation. The issue is not related to the Regex or Change detection options. As you have explained better, you are creating a Pull Request. Bamboo will run a build regardless of any settings when it receives a notification for a new PR.

Please have a look at the following Community thread for a workaround and also a Feature request where you can vote so our developers can be aware of what needs to be implemented.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Jonas Gucu January 17, 2023

Hello @Eduardo Alvarenga 
Sorry for not writing a detailed explanation at first :)

I don't see how that thread helps me to be honest.

So what are the change detection options for then? And is there no way to achieve what I'm trying to do?

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2023

Hello @Jonas Gucu,

Running the first build when a Plan Branch is created is Bamboo's expected behaviour and there is no way to prevent that from happening.

That is documented on the https://jira.atlassian.com/browse/BAM-12944 feature request which you can watch and vote on to have it implemented.

As explained on the linked community thread, you can add a "dummy" task as the first Task to the First Job of your Plan and use it as a workaround to avoid the full build from happening when you create a pull request and consequently the Plan branch is created.

Any other pushes to the same branch that is part of the same Pull Request will be avoided by the Repository's Change detection options and their Regular expression includes/excludes.

Regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Jonas Gucu January 23, 2023

Hello,

 

So as I understand there is no way to achieve what I want.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events