Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluding paths from trigger not working as expected #366

Closed
simonvane opened this issue Oct 23, 2019 · 10 comments
Closed

Excluding paths from trigger not working as expected #366

simonvane opened this issue Oct 23, 2019 · 10 comments

Comments

@simonvane
Copy link

I have the following trigger in my yml build file.

trigger:
  branches:
    include:
    - master
    - develop
  paths:
    exclude:
    - readme.md
    - Deploy/*

The way I would expect that to work is that I get a build if the branch is master or develop unless the only files changed are readme.me or are file in the Deploy folder.

Is my expectation correct?

I made a commit to develop where the only changes were in Deploy but this resulted in a build.

I am wondering if I'm misinterpreting the documentation.

Thanks.

@yesoreyeram
Copy link

Have u tried removing the * ? (In your exclude paths, Just specify Deploy/)

@simonvane
Copy link
Author

simonvane commented Nov 4, 2019

I need to do a bit more digging but I think this is actually working fine and I just need a similar section for PRs i.e.

pr:
  branches:
    include:
    - '*'
  paths:
    exclude:
    - readme.md
    - Deploy/*

I don't think the /* is required in Deploy/* as you suggest but I think it makes the intent clearer.

@ghost
Copy link

ghost commented Nov 27, 2019

I have the same issue exactly and I don't want to have the same setting in PR trigger as I want PR triggers to work from - Deploy/*.
Any information about what's happening?

@simonvane
Copy link
Author

simonvane commented Nov 27, 2019

So I think there are a few issues of usability here but it looks like things are working as intended even if that turns out to be a bit unhelpful.

The usability issues are:

@ghost
Copy link

ghost commented Nov 27, 2019

I found out that in my case what was causing the pipeline to run when I expected otherwise is having - path/to/excluded/* instead of - path/to/excluded in exclude list in trigger. I didn't have to change pr.

@ghost
Copy link

ghost commented Nov 27, 2019

And yes trying to diagnose the problem was really hard.

@simonvane
Copy link
Author

@AElharouny Are you using Azure DevOps repos?

@ghost
Copy link

ghost commented Nov 27, 2019

No we're using Github.

@stale
Copy link

stale bot commented Apr 25, 2020

In order to consolidate to fewer feedback channels, we've moved suggestions and issue reporting to Developer Community. Sorry for any confusion resulting from this move.

@stale stale bot closed this as completed Apr 26, 2020
@Raffaello
Copy link

Raffaello commented May 23, 2020

i have the same issue with the following configuration more or less:

trigger:
  branches:
    include:
    - master
  paths:
    exclude:
    #- .gitignore
    - .github/
    - README.md
    - appveyor.yml
    - LICENSE
    - codecov.yml

  tags:
    include:
    - '*'

pr:
  branches:
    include:
    - master
  paths:
    exclude:
    #- .gitignore
    - .github/config.yml
    - README.md
    - ./appveyor.yml
    - LICENSE

the pipeline is in a azure-pipelines folder, i have also tried, using a ../ relative path, as i (wrongly?) guessed the root path might be the azure-pipelines folder.
From the documentation there are few bits that are not really clear.

basically what i would like to achieve is really simple as: if i change a readme, i do not want to trigger the CI ...... but it is always triggered..
not sure i think i might have missed something, but at the same time i think should be fairly more straight-forward, or it is slightly buggy and the paths.exclude is being overridden somehow?


from my extra little investigation, the triggers and commit checkout are not just working on the single commit, at least for PR, but is like accumulative for all the commits, this imply for eg:

  • 1st commit that should trigger the PR
  • 2nd commit that should not

the result is:
the triggers detect the change as a whole, so triggering the pipeline is like if it was 1 "merged" commit of 1st and 2nd and then the resulting file changes are valid for the PR trigger.

i guess.
For me is not really the expected behavior and should be more on fine grained PR commit

reported also here:
https://developercommunity.visualstudio.com/content/problem/1046653/azure-pipelines-triggers-pathsexclude-in-pr-is-not.html


just need a clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants