jenkinsci / jenkinsci/git-plugin

[JENKINS-34925] Git plugin's "included regions" is ignored when build worker has new workspace

Open
#2,860 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have a job setup to poll a repository and only build when changes are made to a certain directory, using the "Polling Ignores Commits In Certain Paths" -> "Included Regions" configuration. When this job is run on a fresh build worker, with no pre-existing workspace, the build will run to completion regardless of whether the change lays within the "Included Regions" definition.

My build farm is in an auto-scaling group which spins up and down fresh workers as needed, so it is likely that unnecessary builds will be triggered.

The output of the Polling Log on a fresh worker looks like this:

Started on May 17, 2016 12:03:00 PM

Workspace is offline.
Scheduling a new build to get a workspace. (nonexisting_workspace)
Done. Took 0.1 sec
Changes found

The Polling Log with an actual change looks like:

Started on May 17, 2016 12:21:00 AM

Polling SCM changes on jenkins worker (i-abcd1234)
Using strategy: Default
[poll] Last Built Revision: Revision xxxxxx
(refs/remotes/origin/master)
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
> git config remote.origin.url git@​github.com:Company/repo.git # timeout=10
Fetching upstream changes from git@​github.com:Company/repo.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress git@​github.com:Company/repo.git +refs/heads/*:refs/remotes/origin/*
Polling for changes in
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
> git log --full-history --no-abbrev --format=raw -M -m --raw xxxxxx..yyyyy # timeout=10
Done. Took 3.6 sec
Changes found

---
Originally reported by akostibas, imported from: Git plugin's "included regions" is ignored when build worker has new workspace


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 7
  • imported: 2025-12-02

Raw content of original issue

I have a job setup to poll a repository and only build when changes are made to a certain directory, using the "Polling Ignores Commits In Certain Paths" -> "Included Regions" configuration. When this job is run on a fresh build worker, with no pre-existing workspace, the build will run to completion regardless of whether the change lays within the "Included Regions" definition.

My build farm is in an auto-scaling group which spins up and down fresh workers as needed, so it is likely that unnecessary builds will be triggered.

The output of the Polling Log on a fresh worker looks like this:



Started on May 17, 2016 12:03:00 PM

Workspace is offline.
Scheduling a new build to get a workspace. (nonexisting_workspace)
Done. Took 0.1 sec
Changes found

The Polling Log with an actual change looks like:



Started on May 17, 2016 12:21:00 AM

Polling SCM changes on jenkins worker (i-abcd1234)
Using strategy: Default
[poll] Last Built Revision: Revision xxxxxx
(refs/remotes/origin/master)
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
> git config remote.origin.url git@github.com:Company/repo.git # timeout=10
Fetching upstream changes from git@github.com:Company/repo.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress git@github.com:Company/repo.git +refs/heads/*:refs/remotes/origin/*
Polling for changes in
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
> git log --full-history --no-abbrev --format=raw -M -m --raw xxxxxx..yyyyy # timeout=10
Done. Took 3.6 sec
Changes found

environment

```
Jenkins ver. 1.656

Git-Plugin 2.4.3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.