Cannot get repository change detection working
Asked by jay_vee:

I have been trying unsuccessfully to get change detection working in a plan. I am using YAML Specs. My repo config is below.

I have tried different filter patterns and am now just trying to get it to work with a single file. Once I can get this working, I'd like to be able to get this to run on a change to anything in :

- dir1/product/\*\* (needs to be recursive)

- dir2/product/\*\* (also recursive)

I have been trying with patterns similar to \*\*/product/\*\*

I have removed all linked repositories and am only including a plan repo. I have noticed that updating my plan repo file-filter-pattern does not update what I see in the GUI.

repositories:  
- Bitbucket:  
type: bitbucket-server  
server: BitBucket  
project: PROJ  
slug: proj  
clone-url: \<redacted\>  
public-key: \<redacted\>  
private-key: \<redacted\>   
branch: master  
command-timeout-minutes: '180'  
use-shallow-clones: false  
cache-on-agents: true  
submodules: false  
ssh-key-applies-to-submodules: true  
verbose-logs: true  
fetch-all: false  
lfs: false  
viewer:  
com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:bbServerViewer: {}  
change-detection:  
file-filter-type: include_only  
file-filter-pattern: \*\*/delete.me


Answers:
author: Jyothi Charupalli
body: Hi Jay,

Welcome to the Atlassian Community!

To include a single type of pattern file in the change detection options under repository configuration, you can try something like the below:

```
change-detection:
  file-filter-type: include_only
  file-filter-pattern: .+\.txt
```

Please also refer to this [Bamboo yaml specs document](https://docs.atlassian.com/bamboo-specs-docs/9.2.8/specs.html?yaml#git-advanced-options) for more details on this.

Best Regards,

Jyothi

**\*please don't forget to Accept the answer if your query was answered\*\***

comments: author: jay_vee
body: Thanks Jyothi

let's say for example, I have the following folder structure

ansible/roles/app1/

ansible/roles/app2/

containers/app1/

containers/app2/

How would I target just the app1 folders?

I get errors in the yaml validation when I use:

\*\*/\*app1\*/\*\*

'\*\*/\*app1\*/\*\*'

\*app1\*

/\*\*/\*app1\*/

however, it works if I do:

/(ansible/roles\|containers)/\*app1\*/

but

any ideas how to get it to work with \`\*\*\` ?


author: Jyothi Charupalli
body: Hi Jay,

The regular expression pattern should have the whole path pattern to match the files. That is why the below is working as expected, which is the correct pattern.

```
/(ansible/roles|containers)/*app1*/
```

Please refer to [_planRepositoryIncludeExcludeFilesExamples](https://confluence.atlassian.com/bamboo0902/_planrepositoryincludeexcludefilesexamples-1236930829.html) for some examples.

Best Regards,

Jyothi


author: jay_vee
body: Thanks Jyothi

There are no examples on that page with a \`\*\*\`. Am I correct then, when I say that the \`\*\*\` wildcard doesn't work?


author: Jyothi Charupalli
body: Hi Jay,

Yes, you are absolutely right! These wildcards like(\*\*) will not work in this "IncludeExcludeFilespattern" under Bamboo Repository configuration as we need to provide the whole path pattern to match the files as mentioned in my previous comment.

Best Regards,

Jyothi