JetBrains / JetBrains/teamcity-git

VCS Trigger unexpectedly triggers all environment builds regardless of file-specific trigger rules

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
14
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I'm experiencing an issue with TeamCity VCS triggers where changes to specific environment files are causing all environment builds to trigger, despite having configured file-specific trigger rules.

## Current Setup:
- Multiple build configurations for different environments (prod-1, prod-2, dev-1, dev-2, staging)
- Each build configuration has specific file path triggers (e.g., `/env/prod/prod-1/env.hcl`)
- Using branch filter `+:pull/*` to include pull requests

## Expected Behavior:
When a change is made to `/env/prod/prod-1/env.hcl`, only the prod-1 build should trigger. Similarly, when a change is made to `/env/prod/prod-2/env.hcl`, only the prod-2 build should trigger.

## Actual Behavior:
When a change is made to any environment file (e.g., `/env/prod/prod-1/env.hcl`), all environment builds (prod-1, prod-2, dev-1, dev-2) are triggered. Only staging builds are correctly not triggering for some reason.

## Investigation:
I've found that the branch filter `+:pull/*` seems to be overriding the file-specific trigger rules, causing any PR to trigger all build configurations regardless of which files were changed.
I've tried the following without success:
- Adding exclusion rules: -`:/env/non-prod/dev-2/env.hcl -:/env/non-prod/dev-1/env.hcl`
- Various combinations of include/exclude rules
- Removing wildcards and using exact paths

## Question:
Is there a way to configure TeamCity to respect both branch filters and file-specific trigger rules, so that only the builds affected by specific file changes are triggered, even when those changes come from pull requests?

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file, test, or code entry point is identified in the issue. Start by locating the VCS trigger handling and its branch and file-rule evaluation, then reproduce the pull-request case described; done means affected environment builds trigger selectively while unrelated builds do not.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.